@emailmaker/emailmaker 1.0.100 → 1.0.101-alpha.2

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 (935) hide show
  1. package/README.md +3 -2
  2. package/asset-manifest.json +890 -111
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.d.ts +226 -62
  5. package/emailmaker.js +1 -1
  6. package/fm-notification.d.ts +368 -0
  7. package/iframe/429.js +1 -1
  8. package/iframe/766.js +1 -1
  9. package/iframe/css/sandbox.css +25 -1
  10. package/iframe/css/sandbox.locale.en_en.css +4 -0
  11. package/iframe/css/sandbox.locale.ru_ru.css +4 -0
  12. package/iframe/iframe-eblock.23c21a44a5dc8a1c4e79.html +1 -0
  13. package/iframe/iframe.23c21a44a5dc8a1c4e79.html +1 -0
  14. package/iframe/js/330.5b87e8cb.js +1 -0
  15. package/iframe/sandbox-eblock.js +1 -1
  16. package/iframe/sandbox.js +1 -1
  17. package/js/amplitude.min.js +2 -0
  18. package/package.json +1 -1
  19. package/plugin.html +45 -38
  20. package/plugin_blocks_test.html +1 -1
  21. package/plugin_default.html +62 -52
  22. package/plugin_idigital.html +1 -1
  23. package/plugin_nota.html +1 -1
  24. package/plugin_s.html +1 -1
  25. package/static/css/3435.6e12750c.chunk.css +1 -0
  26. package/static/js/{1169.baef237c.chunk.js → 1169.41f7faae.js} +1 -1
  27. package/static/js/{1538.68b12a82.chunk.js → 1538.bfc8d578.js} +2 -2
  28. package/static/js/{2624.5a8b68ca.js → 2624.c73e6966.js} +2 -2
  29. package/static/js/2897.21033685.js +2 -0
  30. package/static/js/{207.2a052cc2.js.LICENSE.txt → 2897.21033685.js.LICENSE.txt} +10 -0
  31. package/static/js/3017.64a47f09.js +1 -0
  32. package/static/js/{3019.8534e1e7.chunk.js → 3019.b5f316a5.js} +1 -1
  33. package/static/js/{3085.bcc62ca0.chunk.js → 3085.0ddbb320.js} +1 -1
  34. package/static/js/3435.b0aac1ed.js +1 -0
  35. package/static/js/3473.abdeb8f7.js +2 -0
  36. package/static/js/5447.173960c2.js +2 -0
  37. package/static/js/{8473.88a48c70.chunk.js.LICENSE.txt → 5447.173960c2.js.LICENSE.txt} +4 -27
  38. package/static/js/{6144.a3bf0881.chunk.js → 6144.5d2c141c.js} +1 -1
  39. package/static/js/{6501.40bbf4df.chunk.js → 6501.ce1c1684.js} +1 -1
  40. package/static/js/{2854.da9b4ca6.js → 6655.b54ad4d6.js} +2 -2
  41. package/static/js/6798.4b7584f2.js +2 -0
  42. package/static/js/{6801.562ec824.chunk.js → 6801.d6cefb00.js} +1 -1
  43. package/static/js/{6819.16ca9581.chunk.js → 6819.c2bea9e8.js} +1 -1
  44. package/static/js/7419.28b3875c.js +2 -0
  45. package/static/js/{9960.6fbe3e6d.chunk.js.LICENSE.txt → 7419.28b3875c.js.LICENSE.txt} +0 -10
  46. package/static/js/{7463.51929d73.chunk.js → 7463.45a04221.js} +1 -1
  47. package/static/js/{84.25bf13c1.chunk.js → 84.c021c849.js} +1 -1
  48. package/static/js/{8521.0e5efd08.chunk.js → 8521.e891fa18.js} +1 -1
  49. package/static/js/9332.dc949fd3.js +2 -0
  50. package/static/js/{9644.eb778968.chunk.js → 9644.c8707a98.js} +1 -1
  51. package/static/js/9981.1dda98a3.js +1 -0
  52. package/static/js/emailmaker_core.ea526523.js +2 -0
  53. package/static/media/image-editor/fonts/TrashHand.ttf +0 -0
  54. package/static/media/image-editor/fonts/aleo-v4-latin-ext_latin-700.woff2 +0 -0
  55. package/static/media/image-editor/fonts/amatic-sc-v16-latin-ext_latin-regular.woff2 +0 -0
  56. package/static/media/image-editor/fonts/bungee-inline-v6-latin-ext_latin-regular.woff2 +0 -0
  57. package/static/media/image-editor/fonts/carter-one-v12-latin-regular.woff2 +0 -0
  58. package/static/media/image-editor/fonts/codystar-v10-latin-ext_latin-regular.woff2 +0 -0
  59. package/static/media/image-editor/fonts/corinthia-v7-latin-ext_latin-700.woff2 +0 -0
  60. package/static/media/image-editor/fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2 +0 -0
  61. package/static/media/image-editor/fonts/fuzzy-bubbles-v3-latin-700.woff2 +0 -0
  62. package/static/media/image-editor/fonts/krona-one-v9-latin-ext_latin-regular.woff2 +0 -0
  63. package/static/media/image-editor/fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2 +0 -0
  64. package/static/media/image-editor/fonts/lobster-two-v13-latin-regular.woff2 +0 -0
  65. package/static/media/image-editor/fonts/molle-v11-latin-ext_latin-italic.woff2 +0 -0
  66. package/static/media/image-editor/fonts/monoton-v10-latin-regular.woff2 +0 -0
  67. package/static/media/image-editor/fonts/nixie-one-v11-latin-regular.woff2 +0 -0
  68. package/static/media/image-editor/fonts/open-sans-v27-latin-ext_latin-regular.woff2 +0 -0
  69. package/static/media/image-editor/fonts/permanent-marker-v10-latin-regular.woff2 +0 -0
  70. package/static/media/image-editor/fonts/roboto-slab-v16-latin-ext_latin-500.woff2 +0 -0
  71. package/static/media/image-editor/fonts/sancreek-v13-latin-ext_latin-regular.woff2 +0 -0
  72. package/static/media/image-editor/fonts/stint-ultra-expanded-v10-latin-regular.woff2 +0 -0
  73. package/static/media/image-editor/fonts/vt323-v12-latin-ext_latin-regular.woff2 +0 -0
  74. package/static/media/image-editor/images/brushes/black/circle.png +0 -0
  75. package/static/media/image-editor/images/brushes/black/diamond.png +0 -0
  76. package/static/media/image-editor/images/brushes/black/hline.png +0 -0
  77. package/static/media/image-editor/images/brushes/black/pencil.png +0 -0
  78. package/static/media/image-editor/images/brushes/black/spray.png +0 -0
  79. package/static/media/image-editor/images/brushes/black/square.png +0 -0
  80. package/static/media/image-editor/images/brushes/black/vline.png +0 -0
  81. package/static/media/image-editor/images/brushes/white/circle.png +0 -0
  82. package/static/media/image-editor/images/brushes/white/diamond.png +0 -0
  83. package/static/media/image-editor/images/brushes/white/hline.png +0 -0
  84. package/static/media/image-editor/images/brushes/white/pencil.png +0 -0
  85. package/static/media/image-editor/images/brushes/white/spray.png +0 -0
  86. package/static/media/image-editor/images/brushes/white/square.png +0 -0
  87. package/static/media/image-editor/images/brushes/white/vline.png +0 -0
  88. package/static/media/image-editor/images/empty-canvas-bg.png +0 -0
  89. package/static/media/image-editor/images/filter/blackWhite.jpg +0 -0
  90. package/static/media/image-editor/images/filter/blendColor.jpg +0 -0
  91. package/static/media/image-editor/images/filter/blur.jpg +0 -0
  92. package/static/media/image-editor/images/filter/brightness.jpg +0 -0
  93. package/static/media/image-editor/images/filter/brownie.jpg +0 -0
  94. package/static/media/image-editor/images/filter/emboss.jpg +0 -0
  95. package/static/media/image-editor/images/filter/gamma.jpg +0 -0
  96. package/static/media/image-editor/images/filter/grayscale.jpg +0 -0
  97. package/static/media/image-editor/images/filter/invert.jpg +0 -0
  98. package/static/media/image-editor/images/filter/kodachrome.jpg +0 -0
  99. package/static/media/image-editor/images/filter/noise.jpg +0 -0
  100. package/static/media/image-editor/images/filter/original.jpg +0 -0
  101. package/static/media/image-editor/images/filter/pixelate.jpg +0 -0
  102. package/static/media/image-editor/images/filter/polaroid.jpg +0 -0
  103. package/static/media/image-editor/images/filter/removeColor.jpg +0 -0
  104. package/static/media/image-editor/images/filter/sepia.jpg +0 -0
  105. package/static/media/image-editor/images/filter/sharpen.jpg +0 -0
  106. package/static/media/image-editor/images/filter/technicolor.jpg +0 -0
  107. package/static/media/image-editor/images/filter/vintage.jpg +0 -0
  108. package/static/media/image-editor/images/frames/art1/bottom.png +0 -0
  109. package/static/media/image-editor/images/frames/art1/bottomLeft.png +0 -0
  110. package/static/media/image-editor/images/frames/art1/bottomRight.png +0 -0
  111. package/static/media/image-editor/images/frames/art1/left.png +0 -0
  112. package/static/media/image-editor/images/frames/art1/right.png +0 -0
  113. package/static/media/image-editor/images/frames/art1/thumbnail.png +0 -0
  114. package/static/media/image-editor/images/frames/art1/top.png +0 -0
  115. package/static/media/image-editor/images/frames/art1/topLeft.png +0 -0
  116. package/static/media/image-editor/images/frames/art1/topRight.png +0 -0
  117. package/static/media/image-editor/images/frames/art2/bottom.png +0 -0
  118. package/static/media/image-editor/images/frames/art2/bottomLeft.png +0 -0
  119. package/static/media/image-editor/images/frames/art2/bottomRight.png +0 -0
  120. package/static/media/image-editor/images/frames/art2/left.png +0 -0
  121. package/static/media/image-editor/images/frames/art2/right.png +0 -0
  122. package/static/media/image-editor/images/frames/art2/thumbnail.png +0 -0
  123. package/static/media/image-editor/images/frames/art2/top.png +0 -0
  124. package/static/media/image-editor/images/frames/art2/topLeft.png +0 -0
  125. package/static/media/image-editor/images/frames/art2/topRight.png +0 -0
  126. package/static/media/image-editor/images/frames/basic/thumbnail.png +0 -0
  127. package/static/media/image-editor/images/frames/ebony/bottom.png +0 -0
  128. package/static/media/image-editor/images/frames/ebony/bottomLeft.png +0 -0
  129. package/static/media/image-editor/images/frames/ebony/bottomRight.png +0 -0
  130. package/static/media/image-editor/images/frames/ebony/left.png +0 -0
  131. package/static/media/image-editor/images/frames/ebony/right.png +0 -0
  132. package/static/media/image-editor/images/frames/ebony/thumbnail.png +0 -0
  133. package/static/media/image-editor/images/frames/ebony/top.png +0 -0
  134. package/static/media/image-editor/images/frames/ebony/topLeft.png +0 -0
  135. package/static/media/image-editor/images/frames/ebony/topRight.png +0 -0
  136. package/static/media/image-editor/images/frames/grunge1/bottom.png +0 -0
  137. package/static/media/image-editor/images/frames/grunge1/bottomLeft.png +0 -0
  138. package/static/media/image-editor/images/frames/grunge1/bottomRight.png +0 -0
  139. package/static/media/image-editor/images/frames/grunge1/left.png +0 -0
  140. package/static/media/image-editor/images/frames/grunge1/right.png +0 -0
  141. package/static/media/image-editor/images/frames/grunge1/thumbnail.png +0 -0
  142. package/static/media/image-editor/images/frames/grunge1/top.png +0 -0
  143. package/static/media/image-editor/images/frames/grunge1/topLeft.png +0 -0
  144. package/static/media/image-editor/images/frames/grunge1/topRight.png +0 -0
  145. package/static/media/image-editor/images/frames/grunge2/bottom.png +0 -0
  146. package/static/media/image-editor/images/frames/grunge2/bottomLeft.png +0 -0
  147. package/static/media/image-editor/images/frames/grunge2/bottomRight.png +0 -0
  148. package/static/media/image-editor/images/frames/grunge2/left.png +0 -0
  149. package/static/media/image-editor/images/frames/grunge2/right.png +0 -0
  150. package/static/media/image-editor/images/frames/grunge2/thumbnail.png +0 -0
  151. package/static/media/image-editor/images/frames/grunge2/top.png +0 -0
  152. package/static/media/image-editor/images/frames/grunge2/topLeft.png +0 -0
  153. package/static/media/image-editor/images/frames/grunge2/topRight.png +0 -0
  154. package/static/media/image-editor/images/frames/oak/bottom.png +0 -0
  155. package/static/media/image-editor/images/frames/oak/bottomLeft.png +0 -0
  156. package/static/media/image-editor/images/frames/oak/bottomRight.png +0 -0
  157. package/static/media/image-editor/images/frames/oak/left.png +0 -0
  158. package/static/media/image-editor/images/frames/oak/right.png +0 -0
  159. package/static/media/image-editor/images/frames/oak/thumbnail.png +0 -0
  160. package/static/media/image-editor/images/frames/oak/top.png +0 -0
  161. package/static/media/image-editor/images/frames/oak/topLeft.png +0 -0
  162. package/static/media/image-editor/images/frames/oak/topRight.png +0 -0
  163. package/static/media/image-editor/images/frames/pine/bottom.png +0 -0
  164. package/static/media/image-editor/images/frames/pine/bottomLeft.png +0 -0
  165. package/static/media/image-editor/images/frames/pine/bottomRight.png +0 -0
  166. package/static/media/image-editor/images/frames/pine/left.png +0 -0
  167. package/static/media/image-editor/images/frames/pine/right.png +0 -0
  168. package/static/media/image-editor/images/frames/pine/thumbnail.png +0 -0
  169. package/static/media/image-editor/images/frames/pine/top.png +0 -0
  170. package/static/media/image-editor/images/frames/pine/topLeft.png +0 -0
  171. package/static/media/image-editor/images/frames/pine/topRight.png +0 -0
  172. package/static/media/image-editor/images/frames/rainbow/bottom.png +0 -0
  173. package/static/media/image-editor/images/frames/rainbow/bottomLeft.png +0 -0
  174. package/static/media/image-editor/images/frames/rainbow/bottomRight.png +0 -0
  175. package/static/media/image-editor/images/frames/rainbow/left.png +0 -0
  176. package/static/media/image-editor/images/frames/rainbow/right.png +0 -0
  177. package/static/media/image-editor/images/frames/rainbow/thumbnail.png +0 -0
  178. package/static/media/image-editor/images/frames/rainbow/top.png +0 -0
  179. package/static/media/image-editor/images/frames/rainbow/topLeft.png +0 -0
  180. package/static/media/image-editor/images/frames/rainbow/topRight.png +0 -0
  181. package/static/media/image-editor/images/gradients/0.png +0 -0
  182. package/static/media/image-editor/images/gradients/1.png +0 -0
  183. package/static/media/image-editor/images/gradients/10.png +0 -0
  184. package/static/media/image-editor/images/gradients/11.png +0 -0
  185. package/static/media/image-editor/images/gradients/12.png +0 -0
  186. package/static/media/image-editor/images/gradients/2.png +0 -0
  187. package/static/media/image-editor/images/gradients/3.png +0 -0
  188. package/static/media/image-editor/images/gradients/4.png +0 -0
  189. package/static/media/image-editor/images/gradients/5.png +0 -0
  190. package/static/media/image-editor/images/gradients/6.png +0 -0
  191. package/static/media/image-editor/images/gradients/7.png +0 -0
  192. package/static/media/image-editor/images/gradients/8.png +0 -0
  193. package/static/media/image-editor/images/gradients/9.png +0 -0
  194. package/static/media/image-editor/images/samples/large_sample.jpg +0 -0
  195. package/static/media/image-editor/images/samples/sample1.jpg +0 -0
  196. package/static/media/image-editor/images/samples/sample1_thumbnail.jpg +0 -0
  197. package/static/media/image-editor/images/samples/sample2.jpg +0 -0
  198. package/static/media/image-editor/images/samples/sample2_thumbnail.jpg +0 -0
  199. package/static/media/image-editor/images/samples/sample3.jpg +0 -0
  200. package/static/media/image-editor/images/samples/sample3_thumbnail.jpg +0 -0
  201. package/static/media/image-editor/images/samples/sample4.json +871 -0
  202. package/static/media/image-editor/images/samples/sample4_preview.jpg +0 -0
  203. package/static/media/image-editor/images/stickers/beach/0.svg +25 -0
  204. package/static/media/image-editor/images/stickers/beach/1.svg +14 -0
  205. package/static/media/image-editor/images/stickers/beach/10.svg +34 -0
  206. package/static/media/image-editor/images/stickers/beach/11.svg +27 -0
  207. package/static/media/image-editor/images/stickers/beach/12.svg +10 -0
  208. package/static/media/image-editor/images/stickers/beach/13.svg +25 -0
  209. package/static/media/image-editor/images/stickers/beach/14.svg +16 -0
  210. package/static/media/image-editor/images/stickers/beach/15.svg +14 -0
  211. package/static/media/image-editor/images/stickers/beach/16.svg +44 -0
  212. package/static/media/image-editor/images/stickers/beach/17.svg +35 -0
  213. package/static/media/image-editor/images/stickers/beach/18.svg +32 -0
  214. package/static/media/image-editor/images/stickers/beach/19.svg +23 -0
  215. package/static/media/image-editor/images/stickers/beach/2.svg +14 -0
  216. package/static/media/image-editor/images/stickers/beach/20.svg +24 -0
  217. package/static/media/image-editor/images/stickers/beach/21.svg +11 -0
  218. package/static/media/image-editor/images/stickers/beach/3.svg +26 -0
  219. package/static/media/image-editor/images/stickers/beach/4.svg +25 -0
  220. package/static/media/image-editor/images/stickers/beach/5.svg +22 -0
  221. package/static/media/image-editor/images/stickers/beach/6.svg +20 -0
  222. package/static/media/image-editor/images/stickers/beach/7.svg +32 -0
  223. package/static/media/image-editor/images/stickers/beach/8.svg +28 -0
  224. package/static/media/image-editor/images/stickers/beach/9.svg +18 -0
  225. package/static/media/image-editor/images/stickers/bubbles/0.png +0 -0
  226. package/static/media/image-editor/images/stickers/bubbles/1.png +0 -0
  227. package/static/media/image-editor/images/stickers/bubbles/10.png +0 -0
  228. package/static/media/image-editor/images/stickers/bubbles/100.png +0 -0
  229. package/static/media/image-editor/images/stickers/bubbles/101.png +0 -0
  230. package/static/media/image-editor/images/stickers/bubbles/102.png +0 -0
  231. package/static/media/image-editor/images/stickers/bubbles/103.png +0 -0
  232. package/static/media/image-editor/images/stickers/bubbles/105.png +0 -0
  233. package/static/media/image-editor/images/stickers/bubbles/11.png +0 -0
  234. package/static/media/image-editor/images/stickers/bubbles/12.png +0 -0
  235. package/static/media/image-editor/images/stickers/bubbles/13.png +0 -0
  236. package/static/media/image-editor/images/stickers/bubbles/14.png +0 -0
  237. package/static/media/image-editor/images/stickers/bubbles/15.png +0 -0
  238. package/static/media/image-editor/images/stickers/bubbles/16.png +0 -0
  239. package/static/media/image-editor/images/stickers/bubbles/17.png +0 -0
  240. package/static/media/image-editor/images/stickers/bubbles/18.png +0 -0
  241. package/static/media/image-editor/images/stickers/bubbles/19.png +0 -0
  242. package/static/media/image-editor/images/stickers/bubbles/2.png +0 -0
  243. package/static/media/image-editor/images/stickers/bubbles/20.png +0 -0
  244. package/static/media/image-editor/images/stickers/bubbles/21.png +0 -0
  245. package/static/media/image-editor/images/stickers/bubbles/22.png +0 -0
  246. package/static/media/image-editor/images/stickers/bubbles/23.png +0 -0
  247. package/static/media/image-editor/images/stickers/bubbles/24.png +0 -0
  248. package/static/media/image-editor/images/stickers/bubbles/25.png +0 -0
  249. package/static/media/image-editor/images/stickers/bubbles/26.png +0 -0
  250. package/static/media/image-editor/images/stickers/bubbles/27.png +0 -0
  251. package/static/media/image-editor/images/stickers/bubbles/28.png +0 -0
  252. package/static/media/image-editor/images/stickers/bubbles/29.png +0 -0
  253. package/static/media/image-editor/images/stickers/bubbles/3.png +0 -0
  254. package/static/media/image-editor/images/stickers/bubbles/30.png +0 -0
  255. package/static/media/image-editor/images/stickers/bubbles/31.png +0 -0
  256. package/static/media/image-editor/images/stickers/bubbles/32.png +0 -0
  257. package/static/media/image-editor/images/stickers/bubbles/33.png +0 -0
  258. package/static/media/image-editor/images/stickers/bubbles/34.png +0 -0
  259. package/static/media/image-editor/images/stickers/bubbles/35.png +0 -0
  260. package/static/media/image-editor/images/stickers/bubbles/36.png +0 -0
  261. package/static/media/image-editor/images/stickers/bubbles/37.png +0 -0
  262. package/static/media/image-editor/images/stickers/bubbles/38.png +0 -0
  263. package/static/media/image-editor/images/stickers/bubbles/39.png +0 -0
  264. package/static/media/image-editor/images/stickers/bubbles/4.png +0 -0
  265. package/static/media/image-editor/images/stickers/bubbles/40.png +0 -0
  266. package/static/media/image-editor/images/stickers/bubbles/41.png +0 -0
  267. package/static/media/image-editor/images/stickers/bubbles/42.png +0 -0
  268. package/static/media/image-editor/images/stickers/bubbles/43.png +0 -0
  269. package/static/media/image-editor/images/stickers/bubbles/44.png +0 -0
  270. package/static/media/image-editor/images/stickers/bubbles/45.png +0 -0
  271. package/static/media/image-editor/images/stickers/bubbles/46.png +0 -0
  272. package/static/media/image-editor/images/stickers/bubbles/47.png +0 -0
  273. package/static/media/image-editor/images/stickers/bubbles/48.png +0 -0
  274. package/static/media/image-editor/images/stickers/bubbles/49.png +0 -0
  275. package/static/media/image-editor/images/stickers/bubbles/5.png +0 -0
  276. package/static/media/image-editor/images/stickers/bubbles/50.png +0 -0
  277. package/static/media/image-editor/images/stickers/bubbles/51.png +0 -0
  278. package/static/media/image-editor/images/stickers/bubbles/52.png +0 -0
  279. package/static/media/image-editor/images/stickers/bubbles/53.png +0 -0
  280. package/static/media/image-editor/images/stickers/bubbles/54.png +0 -0
  281. package/static/media/image-editor/images/stickers/bubbles/55.png +0 -0
  282. package/static/media/image-editor/images/stickers/bubbles/56.png +0 -0
  283. package/static/media/image-editor/images/stickers/bubbles/57.png +0 -0
  284. package/static/media/image-editor/images/stickers/bubbles/58.png +0 -0
  285. package/static/media/image-editor/images/stickers/bubbles/59.png +0 -0
  286. package/static/media/image-editor/images/stickers/bubbles/6.png +0 -0
  287. package/static/media/image-editor/images/stickers/bubbles/60.png +0 -0
  288. package/static/media/image-editor/images/stickers/bubbles/61.png +0 -0
  289. package/static/media/image-editor/images/stickers/bubbles/62.png +0 -0
  290. package/static/media/image-editor/images/stickers/bubbles/63.png +0 -0
  291. package/static/media/image-editor/images/stickers/bubbles/64.png +0 -0
  292. package/static/media/image-editor/images/stickers/bubbles/65.png +0 -0
  293. package/static/media/image-editor/images/stickers/bubbles/66.png +0 -0
  294. package/static/media/image-editor/images/stickers/bubbles/67.png +0 -0
  295. package/static/media/image-editor/images/stickers/bubbles/68.png +0 -0
  296. package/static/media/image-editor/images/stickers/bubbles/69.png +0 -0
  297. package/static/media/image-editor/images/stickers/bubbles/7.png +0 -0
  298. package/static/media/image-editor/images/stickers/bubbles/70.png +0 -0
  299. package/static/media/image-editor/images/stickers/bubbles/71.png +0 -0
  300. package/static/media/image-editor/images/stickers/bubbles/72.png +0 -0
  301. package/static/media/image-editor/images/stickers/bubbles/73.png +0 -0
  302. package/static/media/image-editor/images/stickers/bubbles/74.png +0 -0
  303. package/static/media/image-editor/images/stickers/bubbles/75.png +0 -0
  304. package/static/media/image-editor/images/stickers/bubbles/76.png +0 -0
  305. package/static/media/image-editor/images/stickers/bubbles/77.png +0 -0
  306. package/static/media/image-editor/images/stickers/bubbles/78.png +0 -0
  307. package/static/media/image-editor/images/stickers/bubbles/79.png +0 -0
  308. package/static/media/image-editor/images/stickers/bubbles/8.png +0 -0
  309. package/static/media/image-editor/images/stickers/bubbles/80.png +0 -0
  310. package/static/media/image-editor/images/stickers/bubbles/81.png +0 -0
  311. package/static/media/image-editor/images/stickers/bubbles/82.png +0 -0
  312. package/static/media/image-editor/images/stickers/bubbles/83.png +0 -0
  313. package/static/media/image-editor/images/stickers/bubbles/84.png +0 -0
  314. package/static/media/image-editor/images/stickers/bubbles/85.png +0 -0
  315. package/static/media/image-editor/images/stickers/bubbles/86.png +0 -0
  316. package/static/media/image-editor/images/stickers/bubbles/87.png +0 -0
  317. package/static/media/image-editor/images/stickers/bubbles/88.png +0 -0
  318. package/static/media/image-editor/images/stickers/bubbles/89.png +0 -0
  319. package/static/media/image-editor/images/stickers/bubbles/9.png +0 -0
  320. package/static/media/image-editor/images/stickers/bubbles/90.png +0 -0
  321. package/static/media/image-editor/images/stickers/bubbles/91.png +0 -0
  322. package/static/media/image-editor/images/stickers/bubbles/92.png +0 -0
  323. package/static/media/image-editor/images/stickers/bubbles/93.png +0 -0
  324. package/static/media/image-editor/images/stickers/bubbles/94.png +0 -0
  325. package/static/media/image-editor/images/stickers/bubbles/95.png +0 -0
  326. package/static/media/image-editor/images/stickers/bubbles/96.png +0 -0
  327. package/static/media/image-editor/images/stickers/bubbles/97.png +0 -0
  328. package/static/media/image-editor/images/stickers/bubbles/98.png +0 -0
  329. package/static/media/image-editor/images/stickers/bubbles/99.png +0 -0
  330. package/static/media/image-editor/images/stickers/categories/beach.svg +18 -0
  331. package/static/media/image-editor/images/stickers/categories/clouds.svg +15 -0
  332. package/static/media/image-editor/images/stickers/categories/doodles.svg +13 -0
  333. package/static/media/image-editor/images/stickers/categories/emoticon.svg +10 -0
  334. package/static/media/image-editor/images/stickers/categories/landmark.svg +20 -0
  335. package/static/media/image-editor/images/stickers/categories/speech-bubble.svg +6 -0
  336. package/static/media/image-editor/images/stickers/categories/star.svg +6 -0
  337. package/static/media/image-editor/images/stickers/categories/transportation.svg +18 -0
  338. package/static/media/image-editor/images/stickers/clouds/0.png +0 -0
  339. package/static/media/image-editor/images/stickers/clouds/1.png +0 -0
  340. package/static/media/image-editor/images/stickers/clouds/10.png +0 -0
  341. package/static/media/image-editor/images/stickers/clouds/11.png +0 -0
  342. package/static/media/image-editor/images/stickers/clouds/12.png +0 -0
  343. package/static/media/image-editor/images/stickers/clouds/13.png +0 -0
  344. package/static/media/image-editor/images/stickers/clouds/14.png +0 -0
  345. package/static/media/image-editor/images/stickers/clouds/2.png +0 -0
  346. package/static/media/image-editor/images/stickers/clouds/3.png +0 -0
  347. package/static/media/image-editor/images/stickers/clouds/4.png +0 -0
  348. package/static/media/image-editor/images/stickers/clouds/5.png +0 -0
  349. package/static/media/image-editor/images/stickers/clouds/6.png +0 -0
  350. package/static/media/image-editor/images/stickers/clouds/7.png +0 -0
  351. package/static/media/image-editor/images/stickers/clouds/8.png +0 -0
  352. package/static/media/image-editor/images/stickers/clouds/9.png +0 -0
  353. package/static/media/image-editor/images/stickers/doodles/0.svg +201 -0
  354. package/static/media/image-editor/images/stickers/doodles/1.svg +255 -0
  355. package/static/media/image-editor/images/stickers/doodles/10.svg +160 -0
  356. package/static/media/image-editor/images/stickers/doodles/11.svg +393 -0
  357. package/static/media/image-editor/images/stickers/doodles/12.svg +293 -0
  358. package/static/media/image-editor/images/stickers/doodles/13.svg +251 -0
  359. package/static/media/image-editor/images/stickers/doodles/14.svg +370 -0
  360. package/static/media/image-editor/images/stickers/doodles/15.svg +194 -0
  361. package/static/media/image-editor/images/stickers/doodles/16.svg +383 -0
  362. package/static/media/image-editor/images/stickers/doodles/17.svg +346 -0
  363. package/static/media/image-editor/images/stickers/doodles/18.svg +286 -0
  364. package/static/media/image-editor/images/stickers/doodles/19.svg +241 -0
  365. package/static/media/image-editor/images/stickers/doodles/2.svg +227 -0
  366. package/static/media/image-editor/images/stickers/doodles/20.svg +330 -0
  367. package/static/media/image-editor/images/stickers/doodles/21.svg +200 -0
  368. package/static/media/image-editor/images/stickers/doodles/22.svg +308 -0
  369. package/static/media/image-editor/images/stickers/doodles/23.svg +518 -0
  370. package/static/media/image-editor/images/stickers/doodles/24.svg +207 -0
  371. package/static/media/image-editor/images/stickers/doodles/25.svg +260 -0
  372. package/static/media/image-editor/images/stickers/doodles/26.svg +380 -0
  373. package/static/media/image-editor/images/stickers/doodles/27.svg +222 -0
  374. package/static/media/image-editor/images/stickers/doodles/28.svg +164 -0
  375. package/static/media/image-editor/images/stickers/doodles/29.svg +271 -0
  376. package/static/media/image-editor/images/stickers/doodles/3.svg +272 -0
  377. package/static/media/image-editor/images/stickers/doodles/30.svg +283 -0
  378. package/static/media/image-editor/images/stickers/doodles/31.svg +257 -0
  379. package/static/media/image-editor/images/stickers/doodles/32.svg +276 -0
  380. package/static/media/image-editor/images/stickers/doodles/33.svg +198 -0
  381. package/static/media/image-editor/images/stickers/doodles/34.svg +314 -0
  382. package/static/media/image-editor/images/stickers/doodles/35.svg +236 -0
  383. package/static/media/image-editor/images/stickers/doodles/36.svg +273 -0
  384. package/static/media/image-editor/images/stickers/doodles/37.svg +284 -0
  385. package/static/media/image-editor/images/stickers/doodles/38.svg +167 -0
  386. package/static/media/image-editor/images/stickers/doodles/39.svg +381 -0
  387. package/static/media/image-editor/images/stickers/doodles/4.svg +216 -0
  388. package/static/media/image-editor/images/stickers/doodles/40.svg +198 -0
  389. package/static/media/image-editor/images/stickers/doodles/41.svg +259 -0
  390. package/static/media/image-editor/images/stickers/doodles/42.svg +371 -0
  391. package/static/media/image-editor/images/stickers/doodles/43.svg +198 -0
  392. package/static/media/image-editor/images/stickers/doodles/44.svg +174 -0
  393. package/static/media/image-editor/images/stickers/doodles/45.svg +178 -0
  394. package/static/media/image-editor/images/stickers/doodles/46.svg +211 -0
  395. package/static/media/image-editor/images/stickers/doodles/47.svg +195 -0
  396. package/static/media/image-editor/images/stickers/doodles/48.svg +293 -0
  397. package/static/media/image-editor/images/stickers/doodles/49.svg +191 -0
  398. package/static/media/image-editor/images/stickers/doodles/5.svg +179 -0
  399. package/static/media/image-editor/images/stickers/doodles/50.svg +323 -0
  400. package/static/media/image-editor/images/stickers/doodles/51.svg +308 -0
  401. package/static/media/image-editor/images/stickers/doodles/52.svg +162 -0
  402. package/static/media/image-editor/images/stickers/doodles/53.svg +263 -0
  403. package/static/media/image-editor/images/stickers/doodles/54.svg +175 -0
  404. package/static/media/image-editor/images/stickers/doodles/55.svg +177 -0
  405. package/static/media/image-editor/images/stickers/doodles/56.svg +160 -0
  406. package/static/media/image-editor/images/stickers/doodles/57.svg +115 -0
  407. package/static/media/image-editor/images/stickers/doodles/58.svg +327 -0
  408. package/static/media/image-editor/images/stickers/doodles/59.svg +197 -0
  409. package/static/media/image-editor/images/stickers/doodles/6.svg +388 -0
  410. package/static/media/image-editor/images/stickers/doodles/60.svg +414 -0
  411. package/static/media/image-editor/images/stickers/doodles/61.svg +287 -0
  412. package/static/media/image-editor/images/stickers/doodles/62.svg +193 -0
  413. package/static/media/image-editor/images/stickers/doodles/63.svg +329 -0
  414. package/static/media/image-editor/images/stickers/doodles/64.svg +150 -0
  415. package/static/media/image-editor/images/stickers/doodles/65.svg +275 -0
  416. package/static/media/image-editor/images/stickers/doodles/66.svg +174 -0
  417. package/static/media/image-editor/images/stickers/doodles/67.svg +343 -0
  418. package/static/media/image-editor/images/stickers/doodles/68.svg +242 -0
  419. package/static/media/image-editor/images/stickers/doodles/69.svg +160 -0
  420. package/static/media/image-editor/images/stickers/doodles/7.svg +194 -0
  421. package/static/media/image-editor/images/stickers/doodles/70.svg +365 -0
  422. package/static/media/image-editor/images/stickers/doodles/71.svg +454 -0
  423. package/static/media/image-editor/images/stickers/doodles/72.svg +162 -0
  424. package/static/media/image-editor/images/stickers/doodles/73.svg +393 -0
  425. package/static/media/image-editor/images/stickers/doodles/74.svg +206 -0
  426. package/static/media/image-editor/images/stickers/doodles/75.svg +275 -0
  427. package/static/media/image-editor/images/stickers/doodles/76.svg +350 -0
  428. package/static/media/image-editor/images/stickers/doodles/77.svg +323 -0
  429. package/static/media/image-editor/images/stickers/doodles/78.svg +316 -0
  430. package/static/media/image-editor/images/stickers/doodles/79.svg +503 -0
  431. package/static/media/image-editor/images/stickers/doodles/8.svg +185 -0
  432. package/static/media/image-editor/images/stickers/doodles/80.svg +235 -0
  433. package/static/media/image-editor/images/stickers/doodles/81.svg +184 -0
  434. package/static/media/image-editor/images/stickers/doodles/82.svg +246 -0
  435. package/static/media/image-editor/images/stickers/doodles/83.svg +125 -0
  436. package/static/media/image-editor/images/stickers/doodles/84.svg +168 -0
  437. package/static/media/image-editor/images/stickers/doodles/85.svg +138 -0
  438. package/static/media/image-editor/images/stickers/doodles/86.svg +223 -0
  439. package/static/media/image-editor/images/stickers/doodles/87.svg +475 -0
  440. package/static/media/image-editor/images/stickers/doodles/88.svg +172 -0
  441. package/static/media/image-editor/images/stickers/doodles/89.svg +199 -0
  442. package/static/media/image-editor/images/stickers/doodles/9.svg +368 -0
  443. package/static/media/image-editor/images/stickers/doodles/90.svg +298 -0
  444. package/static/media/image-editor/images/stickers/doodles/91.svg +176 -0
  445. package/static/media/image-editor/images/stickers/doodles/92.svg +152 -0
  446. package/static/media/image-editor/images/stickers/doodles/93.svg +206 -0
  447. package/static/media/image-editor/images/stickers/doodles/94.svg +202 -0
  448. package/static/media/image-editor/images/stickers/doodles/95.svg +114 -0
  449. package/static/media/image-editor/images/stickers/doodles/96.svg +149 -0
  450. package/static/media/image-editor/images/stickers/doodles/97.svg +197 -0
  451. package/static/media/image-editor/images/stickers/doodles/98.svg +397 -0
  452. package/static/media/image-editor/images/stickers/doodles/99.svg +502 -0
  453. package/static/media/image-editor/images/stickers/emoticons/afro-1.svg +122 -0
  454. package/static/media/image-editor/images/stickers/emoticons/afro.svg +85 -0
  455. package/static/media/image-editor/images/stickers/emoticons/agent.svg +114 -0
  456. package/static/media/image-editor/images/stickers/emoticons/alien-1.svg +60 -0
  457. package/static/media/image-editor/images/stickers/emoticons/alien.svg +64 -0
  458. package/static/media/image-editor/images/stickers/emoticons/angel.svg +47 -0
  459. package/static/media/image-editor/images/stickers/emoticons/angry-1.svg +83 -0
  460. package/static/media/image-editor/images/stickers/emoticons/angry-2.svg +48 -0
  461. package/static/media/image-editor/images/stickers/emoticons/angry-3.svg +45 -0
  462. package/static/media/image-editor/images/stickers/emoticons/angry-4.svg +52 -0
  463. package/static/media/image-editor/images/stickers/emoticons/angry-5.svg +62 -0
  464. package/static/media/image-editor/images/stickers/emoticons/angry.svg +78 -0
  465. package/static/media/image-editor/images/stickers/emoticons/arguing.svg +49 -0
  466. package/static/media/image-editor/images/stickers/emoticons/arrogant.svg +98 -0
  467. package/static/media/image-editor/images/stickers/emoticons/asian-1.svg +52 -0
  468. package/static/media/image-editor/images/stickers/emoticons/asian.svg +54 -0
  469. package/static/media/image-editor/images/stickers/emoticons/avatar.svg +49 -0
  470. package/static/media/image-editor/images/stickers/emoticons/baby-1.svg +51 -0
  471. package/static/media/image-editor/images/stickers/emoticons/baby-2.svg +54 -0
  472. package/static/media/image-editor/images/stickers/emoticons/baby.svg +66 -0
  473. package/static/media/image-editor/images/stickers/emoticons/bully.svg +68 -0
  474. package/static/media/image-editor/images/stickers/emoticons/burglar.svg +75 -0
  475. package/static/media/image-editor/images/stickers/emoticons/businessman.svg +52 -0
  476. package/static/media/image-editor/images/stickers/emoticons/cheeky-1.svg +83 -0
  477. package/static/media/image-editor/images/stickers/emoticons/cheeky.svg +73 -0
  478. package/static/media/image-editor/images/stickers/emoticons/clown.svg +75 -0
  479. package/static/media/image-editor/images/stickers/emoticons/confused-1.svg +74 -0
  480. package/static/media/image-editor/images/stickers/emoticons/confused-2.svg +55 -0
  481. package/static/media/image-editor/images/stickers/emoticons/confused-3.svg +45 -0
  482. package/static/media/image-editor/images/stickers/emoticons/confused.svg +66 -0
  483. package/static/media/image-editor/images/stickers/emoticons/creepy.svg +60 -0
  484. package/static/media/image-editor/images/stickers/emoticons/crying-1.svg +55 -0
  485. package/static/media/image-editor/images/stickers/emoticons/crying-2.svg +83 -0
  486. package/static/media/image-editor/images/stickers/emoticons/crying-3.svg +53 -0
  487. package/static/media/image-editor/images/stickers/emoticons/crying.svg +59 -0
  488. package/static/media/image-editor/images/stickers/emoticons/dazed-1.svg +63 -0
  489. package/static/media/image-editor/images/stickers/emoticons/dazed-2.svg +51 -0
  490. package/static/media/image-editor/images/stickers/emoticons/dazed-3.svg +55 -0
  491. package/static/media/image-editor/images/stickers/emoticons/dazed.svg +56 -0
  492. package/static/media/image-editor/images/stickers/emoticons/dead-1.svg +61 -0
  493. package/static/media/image-editor/images/stickers/emoticons/dead-2.svg +80 -0
  494. package/static/media/image-editor/images/stickers/emoticons/dead-3.svg +66 -0
  495. package/static/media/image-editor/images/stickers/emoticons/dead-4.svg +54 -0
  496. package/static/media/image-editor/images/stickers/emoticons/dead-5.svg +52 -0
  497. package/static/media/image-editor/images/stickers/emoticons/dead-6.svg +53 -0
  498. package/static/media/image-editor/images/stickers/emoticons/dead.svg +54 -0
  499. package/static/media/image-editor/images/stickers/emoticons/desperate-1.svg +47 -0
  500. package/static/media/image-editor/images/stickers/emoticons/desperate.svg +75 -0
  501. package/static/media/image-editor/images/stickers/emoticons/detective.svg +75 -0
  502. package/static/media/image-editor/images/stickers/emoticons/dissapointment.svg +70 -0
  503. package/static/media/image-editor/images/stickers/emoticons/doctor.svg +61 -0
  504. package/static/media/image-editor/images/stickers/emoticons/drunk.svg +55 -0
  505. package/static/media/image-editor/images/stickers/emoticons/dumb.svg +50 -0
  506. package/static/media/image-editor/images/stickers/emoticons/emo-1.svg +104 -0
  507. package/static/media/image-editor/images/stickers/emoticons/emo-2.svg +111 -0
  508. package/static/media/image-editor/images/stickers/emoticons/emo.svg +56 -0
  509. package/static/media/image-editor/images/stickers/emoticons/emoticon.svg +84 -0
  510. package/static/media/image-editor/images/stickers/emoticons/evil.svg +59 -0
  511. package/static/media/image-editor/images/stickers/emoticons/faint-1.svg +75 -0
  512. package/static/media/image-editor/images/stickers/emoticons/faint.svg +84 -0
  513. package/static/media/image-editor/images/stickers/emoticons/flirt-1.svg +81 -0
  514. package/static/media/image-editor/images/stickers/emoticons/flirt-2.svg +68 -0
  515. package/static/media/image-editor/images/stickers/emoticons/flirt.svg +71 -0
  516. package/static/media/image-editor/images/stickers/emoticons/flirty.svg +60 -0
  517. package/static/media/image-editor/images/stickers/emoticons/gangster.svg +54 -0
  518. package/static/media/image-editor/images/stickers/emoticons/geek-1.svg +76 -0
  519. package/static/media/image-editor/images/stickers/emoticons/geek.svg +69 -0
  520. package/static/media/image-editor/images/stickers/emoticons/gentleman-1.svg +82 -0
  521. package/static/media/image-editor/images/stickers/emoticons/gentleman-2.svg +58 -0
  522. package/static/media/image-editor/images/stickers/emoticons/gentleman-3.svg +54 -0
  523. package/static/media/image-editor/images/stickers/emoticons/gentleman-4.svg +59 -0
  524. package/static/media/image-editor/images/stickers/emoticons/gentleman.svg +57 -0
  525. package/static/media/image-editor/images/stickers/emoticons/ginger.svg +55 -0
  526. package/static/media/image-editor/images/stickers/emoticons/girl-1.svg +70 -0
  527. package/static/media/image-editor/images/stickers/emoticons/girl.svg +73 -0
  528. package/static/media/image-editor/images/stickers/emoticons/goofy-1.svg +46 -0
  529. package/static/media/image-editor/images/stickers/emoticons/goofy-2.svg +79 -0
  530. package/static/media/image-editor/images/stickers/emoticons/goofy-3.svg +79 -0
  531. package/static/media/image-editor/images/stickers/emoticons/goofy-4.svg +46 -0
  532. package/static/media/image-editor/images/stickers/emoticons/goofy.svg +79 -0
  533. package/static/media/image-editor/images/stickers/emoticons/grubby-1.svg +114 -0
  534. package/static/media/image-editor/images/stickers/emoticons/grubby.svg +165 -0
  535. package/static/media/image-editor/images/stickers/emoticons/happy-1.svg +49 -0
  536. package/static/media/image-editor/images/stickers/emoticons/happy-10.svg +62 -0
  537. package/static/media/image-editor/images/stickers/emoticons/happy-11.svg +55 -0
  538. package/static/media/image-editor/images/stickers/emoticons/happy-12.svg +53 -0
  539. package/static/media/image-editor/images/stickers/emoticons/happy-13.svg +58 -0
  540. package/static/media/image-editor/images/stickers/emoticons/happy-14.svg +62 -0
  541. package/static/media/image-editor/images/stickers/emoticons/happy-15.svg +49 -0
  542. package/static/media/image-editor/images/stickers/emoticons/happy-16.svg +49 -0
  543. package/static/media/image-editor/images/stickers/emoticons/happy-2.svg +71 -0
  544. package/static/media/image-editor/images/stickers/emoticons/happy-3.svg +74 -0
  545. package/static/media/image-editor/images/stickers/emoticons/happy-4.svg +77 -0
  546. package/static/media/image-editor/images/stickers/emoticons/happy-5.svg +52 -0
  547. package/static/media/image-editor/images/stickers/emoticons/happy-6.svg +54 -0
  548. package/static/media/image-editor/images/stickers/emoticons/happy-7.svg +58 -0
  549. package/static/media/image-editor/images/stickers/emoticons/happy-8.svg +42 -0
  550. package/static/media/image-editor/images/stickers/emoticons/happy-9.svg +45 -0
  551. package/static/media/image-editor/images/stickers/emoticons/happy.svg +48 -0
  552. package/static/media/image-editor/images/stickers/emoticons/harry-potter.svg +68 -0
  553. package/static/media/image-editor/images/stickers/emoticons/heisenberg.svg +80 -0
  554. package/static/media/image-editor/images/stickers/emoticons/hipster-1.svg +118 -0
  555. package/static/media/image-editor/images/stickers/emoticons/hipster-2.svg +49 -0
  556. package/static/media/image-editor/images/stickers/emoticons/hipster.svg +48 -0
  557. package/static/media/image-editor/images/stickers/emoticons/in-love-1.svg +62 -0
  558. package/static/media/image-editor/images/stickers/emoticons/in-love-2.svg +48 -0
  559. package/static/media/image-editor/images/stickers/emoticons/in-love-3.svg +49 -0
  560. package/static/media/image-editor/images/stickers/emoticons/in-love-4.svg +50 -0
  561. package/static/media/image-editor/images/stickers/emoticons/in-love-5.svg +49 -0
  562. package/static/media/image-editor/images/stickers/emoticons/in-love-6.svg +53 -0
  563. package/static/media/image-editor/images/stickers/emoticons/in-love.svg +57 -0
  564. package/static/media/image-editor/images/stickers/emoticons/japan.svg +79 -0
  565. package/static/media/image-editor/images/stickers/emoticons/jew.svg +83 -0
  566. package/static/media/image-editor/images/stickers/emoticons/joyful-1.svg +72 -0
  567. package/static/media/image-editor/images/stickers/emoticons/joyful-2.svg +45 -0
  568. package/static/media/image-editor/images/stickers/emoticons/joyful.svg +47 -0
  569. package/static/media/image-editor/images/stickers/emoticons/kiss-1.svg +48 -0
  570. package/static/media/image-editor/images/stickers/emoticons/kiss-2.svg +59 -0
  571. package/static/media/image-editor/images/stickers/emoticons/kiss-3.svg +53 -0
  572. package/static/media/image-editor/images/stickers/emoticons/kiss-4.svg +59 -0
  573. package/static/media/image-editor/images/stickers/emoticons/kiss.svg +67 -0
  574. package/static/media/image-editor/images/stickers/emoticons/laughing-1.svg +54 -0
  575. package/static/media/image-editor/images/stickers/emoticons/laughing-2.svg +57 -0
  576. package/static/media/image-editor/images/stickers/emoticons/laughing-3.svg +55 -0
  577. package/static/media/image-editor/images/stickers/emoticons/laughing.svg +56 -0
  578. package/static/media/image-editor/images/stickers/emoticons/listening.svg +55 -0
  579. package/static/media/image-editor/images/stickers/emoticons/love.svg +74 -0
  580. package/static/media/image-editor/images/stickers/emoticons/manly.svg +75 -0
  581. package/static/media/image-editor/images/stickers/emoticons/miserly-1.svg +90 -0
  582. package/static/media/image-editor/images/stickers/emoticons/miserly.svg +82 -0
  583. package/static/media/image-editor/images/stickers/emoticons/nerd-1.svg +88 -0
  584. package/static/media/image-editor/images/stickers/emoticons/nerd-2.svg +73 -0
  585. package/static/media/image-editor/images/stickers/emoticons/nerd-3.svg +60 -0
  586. package/static/media/image-editor/images/stickers/emoticons/nerd-4.svg +70 -0
  587. package/static/media/image-editor/images/stickers/emoticons/nerd.svg +88 -0
  588. package/static/media/image-editor/images/stickers/emoticons/ninja.svg +51 -0
  589. package/static/media/image-editor/images/stickers/emoticons/pirate-1.svg +92 -0
  590. package/static/media/image-editor/images/stickers/emoticons/pirate-2.svg +48 -0
  591. package/static/media/image-editor/images/stickers/emoticons/pirate.svg +286 -0
  592. package/static/media/image-editor/images/stickers/emoticons/punk-1.svg +134 -0
  593. package/static/media/image-editor/images/stickers/emoticons/punk-2.svg +153 -0
  594. package/static/media/image-editor/images/stickers/emoticons/punk.svg +82 -0
  595. package/static/media/image-editor/images/stickers/emoticons/rapper.svg +51 -0
  596. package/static/media/image-editor/images/stickers/emoticons/relieved.svg +56 -0
  597. package/static/media/image-editor/images/stickers/emoticons/rich-1.svg +59 -0
  598. package/static/media/image-editor/images/stickers/emoticons/rich-2.svg +93 -0
  599. package/static/media/image-editor/images/stickers/emoticons/rich.svg +88 -0
  600. package/static/media/image-editor/images/stickers/emoticons/rockstar.svg +177 -0
  601. package/static/media/image-editor/images/stickers/emoticons/sad-1.svg +43 -0
  602. package/static/media/image-editor/images/stickers/emoticons/sad-2.svg +49 -0
  603. package/static/media/image-editor/images/stickers/emoticons/sad-3.svg +49 -0
  604. package/static/media/image-editor/images/stickers/emoticons/sad-4.svg +49 -0
  605. package/static/media/image-editor/images/stickers/emoticons/sad-5.svg +45 -0
  606. package/static/media/image-editor/images/stickers/emoticons/sad-6.svg +47 -0
  607. package/static/media/image-editor/images/stickers/emoticons/sad.svg +47 -0
  608. package/static/media/image-editor/images/stickers/emoticons/scared-1.svg +79 -0
  609. package/static/media/image-editor/images/stickers/emoticons/scared-2.svg +59 -0
  610. package/static/media/image-editor/images/stickers/emoticons/scared-3.svg +52 -0
  611. package/static/media/image-editor/images/stickers/emoticons/scared.svg +45 -0
  612. package/static/media/image-editor/images/stickers/emoticons/sceptic-1.svg +59 -0
  613. package/static/media/image-editor/images/stickers/emoticons/sceptic-2.svg +80 -0
  614. package/static/media/image-editor/images/stickers/emoticons/sceptic-3.svg +59 -0
  615. package/static/media/image-editor/images/stickers/emoticons/sceptic-4.svg +46 -0
  616. package/static/media/image-editor/images/stickers/emoticons/sceptic-5.svg +43 -0
  617. package/static/media/image-editor/images/stickers/emoticons/sceptic-6.svg +42 -0
  618. package/static/media/image-editor/images/stickers/emoticons/sceptic-7.svg +50 -0
  619. package/static/media/image-editor/images/stickers/emoticons/sceptic.svg +44 -0
  620. package/static/media/image-editor/images/stickers/emoticons/secret.svg +48 -0
  621. package/static/media/image-editor/images/stickers/emoticons/shocked-1.svg +67 -0
  622. package/static/media/image-editor/images/stickers/emoticons/shocked-2.svg +44 -0
  623. package/static/media/image-editor/images/stickers/emoticons/shocked-3.svg +48 -0
  624. package/static/media/image-editor/images/stickers/emoticons/shocked.svg +46 -0
  625. package/static/media/image-editor/images/stickers/emoticons/sick-1.svg +55 -0
  626. package/static/media/image-editor/images/stickers/emoticons/sick-2.svg +48 -0
  627. package/static/media/image-editor/images/stickers/emoticons/sick-3.svg +49 -0
  628. package/static/media/image-editor/images/stickers/emoticons/sick-4.svg +52 -0
  629. package/static/media/image-editor/images/stickers/emoticons/sick.svg +52 -0
  630. package/static/media/image-editor/images/stickers/emoticons/silent.svg +43 -0
  631. package/static/media/image-editor/images/stickers/emoticons/skeleton.svg +64 -0
  632. package/static/media/image-editor/images/stickers/emoticons/smile.svg +43 -0
  633. package/static/media/image-editor/images/stickers/emoticons/smiling-1.svg +47 -0
  634. package/static/media/image-editor/images/stickers/emoticons/smiling.svg +75 -0
  635. package/static/media/image-editor/images/stickers/emoticons/smoked.svg +131 -0
  636. package/static/media/image-editor/images/stickers/emoticons/smug-1.svg +74 -0
  637. package/static/media/image-editor/images/stickers/emoticons/smug-2.svg +82 -0
  638. package/static/media/image-editor/images/stickers/emoticons/smug-3.svg +71 -0
  639. package/static/media/image-editor/images/stickers/emoticons/smug-4.svg +50 -0
  640. package/static/media/image-editor/images/stickers/emoticons/smug-5.svg +64 -0
  641. package/static/media/image-editor/images/stickers/emoticons/smug-6.svg +82 -0
  642. package/static/media/image-editor/images/stickers/emoticons/smug.svg +96 -0
  643. package/static/media/image-editor/images/stickers/emoticons/sporty.svg +68 -0
  644. package/static/media/image-editor/images/stickers/emoticons/stunned.svg +72 -0
  645. package/static/media/image-editor/images/stickers/emoticons/superhero-1.svg +60 -0
  646. package/static/media/image-editor/images/stickers/emoticons/superhero-2.svg +47 -0
  647. package/static/media/image-editor/images/stickers/emoticons/superhero-3.svg +48 -0
  648. package/static/media/image-editor/images/stickers/emoticons/superhero-4.svg +52 -0
  649. package/static/media/image-editor/images/stickers/emoticons/superhero.svg +45 -0
  650. package/static/media/image-editor/images/stickers/emoticons/surprised-1.svg +47 -0
  651. package/static/media/image-editor/images/stickers/emoticons/surprised.svg +58 -0
  652. package/static/media/image-editor/images/stickers/emoticons/thinking.svg +43 -0
  653. package/static/media/image-editor/images/stickers/emoticons/tired-1.svg +78 -0
  654. package/static/media/image-editor/images/stickers/emoticons/tired-2.svg +65 -0
  655. package/static/media/image-editor/images/stickers/emoticons/tired-3.svg +59 -0
  656. package/static/media/image-editor/images/stickers/emoticons/tired.svg +83 -0
  657. package/static/media/image-editor/images/stickers/emoticons/tough-1.svg +65 -0
  658. package/static/media/image-editor/images/stickers/emoticons/tough.svg +158 -0
  659. package/static/media/image-editor/images/stickers/emoticons/trendy.svg +57 -0
  660. package/static/media/image-editor/images/stickers/emoticons/vampire-1.svg +56 -0
  661. package/static/media/image-editor/images/stickers/emoticons/vampire.svg +59 -0
  662. package/static/media/image-editor/images/stickers/emoticons/wink-1.svg +54 -0
  663. package/static/media/image-editor/images/stickers/emoticons/wink-2.svg +64 -0
  664. package/static/media/image-editor/images/stickers/emoticons/wink.svg +73 -0
  665. package/static/media/image-editor/images/stickers/emoticons/winking-1.svg +52 -0
  666. package/static/media/image-editor/images/stickers/emoticons/winking.svg +43 -0
  667. package/static/media/image-editor/images/stickers/emoticons/yawning-1.svg +62 -0
  668. package/static/media/image-editor/images/stickers/emoticons/yawning-2.svg +51 -0
  669. package/static/media/image-editor/images/stickers/emoticons/yawning-3.svg +51 -0
  670. package/static/media/image-editor/images/stickers/emoticons/yawning.svg +73 -0
  671. package/static/media/image-editor/images/stickers/emoticons/yelling.svg +80 -0
  672. package/static/media/image-editor/images/stickers/emoticons/zombie.svg +65 -0
  673. package/static/media/image-editor/images/stickers/landmarks/0.svg +38 -0
  674. package/static/media/image-editor/images/stickers/landmarks/1.svg +46 -0
  675. package/static/media/image-editor/images/stickers/landmarks/10.svg +18 -0
  676. package/static/media/image-editor/images/stickers/landmarks/11.svg +81 -0
  677. package/static/media/image-editor/images/stickers/landmarks/12.svg +77 -0
  678. package/static/media/image-editor/images/stickers/landmarks/13.svg +42 -0
  679. package/static/media/image-editor/images/stickers/landmarks/14.svg +78 -0
  680. package/static/media/image-editor/images/stickers/landmarks/15.svg +84 -0
  681. package/static/media/image-editor/images/stickers/landmarks/16.svg +87 -0
  682. package/static/media/image-editor/images/stickers/landmarks/17.svg +60 -0
  683. package/static/media/image-editor/images/stickers/landmarks/18.svg +30 -0
  684. package/static/media/image-editor/images/stickers/landmarks/19.svg +36 -0
  685. package/static/media/image-editor/images/stickers/landmarks/2.svg +28 -0
  686. package/static/media/image-editor/images/stickers/landmarks/20.svg +137 -0
  687. package/static/media/image-editor/images/stickers/landmarks/21.svg +63 -0
  688. package/static/media/image-editor/images/stickers/landmarks/22.svg +26 -0
  689. package/static/media/image-editor/images/stickers/landmarks/23.svg +52 -0
  690. package/static/media/image-editor/images/stickers/landmarks/24.svg +56 -0
  691. package/static/media/image-editor/images/stickers/landmarks/25.svg +40 -0
  692. package/static/media/image-editor/images/stickers/landmarks/26.svg +34 -0
  693. package/static/media/image-editor/images/stickers/landmarks/27.svg +32 -0
  694. package/static/media/image-editor/images/stickers/landmarks/28.svg +19 -0
  695. package/static/media/image-editor/images/stickers/landmarks/29.svg +23 -0
  696. package/static/media/image-editor/images/stickers/landmarks/3.svg +36 -0
  697. package/static/media/image-editor/images/stickers/landmarks/30.svg +36 -0
  698. package/static/media/image-editor/images/stickers/landmarks/31.svg +27 -0
  699. package/static/media/image-editor/images/stickers/landmarks/32.svg +25 -0
  700. package/static/media/image-editor/images/stickers/landmarks/33.svg +29 -0
  701. package/static/media/image-editor/images/stickers/landmarks/34.svg +72 -0
  702. package/static/media/image-editor/images/stickers/landmarks/35.svg +18 -0
  703. package/static/media/image-editor/images/stickers/landmarks/36.svg +45 -0
  704. package/static/media/image-editor/images/stickers/landmarks/37.svg +46 -0
  705. package/static/media/image-editor/images/stickers/landmarks/38.svg +44 -0
  706. package/static/media/image-editor/images/stickers/landmarks/39.svg +23 -0
  707. package/static/media/image-editor/images/stickers/landmarks/4.svg +33 -0
  708. package/static/media/image-editor/images/stickers/landmarks/40.svg +25 -0
  709. package/static/media/image-editor/images/stickers/landmarks/41.svg +69 -0
  710. package/static/media/image-editor/images/stickers/landmarks/42.svg +75 -0
  711. package/static/media/image-editor/images/stickers/landmarks/43.svg +44 -0
  712. package/static/media/image-editor/images/stickers/landmarks/44.svg +65 -0
  713. package/static/media/image-editor/images/stickers/landmarks/45.svg +19 -0
  714. package/static/media/image-editor/images/stickers/landmarks/46.svg +47 -0
  715. package/static/media/image-editor/images/stickers/landmarks/47.svg +544 -0
  716. package/static/media/image-editor/images/stickers/landmarks/48.svg +162 -0
  717. package/static/media/image-editor/images/stickers/landmarks/49.svg +70 -0
  718. package/static/media/image-editor/images/stickers/landmarks/5.svg +36 -0
  719. package/static/media/image-editor/images/stickers/landmarks/50.svg +52 -0
  720. package/static/media/image-editor/images/stickers/landmarks/51.svg +110 -0
  721. package/static/media/image-editor/images/stickers/landmarks/52.svg +41 -0
  722. package/static/media/image-editor/images/stickers/landmarks/53.svg +74 -0
  723. package/static/media/image-editor/images/stickers/landmarks/54.svg +36 -0
  724. package/static/media/image-editor/images/stickers/landmarks/55.svg +84 -0
  725. package/static/media/image-editor/images/stickers/landmarks/56.svg +93 -0
  726. package/static/media/image-editor/images/stickers/landmarks/57.svg +67 -0
  727. package/static/media/image-editor/images/stickers/landmarks/58.svg +101 -0
  728. package/static/media/image-editor/images/stickers/landmarks/59.svg +47 -0
  729. package/static/media/image-editor/images/stickers/landmarks/6.svg +59 -0
  730. package/static/media/image-editor/images/stickers/landmarks/60.svg +134 -0
  731. package/static/media/image-editor/images/stickers/landmarks/61.svg +79 -0
  732. package/static/media/image-editor/images/stickers/landmarks/62.svg +43 -0
  733. package/static/media/image-editor/images/stickers/landmarks/63.svg +83 -0
  734. package/static/media/image-editor/images/stickers/landmarks/64.svg +99 -0
  735. package/static/media/image-editor/images/stickers/landmarks/65.svg +79 -0
  736. package/static/media/image-editor/images/stickers/landmarks/66.svg +37 -0
  737. package/static/media/image-editor/images/stickers/landmarks/67.svg +82 -0
  738. package/static/media/image-editor/images/stickers/landmarks/68.svg +216 -0
  739. package/static/media/image-editor/images/stickers/landmarks/69.svg +17 -0
  740. package/static/media/image-editor/images/stickers/landmarks/7.svg +16 -0
  741. package/static/media/image-editor/images/stickers/landmarks/70.svg +45 -0
  742. package/static/media/image-editor/images/stickers/landmarks/71.svg +37 -0
  743. package/static/media/image-editor/images/stickers/landmarks/72.svg +28 -0
  744. package/static/media/image-editor/images/stickers/landmarks/73.svg +25 -0
  745. package/static/media/image-editor/images/stickers/landmarks/74.svg +23 -0
  746. package/static/media/image-editor/images/stickers/landmarks/75.svg +88 -0
  747. package/static/media/image-editor/images/stickers/landmarks/76.svg +25 -0
  748. package/static/media/image-editor/images/stickers/landmarks/77.svg +23 -0
  749. package/static/media/image-editor/images/stickers/landmarks/78.svg +63 -0
  750. package/static/media/image-editor/images/stickers/landmarks/79.svg +25 -0
  751. package/static/media/image-editor/images/stickers/landmarks/8.svg +52 -0
  752. package/static/media/image-editor/images/stickers/landmarks/80.svg +29 -0
  753. package/static/media/image-editor/images/stickers/landmarks/81.svg +44 -0
  754. package/static/media/image-editor/images/stickers/landmarks/82.svg +83 -0
  755. package/static/media/image-editor/images/stickers/landmarks/83.svg +65 -0
  756. package/static/media/image-editor/images/stickers/landmarks/84.svg +31 -0
  757. package/static/media/image-editor/images/stickers/landmarks/85.svg +30 -0
  758. package/static/media/image-editor/images/stickers/landmarks/86.svg +26 -0
  759. package/static/media/image-editor/images/stickers/landmarks/87.svg +132 -0
  760. package/static/media/image-editor/images/stickers/landmarks/88.svg +93 -0
  761. package/static/media/image-editor/images/stickers/landmarks/89.svg +91 -0
  762. package/static/media/image-editor/images/stickers/landmarks/9.svg +70 -0
  763. package/static/media/image-editor/images/stickers/landmarks/90.svg +65 -0
  764. package/static/media/image-editor/images/stickers/landmarks/91.svg +36 -0
  765. package/static/media/image-editor/images/stickers/landmarks/92.svg +66 -0
  766. package/static/media/image-editor/images/stickers/landmarks/93.svg +65 -0
  767. package/static/media/image-editor/images/stickers/landmarks/94.svg +28 -0
  768. package/static/media/image-editor/images/stickers/landmarks/95.svg +31 -0
  769. package/static/media/image-editor/images/stickers/landmarks/96.svg +25 -0
  770. package/static/media/image-editor/images/stickers/landmarks/97.svg +31 -0
  771. package/static/media/image-editor/images/stickers/landmarks/98.svg +52 -0
  772. package/static/media/image-editor/images/stickers/landmarks/99.svg +56 -0
  773. package/static/media/image-editor/images/stickers/stars/0.png +0 -0
  774. package/static/media/image-editor/images/stickers/stars/1.png +0 -0
  775. package/static/media/image-editor/images/stickers/stars/2.png +0 -0
  776. package/static/media/image-editor/images/stickers/stars/3.png +0 -0
  777. package/static/media/image-editor/images/stickers/stars/4.png +0 -0
  778. package/static/media/image-editor/images/stickers/stars/5.png +0 -0
  779. package/static/media/image-editor/images/stickers/transportation/0.svg +26 -0
  780. package/static/media/image-editor/images/stickers/transportation/1.svg +10 -0
  781. package/static/media/image-editor/images/stickers/transportation/10.svg +16 -0
  782. package/static/media/image-editor/images/stickers/transportation/11.svg +30 -0
  783. package/static/media/image-editor/images/stickers/transportation/12.svg +22 -0
  784. package/static/media/image-editor/images/stickers/transportation/13.svg +24 -0
  785. package/static/media/image-editor/images/stickers/transportation/14.svg +19 -0
  786. package/static/media/image-editor/images/stickers/transportation/15.svg +23 -0
  787. package/static/media/image-editor/images/stickers/transportation/16.svg +25 -0
  788. package/static/media/image-editor/images/stickers/transportation/17.svg +34 -0
  789. package/static/media/image-editor/images/stickers/transportation/18.svg +29 -0
  790. package/static/media/image-editor/images/stickers/transportation/19.svg +24 -0
  791. package/static/media/image-editor/images/stickers/transportation/2.svg +27 -0
  792. package/static/media/image-editor/images/stickers/transportation/20.svg +25 -0
  793. package/static/media/image-editor/images/stickers/transportation/21.svg +22 -0
  794. package/static/media/image-editor/images/stickers/transportation/3.svg +18 -0
  795. package/static/media/image-editor/images/stickers/transportation/4.svg +24 -0
  796. package/static/media/image-editor/images/stickers/transportation/5.svg +15 -0
  797. package/static/media/image-editor/images/stickers/transportation/6.svg +25 -0
  798. package/static/media/image-editor/images/stickers/transportation/7.svg +17 -0
  799. package/static/media/image-editor/images/stickers/transportation/8.svg +28 -0
  800. package/static/media/image-editor/images/stickers/transportation/9.svg +23 -0
  801. package/static/media/image-editor/images/textures/0.png +0 -0
  802. package/static/media/image-editor/images/textures/1.png +0 -0
  803. package/static/media/image-editor/images/textures/10.png +0 -0
  804. package/static/media/image-editor/images/textures/11.png +0 -0
  805. package/static/media/image-editor/images/textures/12.png +0 -0
  806. package/static/media/image-editor/images/textures/13.png +0 -0
  807. package/static/media/image-editor/images/textures/14.png +0 -0
  808. package/static/media/image-editor/images/textures/15.png +0 -0
  809. package/static/media/image-editor/images/textures/16.png +0 -0
  810. package/static/media/image-editor/images/textures/17.png +0 -0
  811. package/static/media/image-editor/images/textures/18.png +0 -0
  812. package/static/media/image-editor/images/textures/19.png +0 -0
  813. package/static/media/image-editor/images/textures/2.png +0 -0
  814. package/static/media/image-editor/images/textures/20.png +0 -0
  815. package/static/media/image-editor/images/textures/21.png +0 -0
  816. package/static/media/image-editor/images/textures/22.png +0 -0
  817. package/static/media/image-editor/images/textures/23.png +0 -0
  818. package/static/media/image-editor/images/textures/24.png +0 -0
  819. package/static/media/image-editor/images/textures/25.png +0 -0
  820. package/static/media/image-editor/images/textures/26.png +0 -0
  821. package/static/media/image-editor/images/textures/27.png +0 -0
  822. package/static/media/image-editor/images/textures/28.png +0 -0
  823. package/static/media/image-editor/images/textures/3.png +0 -0
  824. package/static/media/image-editor/images/textures/4.png +0 -0
  825. package/static/media/image-editor/images/textures/5.png +0 -0
  826. package/static/media/image-editor/images/textures/6.png +0 -0
  827. package/static/media/image-editor/images/textures/7.png +0 -0
  828. package/static/media/image-editor/images/textures/8.png +0 -0
  829. package/static/media/image-editor/images/textures/9.png +0 -0
  830. package/translations.pot +178 -144
  831. package/iframe/iframe-eblock.e88ae8a9ae883be1118b.html +0 -1
  832. package/iframe/iframe.e88ae8a9ae883be1118b.html +0 -1
  833. package/iframe/js/330.4622fd92.js +0 -1
  834. package/static/css/57.c4280089.chunk.css +0 -1
  835. package/static/js/1303.92cc3c9c.js +0 -2
  836. package/static/js/207.2a052cc2.js +0 -2
  837. package/static/js/3017.102adc4c.chunk.js +0 -1
  838. package/static/js/3065.c2b60870.js +0 -2
  839. package/static/js/57.3e1e762a.chunk.js +0 -1
  840. package/static/js/6798.65ecf642.chunk.js +0 -2
  841. package/static/js/8473.88a48c70.chunk.js +0 -2
  842. package/static/js/9960.6fbe3e6d.chunk.js +0 -2
  843. package/static/js/9981.4c03120e.js +0 -1
  844. package/static/js/emailmaker_core.c2851865.js +0 -2
  845. /package/iframe/js/{330.4622fd92.js.LICENSE.txt → 330.5b87e8cb.js.LICENSE.txt} +0 -0
  846. /package/static/js/{1169.baef237c.chunk.js.LICENSE.txt → 1169.41f7faae.js.LICENSE.txt} +0 -0
  847. /package/static/js/{ant-locale/locale-vi_VN-js.c5140ea5.chunk.js → 1241.c5140ea5.js} +0 -0
  848. /package/static/js/{ant-locale/locale-fr_FR-js.5d07a79a.chunk.js → 1330.5d07a79a.js} +0 -0
  849. /package/static/js/{ant-locale/locale-hi_IN-js.7af15f51.chunk.js → 1332.7af15f51.js} +0 -0
  850. /package/static/js/{ant-locale/locale-cs_CZ-js.1e90fb24.chunk.js → 1377.1e90fb24.js} +0 -0
  851. /package/static/js/{ant-locale/locale-ka_GE-js.853f3af0.chunk.js → 1454.853f3af0.js} +0 -0
  852. /package/static/js/{ant-locale/locale-en_GB-js.92cc4647.chunk.js → 1502.92cc4647.js} +0 -0
  853. /package/static/js/{ant-locale/locale-hr_HR-js.4ebb11e0.chunk.js → 1510.4ebb11e0.js} +0 -0
  854. /package/static/js/{1538.68b12a82.chunk.js.LICENSE.txt → 1538.bfc8d578.js.LICENSE.txt} +0 -0
  855. /package/static/js/{ant-locale/locale-ca_ES-js.24fe4aef.chunk.js → 1626.24fe4aef.js} +0 -0
  856. /package/static/js/{ant-locale/locale-ta_IN-js.ee264565.chunk.js → 1640.ee264565.js} +0 -0
  857. /package/static/js/{1729.a0be903e.chunk.js → 1729.a0be903e.js} +0 -0
  858. /package/static/js/{ant-locale/locale-uk_UA-js.cef1c751.chunk.js → 1788.cef1c751.js} +0 -0
  859. /package/static/js/{ant-locale/locale-ga_IE-js.afa510f9.chunk.js → 1872.afa510f9.js} +0 -0
  860. /package/static/js/{1880.5668de7d.chunk.js → 1880.5668de7d.js} +0 -0
  861. /package/static/js/{ant-locale/locale-zh_HK-js.ca14eb1f.chunk.js → 197.ca14eb1f.js} +0 -0
  862. /package/static/js/{ant-locale/locale-da_DK-js.61788209.chunk.js → 2066.61788209.js} +0 -0
  863. /package/static/js/{ant-locale/locale-es_ES-js.a31d70e0.chunk.js → 2114.a31d70e0.js} +0 -0
  864. /package/static/js/{ant-locale/locale-it_IT-js.59a531ef.chunk.js → 2408.59a531ef.js} +0 -0
  865. /package/static/js/{ant-locale/locale-lt_LT-js.976c50a6.chunk.js → 2438.976c50a6.js} +0 -0
  866. /package/static/js/{mergeTags/locale0.24c6e2da.chunk.js → 2466.24c6e2da.js} +0 -0
  867. /package/static/js/{2624.5a8b68ca.js.LICENSE.txt → 2624.c73e6966.js.LICENSE.txt} +0 -0
  868. /package/static/js/{2642.b60a63f6.chunk.js → 2642.b60a63f6.js} +0 -0
  869. /package/static/js/{ant-locale/locale-sl_SI-js.f054d794.chunk.js → 2827.f054d794.js} +0 -0
  870. /package/static/js/{ant-locale/locale-bg_BG-js.3d7c7e4f.chunk.js → 2844.3d7c7e4f.js} +0 -0
  871. /package/static/js/{ant-locale/locale-ml_IN-js.9ca0875e.chunk.js → 290.9ca0875e.js} +0 -0
  872. /package/static/js/{ant-locale/locale-nb_NO-js.85b15451.chunk.js → 2917.85b15451.js} +0 -0
  873. /package/static/js/{ant-locale/locale-ro_RO-js.3e1e40bb.chunk.js → 2988.3e1e40bb.js} +0 -0
  874. /package/static/js/{3019.8534e1e7.chunk.js.LICENSE.txt → 3019.b5f316a5.js.LICENSE.txt} +0 -0
  875. /package/static/js/{3085.bcc62ca0.chunk.js.LICENSE.txt → 3085.0ddbb320.js.LICENSE.txt} +0 -0
  876. /package/static/js/{ant-locale/locale-lv_LV-js.d2b7eb7a.chunk.js → 3302.d2b7eb7a.js} +0 -0
  877. /package/static/js/{ant-locale/locale-fr_BE-js.2e2298ab.chunk.js → 3411.2e2298ab.js} +0 -0
  878. /package/static/js/{1303.92cc3c9c.js.LICENSE.txt → 3473.abdeb8f7.js.LICENSE.txt} +0 -0
  879. /package/static/js/{ant-locale/locale-id_ID-js.ab0888b9.chunk.js → 3624.ab0888b9.js} +0 -0
  880. /package/static/js/{ant-locale/locale-gl_ES-js.72e19ffc.chunk.js → 3711.72e19ffc.js} +0 -0
  881. /package/static/js/{ant-locale/locale-az_AZ-js.b84a560f.chunk.js → 3816.b84a560f.js} +0 -0
  882. /package/static/js/{ant-locale/locale-kn_IN-js.5fbd9645.chunk.js → 3914.5fbd9645.js} +0 -0
  883. /package/static/js/{4309.6c1989bb.chunk.js → 4309.6c1989bb.js} +0 -0
  884. /package/static/js/{ant-locale/locale-kk_KZ-js.5fdcc75b.chunk.js → 4425.5fdcc75b.js} +0 -0
  885. /package/static/js/{ant-locale/locale-ar_EG-js.a068e3a8.chunk.js → 4607.a068e3a8.js} +0 -0
  886. /package/static/js/{ant-locale/locale-tr_TR-js.4c6d775a.chunk.js → 4686.4c6d775a.js} +0 -0
  887. /package/static/js/{ant-locale/locale-pt_BR-js.17328a86.chunk.js → 4702.17328a86.js} +0 -0
  888. /package/static/js/{ant-locale/locale-zh_TW-js.69bb4746.chunk.js → 4813.69bb4746.js} +0 -0
  889. /package/static/js/{ant-locale/locale-si_LK-js.facbc144.chunk.js → 4823.facbc144.js} +0 -0
  890. /package/static/js/{ant-locale/locale-fr_CA-js.b2f59d9c.chunk.js → 494.b2f59d9c.js} +0 -0
  891. /package/static/js/{ant-locale/locale-ku_IQ-js.8d56188e.chunk.js → 5108.8d56188e.js} +0 -0
  892. /package/static/js/{ant-locale/locale-ko_KR-js.07676057.chunk.js → 5261.07676057.js} +0 -0
  893. /package/static/js/{ant-locale/locale-fa_IR-js.f0f50266.chunk.js → 5322.f0f50266.js} +0 -0
  894. /package/static/js/{ant-locale/locale-nl_NL-js.26845b27.chunk.js → 5466.26845b27.js} +0 -0
  895. /package/static/js/{ant-locale/locale-nl_BE-js.71247744.chunk.js → 5653.71247744.js} +0 -0
  896. /package/static/js/{ant-locale/locale-ne_NP-js.db143616.chunk.js → 5827.db143616.js} +0 -0
  897. /package/static/js/{ant-locale/locale-pl_PL-js.44a62852.chunk.js → 5862.44a62852.js} +0 -0
  898. /package/static/js/{ant-locale/locale-tk_TK-js.015ee01f.chunk.js → 5864.015ee01f.js} +0 -0
  899. /package/static/js/{ant-locale/locale-th_TH-js.f1d32c8f.chunk.js → 5902.f1d32c8f.js} +0 -0
  900. /package/static/js/{ant-locale/locale-ms_MY-js.68d51cfa.chunk.js → 5980.68d51cfa.js} +0 -0
  901. /package/static/js/{ant-locale/locale-km_KH-js.988792d2.chunk.js → 6033.988792d2.js} +0 -0
  902. /package/static/js/{ant-locale/locale-et_EE-js.337814a0.chunk.js → 6135.337814a0.js} +0 -0
  903. /package/static/js/{6144.a3bf0881.chunk.js.LICENSE.txt → 6144.5d2c141c.js.LICENSE.txt} +0 -0
  904. /package/static/js/{ant-locale/locale-sk_SK-js.32bd8996.chunk.js → 6418.32bd8996.js} +0 -0
  905. /package/static/js/{ant-locale/locale-bn_BD-js.dd1a7e84.chunk.js → 6428.dd1a7e84.js} +0 -0
  906. /package/static/js/{ant-locale/locale-fi_FI-js.e2e08d8a.chunk.js → 6552.e2e08d8a.js} +0 -0
  907. /package/static/js/{ant-locale/locale-my_MM-js.1d798fbf.chunk.js → 6618.1d798fbf.js} +0 -0
  908. /package/static/js/{2854.da9b4ca6.js.LICENSE.txt → 6655.b54ad4d6.js.LICENSE.txt} +0 -0
  909. /package/static/js/{ant-locale/locale-hu_HU-js.ecde5d7e.chunk.js → 6764.ecde5d7e.js} +0 -0
  910. /package/static/js/{3065.c2b60870.js.LICENSE.txt → 6798.4b7584f2.js.LICENSE.txt} +0 -0
  911. /package/static/js/{6801.562ec824.chunk.js.LICENSE.txt → 6801.d6cefb00.js.LICENSE.txt} +0 -0
  912. /package/static/js/{6819.16ca9581.chunk.js.LICENSE.txt → 6819.c2bea9e8.js.LICENSE.txt} +0 -0
  913. /package/static/js/{ant-locale/locale-mn_MN-js.e5c5e6b3.chunk.js → 6832.e5c5e6b3.js} +0 -0
  914. /package/static/js/{mergeTags/locale1.24fd0fd2.chunk.js → 6859.24fd0fd2.js} +0 -0
  915. /package/static/js/{6957.7ea22637.chunk.js → 6957.7ea22637.js} +0 -0
  916. /package/static/js/{ant-locale/locale-el_GR-js.6c5e0839.chunk.js → 7288.6c5e0839.js} +0 -0
  917. /package/static/js/{ant-locale/locale-hy_AM-js.15e07ba1.chunk.js → 737.15e07ba1.js} +0 -0
  918. /package/static/js/{ant-locale/locale-is_IS-js.fdbfc750.chunk.js → 7426.fdbfc750.js} +0 -0
  919. /package/static/js/{7463.51929d73.chunk.js.LICENSE.txt → 7463.45a04221.js.LICENSE.txt} +0 -0
  920. /package/static/js/{ant-locale/locale-sv_SE-js.ecd8298d.chunk.js → 77.ecd8298d.js} +0 -0
  921. /package/static/js/{ant-locale/locale-he_IL-js.47b71730.chunk.js → 7974.47b71730.js} +0 -0
  922. /package/static/js/{ant-locale/locale-mk_MK-js.1a324243.chunk.js → 8466.1a324243.js} +0 -0
  923. /package/static/js/{8521.0e5efd08.chunk.js.LICENSE.txt → 8521.e891fa18.js.LICENSE.txt} +0 -0
  924. /package/static/js/{ant-locale/locale-pt_PT-js.05d4d804.chunk.js → 8534.05d4d804.js} +0 -0
  925. /package/static/js/{ant-locale/locale-ur_PK-js.b5d52218.chunk.js → 8590.b5d52218.js} +0 -0
  926. /package/static/js/{ant-locale/locale-sr_RS-js.317370b5.chunk.js → 8682.317370b5.js} +0 -0
  927. /package/static/js/{ant-locale/locale-de_DE-js.8e7fdd44.chunk.js → 8796.8e7fdd44.js} +0 -0
  928. /package/static/js/{ant-locale/locale-ja_JP-js.7870613a.chunk.js → 8839.7870613a.js} +0 -0
  929. /package/static/js/{ant-locale/locale-zh_CN-js.861c7ef0.chunk.js → 9169.861c7ef0.js} +0 -0
  930. /package/static/js/{ant-locale/locale-by_BY-js.49b7fc6b.chunk.js → 9200.49b7fc6b.js} +0 -0
  931. /package/static/js/{6798.65ecf642.chunk.js.LICENSE.txt → 9332.dc949fd3.js.LICENSE.txt} +0 -0
  932. /package/static/js/{ant-locale/locale-kmr_IQ-js.6903b04d.chunk.js → 9508.6903b04d.js} +0 -0
  933. /package/static/js/{9644.eb778968.chunk.js.LICENSE.txt → 9644.c8707a98.js.LICENSE.txt} +0 -0
  934. /package/static/js/{ant-locale/locale-eu_ES-js.18f1c965.chunk.js → 9716.18f1c965.js} +0 -0
  935. /package/static/js/{emailmaker_core.c2851865.js.LICENSE.txt → emailmaker_core.ea526523.js.LICENSE.txt} +0 -0
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 5447.173960c2.js.LICENSE.txt */
2
+ "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[5447],{95447:(e,t,n)=>{var r;n.d(t,{BC:()=>$T,KG:()=>HT,mM:()=>GT});var i=n(23689),o=n(98173),a=n(73013),s=n(99291),l=n(71446),c=n(37969),u=n(10423),d=n(82021),h=n(38),f=n(66964),p=n(28973),g=n(94674),m=n(38927),v=n(48944),y=n(69550),b=n(69194),w=n(8218),x=n(47555),C=n(93771),_=n(48753),S=n(73477),k=n(50483),A=n(201),j=n(62913),E=n(49823),I=n(49856),T=n(98447),O=n(10582),F=n(67034),P=n(40120),M=n(13785),R=n(27580),L=n(63719),D=n(59987),N=n(83177),z=n(95856),B=n(50078),V=n(35850),U=n(30702),W=n(36236),H=n(80320),$=n(34401),G=n(67756),Y=n(61657),q=n(48426),X=n(10585),K=n(82648),Z=n(76293),J=n(48300),Q=n(38826),ee=n(66711),te=n(38992),ne=n(85740),re=(n(97320),n(45764).Buffer);function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ie(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function se(e){var t=function(e,t){if("object"!=ae(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=ae(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==ae(t)?t:t+""}function le(e,t,n){return(t=se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ce(Object(n),!0).forEach(function(t){le(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var de={},he=[];function fe(e,t){}function pe(e,t){}function ge(e,t,n){t||de[n]||(e(!1,n),de[n]=!0)}function me(e,t){ge(fe,e,t)}function ve(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=new Set;return function e(t,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=r.has(t);if(me(!a,"Warning: There may be circular references"),a)return!1;if(t===i)return!0;if(n&&o>1)return!1;r.add(t);var s=o+1;if(Array.isArray(t)){if(!Array.isArray(i)||t.length!==i.length)return!1;for(var l=0;l<t.length;l++)if(!e(t[l],i[l],s))return!1;return!0}if(t&&i&&"object"===ae(t)&&"object"===ae(i)){var c=Object.keys(t);return c.length===Object.keys(i).length&&c.every(function(n){return e(t[n],i[n],s)})}return!1}(e,t)}function ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,se(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function we(e){return e.join("%")}me.preMessage=function(e){he.push(e)},me.resetWarned=function(){de={}},me.noteOnce=function(e,t){ge(pe,e,t)};var xe=function(){function e(t){ye(this,e),le(this,"instanceId",void 0),le(this,"cache",new Map),le(this,"extracted",new Set),this.instanceId=t}return be(e,[{key:"get",value:function(e){return this.opGet(we(e))}},{key:"opGet",value:function(e){return this.cache.get(e)||null}},{key:"update",value:function(e,t){return this.opUpdate(we(e),t)}},{key:"opUpdate",value:function(e,t){var n=t(this.cache.get(e));null===n?this.cache.delete(e):this.cache.set(e,n)}}]),e}(),Ce=["children"],_e="data-css-hash",Se="__cssinjs_instance__";function ke(){var e=Math.random().toString(12).slice(2);if("undefined"!=typeof document&&document.head&&document.body){var t=document.body.querySelectorAll("style[".concat(_e,"]"))||[],n=document.head.firstChild;Array.from(t).forEach(function(t){t[Se]=t[Se]||e,t[Se]===e&&document.head.insertBefore(t,n)});var r={};Array.from(document.querySelectorAll("style[".concat(_e,"]"))).forEach(function(t){var n,i=t.getAttribute(_e);r[i]?t[Se]===e&&(null===(n=t.parentNode)||void 0===n||n.removeChild(t)):r[i]=!0})}return new xe(e)}var Ae=o.createContext({hashPriority:"low",cache:ke(),defaultCache:!0}),je=function(e){var t,n,r,i,a=e.children,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,Ce),l=o.useContext(Ae),c=(t=function(){var e=ue({},l);Object.keys(s).forEach(function(t){var n=s[t];void 0!==s[t]&&(e[t]=n)});var t=s.cache;return e.cache=e.cache||ke(),e.defaultCache=!t&&l.defaultCache,e},n=[l,s],r=function(e,t){return!ve(e[0],t[0],!0)||!ve(e[1],t[1],!0)},"value"in(i=o.useRef({})).current&&!r(i.current.condition,n)||(i.current.value=t(),i.current.condition=n),i.current.value);return o.createElement(Ae.Provider,{value:c},a)},Ee=function(){function e(){ye(this,e),le(this,"cache",void 0),le(this,"keys",void 0),le(this,"cacheCallTimes",void 0),this.cache=new Map,this.keys=[],this.cacheCallTimes=0}return be(e,[{key:"size",value:function(){return this.keys.length}},{key:"internalGet",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i={map:this.cache};return e.forEach(function(e){var t;i=i?null===(t=i)||void 0===t||null===(t=t.map)||void 0===t?void 0:t.get(e):void 0}),null!==(t=i)&&void 0!==t&&t.value&&r&&(i.value[1]=this.cacheCallTimes++),null===(n=i)||void 0===n?void 0:n.value}},{key:"get",value:function(e){var t;return null===(t=this.internalGet(e,!0))||void 0===t?void 0:t[0]}},{key:"has",value:function(e){return!!this.internalGet(e)}},{key:"set",value:function(t,n){var r=this;if(!this.has(t)){if(this.size()+1>e.MAX_CACHE_SIZE+e.MAX_CACHE_OFFSET){var i=this.keys.reduce(function(e,t){var n=oe(e,2)[1];return r.internalGet(t)[1]<n?[t,r.internalGet(t)[1]]:e},[this.keys[0],this.cacheCallTimes]),o=oe(i,1)[0];this.delete(o)}this.keys.push(t)}var a=this.cache;t.forEach(function(e,i){if(i===t.length-1)a.set(e,{value:[n,r.cacheCallTimes++]});else{var o=a.get(e);o?o.map||(o.map=new Map):a.set(e,{map:new Map}),a=a.get(e).map}})}},{key:"deleteByPath",value:function(e,t){var n,r=e.get(t[0]);if(1===t.length)return r.map?e.set(t[0],{map:r.map}):e.delete(t[0]),null===(n=r.value)||void 0===n?void 0:n[0];var i=this.deleteByPath(r.map,t.slice(1));return r.map&&0!==r.map.size||r.value||e.delete(t[0]),i}},{key:"delete",value:function(e){if(this.has(e))return this.keys=this.keys.filter(function(t){return!function(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,e)}),this.deleteByPath(this.cache,e)}}]),e}();function Ie(e,t,n){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4])return e;var r=ue(ue({},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}),{},le(le({},"data-token-hash",t),_e,n)),i=Object.keys(r).map(function(e){var t=r[e];return t?"".concat(e,'="').concat(t,'"'):null}).filter(function(e){return e}).join(" ");return"<style ".concat(i,">").concat(e,"</style>")}le(Ee,"MAX_CACHE_SIZE",20),le(Ee,"MAX_CACHE_OFFSET",5),new Ee,"undefined"!=typeof window&&window.document&&window.document.createElement?o.useLayoutEffect:o.useEffect,ue({},r||(r=n.t(o,2))).useInsertionEffect,ue({},r||(r=n.t(o,2))).useInsertionEffect;var Te="comm",Oe="rule",Fe="decl",Pe=Math.abs,Me=String.fromCharCode;function Re(e){return e.trim()}function Le(e,t,n){return e.replace(t,n)}function De(e,t,n){return e.indexOf(t,n)}function Ne(e,t){return 0|e.charCodeAt(t)}function ze(e,t,n){return e.slice(t,n)}function Be(e){return e.length}function Ve(e,t){return t.push(e),e}var Ue=1,We=1,He=0,$e=0,Ge=0,Ye="";function qe(e,t,n,r,i,o,a,s){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:Ue,column:We,length:a,return:"",siblings:s}}function Xe(){return Ge=$e>0?Ne(Ye,--$e):0,We--,10===Ge&&(We=1,Ue--),Ge}function Ke(){return Ge=$e<He?Ne(Ye,$e++):0,We++,10===Ge&&(We=1,Ue++),Ge}function Ze(){return Ne(Ye,$e)}function Je(){return $e}function Qe(e,t){return ze(Ye,e,t)}function et(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tt(e){return Re(Qe($e-1,it(91===e?e+2:40===e?e+1:e)))}function nt(e){for(;(Ge=Ze())&&Ge<33;)Ke();return et(e)>2||et(Ge)>3?"":" "}function rt(e,t){for(;--t&&Ke()&&!(Ge<48||Ge>102||Ge>57&&Ge<65||Ge>70&&Ge<97););return Qe(e,Je()+(t<6&&32==Ze()&&32==Ke()))}function it(e){for(;Ke();)switch(Ge){case e:return $e;case 34:case 39:34!==e&&39!==e&&it(Ge);break;case 40:41===e&&it(e);break;case 92:Ke()}return $e}function ot(e,t){for(;Ke()&&e+Ge!==57&&(e+Ge!==84||47!==Ze()););return"/*"+Qe(t,$e-1)+"*"+Me(47===e?e:Ke())}function at(e){for(;!et(Ze());)Ke();return Qe(e,$e)}function st(e){return function(e){return Ye="",e}(lt("",null,null,null,[""],e=function(e){return Ue=We=1,He=Be(Ye=e),$e=0,[]}(e),0,[0],e))}function lt(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,h=0,f=0,p=0,g=1,m=1,v=1,y=0,b="",w=i,x=o,C=r,_=b;m;)switch(p=y,y=Ke()){case 40:if(108!=p&&58==Ne(_,d-1)){-1!=De(_+=Le(tt(y),"&","&\f"),"&\f",Pe(c?s[c-1]:0))&&(v=-1);break}case 34:case 39:case 91:_+=tt(y);break;case 9:case 10:case 13:case 32:_+=nt(p);break;case 92:_+=rt(Je()-1,7);continue;case 47:switch(Ze()){case 42:case 47:Ve(ut(ot(Ke(),Je()),t,n,l),l),5!=et(p||1)&&5!=et(Ze()||1)||!Be(_)||" "===ze(_,-1,void 0)||(_+=" ");break;default:_+="/"}break;case 123*g:s[c++]=Be(_)*v;case 125*g:case 59:case 0:switch(y){case 0:case 125:m=0;case 59+u:-1==v&&(_=Le(_,/\f/g,"")),f>0&&(Be(_)-d||0===g&&47===p)&&Ve(f>32?dt(_+";",r,n,d-1,l):dt(Le(_," ","")+";",r,n,d-2,l),l);break;case 59:_+=";";default:if(Ve(C=ct(_,t,n,c,u,i,s,b,w=[],x=[],d,o),o),123===y)if(0===u)lt(_,t,C,C,w,o,d,s,x);else{switch(h){case 99:if(110===Ne(_,3))break;case 108:if(97===Ne(_,2))break;default:u=0;case 100:case 109:case 115:}u?lt(e,C,C,r&&Ve(ct(e,C,C,0,0,i,s,b,i,w=[],d,x),x),i,x,d,s,r?w:x):lt(_,C,C,C,[""],x,0,s,x)}}c=u=f=0,g=v=1,b=_="",d=a;break;case 58:d=1+Be(_),f=p;default:if(g<1)if(123==y)--g;else if(125==y&&0==g++&&125==Xe())continue;switch(_+=Me(y),y*g){case 38:v=u>0?1:(_+="\f",-1);break;case 44:s[c++]=(Be(_)-1)*v,v=1;break;case 64:45===Ze()&&(_+=tt(Ke())),h=Ze(),u=d=Be(b=_+=at(Je())),y++;break;case 45:45===p&&2==Be(_)&&(g=0)}}return o}function ct(e,t,n,r,i,o,a,s,l,c,u,d){for(var h=i-1,f=0===i?o:[""],p=function(e){return e.length}(f),g=0,m=0,v=0;g<r;++g)for(var y=0,b=ze(e,h+1,h=Pe(m=a[g])),w=e;y<p;++y)(w=Re(m>0?f[y]+" "+b:Le(b,/&\f/g,f[y])))&&(l[v++]=w);return qe(e,t,n,0===i?Oe:s,l,c,u,d)}function ut(e,t,n,r){return qe(e,t,n,Te,Me(Ge),ze(e,2,-2),0,r)}function dt(e,t,n,r,i){return qe(e,t,n,Fe,ze(e,0,r),ze(e,r+1,-1),r,i)}function ht(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function ft(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case Fe:return e.return=e.return||e.value;case Te:return"";case"@keyframes":return e.return=e.value+"{"+ht(e.children,r)+"}";case Oe:if(!Be(e.value=e.props.join(",")))return""}return Be(n=ht(e.children,r))?e.return=e.value+"{"+n+"}":""}function pt(e){return e.notSplit=!0,e}le(le(le({},"style",function(e,t,n){var r=oe(e,6),i=r[0],o=r[1],a=r[2],s=r[3],l=r[4],c=r[5],u=(n||{}).plain;if(l)return null;var d=i,h={"data-rc-order":"prependQueue","data-rc-priority":"".concat(c)};return d=Ie(i,o,a,h,u),s&&Object.keys(s).forEach(function(e){if(!t[e]){t[e]=!0;var n=function(e){return ht(st(e),ft).replace(/\{%%%\:[^;];}/g,";")}(s[e]),r=Ie(n,o,"_effect-".concat(e),h,u);e.startsWith("@layer")?d=r+d:d+=r}}),[c,a,d]}),"token",function(e,t,n){var r=oe(e,5),i=r[2],o=r[3],a=r[4],s=(n||{}).plain;if(!o)return null;var l=i._tokenKey;return[-999,l,Ie(o,a,l,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]}),"cssVar",function(e,t,n){var r=oe(e,4),i=r[1],o=r[2],a=r[3],s=(n||{}).plain;return i?[-999,o,Ie(i,a,o,{"data-rc-order":"prependQueue","data-rc-priority":"".concat(-999)},s)]:null}),pt(["borderTop","borderBottom"]),pt(["borderTop"]),pt(["borderBottom"]),pt(["borderLeft","borderRight"]),pt(["borderLeft"]),pt(["borderRight"]);const gt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function mt(e,t){return t}function vt(e,t){return e.filter(e=>void 0!==e)}var yt,bt;function wt(e){return"object"!=typeof e||null===e?0:Array.isArray(e)?2:function(e){if(!_t.includes(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(void 0===t)return!0;const n=t.prototype;return!(null===n||"object"!=typeof n||!_t.includes(Object.prototype.toString.call(n)))&&!!n.hasOwnProperty("isPrototypeOf")}(e)?1:e instanceof Set?3:e instanceof Map?4:5}function xt(e,t){return"object"==typeof e&&Object.prototype.propertyIsEnumerable.call(e,t)}function Ct(e){let t=0,n=e[0]?.[Symbol.iterator]();return{[Symbol.iterator]:()=>({next(){for(;;){if(void 0===n)return{done:!0,value:void 0};const r=n.next();if(!0!==r.done)return{done:!1,value:r.value};t+=1,n=e[t]?.[Symbol.iterator]()}}})}}(bt=yt||(yt={}))[bt.NOT=0]="NOT",bt[bt.RECORD=1]="RECORD",bt[bt.ARRAY=2]="ARRAY",bt[bt.SET=3]="SET",bt[bt.MAP=4]="MAP",bt[bt.OTHER=5]="OTHER";const _t=["[object Object]","[object Module]"],St={mergeRecords:function(e,t,n){const r={};for(const i of function(e){const t=new Set;for(const n of e)for(const e of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(e);return t}(e)){const o=[];for(const t of e)xt(t,i)&&o.push(t[i]);if(0===o.length)continue;const a=t.metaDataUpdater(n,{key:i,parents:e}),s=kt(o,t,a);s!==gt.skip&&("__proto__"===i?Object.defineProperty(r,i,{value:s,configurable:!0,enumerable:!0,writable:!0}):r[i]=s)}return r},mergeArrays:function(e){return e.flat()},mergeSets:function(e){return new Set(Ct(e))},mergeMaps:function(e){return new Map(Ct(e))},mergeOthers:function(e){return e.at(-1)}};function kt(e,t,n){const r=t.filterValues?.(e,n)??e;if(0===r.length)return;if(1===r.length)return At(r,t,n);const i=wt(r[0]);if(0!==i&&5!==i)for(let o=1;o<r.length;o++)if(wt(r[o])!==i)return At(r,t,n);switch(i){case 1:return function(e,t,n){const r=t.mergeFunctions.mergeRecords(e,t,n);return r===gt.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}(r,t,n);case 2:return function(e,t,n){const r=t.mergeFunctions.mergeArrays(e,t,n);return r===gt.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}(r,t,n);case 3:return function(e,t,n){const r=t.mergeFunctions.mergeSets(e,t,n);return r===gt.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}(r,t,n);case 4:return function(e,t,n){const r=t.mergeFunctions.mergeMaps(e,t,n);return r===gt.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}(r,t,n);default:return At(r,t,n)}}function At(e,t,n){const r=t.mergeFunctions.mergeOthers(e,t,n);return r===gt.defaultMerge||t.useImplicitDefaultMerging&&void 0===r&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}const jt="my_files",Et="gif",It="stock_images",Tt="ai",Ot="editor",Ft="light",Pt="dark",Mt="system",Rt="(prefers-color-scheme: dark)",Lt=["jpg","jpeg","png","gif","bmp","webp","svg","ico","tiff","tif"],Dt="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQABLAEsAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAAEsAAAAAQAAASwAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQOgAwAEAAAAAQAAAMoAAAAA/+EJ2Wh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1wTU06RG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6c3RvY2s6Mzk2MmU4NTQtNjA1NC00MGZmLWEwYzMtYjJkNjcwMzQ2OWFhIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOmE5M2NiZTgyLWI5NjEtNGUzNS1iYmQ0LWJjZWE1Zjc1YTQwZiIvPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDw/eHBhY2tldCBlbmQ9InciPz4A/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAMoBAwMBIgACEQADEQD/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAUDBAQEAwUEBAQFBQUGBwwIBwcHBw8LCwkMEQ8SEhEPERETFhwXExQaFRERGCEYGh0dHx8fExciJCIeJBweHx7/3QAEABH/2gAMAwEAAhEDEQA/APsuiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAoqG7uIbWB55nCooyTS208VxCssLh0boRQBLRRRQAUUUUAFFFFAH/9D7LooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAqG7uIrWBppnCoo5Jou7iK1gaaZwqKM5NcRq2oXOsXqxQq2wnEcYPX3NABq2oXOr3qwxK3l5xHGO/ua6nw7pzadZ7ZJGaR+WBPA9hUfh7R49Pi82TDXDDkkfd9hWxQAUUUUAFFFFABRRRQB//9H7LooooAKKKKACiiuOv/EOpQX88KNDsSQqMp6H60AdjRXD/wDCTapn70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iiuH/4SfVP70P/AH7/APr0f8JPqn96H/v3/wDXoA7iiuH/AOEn1T+9D/37/wDr0f8ACT6p/eh/79//AF6AO4orh/8AhJ9U/vQ/9+//AK9H/CT6p/eh/wC/f/16AO4orh/+En1T+9D/AN+//r0f8JPqn96H/v3/APXoA7iobq4itYHmncIijJJrE0jUdQlt2v8AUJIYrNVyMJgv9Oaw9X1C51e8WGJWMecRxr39zQAatqNzq94kUasELYjjB6/Wul8P6NHp8Qlkw1ww5P8Ad9hWRmDw9bfwTajIv4Riqw8Tap6wf98f/XoA7elrh/8AhJtU/vQ/9+//AK9avhnWL3UL94bgx7BGWG1cdwPX3oA6OiiigAooooAKKKKAP//S+y6KKKACiiigArgHAbxSVYAg3mCD3+eu/rgT/wAjV/2+f+z0Adt9jtMf8esH/fsUfY7T/n1g/wC/Yqeh2CIWY4AGSaAK7WlmqktbQADkkxr/AIVUe50JJPLZ7EN6YWuX17WJr+dkRylurYVQfve5rKJoA9Ghh0+Zd0MVtIvqqKaf9jtP+fWD/v2K89sry4sphLbyFD3HY/Wu+0e9TULFLhQATww9DQBJ9jtP+fWD/v2KattZM7ILe3LL94bF4p99cx2lpJcS/dRc/X2rjdG1eSLWmuZ2Oy4bEnoPQ/hQB2P2O0/59YP+/Yo+x2n/AD6wf9+xU4IPSloAr/Y7T/n1g/79ij7Haf8APrB/37FWKKAK/wBjtP8An1g/79ij7Haf8+sH/fsVYooAr/Y7T/n1g/79ioruPTrWBppoLdUUckxj/Cp7u4itYGnmcKijJJriNX1C61i9EUKtsziOMHr7mgBNVv7jVrxYII/3YOIYl/ma6bw9o8enxCSTD3DDkn+H2FHh/R49Pi8yTDXDDkkfd9hWxQBC9rbOxZ7eJmPUlATTfsdp/wA+sH/fsVYooAztXtbVdLumW3hBELkEIOPlNc74H/5Csv8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0/suiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72s/xI7R6HdMpwdmPzODWhUN/ALqymt26SIVoA816UlS3ML207wSrtdCQai+lAC11HgN2xdx4+XKH6Hn/AArl++K6jSv+JN4flvJhiWfBRe/Tj+ZNAEHjLUfOnFjEw2R/NJju3Yfl/Oudp0jtJIzucsxJJ96bQB2/hLUftdkLeRh50OF+q9jW3XnOkXrWF/HcDJUHDjPUV6HDIssSSIQVYAg0APooooAKhu7iK1gaeZwqKM5NF3cQ2sDTTOFRRk5riNW1C51i9WKJW8vOI4x39zQAavqF1rF6IYVbZnEcYPX3NdL4e0ePT4hLIA1w45JH3fYUeHtHj0+LzJcNcMOTj7vsK2KACiiigAooooAqaz/yCbz/AK4v/wCgmuX8D/8AIWl/64n+YrqNZ/5BN5/1xf8A9BNcv4H/AOQtL/1xP8xQB2dFFFABRRRQAUUUUAf/1PsuiiigAooooAK4E/8AI1f9vn/s9d9XAn/kav8At8/9noA72lpKWgDO1bSLXUQDKCsg6OvX/wCvWFJ4Tn3fJdxFc8FkOa66igDC0zw3a2riadzPIOeRhR+FYXinUPtl+Yoz+5h+VcdCe5/p+FdH4n1H7DYFYziaX5U9vU1wn40AFFFFABXW+DNR3xtp8x+ZPmjyeo7j/PrXJVNZzva3UdxG2HjbP/1qAPTKhu7iK2gaaZwqKOSahTULf+zFv3bZEybsmuP1XULnV70QxK3l7sRxr39zQAmrahc6xerFEreXnEcY7+5rpfD2jx6fF5suGuGHJx932FHh7R49PiEkuGuGHJ/u+wrYoAKKKKACiiigAooooAqaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5iuo1n/AJBN5/1xf/0E1y/gf/kLS/8AXE/zFAHZ0UUUAFFFFABRRRQB/9X7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAKazBVZicBRkmnVz3jHUfs9qLOJsSy/ex2XvQBzuu351DUXlDfu1+WMewqhRRQAUUUv40AFbGi6ZG8TahqB8uzTkA9ZP/AK1Gi6ZG8TajqJ2WcfIB/wCWn/1qi1W+uNWu0hhQiIHbFEv86ADU7+fVbpIIU2xZ2xRL/M103h7R00+LzZcPcMOTj7vsKyCYfD9sQNsupSr+EY/z+ddDot8uoWCTj7/Rx6N3oAvUUUUAFZ17rFta6jDZydZPvNnhPTNSaxqEWn2bTv8AM3RF9TXntxLJPK8sp3O5yx9TQB6dmlrA8Kar9qg+yzt+/jHBP8QrfoAKKKKAKms/8gm8/wCuL/8AoJrl/A//ACFpf+uJ/mK6jWf+QTef9cX/APQTXL+B/wDkLS/9cT/MUAdnRRRQAUUUUAFFFFAH/9b7LooooAKKKKACuBP/ACNX/b5/7PXfVwJ/5Gr/ALfP/Z6AO9paSloAjuZo7eB5pThEGSa851G6e9vJLl+rngeg7Ct/xpqOWXT4m6fNLj9B/X8q5mgBKKKO9AADzWzoumRvEdQ1A7LOPkA/8tP/AK1JoulxvE2oagQlnHyAf+Wn/wBaotVv59WukhhjIizthiX+dABql/catdJBDGRHnbDEv86vkweH7bHyy6jKv4Rj/P8An0UmDw/bEfLLqMq/hGP8/n/Ln5JHlkaSRi7scsx70AEkjySNLIxd2OWY961fCuo/Y78RSNiGY7T7Hsax6WgD1EGmyuscbSOwVVBJPoKy/DGofbrABzmaLCvk9fQ1k+MNU3MdPgY4X/WkevpQBla7qLajel84iTiMe3rWdS0lAEtrPJbXMdxC2HQ5HvXoWlXsd/ZpPGevDD0PevOK0/D2pHTr0FiTBJgOP60Ad/RTUYOoZSCCMg06gCprP/IJvP8Ari//AKCa5fwP/wAhaX/rif5iuo1n/kE3n/XF/wD0E1y/gf8A5C0v/XE/zFAHZ0UUUAFFFFABRRRQB//X+y6KKKACiiigArgT/wAjV/2+f+z131cCf+Rq/wC3z/2egDvarapeJY2Mlw/8I+UZ6nsKs1xni7UftN39ljb91Eecd2/z/WgDFnlknmeaRsu5JJqOigdeKAFrX0XS43iOoagQlnHyAf8Alp/9al0XTI3ibUNQISzj5Ab/AJaf/WqHVb+41a6SGGMrEDtiiX+dAC6rfT6tdJBChEWdsMS/zq+TB4ftj92XUZV/CMf5/P8AkhMPh+2x8suoyr+EY/z+f8sCSR5ZGlkYu7HLMe9ABJI8sjSSMXdjlmPemUUUAFLSUUAWtOvp7CZ5YD8zIVOenNVmJZixJJPUmkooAKKKKAClFJRQB1Pg/VOBp87Dj/VEn9K6jPFeYRs0bh0JDqQQR2Nd7oGpJqNkGJxKnEg/rQBY1n/kE3n/AFxf/wBBNcv4H/5C0v8A1xP8xXUaz/yCbz/ri/8A6Ca5fwP/AMhaX/rif5igDs6KKKACiiigAooooA//0PsuiiigAooooAK4E/8AI1f9vn/s9d8a89u5RB4hlnYEiO5LkDvhs0Adtq808Ni7W0TyTEbUCjkE964c6TqhJJspyTySVroB4stsY+xzf99Cj/hK7X/nzl/76FAHPnSdTx/x4z/981d0zRvL33eqr5NtFztbq5/wro7PVo5rF72SB7eBfutIcbvpXLatqFzq94IokYpnEca859zQAmq31xq12sEEZEQOIol/nWxBYzaPZeZBavc30oxlVyIxUVsbLw6i+epuL1wCyp/AP6VY/wCEstv+fSb/AL6FAGBLpmrSyNJJZ3DuxyzFetN/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmj+yNT/wCfGf8A75roP+Ertf8Anzl/76FH/CV2v/PnL/30KAOf/sjU/wDnxn/75o/sjU/+fGf/AL5roP8AhK7X/nzl/wC+hR/wldr/AM+cv/fQoA5/+yNT/wCfGf8A75o/sjU/+fGf/vmug/4Su1/585f++hR/wldr/wA+cv8A30KAOf8A7I1P/nxn/wC+aP7I1P8A58Z/++a6D/hK7X/nzl/76FH/AAldr/z5y/8AfQoA5/8AsjU/+fGf/vmrmkW+r6ferOllPtzh12n5hWp/wldr/wA+cv8A30KP+Ertf+fOX/voUAa+rNu0a6bBGYGOD1HymuZ8D/8AIWl/64n+YqzfeJre4spoBayqZI2UEkcZGKreB/8AkKyn/pif5igDs6KKKACiiigAooooA//R+y6KKKACiiigArHn8OadPO80nm73YscNjknNbFFAGJ/wjGmf9N/+/lRXGg6NZxG4nMnlpyQ0mQfatq7uIrWBppnCoozk1xGrajdaxeLFCh2E4jjHf3NACapfT6tdpBDGfKU4hjUfrXTeH9HTT4vNkw1yw5JH3fYUeHtHj0+LzZMNcMOSR932FbFAGNL4b0+WRpJXuHdjks0nJNN/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTP+m/8A38o/4RjTP+m//fytuigDE/4RjTPSf/v5VrTNGs9PnM1v5m4qVO5s8ZB/pWjRQAUUUUAFFFFABRRRQB//0vsuiiigAooooAKhu7mK1t2nmYKijkmpq5fxda6jNcReXukgYgBVHQ+9AGVq2oXOsXqxRK2zdiNB39zXS+H9Hj0+ISSYa4Ycn+77Cjw/o8enxebLhrhhySPu+wrYoAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigAooooAKKKKAP/9P7LooooAKKKKACkxS0UAFFFFABRRTW6D6igB1FN7n8KQE+YRQA+iiigAopsnEZI64pR90UALRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==",Nt={keywords:"",color:"",orientation:""};T.A.setDefaultIndicator((0,i.jsx)(()=>(0,i.jsx)(Q.A,{style:{fontSize:48,height:"100%"},spin:!0}),{}));const zt={hashed:!1,algorithm:P.A.defaultAlgorithm,token:{colorLink:"#1677ff",colorInfo:"#722ed1",colorTextBase:"#000000",colorBgLayout:"#f0f2f5",borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},components:{Progress:{colorFillSecondary:"#ffffff"},Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},Bt={hashed:!1,algorithm:P.A.darkAlgorithm,token:{colorBgBase:"#1F1F1F",colorInfo:"#9254de",colorLink:"#1890ff",colorLinkHover:"#69c0ff",wireframe:!1,borderRadiusXL:16,borderRadiusLG:12,borderRadius:8,borderRadiusSM:6,borderWidth:1,colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},components:{Tabs:{titleFontSize:16,titleFontSizeSM:16,fontSize:16,fontSizeLG:16}}},Vt=({externalTheme:e=Ft,children:t,customThemeToken:n})=>{const r=matchMedia(Rt).matches?Pt:Ft,a=e===Mt?r:e,[s,c]=(0,o.useState)(a),[u,d]=(0,o.useState)("light"===s?zt:Bt);return(0,o.useEffect)(()=>{c(a)},[a]),(0,o.useEffect)(()=>{const e="light"===s?zt:Bt,t=n?function(...e){return function(){const e=function(e,t){return{defaultMergeFunctions:St,mergeFunctions:{...St,...Object.fromEntries(Object.entries(e).filter(([e,t])=>Object.hasOwn(St,e)).map(([e,t])=>!1===t?[e,St.mergeOthers]:[e,t]))},metaDataUpdater:e.metaDataUpdater??mt,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,filterValues:!1===e.filterValues?void 0:e.filterValues??vt,actions:gt}}({},t);function t(...t){return kt(t,e,void 0)}return t}()(...e)}(e.token,n):e.token;d(Object.assign(Object.assign({},e),{token:t}))},[d,s,n]),(0,i.jsx)("div",{id:"file-manager-element-id",style:{height:"100%"},children:(0,i.jsx)(p.Ay,{theme:u,children:(0,i.jsx)(je,{transformers:[],children:(0,i.jsx)(l.A,{style:{height:"100%"},children:t})})})})};let Ut=!1;const Wt=()=>{if(Ut)return;window.addEventListener("error",e=>!(!e.message||!e.message.includes("ResizeObserver loop completed with undelivered notifications"))&&(e.stopImmediatePropagation(),e.preventDefault(),!0),!0);const e=window.onerror;window.onerror=(t,n,r,i,o)=>!("string"!=typeof t||!t.includes("ResizeObserver loop completed with undelivered notifications"))||!!e&&e(t,n,r,i,o),window.addEventListener("unhandledrejection",e=>{var t,n;(null===(n=null===(t=e.reason)||void 0===t?void 0:t.message)||void 0===n?void 0:n.includes("ResizeObserver loop completed with undelivered notifications"))&&e.preventDefault()});const t=console.error;if(console.error=(...e)=>{var n;((null===(n=e[0])||void 0===n?void 0:n.toString())||"").includes("ResizeObserver loop completed with undelivered notifications")||t.apply(console,e)},"undefined"!=typeof window){const e=()=>{try{["webpackHotUpdate","__webpack_require__","__webpack_hash__"].forEach(e=>{if(window[e]){window.__webpack_require__}})}catch(e){}};e(),setTimeout(e,1e3)}Ut=!0},Ht=(e,t="image/png")=>{let n=t;if(e.startsWith("data:")){const t=e.match(/^data:([^;]+)/);t&&t[1].startsWith("image/")&&(n=t[1])}return n=n.includes("jpeg")||n.includes("jpg")?"image/jpeg":n.includes("png")?"image/png":n.includes("gif")?"image/gif":"image/png",n},$t=e=>e.split("/")[1]||"png",Gt=/^data:(.+?);base64,(.+)$/i,Yt=(e,t)=>{const n=(e=>{const t=(e=>{if("function"!=typeof globalThis.atob)throw new Error("Base64 decoding is not supported in the current environment.");return globalThis.atob(e)})(e),n=t.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=t.charCodeAt(i);return r})(e.replace(/\s/g,"")),r=new ArrayBuffer(n.length);return new Uint8Array(r).set(n),new Blob([r],{type:t})},qt=(e,t="application/octet-stream")=>{if(e instanceof Blob)return e;if("string"==typeof e){const n=e.trim(),r=n.match(Gt);if(r){const[,e,t]=r;return Yt(t,e)}return Yt(n,t)}throw new Error("Unsupported data type. Expected Blob or base64 string.")};var Xt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof n.g?n.g:"undefined"!=typeof self?self:{};const Kt={},Zt=(e,t,n,r)=>{tn(n)&&Kt[n]||(tn(n)&&(Kt[n]=new Date),((e,t,n,r)=>{const i=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);tn(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...i):console})(e,t,n,r))},Jt=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Qt=(e,t,n)=>{e.loadNamespaces(t,Jt(e,n))},en=(e,t,n,r)=>{if(tn(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Qt(e,n,r);n.forEach(t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)}),e.loadLanguages(t,Jt(e,r))},tn=e=>"string"==typeof e,nn=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,rn={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xa9","&#169;":"\xa9","&reg;":"\xae","&#174;":"\xae","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},on=e=>rn[e];let an,sn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(nn,on)};const ln={type:"3rdParty",init(e){((e={})=>{sn={...sn,...e}})(e.options.react),(e=>{an=e})(e)}},cn=(0,o.createContext)();class un{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const dn=(e,t,n,r)=>e.getFixedT(t,n,r),hn=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:i}=(0,o.useContext)(cn)||{},a=n||r||an;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new un),!a){Zt(a,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>{return tn(t)?t:"object"==typeof(n=t)&&null!==n&&tn(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e;var n},t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react?.wait&&Zt(a,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const s={...sn,...a.options.react,...t},{useSuspense:l,keyPrefix:c}=s;let u=i||a.options?.defaultNS;u=tn(u)?[u]:u||["translation"],a.reportNamespaces.addUsedNamespaces?.(u);const d=(a.isInitialized||a.initializedStoreOnce)&&u.every(e=>((e,t,n={})=>t.languages&&t.languages.length?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):(Zt(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0))(e,a,s)),h=((e,t,n,r)=>(0,o.useCallback)(dn(e,t,n,r),[e,t,n,r]))(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),f=()=>h,p=()=>dn(a,t.lng||null,"fallback"===s.nsMode?u:u[0],c),[g,m]=(0,o.useState)(f);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const y=(e=>{const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e,void 0]),t.current})(v),b=(0,o.useRef)(!0);(0,o.useEffect)(()=>{const{bindI18n:e,bindI18nStore:n}=s;b.current=!0,d||l||(t.lng?en(a,t.lng,u,()=>{b.current&&m(p)}):Qt(a,u,()=>{b.current&&m(p)})),d&&y&&y!==v&&b.current&&m(p);const r=()=>{b.current&&m(p)};return e&&a?.on(e,r),n&&a?.store.on(n,r),()=>{b.current=!1,a&&e&&e?.split(" ").forEach(e=>a.off(e,r)),n&&a&&n.split(" ").forEach(e=>a.store.off(e,r))}},[a,v]),(0,o.useEffect)(()=>{b.current&&d&&m(f)},[a,c,d]);const w=[g,a,d];if(w.t=g,w.i18n=a,w.ready=d,d)return w;if(!d&&!l)return w;throw new Promise(e=>{t.lng?en(a,t.lng,u,()=>e()):Qt(a,u,()=>e())})};function fn({i18n:e,defaultNS:t,children:n}){const r=(0,o.useMemo)(()=>({i18n:e,defaultNS:t}),[e,t]);return(0,o.createElement)(cn.Provider,{value:r},n)}const pn=e=>"string"==typeof e,gn=()=>{let e,t;const n=new Promise((n,r)=>{e=n,t=r});return n.resolve=e,n.reject=t,n},mn=e=>null==e?"":""+e,vn=/###/g,yn=e=>e&&e.indexOf("###")>-1?e.replace(vn,"."):e,bn=e=>!e||pn(e),wn=(e,t,n)=>{const r=pn(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(bn(e))return{};const t=yn(r[i]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++i}return bn(e)?{}:{obj:e,k:yn(r[i])}},xn=(e,t,n)=>{const{obj:r,k:i}=wn(e,t,Object);if(void 0!==r||1===t.length)return void(r[i]=n);let o=t[t.length-1],a=t.slice(0,t.length-1),s=wn(e,a,Object);for(;void 0===s.obj&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=wn(e,a,Object),s?.obj&&void 0!==s.obj[`${s.k}.${o}`]&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},Cn=(e,t)=>{const{obj:n,k:r}=wn(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},_n=(e,t,n)=>{for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?pn(e[r])||e[r]instanceof String||pn(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):_n(e[r],t[r],n):e[r]=t[r]);return e},Sn=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const An=e=>pn(e)?e.replace(/[&<>"'\/]/g,e=>kn[e]):e,jn=[" ",",","?","!",";"],En=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),In=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||"object"!=typeof i)return;let e,t="";for(let a=o;a<r.length;++a)if(a!==o&&(t+=n),t+=r[a],e=i[t],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&a<r.length-1)continue;o+=a-o+1;break}i=e}return i},Tn=e=>e?.replace("_","-"),On={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){}};class Fn{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||On,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:(pn(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Fn(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Fn(this.logger,e)}}var Pn=new Fn;class Mn{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let r=0;r<n;r++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let i=0;i<r;i++)n.apply(n,[e,...t])})}}class Rn extends Mn{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,r={}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],n&&(Array.isArray(n)?a.push(...n):pn(n)&&i?a.push(...n.split(i)):a.push(n)));const s=Cn(this.data,a);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=a[0],t=a[1],n=a.slice(2).join(".")),!s&&o&&pn(n)?In(this.data?.[e]?.[t],n,i):s}addResource(e,t,n,r,i={silent:!1}){const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),xn(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}addResources(e,t,n,r={silent:!1}){for(const i in n)(pn(n[i])||Array.isArray(n[i]))&&this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,i,o={silent:!1,skipCopy:!1}){let a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let s=Cn(this.data,a)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?_n(s,n,i):s={...s,...n},xn(this.data,a,s),o.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Ln={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(e=>{t=this.processors[e]?.process(t,n,r,i)??t}),t}};const Dn=Symbol("i18next/PATH_KEY");function Nn(e,t){const{[Dn]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(r,i)=>(n?.revoke?.(),i===Dn?e:(e.push(i),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(t?.keySeparator??".")}const zn={},Bn=e=>!pn(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Vn extends Mn{constructor(e,t={}){super(),((e,t,n)=>{["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{t[e]&&(n[e]=t[e])})})(0,e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Pn.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const r=this.resolve(e,n);return void 0!==r?.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let i=t.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const r=jn.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===r.length)return!0;const i=En.getRegExp(`(${r.map(e=>"?"===e?"\\?":e).join("|")})`);let o=!i.test(e);if(!o){const t=e.indexOf(n);t>0&&!i.test(e.substring(0,t))&&(o=!0)}return o})(e,n,r));if(o&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:pn(i)?[i]:i};const o=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),e=o.join(r)}return{key:e,namespaces:pn(i)?[i]:i}}translate(e,t,n){let r="object"==typeof t?{...t}:t;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==e)return"";"function"==typeof e&&(e=Nn(e,{...this.options,...r})),Array.isArray(e)||(e=[String(e)]);const i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(e[e.length-1],r),l=s[s.length-1];let c=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const u=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return d?i?{res:`${l}${c}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${c}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:a;const h=this.resolve(e,r);let f=h?.res;const p=h?.usedKey||a,g=h?.exactUsedKey||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,y=void 0!==r.count&&!pn(r.count),b=Vn.hasDefaultValue(r),w=y?this.pluralResolver.getSuffix(u,r.count,r):"",x=r.ordinal&&y?this.pluralResolver.getSuffix(u,r.count,{ordinal:!1}):"",C=y&&!r.ordinal&&0===r.count,_=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue;let S=f;v&&!f&&b&&(S=_);const k=Bn(S),A=Object.prototype.toString.apply(S);if(!(v&&S&&k&&["[object Number]","[object Function]","[object RegExp]"].indexOf(A)<0)||pn(m)&&Array.isArray(S))if(v&&pn(m)&&Array.isArray(f))f=f.join(m),f&&(f=this.extendTranslation(f,e,r,n));else{let t=!1,i=!1;!this.isValidLookup(f)&&b&&(t=!0,f=_),this.isValidLookup(f)||(i=!0,f=a);const s=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:f,d=b&&_!==f&&this.options.updateMissing;if(i||t||d){if(this.logger.log(d?"updateKey":"missingKey",u,l,a,d?_:f),o){const e=this.resolve(a,{...r,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let r=0;r<t.length;r++)e.push(t[r]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(r.lng||this.language):e.push(r.lng||this.language);const n=(e,t,n)=>{const i=b&&n!==f?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,l,t,i,d,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(e,l,t,i,d,r),this.emit("missingKey",e,l,t,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&y?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],a+t,r[`defaultValue${t}`]||_)})}):n(e,a,_))}f=this.extendTranslation(f,e,r,h,n),i&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}${c}${a}`),(i||t)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${c}${a}`:a,t?f:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,S,{...r,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=e,h.usedParams=this.getUsedParamsDetails(r),h):e}if(o){const e=Array.isArray(S),t=e?[]:{},n=e?g:p;for(const i in S)if(Object.prototype.hasOwnProperty.call(S,i)){const e=`${n}${o}${i}`;t[i]=b&&!f?this.translate(e,{...r,defaultValue:Bn(_)?_[i]:void 0,joinArrays:!1,ns:s}):this.translate(e,{...r,joinArrays:!1,ns:s}),t[i]===e&&(t[i]=S[i])}f=t}}return i?(h.res=f,h.usedParams=this.getUsedParamsDetails(r),h):f}extendTranslation(e,t,n,r,i){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const o=pn(e)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(o){const t=e.match(this.interpolator.nestingRegexp);a=t&&t.length}let s=n.replace&&!pn(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||r.usedLng,n),o){const t=e.match(this.interpolator.nestingRegexp);a<(t&&t.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>i?.[0]!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const o=n.postProcess||this.options.postProcess,a=pn(o)?[o]:o;return null!=e&&a?.length&&!1!==n.applyPostProcessor&&(e=Ln.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,r,i,o,a;return pn(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),l=s.key;r=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==t.count&&!pn(t.count),d=u&&!t.ordinal&&0===t.count,h=void 0!==t.context&&(pn(t.context)||"number"==typeof t.context)&&""!==t.context,f=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(a=e,zn[`${f[0]}-${e}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(zn[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${r}" for languages "${f.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(r=>{if(this.isValidLookup(n))return;o=r;const a=[l];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,r,e,t);else{let e;u&&(e=this.pluralResolver.getSuffix(r,t.count,t));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(t.ordinal&&0===e.indexOf(i)&&a.push(l+e.replace(i,this.options.pluralSeparator)),a.push(l+e),d&&a.push(l+n)),h){const r=`${l}${this.options.contextSeparator||"_"}${t.context}`;a.push(r),u&&(t.ordinal&&0===e.indexOf(i)&&a.push(r+e.replace(i,this.options.pluralSeparator)),a.push(r+e),d&&a.push(r+n))}}let s;for(;s=a.pop();)this.isValidLookup(n)||(i=s,n=this.getResource(r,e,s,t))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!pn(e.replace);let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Un{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Pn.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Tn(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Tn(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(pn(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(e);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(e=>e===r?e:e.indexOf("-")<0&&r.indexOf("-")<0?void 0:e.indexOf("-")>0&&r.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===r||0===e.indexOf(r)&&r.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),pn(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),r=[],i=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return pn(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):pn(e)&&i(this.formatLanguageCode(e)),n.forEach(e=>{r.indexOf(e)<0&&i(this.formatLanguageCode(e))}),r}}const Wn={zero:0,one:1,two:2,few:3,many:4,other:5},Hn={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class $n{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Pn.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Tn("dev"===e?"en":e),r=t.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:r});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Hn;if(!e.match(/-|_/))return Hn;const r=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(r,t)}return this.pluralRulesCache[i]=o,o}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>Wn[e]-Wn[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const r=this.getRule(e,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const Gn=(e,t,n,r=".",i=!0)=>{let o=((e,t,n)=>{const r=Cn(e,n);return void 0!==r?r:Cn(t,n)})(e,t,n);return!o&&i&&pn(n)&&(o=In(e,n,r),void 0===o&&(o=In(t,n,r))),o},Yn=e=>e.replace(/\$/g,"$$$$");class qn{constructor(e={}){this.logger=Pn.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:r,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:s,formatSeparator:l,unescapeSuffix:c,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:m,alwaysFormat:v}=e.interpolation;this.escape=void 0!==t?t:An,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=i?Sn(i):o||"{{",this.suffix=a?Sn(a):s||"}}",this.formatSeparator=l||",",this.unescapePrefix=c?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=d?Sn(d):h||Sn("$t("),this.nestingSuffix=f?Sn(f):p||Sn(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==v&&v,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>e?.source===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,r){let i,o,a;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=e=>{if(e.indexOf(this.formatSeparator)<0){const i=Gn(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...r,...t,interpolationkey:e}):i}const i=e.split(this.formatSeparator),o=i.shift().trim(),a=i.join(this.formatSeparator).trim();return this.format(Gn(t,s,o,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:o})};this.resetRegExp();const c=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>Yn(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?Yn(this.escape(e)):Yn(e)}].forEach(t=>{for(a=0;i=t.regex.exec(e);){const n=i[1].trim();if(o=l(n),void 0===o)if("function"==typeof c){const t=c(e,i,r);o=pn(t)?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))o="";else{if(u){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),o=""}else pn(o)||this.useRawValueToEscape||(o=mn(o));const s=t.safeValue(o);if(e=e.replace(i[0],s),u?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t,n={}){let r,i,o;const a=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),s=i.match(/"/g);((a?.length??0)%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,e};for(;r=this.nestingRegexp.exec(e);){let s=[];o={...n},o=o.replace&&!pn(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(s=r[1].slice(l).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),i=t(a.call(this,r[1].trim(),o),o),i&&r[0]===e&&!pn(i))return i;pn(i)||(i=mn(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`),i=""),s.length&&(i=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),e=e.replace(r[0],i),this.regexp.lastIndex=0}return e}}const Xn=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(Tn(r),i),t[a]=s),s(n)}},Kn=e=>(t,n,r)=>e(Tn(n),r)(t);class Zn{constructor(e={}){this.logger=Pn.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?Xn:Kn;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=Xn(t)}format(e,t,n,r={}){const i=t.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(e=>e.indexOf(")")>-1)){const e=i.findIndex(e=>e.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,e)].join(this.formatSeparator)}const o=i.reduce((e,t)=>{const{formatName:i,formatOptions:o}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(e=>{if(e){const[t,...r]=e.split(":"),i=r.join(":").trim().replace(/^'+|'+$/g,""),o=t.trim();n[o]||(n[o]=i),"false"===i&&(n[o]=!1),"true"===i&&(n[o]=!0),isNaN(i)||(n[o]=parseInt(i,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[i]){let t=e;try{const a=r?.formatParams?.[r.interpolationkey]||{},s=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[i](e,s,{...o,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${i}`),e},e);return o}}class Jn extends Mn{constructor(e,t,n,r={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=Pn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(n,r.backend,r)}queueLoad(e,t,n,r){const i={},o={},a={},s={};return e.forEach(e=>{let r=!0;t.forEach(t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===o[a]&&(o[a]=!0):(this.state[a]=1,r=!1,void 0===o[a]&&(o[a]=!0),void 0===i[a]&&(i[a]=!0),void 0===s[t]&&(s[t]=!0)))}),r||(a[e]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),!t&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const a={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:r,k:i}=wn(e,t,Object);r[i]=r[i]||[],r[i].push(n)})(n.loaded,[i],o),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===a[e][t]&&(a[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,r=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:i,callback:o});this.readingCalls++;const a=(a,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&s&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,r+1,2*i,o)},i):o(a,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,a);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>a(null,e)).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();pn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),pn(t)&&(t=[t]);const i=this.queueLoad(e,t,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),r=n[0],i=n[1];this.read(r,i,"read",void 0,void 0,(n,o)=>{n&&this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`,n),!n&&o&&this.logger.log(`${t}loaded namespace ${i} for language ${r}`,o),this.loaded(e,n,o)})}saveMissing(e,t,n,r,i,o={},a=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(t)){if(null!=n&&""!==n){if(this.backend?.create){const s={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(e,t,n,r,s):l(e,t,n,r),i&&"function"==typeof i.then?i.then(e=>a(null,e)).catch(a):a(null,i)}catch(e){a(e)}else l(e,t,n,r,a,s)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Qn=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),pn(e[1])&&(t.defaultValue=e[1]),pn(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),er=e=>(pn(e.ns)&&(e.ns=[e.ns]),pn(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),pn(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),tr=()=>{};class nr extends Mn{constructor(e={},t){var n;if(super(),this.options=er(e),this.services={},this.logger=Pn,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(pn(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=Qn();this.options={...n,...this.options,...er(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator);const r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Pn.init(r(this.modules.logger),this.options):Pn.init(null,this.options),e=this.modules.formatter?this.modules.formatter:Zn;const t=new Un(this.options);this.store=new Rn(this.options.resources,this.options);const i=this.services;i.logger=Pn,i.resourceStore=this.store,i.languageUtils=t,i.pluralResolver=new $n(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(i.formatter=r(e),i.formatter.init&&i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new qn(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Jn(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Vn(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=tr),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=gn(),o=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?o():setTimeout(o,0),i}loadResources(e,t=tr){let n=t;const r=pn(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};r?t(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload?.forEach?.(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const r=gn();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=tr),this.services.backendConnector.reload(e,t,e=>{r.resolve(),n(e)}),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Ln.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=gn();this.emit("languageChanging",e);const r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(i,o)=>{o?this.isLanguageChangingTo===e&&(r(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(i,(...e)=>this.t(...e))},o=t=>{e||t||!this.services.languageDetector||(t=[]);const n=pn(t)?t:t&&t[0],o=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(pn(t)?[t]:t);o&&(this.language||r(o),this.translator.language||this.translator.changeLanguage(o),this.services.languageDetector?.cacheUserLanguage?.(o)),this.loadResources(o,e=>{i(e,o)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const r=(e,t,...i)=>{let o;o="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(i)):{...t},o.lng=o.lng||r.lng,o.lngs=o.lngs||r.lngs,o.ns=o.ns||r.ns,""!==o.keyPrefix&&(o.keyPrefix=o.keyPrefix||n||r.keyPrefix);const a=this.options.keySeparator||".";let s;return o.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Nn(e,{...this.options,...t})),`${o.keyPrefix}${a}${e}`)):("function"==typeof e&&(e=Nn(e,{...this.options,...t})),s=o.keyPrefix?`${o.keyPrefix}${a}${e}`:e),this.t(s,o)};return pn(e)?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,o);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!o(n,e)||r&&!o(i,e))}loadNamespaces(e,t){const n=gn();return this.options.ns?(pn(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=gn();pn(e)&&(e=[e]);const r=this.options.preload||[],i=e.filter(e=>r.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return i.length?(this.options.preload=r.concat(i),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=this.services?.languageUtils||new Un(Qn());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new nr(e,t)}cloneInstance(e={},t=tr){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},i=new nr(r);if(void 0===e.debug&&void 0===e.prefix||(i.logger=i.logger.clone(e)),["store","services","language"].forEach(e=>{i[e]=this[e]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,r)=>(n[r]={...e[t][r]},n),e[t]),e),{});i.store=new Rn(e,r),i.services.resourceStore=i.store}return i.translator=new Vn(i.services,r),i.translator.on("*",(e,...t)=>{i.emit(e,...t)}),i.init(r,t),i.translator.options=r,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const rr=nr.createInstance();rr.createInstance=nr.createInstance,rr.createInstance,rr.dir,rr.init,rr.loadResources,rr.reloadResources,rr.use,rr.changeLanguage,rr.getFixedT,rr.t,rr.exists,rr.setDefaultNamespace,rr.hasLoadedNamespace,rr.loadNamespaces,rr.loadLanguages;var ir,or,ar,sr,lr,cr={};!function(){if(lr)return cr;lr=1;var e=function(){if(sr)return ar;function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}sr=1;var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(function(){if(or)return ir;function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}function n(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function r(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,o(e,t,"get"))}function i(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,o(e,t,"set"),n),n}function o(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function a(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}or=1;var s=function(t){if(!t)return[];Array.isArray(t)||(t=[t]);for(var n={},r=0;r<t.length;++r){var i,o=t[r];if(o&&"object"===e(o)&&(o=String(o)),"string"!=typeof o){var a="Locales should be strings, ".concat(JSON.stringify(o)," isn't.");throw new TypeError(a)}var s=o.split("-");if(!s.every(function(e){return/[a-z0-9]+/i.test(e)})){var l=JSON.stringify(o),c="The locale ".concat(l," is not a structurally valid BCP 47 language tag.");throw new RangeError(c)}var u=s[0].toLowerCase();s[0]=null!==(i={in:"id",iw:"he",ji:"yi"}[u])&&void 0!==i?i:u,n[s.join("-")]=!0}return Object.keys(n)};function l(t){switch(e(t)){case"number":return t;case"bigint":throw new TypeError("Cannot convert a BigInt value to a number");default:return Number(t)}}return ir=function(e,n,o,c){var u=function(e){do{if(n(e))return e;e=e.replace(/-?[^-]*$/,"")}while(e);return null},d=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,m=function(){function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),a(this,d,{writable:!0,value:void 0}),a(this,h,{writable:!0,value:void 0}),a(this,f,{writable:!0,value:void 0}),a(this,p,{writable:!0,value:void 0}),a(this,g,{writable:!0,value:void 0}),i(this,d,function(t){for(var n=s(t),r=0;r<n.length;++r){var i=u(n[r]);if(i)return i}var o=(new e).resolvedOptions().locale;return u(o)}(t)),i(this,f,n(r(this,d))),i(this,h,c(r(this,d))),i(this,p,function(e){var t=Object.prototype.hasOwnProperty.call(e,"type")&&e.type;if(!t)return"cardinal";if("cardinal"===t||"ordinal"===t)return t;throw new RangeError("Not a valid plural type: "+JSON.stringify(t))}(o)),i(this,g,new e("en",o))}var v,y,b;return v=m,b=[{key:"supportedLocalesOf",value:function(e){return s(e).filter(u)}}],(y=[{key:"resolvedOptions",value:function(){var e=r(this,g).resolvedOptions(),t=e.minimumIntegerDigits,n=e.minimumFractionDigits,i=e.maximumFractionDigits,a=e.minimumSignificantDigits,s=e.maximumSignificantDigits,l=e.roundingPriority,c={locale:r(this,d),type:r(this,p),minimumIntegerDigits:t,minimumFractionDigits:n,maximumFractionDigits:i};return"number"==typeof a&&(c.minimumSignificantDigits=a,c.maximumSignificantDigits=s),c.pluralCategories=o(r(this,d),"ordinal"===r(this,p)).slice(0),c.roundingPriority=l||"auto",c}},{key:"select",value:function(e){if(!(this instanceof m))throw new TypeError("select() called on incompatible ".concat(this));if("number"!=typeof e&&(e=Number(e)),!isFinite(e))return"other";var t=r(this,g).format(Math.abs(e));return r(this,f).call(this,t,"ordinal"===r(this,p))}},{key:"selectRange",value:function(e,t){if(!(this instanceof m))throw new TypeError("selectRange() called on incompatible ".concat(this));if(void 0===e)throw new TypeError("start is undefined");if(void 0===t)throw new TypeError("end is undefined");var n=l(e),i=l(t);if(!isFinite(n))throw new RangeError("start must be finite");if(!isFinite(i))throw new RangeError("end must be finite");return r(this,h).call(this,this.select(n),this.select(i))}}])&&t(v.prototype,y),b&&t(v,b),Object.defineProperty(v,"prototype",{writable:!1}),m}();return"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(m.prototype,Symbol.toStringTag,{value:"Intl.PluralRules",writable:!1,configurable:!0}),Object.defineProperty(m,"prototype",{writable:!1}),m},ir}());function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Xt||"undefined"!=typeof self&&self;var r={exports:{}};!function(e){var t=function(e,t){return t?"other":1==e?"one":"other"},n=function(e,t){return t?"other":0==e||1==e?"one":"other"},r=function(e,t){return t?"other":e>=0&&e<=1?"one":"other"},i=function(e,t){var n=!String(e).split(".")[1];return t?"other":1==e&&n?"one":"other"},o=function(e,t){return"other"},a=function(e,t){return t?"other":1==e?"one":2==e?"two":"other"};!function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),e.exports=n}(0,{af:t,ak:n,am:r,an:t,ar:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},ars:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":0==e?"zero":1==e?"one":2==e?"two":r>=3&&r<=10?"few":r>=11&&r<=99?"many":"other"},as:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},asa:t,ast:i,az:function(e,t){var n=String(e).split(".")[0],r=n.slice(-1),i=n.slice(-2),o=n.slice(-3);return t?1==r||2==r||5==r||7==r||8==r||20==i||50==i||70==i||80==i?"one":3==r||4==r||100==o||200==o||300==o||400==o||500==o||600==o||700==o||800==o||900==o?"few":0==n||6==r||40==i||60==i||90==i?"many":"other":1==e?"one":"other"},bal:function(e,t){return 1==e?"one":"other"},be:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?2!=i&&3!=i||12==o||13==o?"other":"few":1==i&&11!=o?"one":i>=2&&i<=4&&(o<12||o>14)?"few":r&&0==i||i>=5&&i<=9||o>=11&&o<=14?"many":"other"},bem:t,bez:t,bg:t,bho:n,bm:o,bn:function(e,t){return t?1==e||5==e||7==e||8==e||9==e||10==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},bo:o,br:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2),a=r&&n[0].slice(-6);return t?"other":1==i&&11!=o&&71!=o&&91!=o?"one":2==i&&12!=o&&72!=o&&92!=o?"two":(3==i||4==i||9==i)&&(o<10||o>19)&&(o<70||o>79)&&(o<90||o>99)?"few":0!=e&&r&&0==a?"many":"other"},brx:t,bs:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ca:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?1==e||3==e?"one":2==e?"two":4==e?"few":"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},ce:t,ceb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=i.slice(-1);return t?"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},cgg:t,chr:t,ckb:t,cs:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},cy:function(e,t){return t?0==e||7==e||8==e||9==e?"zero":1==e?"one":2==e?"two":3==e||4==e?"few":5==e||6==e?"many":"other":0==e?"zero":1==e?"one":2==e?"two":3==e?"few":6==e?"many":"other"},da:function(e,t){var n=String(e).split("."),r=n[0],i=Number(n[0])==e;return t||1!=e&&(i||0!=r&&1!=r)?"other":"one"},de:i,doi:r,dsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},dv:t,dz:o,ee:t,el:t,en:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1==o&&11!=a?"one":2==o&&12!=a?"two":3==o&&13!=a?"few":"other":1==e&&r?"one":"other"},eo:t,es:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?"other":1==e?"one":0!=r&&0==o&&i?"many":"other"},et:i,eu:t,fa:r,ff:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},fi:i,fil:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},fo:t,fr:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?1==e?"one":"other":e>=0&&e<2?"one":0!=r&&0==o&&i?"many":"other"},fur:t,fy:i,ga:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e?"one":"other":1==e?"one":2==e?"two":r&&e>=3&&e<=6?"few":r&&e>=7&&e<=10?"many":"other"},gd:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||11==e?"one":2==e||12==e?"two":3==e||13==e?"few":"other":1==e||11==e?"one":2==e||12==e?"two":r&&e>=3&&e<=10||r&&e>=13&&e<=19?"few":"other"},gl:i,gsw:t,gu:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},guw:n,gv:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":!i||0!=a&&20!=a&&40!=a&&60!=a&&80!=a?i?"other":"many":"few"},ha:t,haw:t,he:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==r&&i||0==r&&!i?"one":2==r&&i?"two":"other"},hi:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":e>=0&&e<=1?"one":"other"},hnj:o,hr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},hsb:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-2),s=i.slice(-2);return t?"other":o&&1==a||1==s?"one":o&&2==a||2==s?"two":o&&(3==a||4==a)||3==s||4==s?"few":"other"},hu:function(e,t){return t?1==e||5==e?"one":"other":1==e?"one":"other"},hy:function(e,t){return t?1==e?"one":"other":e>=0&&e<2?"one":"other"},ia:i,id:o,ig:o,ii:o,io:i,is:function(e,t){var n=String(e).split("."),r=n[0],i=(n[1]||"").replace(/0+$/,""),o=Number(n[0])==e,a=r.slice(-1),s=r.slice(-2);return t?"other":o&&1==a&&11!=s||i%10==1&&i%100!=11?"one":"other"},it:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},iu:a,ja:o,jbo:o,jgo:t,jmc:t,jv:o,jw:o,ka:function(e,t){var n=String(e).split(".")[0],r=n.slice(-2);return t?1==n?"one":0==n||r>=2&&r<=20||40==r||60==r||80==r?"many":"other":1==e?"one":"other"},kab:function(e,t){return t?"other":e>=0&&e<2?"one":"other"},kaj:t,kcg:t,kde:o,kea:o,kk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1);return t?6==i||9==i||r&&0==i&&0!=e?"many":"other":1==e?"one":"other"},kkj:t,kl:t,km:o,kn:r,ko:o,ks:t,ksb:t,ksh:function(e,t){return t?"other":0==e?"zero":1==e?"one":"other"},ku:t,kw:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-2),o=r&&n[0].slice(-3),a=r&&n[0].slice(-5),s=r&&n[0].slice(-6);return t?r&&e>=1&&e<=4||i>=1&&i<=4||i>=21&&i<=24||i>=41&&i<=44||i>=61&&i<=64||i>=81&&i<=84?"one":5==e||5==i?"many":"other":0==e?"zero":1==e?"one":2==i||22==i||42==i||62==i||82==i||r&&0==o&&(a>=1e3&&a<=2e4||4e4==a||6e4==a||8e4==a)||0!=e&&1e5==s?"two":3==i||23==i||43==i||63==i||83==i?"few":1==e||1!=i&&21!=i&&41!=i&&61!=i&&81!=i?"other":"many"},ky:t,lag:function(e,t){var n=String(e).split(".")[0];return t?"other":0==e?"zero":0!=n&&1!=n||0==e?"other":"one"},lb:t,lg:t,lij:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e;return t?11==e||8==e||i&&e>=80&&e<=89||i&&e>=800&&e<=899?"many":"other":1==e&&r?"one":"other"},lkt:o,ln:n,lo:function(e,t){return t&&1==e?"one":"other"},lt:function(e,t){var n=String(e).split("."),r=n[1]||"",i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?"other":1==o&&(a<11||a>19)?"one":o>=2&&o<=9&&(a<11||a>19)?"few":0!=r?"many":"other"},lv:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),s=o&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},mas:t,mg:n,mgo:t,mk:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?1==a&&11!=s?"one":2==a&&12!=s?"two":7!=a&&8!=a||17==s||18==s?"other":"many":o&&1==a&&11!=s||1==l&&11!=c?"one":"other"},ml:t,mn:t,mo:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},mr:function(e,t){return t?1==e?"one":2==e||3==e?"two":4==e?"few":"other":1==e?"one":"other"},ms:function(e,t){return t&&1==e?"one":"other"},mt:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-2);return t?"other":1==e?"one":2==e?"two":0==e||r>=3&&r<=10?"few":r>=11&&r<=19?"many":"other"},my:o,nah:t,naq:a,nb:t,nd:t,ne:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?r&&e>=1&&e<=4?"one":"other":1==e?"one":"other"},nl:i,nn:t,nnh:t,no:t,nqo:o,nr:t,nso:n,ny:t,nyn:t,om:t,or:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?1==e||5==e||r&&e>=7&&e<=9?"one":2==e||3==e?"two":4==e?"few":6==e?"many":"other":1==e?"one":"other"},os:t,osa:o,pa:n,pap:t,pcm:r,pl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":1==e&&i?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&1!=r&&(0==o||1==o)||i&&o>=5&&o<=9||i&&a>=12&&a<=14?"many":"other"},prg:function(e,t){var n=String(e).split("."),r=n[1]||"",i=r.length,o=Number(n[0])==e,a=o&&n[0].slice(-1),s=o&&n[0].slice(-2),l=r.slice(-2),c=r.slice(-1);return t?"other":o&&0==a||s>=11&&s<=19||2==i&&l>=11&&l<=19?"zero":1==a&&11!=s||2==i&&1==c&&11!=l||2!=i&&1==c?"one":"other"},ps:t,pt:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?"other":0==r||1==r?"one":0!=r&&0==o&&i?"many":"other"},pt_PT:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},rm:t,ro:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e&&n[0].slice(-2);return t?1==e?"one":"other":1==e&&r?"one":!r||0==e||1!=e&&i>=1&&i<=19?"few":"other"},rof:t,ru:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-1),a=r.slice(-2);return t?"other":i&&1==o&&11!=a?"one":i&&o>=2&&o<=4&&(a<12||a>14)?"few":i&&0==o||i&&o>=5&&o<=9||i&&a>=11&&a<=14?"many":"other"},rwk:t,sah:o,saq:t,sat:a,sc:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},scn:function(e,t){var n=!String(e).split(".")[1];return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&n?"one":"other"},sd:t,sdh:t,se:a,seh:t,ses:o,sg:o,sh:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},shi:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":e>=0&&e<=1?"one":r&&e>=2&&e<=10?"few":"other"},si:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"";return t?"other":0==e||1==e||0==r&&1==i?"one":"other"},sk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1];return t?"other":1==e&&i?"one":r>=2&&r<=4&&i?"few":i?"other":"many"},sl:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-2);return t?"other":i&&1==o?"one":i&&2==o?"two":i&&(3==o||4==o)||!i?"few":"other"},sma:a,smi:a,smj:a,smn:a,sms:a,sn:t,so:t,sq:function(e,t){var n=String(e).split("."),r=Number(n[0])==e,i=r&&n[0].slice(-1),o=r&&n[0].slice(-2);return t?1==e?"one":4==i&&14!=o?"many":"other":1==e?"one":"other"},sr:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=r.slice(-2),l=i.slice(-1),c=i.slice(-2);return t?"other":o&&1==a&&11!=s||1==l&&11!=c?"one":o&&a>=2&&a<=4&&(s<12||s>14)||l>=2&&l<=4&&(c<12||c>14)?"few":"other"},ss:t,ssy:t,st:t,su:o,sv:function(e,t){var n=String(e).split("."),r=!n[1],i=Number(n[0])==e,o=i&&n[0].slice(-1),a=i&&n[0].slice(-2);return t?1!=o&&2!=o||11==a||12==a?"other":"one":1==e&&r?"one":"other"},sw:i,syr:t,ta:t,te:t,teo:t,th:o,ti:n,tig:t,tk:function(e,t){var n=String(e).split("."),r=Number(n[0])==e&&n[0].slice(-1);return t?6==r||9==r||10==e?"few":"other":1==e?"one":"other"},tl:function(e,t){var n=String(e).split("."),r=n[0],i=n[1]||"",o=!n[1],a=r.slice(-1),s=i.slice(-1);return t?1==e?"one":"other":o&&(1==r||2==r||3==r)||o&&4!=a&&6!=a&&9!=a||!o&&4!=s&&6!=s&&9!=s?"one":"other"},tn:t,to:o,tpi:o,tr:t,ts:t,tzm:function(e,t){var n=String(e).split("."),r=Number(n[0])==e;return t?"other":0==e||1==e||r&&e>=11&&e<=99?"one":"other"},ug:t,uk:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=Number(n[0])==e,a=o&&n[0].slice(-1),s=o&&n[0].slice(-2),l=r.slice(-1),c=r.slice(-2);return t?3==a&&13!=s?"few":"other":i&&1==l&&11!=c?"one":i&&l>=2&&l<=4&&(c<12||c>14)?"few":i&&0==l||i&&l>=5&&l<=9||i&&c>=11&&c<=14?"many":"other"},und:o,ur:i,uz:t,ve:t,vec:function(e,t){var n=String(e).split("."),r=n[0],i=!n[1],o=r.slice(-6);return t?11==e||8==e||80==e||800==e?"many":"other":1==e&&i?"one":0!=r&&0==o&&i?"many":"other"},vi:function(e,t){return t&&1==e?"one":"other"},vo:t,vun:t,wa:n,wae:t,wo:o,xh:t,xog:t,yi:i,yo:o,yue:o,zh:o,zu:r})}(r);var i=n(r.exports),o=e({__proto__:null,default:i},[r.exports]),a={exports:{}};!function(e){var t="zero",n="one",r="two",i="few",o="many",a="other",s={cardinal:[n,a],ordinal:[a]},l={cardinal:[n,a],ordinal:[n,a]},c={cardinal:[a],ordinal:[a]},u={cardinal:[n,r,a],ordinal:[a]};!function(t,n){Object.defineProperty(n,"__esModule",{value:!0}),e.exports=n}(0,{af:s,ak:s,am:s,an:s,ar:{cardinal:[t,n,r,i,o,a],ordinal:[a]},ars:{cardinal:[t,n,r,i,o,a],ordinal:[a]},as:{cardinal:[n,a],ordinal:[n,r,i,o,a]},asa:s,ast:s,az:{cardinal:[n,a],ordinal:[n,i,o,a]},bal:l,be:{cardinal:[n,i,o,a],ordinal:[i,a]},bem:s,bez:s,bg:s,bho:s,bm:c,bn:{cardinal:[n,a],ordinal:[n,r,i,o,a]},bo:c,br:{cardinal:[n,r,i,o,a],ordinal:[a]},brx:s,bs:{cardinal:[n,i,a],ordinal:[a]},ca:{cardinal:[n,o,a],ordinal:[n,r,i,a]},ce:s,ceb:s,cgg:s,chr:s,ckb:s,cs:{cardinal:[n,i,o,a],ordinal:[a]},cy:{cardinal:[t,n,r,i,o,a],ordinal:[t,n,r,i,o,a]},da:s,de:s,doi:s,dsb:{cardinal:[n,r,i,a],ordinal:[a]},dv:s,dz:c,ee:s,el:s,en:{cardinal:[n,a],ordinal:[n,r,i,a]},eo:s,es:{cardinal:[n,o,a],ordinal:[a]},et:s,eu:s,fa:s,ff:s,fi:s,fil:l,fo:s,fr:{cardinal:[n,o,a],ordinal:[n,a]},fur:s,fy:s,ga:{cardinal:[n,r,i,o,a],ordinal:[n,a]},gd:{cardinal:[n,r,i,a],ordinal:[n,r,i,a]},gl:s,gsw:s,gu:{cardinal:[n,a],ordinal:[n,r,i,o,a]},guw:s,gv:{cardinal:[n,r,i,o,a],ordinal:[a]},ha:s,haw:s,he:u,hi:{cardinal:[n,a],ordinal:[n,r,i,o,a]},hnj:c,hr:{cardinal:[n,i,a],ordinal:[a]},hsb:{cardinal:[n,r,i,a],ordinal:[a]},hu:l,hy:l,ia:s,id:c,ig:c,ii:c,io:s,is:s,it:{cardinal:[n,o,a],ordinal:[o,a]},iu:u,ja:c,jbo:c,jgo:s,jmc:s,jv:c,jw:c,ka:{cardinal:[n,a],ordinal:[n,o,a]},kab:s,kaj:s,kcg:s,kde:c,kea:c,kk:{cardinal:[n,a],ordinal:[o,a]},kkj:s,kl:s,km:c,kn:s,ko:c,ks:s,ksb:s,ksh:{cardinal:[t,n,a],ordinal:[a]},ku:s,kw:{cardinal:[t,n,r,i,o,a],ordinal:[n,o,a]},ky:s,lag:{cardinal:[t,n,a],ordinal:[a]},lb:s,lg:s,lij:{cardinal:[n,a],ordinal:[o,a]},lkt:c,ln:s,lo:{cardinal:[a],ordinal:[n,a]},lt:{cardinal:[n,i,o,a],ordinal:[a]},lv:{cardinal:[t,n,a],ordinal:[a]},mas:s,mg:s,mgo:s,mk:{cardinal:[n,a],ordinal:[n,r,o,a]},ml:s,mn:s,mo:{cardinal:[n,i,a],ordinal:[n,a]},mr:{cardinal:[n,a],ordinal:[n,r,i,a]},ms:{cardinal:[a],ordinal:[n,a]},mt:{cardinal:[n,r,i,o,a],ordinal:[a]},my:c,nah:s,naq:u,nb:s,nd:s,ne:l,nl:s,nn:s,nnh:s,no:s,nqo:c,nr:s,nso:s,ny:s,nyn:s,om:s,or:{cardinal:[n,a],ordinal:[n,r,i,o,a]},os:s,osa:c,pa:s,pap:s,pcm:s,pl:{cardinal:[n,i,o,a],ordinal:[a]},prg:{cardinal:[t,n,a],ordinal:[a]},ps:s,pt:{cardinal:[n,o,a],ordinal:[a]},pt_PT:{cardinal:[n,o,a],ordinal:[a]},rm:s,ro:{cardinal:[n,i,a],ordinal:[n,a]},rof:s,ru:{cardinal:[n,i,o,a],ordinal:[a]},rwk:s,sah:c,saq:s,sat:u,sc:{cardinal:[n,a],ordinal:[o,a]},scn:{cardinal:[n,a],ordinal:[o,a]},sd:s,sdh:s,se:u,seh:s,ses:c,sg:c,sh:{cardinal:[n,i,a],ordinal:[a]},shi:{cardinal:[n,i,a],ordinal:[a]},si:s,sk:{cardinal:[n,i,o,a],ordinal:[a]},sl:{cardinal:[n,r,i,a],ordinal:[a]},sma:u,smi:u,smj:u,smn:u,sms:u,sn:s,so:s,sq:{cardinal:[n,a],ordinal:[n,o,a]},sr:{cardinal:[n,i,a],ordinal:[a]},ss:s,ssy:s,st:s,su:c,sv:l,sw:s,syr:s,ta:s,te:s,teo:s,th:c,ti:s,tig:s,tk:{cardinal:[n,a],ordinal:[i,a]},tl:l,tn:s,to:c,tpi:c,tr:s,ts:s,tzm:s,ug:s,uk:{cardinal:[n,i,o,a],ordinal:[i,a]},und:c,ur:s,uz:s,ve:s,vec:{cardinal:[n,o,a],ordinal:[o,a]},vi:{cardinal:[a],ordinal:[n,a]},vo:s,vun:s,wa:s,wae:s,wo:c,xh:s,xog:s,yi:s,yo:c,yue:c,zh:c,zu:s})}(a);var s=n(a.exports),l=e({__proto__:null,default:s},[a.exports]),c={exports:{}};!function(e){var t,n=function(e,t){return"other"},r=function(e,t){return"other"===e&&"one"===t?"one":"other"},i=function(e,t){return t||"other"};t={af:n,ak:r,am:i,an:n,ar:function(e,t){return"few"===t?"few":"many"===t?"many":"zero"===e&&"one"===t||"zero"===e&&"two"===t?"zero":"other"},as:i,az:i,be:i,bg:n,bn:i,bs:i,ca:n,cs:i,cy:i,da:i,de:i,el:i,en:n,es:n,et:n,eu:n,fa:r,fi:n,fil:i,fr:i,ga:i,gl:i,gsw:i,gu:i,he:n,hi:i,hr:i,hu:i,hy:i,ia:n,id:n,io:n,is:i,it:i,ja:n,ka:function(e,t){return e||"other"},kk:i,km:n,kn:i,ko:n,ky:i,lij:i,lo:n,lt:i,lv:function(e,t){return"one"===t?"one":"other"},mk:n,ml:i,mn:i,mr:i,ms:n,my:n,nb:n,ne:i,nl:i,no:n,or:r,pa:i,pcm:n,pl:i,ps:i,pt:i,ro:function(e,t){return"few"===t||"one"===t?"few":"other"},ru:i,sc:i,scn:i,sd:r,si:function(e,t){return"one"===e&&"one"===t?"one":"other"},sk:i,sl:function(e,t){return"few"===t||"one"===t?"few":"two"===t?"two":"other"},sq:i,sr:i,sv:n,sw:i,ta:i,te:i,th:n,tk:i,tr:i,ug:i,uk:i,ur:n,uz:i,vi:n,yue:n,zh:n,zu:i},Object.defineProperty(t,"__esModule",{value:!0}),e.exports=t}(c);var u=n(c.exports),d=i||o,h=s||l,f=u||e({__proto__:null,default:u},[c.exports]),p=function(e){return"pt-PT"===e?"pt_PT":e},g=t.default(Intl.NumberFormat,function(e){return d[p(e)]},function(e,t){return h[p(e)][t?"ordinal":"cardinal"]},function(e){return f[p(e)]});return ar=g}();var t=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(e);if("undefined"==typeof Intl)void 0!==Xt?Xt.Intl={PluralRules:t.default}:"undefined"!=typeof window?window.Intl={PluralRules:t.default}:cr.Intl={PluralRules:t.default},t.default.polyfill=!0;else if(Intl.PluralRules&&Intl.PluralRules.prototype.selectRange){var n=["en","es","ru","zh"];Intl.PluralRules.supportedLocalesOf(n).length<n.length&&(Intl.PluralRules=t.default,t.default.polyfill=!0)}else Intl.PluralRules=t.default,t.default.polyfill=!0}();const ur={en:{translation:{Folder:"Folder",Folders:"Folders",Files:"Files",File:"File","Select the destination folder":"Select the destination folder","Filter by type":"Filter by type","All types":"All types","File name":"File name",Size:"Size",Date:"Date",Actions:"Actions",Delete:"Delete",Move:"Move",Copy:"Copy","Add folder":"Add folder","Add file":"Add file","Add file by URL":"Add file by URL","Please select an image file":"Please select an image file","File deleted":"File deleted","Error when deleting a file":"Error when deleting a file","Folder deleted":"Folder deleted","Error when deleting a folder":"Error when deleting a folder","Delete folder":"Delete folder","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Are you sure you want to delete this folder? This action will also delete all files and subfolders.","File moved":"File moved","Error when moving a file":"Error when moving a file","has been successfully uploaded":"has been successfully uploaded","Failed to download file":"Failed to download file","Failed to load JSON data":"Failed to load JSON data","Invalid file URL":"Invalid file URL","Unable to validate file URL":"Unable to validate file URL","Error when uploading a file":"Error when uploading a file","successfully uploaded":"successfully uploaded","Error when downloading a file by URL":"Error when downloading a file by URL","Error loading files":"Error loading files","File Manager not configured":"File Manager not configured","Type to search...":"Type to search...","Failed to create folder":"Failed to create folder",Cancel:"Cancel",Submit:"Submit",months:{january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},files:"files","No available folders":"No available folders","My files":"My files",GIF:"GIF","Stock images":"Stock images",AI:"AI","AI image generation":"AI image generation","Search GIFs":"Search GIFs","That`s all we could find.":"That`s all we could find.","Search image":"Search image",All:"All",Landscape:"Landscape",Portrait:"Portrait",Squarish:"Squarish",Black:"Black","Black and White":"Black and White",White:"White",Orange:"Orange",Red:"Red",Purple:"Purple",Magenta:"Magenta",Green:"Green",Teal:"Teal",Blue:"Blue","Photo by":"Photo by",on:"on",selected:"selected",Deselected:"Deselected",Rename:"Rename","Rename file":"Rename file {{currentFileName}}","Selected files":"Selected files: {{count}}",selected_files_one:"Selected {{count}} file",selected_files_other:"Selected {{count}} files",Edit:"Edit","Move to":"Move to","New folder":"New folder","Image search...":"Image search...","By name":"By name","By size":"By size","By date":"By date",List:"List",Grid:"Grid",Main:"Main","total pages":"Total {{total}} items",Name:"Name",Untitled:"Untitled",Dimensions:"Dimensions",error:"error",created:"created","API-endpoint for file upload is not configured":"API-endpoint for file upload is not configured","The URL must point to an image":"The URL must point to an image","Image upload...":"Image upload...",Unknown:"Unknown","Error downloading file by URL":"Error downloading file by URL","File not found":"File not found","File renamed to":"File renamed to ","Failed to rename the file":"Failed to rename the file","Folder renamed to":"Folder renamed to","Rename folder":"Rename folder","New folder name":"New folder name","Enter a new folder name":"Enter a new folder name","Please drag and drop image files only":"Please drag and drop image files only","Upload file by URL":"Upload file by URL","Upload file":"Upload file","Creating a new folder":"Creating a new folder",Create:"Create","Folder name":"Folder name","Enter the name of the folder":"Enter the name of the folder","A folder will be created inside:":"A folder will be created inside:","selected folder":"selected folder","The folder will be created in the root directory":"The folder will be created in the root directory","Failed to load folders":"Failed to load folders","Folder name cannot be empty":"Folder name cannot be empty","Folder creation provider is not configured":"Folder creation provider is not configured","Folder created":"Folder created","Folder rename is disabled by config":"Folder rename is disabled by config","Folder rename provider is not configured":"Folder rename provider is not configured","Unexpected response when renaming folder":"Unexpected response when renaming folder","Folder renamed":"Folder renamed","Failed to rename folder":"Failed to rename folder","Failed to load folder items count":"Failed to load folder items count","Failed to load subfolders":"Failed to load subfolders",Download:"Download","image URL":"image URL","Enter the URL of the image":"Enter the URL of the image","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"New file name","Enter a new file name":"Enter a new file name","Copy to folder":"Copy to folder",Added:"Added {{date}}","File uploaded successfully":"File {{fileName}} uploaded successfully","Successfully uploaded":"Successfully uploaded {{successCount}} of {{count}} file","Successfully uploaded files":"Successfully uploaded {{successCount}} of {{count}} files",Uploaded:"Uploaded: {{names}}",uploads_success_summary:"Uploaded {{successCount}} of {{totalCount}} files",Failed:"Failed: {{names}}",uploads_fail_summary:"Failed to upload {{failCount}} of {{totalCount}} files","File with this name already exists.":"File with this name already exists.","File not found or no longer available.":"File not found or no longer available.","You don't have permission to access this file.":"You don't have permission to access this file.","File is too large to upload.":"File is too large to upload.","This file type is not allowed.":"This file type is not allowed.","File name is not valid.":"File name is not valid.","Failed to read the file.":"Failed to read the file.","Failed to write the file.":"Failed to write the file.","The file appears to be corrupted.":"The file appears to be corrupted.","File integrity check failed.":"File integrity check failed.","Folder not found or no longer available.":"Folder not found or no longer available.","Folder with this name already exists.":"Folder with this name already exists.","You don't have permission to access this folder.":"You don't have permission to access this folder.","Folder name is not valid.":"Folder name is not valid.","Failed to read the folder contents.":"Failed to read the folder contents.","Failed to write to the folder.":"Failed to write to the folder.","Folder storage quota exceeded.":"Folder storage quota exceeded.","Folder is not empty.":"Folder is not empty.","Server error while processing the folder.":"Server error while processing the folder.","Folder operation took too long.":"Folder operation took too long.","Network error. Please check your connection and try again.":"Network error. Please check your connection and try again.","The operation took too long. Please try again.":"The operation took too long. Please try again.","Server error. Please try again later.":"Server error. Please try again later.","Service is temporarily unavailable. Please try again later.":"Service is temporarily unavailable. Please try again later.","Too many requests. Please try again a bit later.":"Too many requests. Please try again a bit later.","Authentication failed. Please sign in again.":"Authentication failed. Please sign in again.","You are not allowed to perform this action.":"You are not allowed to perform this action.","Some of the provided data is invalid.":"Some of the provided data is invalid.","This operation is not supported.":"This operation is not supported.","Request payload is too large.":"Request payload is too large.","This media type is not supported.":"This media type is not supported.","You have exceeded the upload quota.":"You have exceeded the upload quota.","Network error while uploading the file.":"Network error while uploading the file.","File upload took too long.":"File upload took too long.","Server error while uploading the file.":"Server error while uploading the file.","The specified URL is not valid.":"The specified URL is not valid.","The specified URL is not reachable.":"The specified URL is not reachable.","Content type at the URL is not allowed.":"Content type at the URL is not allowed.","Failed to download file from the URL.":"Failed to download file from the URL.","Network error while downloading the file.":"Network error while downloading the file.","File download took too long.":"File download took too long.","Server error while downloading the file.":"Server error while downloading the file.","Some items could not be processed.":"Some items could not be processed.","Failed to process all items in the batch.":"Failed to process all items in the batch.","Some items in the batch are in a conflicting state.":"Some items in the batch are in a conflicting state.","Some items in the batch did not pass validation.":"Some items in the batch did not pass validation.","AI service returned an invalid response.":"AI service returned an invalid response.","Failed to generate image using AI.":"Failed to generate image using AI.","You have reached the AI image generation limit.":"You have reached the AI image generation limit.","Error in external integration.":"Error in external integration.","Error in a third-party service.":"Error in a third-party service.","An unknown error occurred.":"An unknown error occurred.","Renaming is not allowed for this item.":"Renaming is not allowed for this item.","Moving is not allowed for this item.":"Moving is not allowed for this item.","Copying is not allowed for this item.":"Copying is not allowed for this item.","Deleting is not allowed for this item.":"Deleting is not allowed for this item.","Cannot move an item into itself.":"Cannot move an item into itself.","Cannot move an item into its descendant folder.":"Cannot move an item into its descendant folder.","Configuration error occurred.":"Configuration error occurred.",Moved:"Moved: {{names}}",move_success_summary:"Moved {{successCount}} of {{totalCount}} items",move_fail_summary:"Failed to move {{failCount}} of {{totalCount}} items",Copied:"Copied: {{names}}",copy_success_summary:"Copied {{successCount}} of {{totalCount}} items",copy_fail_summary:"Failed to copy {{failCount}} of {{totalCount}} items","Failed to upload":"Failed to upload {{failCount}} of {{count}} file","Failed to upload files":"Failed to upload {{failCount}} of {{count}} files","No folders yet":"No folders yet","Drag files to upload":"Drag files to upload","Drop files here to upload":"Drop files here to upload","Newest first":"Newest first","Oldest first":"Oldest first","Largest first":"Largest first","Smallest first":"Smallest first","A-Z":"A-Z","Z-A":"Z-A","By type":"By type","Evaluating the task":"Evaluating the task","Something went wrong, please try again":"Something went wrong, please try again","Sort by":"Sort by","preview text":"The image preview is trying to load ...","Use this variant":"Use this variant","Confirm deletion":"Confirm deletion","Are you sure you want to delete the selected items?":"Are you sure you want to delete the selected items?","Move to Trash":"Move to Trash","Are you sure you want to move the selected items to the Trash?":"Are you sure you want to move the selected items to the Trash?","Permanently delete":"Permanently delete","Delete permanently":"Delete permanently","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Are you sure you want to permanently delete the selected items? This action cannot be undone.",delete_files_permanent_one:"This action will permanently delete {{count}} file",delete_files_permanent_other:"This action will permanently delete {{count}} files",delete_folder_permanent:"This action will permanently delete the folder '{{name}}' and all its contents, including {{count}} items.",delete_mixed_permanent:"This action will permanently delete {{total}} selected items, including {{folders}} folders and all {{images}} images within them.",move_files_to_trash_one:"This will move {{count}} file to the Trash.",move_files_to_trash_other:"This will move {{count}} files to the Trash.",move_folder_to_trash:"This will move the folder '{{name}}' and all its contents ({{count}} items) to the Trash.",move_mixed_to_trash:"This will move {{total}} selected items to the Trash, including {{folders}} folders and {{images}} images.",delete_count_confirm_trash_one:"Move {{count}} file to Trash?",delete_count_confirm_trash_other:"Move {{count}} files to Trash?",delete_count_confirm_permanent_one:"Permanently delete {{count}} file?",delete_count_confirm_permanent_other:"Permanently delete {{count}} files?",delete_count_confirm_one:"Delete {{count}} file?",delete_count_confirm_other:"Delete {{count}} files?",item:"item",items:"items",Trash:"Deleted",Choose:"Choose",Stock:"Stock","Select an image from our library":"Select an image from our library","AI generation":"AI generation","Creating an image on demand":"Creating an image on demand","Search file or folder":"Search file or folder","Select a file or drag and drop it here":"Select a file or drag and drop it here","Supported files:":"Supported files:","Create folder":"Create folder",Done:"Done","Move here":"Move here","Copy here":"Copy here","File URL":"File URL","There are no files for your request.":"There are no files for your request.","Millions of free stock images":"Millions of free stock images","Enter a search query and we'll find the perfect image for you":"Enter a search query and we'll find the perfect image for you","Enter your query and we will find the right one for you":"Enter your query and we will find the right one for you","Over 350,000 live images":"Over 350,000 live images","The folder will be created in the root directory.":"The folder will be created in the root directory.",undo:"UNDO",moved_to_trash_one:"Moved {{count}} item to Trash",moved_to_trash_other:"Moved {{count}} items to Trash",restored_items_one:"Restored {{count}} item",restored_items_other:"Restored {{count}} items",Type:"Type","Generate image":"Generate image"}},ru:{translation:{Files:"\u0424\u0430\u0439\u043b\u044b",selected:"\u0432\u044b\u0431\u0440\u0430\u043d\u043e",Deselected:"\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u044b\u0431\u043e\u0440",Rename:"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c","Rename file":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f","Selected files:":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432:","Selected files":"\u0412\u044b\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u043e\u0432: {{count}}",selected_files_one:"\u0412\u044b\u0431\u0440\u0430\u043d {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0430",selected_files_many:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",selected_files_other:"\u0412\u044b\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",Copy:"\u0414\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c",Edit:"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c","Move to":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c",Delete:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c","New folder":"\u041d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0438\u0441\u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439...","By name":"\u041f\u043e \u0438\u043c\u0435\u043d\u0438","By size":"\u041f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443","By date":"\u041f\u043e \u0434\u0430\u0442\u0435",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043b\u0430\u0432\u043d\u0430\u044f",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u0435\u0433\u043e {{total}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Name:"\u0418\u043c\u044f",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f",Size:"\u041e\u0431\u044a\u0451\u043c",Dimensions:"\u0420\u0430\u0437\u043c\u0435\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043e\u0448\u0438\u0431\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u043e\u0437\u0434\u0430\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0443\u0434\u0430\u043b\u0435\u043d","Error when deleting a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Folder deleted":"\u041f\u0430\u043f\u043a\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430","Error when deleting a folder":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Please select an image file":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","The URL must point to an image":"URL \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Image upload...":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f...",Unknown:"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e","Error downloading file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","successfully uploaded":"\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Error when downloading a file by URL":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e URL","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Upload file by URL":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Upload file":"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u043e\u0437\u0434\u0430\u0442\u044c",Cancel:"\u041e\u0442\u043c\u0435\u043d\u0430","Folder name":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438:","selected folder":"\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435","Failed to load folders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0443\u0441\u0442\u044b\u043c","Folder creation provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Folder created":"\u041f\u0430\u043f\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043e\u043a \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439","Folder rename provider is not configured":"\u041f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0430","Failed to rename folder":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0430\u043f\u043a\u0435","Failed to load subfolders":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c","image URL":"URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Enter a new file name":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430","Copy to folder":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d","Successfully uploaded":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Successfully uploaded files":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_success_summary:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432",uploads_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u043e\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b \u0443\u0434\u0430\u043b\u0451\u043d.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438.","This file type is not allowed.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","File name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430.","Failed to read the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d \u0438\u043b\u0438 \u0438\u043c\u0435\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0446\u0435\u043b\u043e\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0438\u043b\u0438 \u0443\u0436\u0435 \u0431\u044b\u043b\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u0430.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0441 \u0442\u0430\u043a\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u044d\u0442\u043e\u0439 \u043f\u0430\u043f\u043a\u0435.","Folder name is not valid.":"\u041d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e\u0435 \u0438\u043c\u044f \u043f\u0430\u043f\u043a\u0438.","Failed to read the folder contents.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u0430\u043f\u043a\u043e\u0439.","Folder storage quota exceeded.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u0443\u0441\u0442\u0430.","Server error while processing the folder.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441 \u043f\u0430\u043f\u043a\u043e\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Network error. Please check your connection and try again.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0442\u0438. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0438\u0441 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0443 \u043f\u043e\u0437\u0436\u0435.","Too many requests. Please try again a bit later.":"\u0421\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0437\u0436\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u043e\u0439\u0434\u0438\u0442\u0435 \u0441\u043d\u043e\u0432\u0430.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.","Some of the provided data is invalid.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b.","This operation is not supported.":"\u042d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Request payload is too large.":"\u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435.","This media type is not supported.":"\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0430 \u043a\u0432\u043e\u0442\u0430 \u043d\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0430\u0439\u043b\u043e\u0432.","Network error while uploading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","File upload took too long.":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0430\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while uploading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430.","The specified URL is not valid.":"\u0423\u043a\u0430\u0437\u0430\u043d \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL.","The specified URL is not reachable.":"\u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 URL.","Network error while downloading the file.":"\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","File download took too long.":"\u0421\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u043e\u0441\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043e\u043b\u0433\u043e.","Server error while downloading the file.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0431\u044b\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0438 \u043e\u0434\u0438\u043d \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438.","Some items in the batch are in a conflicting state.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.","Some items in the batch did not pass validation.":"\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0438\u0441 AI \u0432\u0435\u0440\u043d\u0443\u043b \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.","Failed to generate image using AI.":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AI.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442 \u043b\u0438\u043c\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 AI.","Error in external integration.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438.","Error in a third-party service.":"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u043d\u0435\u0448\u043d\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u0435.","An unknown error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043d\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u044f.","Cannot move an item into its descendant folder.":"\u041d\u0435\u043b\u044c\u0437\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u0434\u043e\u0447\u0435\u0440\u043d\u044e\u044e \u043f\u0430\u043f\u043a\u0443.","Configuration error occurred.":"\u041f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u044b: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",move_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Copied:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",copy_fail_summary:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c {{failCount}} \u0438\u0437 {{totalCount}} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432",Uploaded:"\u0417\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u044b: {{names}}",Failed:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c: {{names}}","Failed to upload":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u0430","Failed to upload files":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c {{failCount}} \u0438\u0437 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",months:{january:"\u044f\u043d\u0432\u0430\u0440\u044f",february:"\u0444\u0435\u0432\u0440\u0430\u043b\u044f",march:"\u043c\u0430\u0440\u0442\u0430",april:"\u0430\u043f\u0440\u0435\u043b\u044f",may:"\u043c\u0430\u044f",june:"\u0438\u044e\u043d\u044f",july:"\u0438\u044e\u043b\u044f",august:"\u0430\u0432\u0433\u0443\u0441\u0442\u0430",september:"\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f",october:"\u043e\u043a\u0442\u044f\u0431\u0440\u044f",november:"\u043d\u043e\u044f\u0431\u0440\u044f",december:"\u0434\u0435\u043a\u0430\u0431\u0440\u044f"},files:"\u0444\u0430\u0439\u043b\u043e\u0432","No available folders":"\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0438 \u0444\u0430\u0439\u043b\u044b",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u044b\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Search GIFs":"\u041d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u042d\u0442\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043d\u0430\u0439\u0442\u0438.","Search image":"\u041d\u0430\u0439\u0442\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435",All:"\u0412\u0441\u0435",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0435",Black:"\u0427\u0435\u0440\u043d\u044b\u0439","Black and White":"\u0427\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u044b\u0439",White:"\u0411\u0435\u043b\u044b\u0439",Orange:"\u041e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",Red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439",Purple:"\u0424\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439",Teal:"\u0411\u0438\u0440\u044e\u0437\u043e\u0432\u044b\u0439",Blue:"\u0421\u0438\u043d\u0438\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d","Filter by type":"\u0424\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u0442\u0438\u043f\u0443","All types":"\u0412\u0441\u0435 \u0442\u0438\u043f\u044b","File name":"\u0418\u043c\u044f \u0444\u0430\u0439\u043b\u0430",Actions:"\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044f","Add file":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d","Error when moving a file":"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430","Failed to download file":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 URL \u0444\u0430\u0439\u043b\u0430","Unable to validate file URL":"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0444\u0430\u0439\u043b \u043f\u043e URL","Type to search...":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430...",Submit:"\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0430 \u043d\u0435\u0442","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438","Drop files here to upload":"\u041e\u0442\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0444\u0430\u0439\u043b\u044b \u0437\u0434\u0435\u0441\u044c, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445","Newest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u043e\u0432\u044b\u0435","Oldest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0440\u044b\u0435","Largest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0435","Smallest first":"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435","A-Z":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u0410-\u042f","Z-A":"\u041f\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0443 \u042f-\u0410","By type":"\u041f\u043e \u0442\u0438\u043f\u0443","Evaluating the task":"\u041e\u0446\u0435\u043d\u043a\u0430 \u0437\u0430\u0434\u0430\u043d\u0438\u044f","Something went wrong, please try again":"\u0427\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e","preview text":"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f ...","Use this variant":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442","Confirm deletion":"\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Are you sure you want to delete the selected items?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443","Are you sure you want to move the selected items to the Trash?":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443?","Permanently delete":"\u041f\u043e\u043b\u043d\u043e\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435","Delete permanently":"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b? \u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c.",delete_files_permanent_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u0430",delete_files_permanent_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_files_permanent_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432",delete_folder_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.",delete_mixed_permanent:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0431\u0435\u0437\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 \u0432\u0441\u0435 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043d\u0443\u0442\u0440\u0438 \u043d\u0438\u0445.",move_files_to_trash_one:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430.",move_files_to_trash_many:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_files_to_trash_other:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432.",move_folder_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0438 \u0432\u0441\u0451 \u0435\u0451 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 ({{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432).",move_mixed_to_trash:"\u042d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{total}} \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044f {{folders}} \u043f\u0430\u043f\u043e\u043a \u0438 {{images}} \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_permanent_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_permanent_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043d\u0430\u0432\u0441\u0435\u0433\u0434\u0430 {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_one:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0430?",delete_count_confirm_many:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",delete_count_confirm_other:"\u0423\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u043e\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u043e\u0432",Trash:"\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435",Choose:"\u0412\u044b\u0431\u0440\u0430\u0442\u044c",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0437 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f","Creating an image on demand":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443","Search file or folder":"\u041d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043f\u0430\u043f\u043a\u0443","Select a file or drag and drop it here":"\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0435\u0433\u043e \u0441\u044e\u0434\u0430","Supported files:":"\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b:","Create folder":"\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u044e\u0434\u0430","Copy here":"\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u044e\u0434\u0430","File URL":"URL \u0444\u0430\u0439\u043b\u0430","There are no files for your request.":"\u0424\u0430\u0439\u043b\u043e\u0432 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u043d\u0435\u0442.","Millions of free stock images":"\u041c\u0438\u043b\u043b\u0438\u043e\u043d\u044b \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0435","Over 350,000 live images":"\u0411\u043e\u043b\u0435\u0435 350 000 \u0436\u0438\u0432\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435.",undo:"\u041e\u0422\u041c\u0415\u041d\u0410",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443",restored_items_one:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0451\u043d {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430",restored_items_many:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",restored_items_other:"\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432",Type:"\u0422\u0438\u043f","Generate image":"C\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043a\u0430\u0442\u0430 \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u044b\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c."}},es:{translation:{Files:"Archivos",selected:"seleccionado(s)",Deselected:"Deseleccionar",Rename:"Renombrar","Rename file":"Renombrar archivo {{currentFileName}}","Select the destination folder":"Seleccionar la carpeta de destino","Selected files:":"Archivos seleccionados:","Selected files":"Archivos seleccionados: {{count}}",selected_files_one:"{{count}} archivo seleccionado",selected_files_few:"{{count}} archivos seleccionados",selected_files_many:"{{count}} archivos seleccionados",selected_files_other:"{{count}} archivos seleccionados",Copy:"Duplicar",Edit:"Editar","Move to":"Mover a",Delete:"Eliminar","New folder":"Nueva carpeta","Image search...":"B\xfasqueda de im\xe1genes...","By name":"Por nombre","By size":"Por tama\xf1o","By date":"Por fecha",List:"Lista",Grid:"Cuadr\xedcula",Main:"Principal",Folders:"Carpetas","total pages":"{{total}} elementos en total",Name:"Nombre",Untitled:"Sin t\xedtulo",Size:"Tama\xf1o",Dimensions:"Dimensiones",Date:"Fecha",error:"error",Folder:"Carpeta",created:"creada","Failed to create folder":"Error al crear la carpeta","File deleted":"Archivo eliminado","Error when deleting a file":"Error al eliminar el archivo","Folder deleted":"Carpeta eliminada","Error when deleting a folder":"Error al eliminar la carpeta","Delete folder":"Eliminar carpeta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\xbfEst\xe1 seguro de que desea eliminar esta carpeta? Esta acci\xf3n tambi\xe9n eliminar\xe1 todos los archivos y subcarpetas.","API-endpoint for file upload is not configured":"El endpoint API para la carga de archivos no est\xe1 configurado","Please select an image file":"Por favor, seleccione un archivo de imagen",File:"Archivo","has been successfully uploaded":"se ha cargado exitosamente","The URL must point to an image":"La URL debe apuntar a una imagen","Image upload...":"Cargando imagen...",Unknown:"Desconocido","Error downloading file by URL":"Error al descargar el archivo por URL","successfully uploaded":"cargado exitosamente","Error when downloading a file by URL":"Error al descargar un archivo por URL","File not found":"Archivo no encontrado","File renamed to":"Archivo renombrado a","Failed to rename the file":"Error al renombrar el archivo","Folder renamed to":"Carpeta renombrada a","Rename folder":"Renombrar carpeta","New folder name":"Nuevo nombre de la carpeta","Enter a new folder name":"Ingrese un nuevo nombre para la carpeta","Please drag and drop image files only":"Por favor, arrastre y suelte solo archivos de imagen","Upload file by URL":"Cargar archivo por URL","Upload file":"Cargar archivo","Creating a new folder":"Creando una nueva carpeta",Create:"Crear",Cancel:"Cancelar","Folder name":"Nombre de la carpeta","Enter the name of the folder":"Ingrese el nombre de la carpeta","A folder will be created inside:":"La carpeta se crear\xe1 dentro de:","selected folder":"carpeta seleccionada","The folder will be created in the root directory":"La carpeta se crear\xe1 en el directorio ra\xedz","Failed to load folders":"No se pudieron cargar las carpetas","Folder name cannot be empty":"El nombre de la carpeta no puede estar vac\xedo","Folder creation provider is not configured":"El proveedor de creaci\xf3n de carpetas no est\xe1 configurado","Folder created":"Carpeta creada","Folder rename is disabled by config":"El renombrado de carpetas est\xe1 deshabilitado por la configuraci\xf3n","Folder rename provider is not configured":"El proveedor para renombrar carpetas no est\xe1 configurado","Unexpected response when renaming folder":"Respuesta inesperada al renombrar la carpeta","Folder renamed":"Carpeta renombrada","Failed to rename folder":"No se pudo renombrar la carpeta","Failed to load folder items count":"No se pudo obtener la cantidad de elementos de la carpeta","Failed to load subfolders":"No se pudieron cargar las subcarpetas",Download:"Descargar","image URL":"URL de la imagen","Enter the URL of the image":"Ingrese la URL de la imagen","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos admitidos: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Nuevo nombre del archivo","Enter a new file name":"Ingrese un nuevo nombre para el archivo","Copy to folder":"Copiar a carpeta",Added:"A\xf1adido el {{date}}","File uploaded successfully":"Archivo cargado exitosamente","Successfully uploaded":"{{successCount}} de {{count}} archivo cargado exitosamente","Successfully uploaded files":"{{successCount}} de {{count}} archivos cargados exitosamente",uploads_success_summary:"Se cargaron {{successCount}} de {{totalCount}} archivos",uploads_fail_summary:"No se pudieron cargar {{failCount}} de {{totalCount}} archivos","File with this name already exists.":"Ya existe un archivo con este nombre.","File not found or no longer available.":"El archivo no se encontr\xf3 o ya fue eliminado.","You don't have permission to access this file.":"No tiene permisos para acceder a este archivo.","File is too large to upload.":"El archivo es demasiado grande para subir.","This file type is not allowed.":"Este tipo de archivo no est\xe1 permitido.","File name is not valid.":"El nombre del archivo no es v\xe1lido.","Failed to read the file.":"No se pudo leer el archivo.","Failed to write the file.":"No se pudo escribir el archivo.","The file appears to be corrupted.":"El archivo parece estar da\xf1ado.","File integrity check failed.":"La verificaci\xf3n de integridad del archivo fall\xf3.","Folder not found or no longer available.":"La carpeta no se encontr\xf3 o ya fue eliminada.","Folder with this name already exists.":"Ya existe una carpeta con este nombre.","You don't have permission to access this folder.":"No tiene permisos para acceder a esta carpeta.","Folder name is not valid.":"El nombre de la carpeta no es v\xe1lido.","Failed to read the folder contents.":"No se pudo leer el contenido de la carpeta.","Failed to write to the folder.":"No se pudo escribir en la carpeta.","Folder storage quota exceeded.":"Se super\xf3 la cuota de almacenamiento de la carpeta.","Folder is not empty.":"La carpeta no est\xe1 vac\xeda.","Server error while processing the folder.":"Error del servidor al procesar la carpeta.","Folder operation took too long.":"La operaci\xf3n con la carpeta tard\xf3 demasiado.","Network error. Please check your connection and try again.":"Error de red. Compruebe su conexi\xf3n e int\xe9ntelo de nuevo.","The operation took too long. Please try again.":"La operaci\xf3n tard\xf3 demasiado. Int\xe9ntelo de nuevo.","Server error. Please try again later.":"Error del servidor. Int\xe9ntelo de nuevo m\xe1s tarde.","Service is temporarily unavailable. Please try again later.":"El servicio no est\xe1 disponible temporalmente. Int\xe9ntelo de nuevo m\xe1s tarde.","Too many requests. Please try again a bit later.":"Demasiadas solicitudes. Int\xe9ntelo de nuevo m\xe1s tarde.","Authentication failed. Please sign in again.":"Error de autenticaci\xf3n. Inicie sesi\xf3n de nuevo.","You are not allowed to perform this action.":"No tiene permisos para realizar esta acci\xf3n.","Some of the provided data is invalid.":"Algunos de los datos proporcionados no son v\xe1lidos.","This operation is not supported.":"Esta operaci\xf3n no est\xe1 soportada.","Request payload is too large.":"El cuerpo de la solicitud es demasiado grande.","This media type is not supported.":"Este tipo de contenido no est\xe1 soportado.","You have exceeded the upload quota.":"Se ha superado la cuota de subida de archivos.","Network error while uploading the file.":"Error de red al subir el archivo.","File upload took too long.":"La subida del archivo tard\xf3 demasiado.","Server error while uploading the file.":"Error del servidor al subir el archivo.","The specified URL is not valid.":"La URL especificada no es v\xe1lida.","The specified URL is not reachable.":"La URL especificada no es accesible.","Content type at the URL is not allowed.":"El tipo de contenido en la URL no est\xe1 permitido.","Failed to download file from the URL.":"No se pudo descargar el archivo desde la URL.","Network error while downloading the file.":"Error de red al descargar el archivo.","File download took too long.":"La descarga del archivo tard\xf3 demasiado.","Server error while downloading the file.":"Error del servidor al descargar el archivo.","Some items could not be processed.":"No todos los elementos se procesaron correctamente.","Failed to process all items in the batch.":"No se pudo procesar ning\xfan elemento del lote.","Some items in the batch are in a conflicting state.":"Algunos elementos del lote est\xe1n en estado de conflicto.","Some items in the batch did not pass validation.":"Algunos elementos del lote no pasaron la validaci\xf3n.","AI service returned an invalid response.":"El servicio de IA devolvi\xf3 una respuesta no v\xe1lida.","Failed to generate image using AI.":"No se pudo generar la imagen usando IA.","You have reached the AI image generation limit.":"Se alcanz\xf3 el l\xedmite de generaci\xf3n de im\xe1genes con IA.","Error in external integration.":"Error en la integraci\xf3n externa.","Error in a third-party service.":"Error en un servicio de terceros.","An unknown error occurred.":"Se ha producido un error desconocido.","Renaming is not allowed for this item.":"No se permite renombrar este elemento.","Moving is not allowed for this item.":"No se permite mover este elemento.","Copying is not allowed for this item.":"No se permite copiar este elemento.","Deleting is not allowed for this item.":"No se permite eliminar este elemento.","Cannot move an item into itself.":"No se puede mover un elemento dentro de s\xed mismo.","Cannot move an item into its descendant folder.":"No se puede mover un elemento a su carpeta descendiente.","Configuration error occurred.":"Se produjo un error de configuraci\xf3n.",Moved:"Movidos: {{names}}",move_success_summary:"Se movieron {{successCount}} de {{totalCount}} elementos",move_fail_summary:"No se pudieron mover {{failCount}} de {{totalCount}} elementos",Copied:"Copiados: {{names}}",copy_success_summary:"Se copiaron {{successCount}} de {{totalCount}} elementos",copy_fail_summary:"No se pudieron copiar {{failCount}} de {{totalCount}} elementos",Uploaded:"Archivos cargados: {{names}}",Failed:"No se pudieron cargar: {{names}}","Failed to upload":"Error al cargar {{failCount}} de {{count}} archivo","Failed to upload files":"Error al cargar {{failCount}} de {{count}} archivos",months:{january:"enero",february:"febrero",march:"marzo",april:"abril",may:"mayo",june:"junio",july:"julio",august:"agosto",september:"septiembre",october:"octubre",november:"noviembre",december:"diciembre"},files:"archivos","No available folders":"No hay carpetas disponibles","My files":"Mis archivos",GIF:"GIF","Stock images":"Im\xe1genes de stock",AI:"IA","AI image generation":"Generaci\xf3n de im\xe1genes con IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Es todo lo que pudimos encontrar.","Search image":"Buscar imagen",All:"Todos",Landscape:"Horizontal",Portrait:"Vertical",Squarish:"Cuadrado",Black:"Negro","Black and White":"Blanco y negro",White:"Blanco",Orange:"Naranja",Red:"Rojo",Purple:"Morado",Magenta:"Magenta",Green:"Verde",Teal:"Verde azulado",Blue:"Azul","Photo by":"Foto de",on:"en","File Manager":"Administrador de archivos","File Manager not configured":"Administrador de archivos no configurado","Filter by type":"Filtrar por tipo","All types":"Todos los tipos","File name":"Nombre del archivo",Actions:"Acciones","Add file":"A\xf1adir archivo","Add folder":"A\xf1adir carpeta","Add file by URL":"A\xf1adir archivo por URL","File moved":"Archivo movido","Error when moving a file":"Error al mover el archivo","Failed to download file":"No se pudo descargar el archivo","Failed to load JSON data":"No se pudieron cargar los datos JSON","Invalid file URL":"URL de archivo inv\xe1lida","Unable to validate file URL":"No se pudo validar la URL del archivo","Type to search...":"Escriba para buscar...",Submit:"Enviar","No folders yet":"A\xfan no hay carpetas","Drag files to upload":"Arrastre archivos para cargarlos","Drop files here to upload":"Suelte los archivos aqu\xed para cargarlos","Newest first":"Los m\xe1s nuevos primero","Oldest first":"Los m\xe1s antiguos primero","Largest first":"Los m\xe1s grandes primero","Smallest first":"Los m\xe1s peque\xf1os primero","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Evaluando la tarea","Something went wrong, please try again":"Algo sali\xf3 mal, por favor intente nuevamente","Sort by":"Ordenar por","preview text":"Cargando imagen...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar eliminaci\xf3n","Are you sure you want to delete the selected items?":"\xbfEst\xe1 seguro de que desea eliminar los elementos seleccionados?","Move to Trash":"Mover a la papelera","Are you sure you want to move the selected items to the Trash?":"\xbfEst\xe1 seguro de que desea mover los elementos seleccionados a la papelera?","Permanently delete":"Eliminaci\xf3n permanente","Delete permanently":"Eliminar permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\xbfEst\xe1 seguro de que desea eliminar permanentemente los elementos seleccionados? Esta acci\xf3n no se puede deshacer.",delete_files_permanent_one:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivo",delete_files_permanent_few:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_many:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_files_permanent_other:"Esta acci\xf3n eliminar\xe1 permanentemente {{count}} archivos",delete_folder_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente la carpeta \xab{{name}}\xbb y todo su contenido, incluyendo {{count}} elementos.",delete_mixed_permanent:"Esta acci\xf3n eliminar\xe1 permanentemente {{total}} elementos seleccionados, incluyendo {{folders}} carpetas y todas las {{images}} im\xe1genes dentro de ellas.",move_files_to_trash_one:"Esta acci\xf3n mover\xe1 {{count}} archivo a la papelera.",move_files_to_trash_few:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_many:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_files_to_trash_other:"Esta acci\xf3n mover\xe1 {{count}} archivos a la papelera.",move_folder_to_trash:"Esta acci\xf3n mover\xe1 la carpeta \xab{{name}}\xbb y todo su contenido ({{count}} elementos) a la papelera.",move_mixed_to_trash:"Esta acci\xf3n mover\xe1 {{total}} elementos seleccionados a la papelera, incluyendo {{folders}} carpetas y {{images}} im\xe1genes.",delete_count_confirm_trash_one:"\xbfMover {{count}} archivo a la papelera?",delete_count_confirm_trash_few:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_many:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_trash_other:"\xbfMover {{count}} archivos a la papelera?",delete_count_confirm_permanent_one:"\xbfEliminar permanentemente {{count}} archivo?",delete_count_confirm_permanent_few:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_many:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_permanent_other:"\xbfEliminar permanentemente {{count}} archivos?",delete_count_confirm_one:"\xbfEliminar {{count}} archivo?",delete_count_confirm_few:"\xbfEliminar {{count}} archivos?",delete_count_confirm_many:"\xbfEliminar {{count}} archivos?",delete_count_confirm_other:"\xbfEliminar {{count}} archivos?",item:"archivo",items:"archivos",Trash:"Papelera",Choose:"Elegir",Stock:"Banco de im\xe1genes","Select an image from our library":"Seleccione una imagen de nuestra biblioteca","AI generation":"Generaci\xf3n con IA","Creating an image on demand":"Creando una imagen bajo demanda","Search file or folder":"Buscar archivo o carpeta","Select a file or drag and drop it here":"Seleccione un archivo o arr\xe1strelo y su\xe9ltelo aqu\xed","Supported files:":"Archivos admitidos:","Create folder":"Crear carpeta",Done:"Hecho","Move here":"Mover aqu\xed","Copy here":"Copiar aqu\xed","File URL":"URL del archivo","There are no files for your request.":"No hay archivos para su solicitud.","Millions of free stock images":"Millones de im\xe1genes de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Ingrese una consulta de b\xfasqueda y encontraremos la imagen perfecta para usted","Enter your query and we will find the right one for you":"Ingrese su consulta y nosotros encontraremos la adecuada para usted","Over 350,000 live images":"M\xe1s de 350,000 im\xe1genes en vivo","The folder will be created in the root directory.":"La carpeta se crear\xe1 en el directorio ra\xedz.",undo:"DESHACER",moved_to_trash_one:"{{count}} elemento movido a la papelera",moved_to_trash_few:"{{count}} elementos movidos a la papelera",moved_to_trash_many:"{{count}} elementos movidos a la papelera",moved_to_trash_other:"{{count}} elementos movidos a la papelera",restored_items_one:"{{count}} elemento restaurado",restored_items_few:"{{count}} elementos restaurados",restored_items_many:"{{count}} elementos restaurados",restored_items_other:"{{count}} elementos restaurados",Type:"Tipo","Generate image":"Generar imagen","A beautiful image of a sunset over a calm ocean.":"Una imagen hermosa de un atardecer sobre un oc\xe9ano tranquilo."}},uk:{translation:{Files:"\u0424\u0430\u0439\u043b\u0438",selected:"\u043e\u0431\u0440\u0430\u043d\u043e",Deselected:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438 \u0432\u0438\u0431\u0456\u0440",Rename:"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438","Rename file":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b {{currentFileName}}","Select the destination folder":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044f","Selected files:":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432:","Selected files":"\u041e\u0431\u0440\u0430\u043d\u043e \u0444\u0430\u0439\u043b\u0456\u0432: {{count}}",selected_files_one:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b",selected_files_few:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0438",selected_files_many:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",selected_files_other:"\u041e\u0431\u0440\u0430\u043d\u043e {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",Copy:"\u0414\u0443\u0431\u043b\u044e\u0432\u0430\u0442\u0438",Edit:"\u0417\u043c\u0456\u043d\u0438\u0442\u0438","Move to":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438",Delete:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438","New folder":"\u041d\u043e\u0432\u0430 \u043f\u0430\u043f\u043a\u0430","Image search...":"\u041f\u043e\u0448\u0443\u043a \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c...","By name":"\u0417\u0430 \u043d\u0430\u0437\u0432\u043e\u044e","By size":"\u0417\u0430 \u0440\u043e\u0437\u043c\u0456\u0440\u043e\u043c","By date":"\u0417\u0430 \u0434\u0430\u0442\u043e\u044e",List:"\u0421\u043f\u0438\u0441\u043e\u043a",Grid:"\u041f\u043b\u0438\u0442\u043a\u0438",Main:"\u0413\u043e\u043b\u043e\u0432\u043d\u0430",Folders:"\u041f\u0430\u043f\u043a\u0438","total pages":"\u0412\u0441\u044c\u043e\u0433\u043e {{total}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Name:"\u041d\u0430\u0437\u0432\u0430",Untitled:"\u0411\u0435\u0437 \u043d\u0430\u0437\u0432\u0438",Size:"\u041e\u0431'\u0454\u043c",Dimensions:"\u0420\u043e\u0437\u043c\u0456\u0440",Date:"\u0414\u0430\u0442\u0430",error:"\u043f\u043e\u043c\u0438\u043b\u043a\u0430",Folder:"\u041f\u0430\u043f\u043a\u0430",created:"\u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430","Failed to create folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","File deleted":"\u0424\u0430\u0439\u043b \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Folder deleted":"\u041f\u0430\u043f\u043a\u0443 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e","Error when deleting a folder":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u0456 \u043f\u0430\u043f\u043a\u0438","Delete folder":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0446\u044e \u043f\u0430\u043f\u043a\u0443? \u0426\u044f \u0434\u0456\u044f \u0442\u0430\u043a\u043e\u0436 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0441\u0456 \u0444\u0430\u0439\u043b\u0438 \u0442\u0430 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438.","API-endpoint for file upload is not configured":"API-endpoint \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Please select an image file":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0432\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",File:"\u0424\u0430\u0439\u043b","has been successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","The URL must point to an image":"URL \u043f\u043e\u0432\u0438\u043d\u0435\u043d \u0432\u043a\u0430\u0437\u0443\u0432\u0430\u0442\u0438 \u043d\u0430 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Image upload...":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f...",Unknown:"\u041d\u0435\u0432\u0456\u0434\u043e\u043c\u043e","Error downloading file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","successfully uploaded":"\u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Error when downloading a file by URL":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430 URL","File not found":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e","File renamed to":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430 ","Failed to rename the file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Folder renamed to":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e \u043d\u0430","Rename folder":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","New folder name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter a new folder name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","Please drag and drop image files only":"\u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u043f\u0435\u0440\u0435\u0442\u044f\u0433\u0443\u0439\u0442\u0435 \u043b\u0438\u0448\u0435 \u0444\u0430\u0439\u043b\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Upload file by URL":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Upload file":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Creating a new folder":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043d\u043e\u0432\u043e\u0457 \u043f\u0430\u043f\u043a\u0438",Create:"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438",Cancel:"\u0421\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438","Folder name":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438","Enter the name of the folder":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u0430\u0437\u0432\u0443 \u043f\u0430\u043f\u043a\u0438","A folder will be created inside:":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456:","selected folder":"\u043e\u0431\u0440\u0430\u043d\u043e\u0457 \u043f\u0430\u043f\u043a\u0438","The folder will be created in the root directory":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456","Failed to load folders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0438","Folder name cannot be empty":"\u041d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u043c\u043e\u0436\u0435 \u0431\u0443\u0442\u0438 \u043f\u043e\u0440\u043e\u0436\u043d\u044c\u043e\u044e","Folder creation provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Folder created":"\u041f\u0430\u043f\u043a\u0443 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u043e","Folder rename is disabled by config":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u0432\u0438\u043c\u043a\u043d\u0435\u043d\u043e \u0432 \u043d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f\u0445","Folder rename provider is not configured":"\u041f\u043e\u0441\u0442\u0430\u0447\u0430\u043b\u044c\u043d\u0438\u043a \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u0438\u0439","Unexpected response when renaming folder":"\u041d\u0435\u043e\u0447\u0456\u043a\u0443\u0432\u0430\u043d\u0430 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c \u043f\u0456\u0434 \u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043f\u0430\u043f\u043a\u0438","Folder renamed":"\u041f\u0430\u043f\u043a\u0443 \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043e","Failed to rename folder":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Failed to load folder items count":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u043a\u0456\u043b\u044c\u043a\u0456\u0441\u0442\u044c \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043f\u0430\u043f\u0446\u0456","Failed to load subfolders":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u043f\u0456\u0434\u043f\u0430\u043f\u043a\u0438",Download:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438","image URL":"URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Enter the URL of the image":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c URL \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u043e\u0440\u043c\u0430\u0442\u0438: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"\u041d\u043e\u0432\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443","Enter a new file name":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043d\u043e\u0432\u0443 \u043d\u0430\u0437\u0432\u0443 \u0444\u0430\u0439\u043b\u0443","Copy to folder":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443",Added:"\u0414\u043e\u0434\u0430\u043d\u043e {{date}}","File uploaded successfully":"\u0424\u0430\u0439\u043b {{fileName}} \u0443\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e","Successfully uploaded":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Successfully uploaded files":"\u0423\u0441\u043f\u0456\u0448\u043d\u043e \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_success_summary:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432",uploads_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0444\u0430\u0439\u043b\u0456\u0432","File with this name already exists.":"\u0424\u0430\u0439\u043b \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","File not found or no longer available.":"\u0424\u0430\u0439\u043b \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0439\u043e\u0433\u043e \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","You don't have permission to access this file.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u044c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0443.","File is too large to upload.":"\u0424\u0430\u0439\u043b \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0438\u0439 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f.","This file type is not allowed.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0443 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","File name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443.","Failed to read the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","Failed to write the file.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u0438 \u0444\u0430\u0439\u043b.","The file appears to be corrupted.":"\u0424\u0430\u0439\u043b \u043f\u043e\u0448\u043a\u043e\u0434\u0436\u0435\u043d\u0438\u0439 \u0430\u0431\u043e \u043c\u0430\u0454 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u0438\u0439 \u0444\u043e\u0440\u043c\u0430\u0442.","File integrity check failed.":"\u041f\u0435\u0440\u0435\u0432\u0456\u0440\u043a\u0430 \u0446\u0456\u043b\u0456\u0441\u043d\u043e\u0441\u0442\u0456 \u0444\u0430\u0439\u043b\u0443 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u043d\u0435\u0432\u0434\u0430\u043b\u043e.","Folder not found or no longer available.":"\u041f\u0430\u043f\u043a\u0443 \u043d\u0435 \u0437\u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0430\u0431\u043e \u0457\u0457 \u0432\u0436\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043e.","Folder with this name already exists.":"\u041f\u0430\u043f\u043a\u0430 \u0437 \u0442\u0430\u043a\u043e\u044e \u043d\u0430\u0437\u0432\u043e\u044e \u0432\u0436\u0435 \u0456\u0441\u043d\u0443\u0454.","You don't have permission to access this folder.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0443 \u0434\u043e \u0446\u0456\u0454\u0457 \u043f\u0430\u043f\u043a\u0438.","Folder name is not valid.":"\u041d\u0435\u043f\u0440\u0438\u043f\u0443\u0441\u0442\u0438\u043c\u0430 \u043d\u0430\u0437\u0432\u0430 \u043f\u0430\u043f\u043a\u0438.","Failed to read the folder contents.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u0438 \u0432\u043c\u0456\u0441\u0442 \u043f\u0430\u043f\u043a\u0438.","Failed to write to the folder.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044e \u0437 \u043f\u0430\u043f\u043a\u043e\u044e.","Folder storage quota exceeded.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u0437\u0431\u0435\u0440\u0456\u0433\u0430\u043d\u043d\u044f \u0434\u043b\u044f \u043f\u0430\u043f\u043a\u0438.","Folder is not empty.":"\u041f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043f\u043e\u0440\u043e\u0436\u043d\u044f.","Server error while processing the folder.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u043e\u0431\u0440\u043e\u0431\u043a\u0438 \u043f\u0430\u043f\u043a\u0438.","Folder operation took too long.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0437 \u043f\u0430\u043f\u043a\u043e\u044e \u0437\u0430\u0439\u043d\u044f\u043b\u0430 \u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0447\u0430\u0441\u0443.","Network error. Please check your connection and try again.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456. \u041f\u0435\u0440\u0435\u0432\u0456\u0440\u0442\u0435 \u043f\u0456\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044f \u0434\u043e \u0456\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0442\u0430 \u043f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443.","The operation took too long. Please try again.":"\u041e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u0432\u0438\u043a\u043e\u043d\u0443\u0432\u0430\u043b\u0430\u0441\u044f \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437.","Server error. Please try again later.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0456. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Service is temporarily unavailable. Please try again later.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0442\u0438\u043c\u0447\u0430\u0441\u043e\u0432\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0439. \u041f\u043e\u0432\u0442\u043e\u0440\u0456\u0442\u044c \u0441\u043f\u0440\u043e\u0431\u0443 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Too many requests. Please try again a bit later.":"\u0417\u0430\u043d\u0430\u0434\u0442\u043e \u0431\u0430\u0433\u0430\u0442\u043e \u0437\u0430\u043f\u0438\u0442\u0456\u0432. \u0421\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437 \u043f\u0456\u0437\u043d\u0456\u0448\u0435.","Authentication failed. Please sign in again.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0440\u043e\u0439\u0442\u0438 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u0444\u0456\u043a\u0430\u0446\u0456\u044e. \u0411\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0443\u0432\u0456\u0439\u0434\u0456\u0442\u044c \u0437\u043d\u043e\u0432\u0443.","You are not allowed to perform this action.":"\u0423 \u0432\u0430\u0441 \u043d\u0435\u043c\u0430\u0454 \u043f\u0440\u0430\u0432 \u0434\u043b\u044f \u0432\u0438\u043a\u043e\u043d\u0430\u043d\u043d\u044f \u0446\u0456\u0454\u0457 \u0434\u0456\u0457.","Some of the provided data is invalid.":"\u0414\u0435\u044f\u043a\u0456 \u0437 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0438\u0445 \u0434\u0430\u043d\u0438\u0445 \u0454 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u043c\u0438.","This operation is not supported.":"\u0426\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u044f \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Request payload is too large.":"\u0422\u0456\u043b\u043e \u0437\u0430\u043f\u0438\u0442\u0443 \u0437\u0430\u043d\u0430\u0434\u0442\u043e \u0432\u0435\u043b\u0438\u043a\u0435.","This media type is not supported.":"\u0426\u0435\u0439 \u0442\u0438\u043f \u0434\u0430\u043d\u0438\u0445 \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","You have exceeded the upload quota.":"\u041f\u0435\u0440\u0435\u0432\u0438\u0449\u0435\u043d\u043e \u043a\u0432\u043e\u0442\u0443 \u043d\u0430 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0456\u0432.","Network error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File upload took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while uploading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","The specified URL is not valid.":"\u0412\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 URL-\u0430\u0434\u0440\u0435\u0441\u0443.","The specified URL is not reachable.":"\u0412\u043a\u0430\u0437\u0430\u043d\u0430 URL-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.","Content type at the URL is not allowed.":"\u0422\u0438\u043f \u0432\u043c\u0456\u0441\u0442\u0443 \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e \u043d\u0435 \u043f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0454\u0442\u044c\u0441\u044f.","Failed to download file from the URL.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 \u0432\u043a\u0430\u0437\u0430\u043d\u043e\u044e URL-\u0430\u0434\u0440\u0435\u0441\u043e\u044e.","Network error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043c\u0435\u0440\u0435\u0436\u0456 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","File download took too long.":"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443 \u0442\u0440\u0438\u0432\u0430\u043b\u043e \u043d\u0430\u0434\u0442\u043e \u0434\u043e\u0432\u0433\u043e.","Server error while downloading the file.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0456\u0434 \u0447\u0430\u0441 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f \u0444\u0430\u0439\u043b\u0443.","Some items could not be processed.":"\u041d\u0435 \u0432\u0441\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0431\u0443\u043b\u0438 \u043e\u0431\u0440\u043e\u0431\u043b\u0435\u043d\u0456 \u0443\u0441\u043f\u0456\u0448\u043d\u043e.","Failed to process all items in the batch.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043e\u0431\u0440\u043e\u0431\u0438\u0442\u0438 \u0436\u043e\u0434\u0435\u043d \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457.","Some items in the batch are in a conflicting state.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043f\u0435\u0440\u0435\u0431\u0443\u0432\u0430\u044e\u0442\u044c \u0443 \u043a\u043e\u043d\u0444\u043b\u0456\u043a\u0442\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u043d\u0456.","Some items in the batch did not pass validation.":"\u0414\u0435\u044f\u043a\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u043d\u0456\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0456\u0457 \u043d\u0435 \u043f\u0440\u043e\u0439\u0448\u043b\u0438 \u0432\u0430\u043b\u0456\u0434\u0430\u0446\u0456\u044e.","AI service returned an invalid response.":"\u0421\u0435\u0440\u0432\u0456\u0441 \u0428\u0406 \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0432 \u043d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0443 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u044c.","Failed to generate image using AI.":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430 \u0434\u043e\u043f\u043e\u043c\u043e\u0433\u043e\u044e \u0428\u0406.","You have reached the AI image generation limit.":"\u0414\u043e\u0441\u044f\u0433\u043d\u0443\u0442\u043e \u043b\u0456\u043c\u0456\u0442\u0443 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u0457 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0428\u0406.","Error in external integration.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u0456\u0439 \u0456\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0456\u0457.","Error in a third-party service.":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u0443 \u0437\u043e\u0432\u043d\u0456\u0448\u043d\u044c\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0456\u0441\u0456.","An unknown error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043d\u0435\u0432\u0456\u0434\u043e\u043c\u0430 \u043f\u043e\u043c\u0438\u043b\u043a\u0430.","Renaming is not allowed for this item.":"\u041f\u0435\u0440\u0435\u0439\u043c\u0435\u043d\u0443\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Moving is not allowed for this item.":"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Copying is not allowed for this item.":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Deleting is not allowed for this item.":"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f \u043d\u0435 \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e \u0434\u043b\u044f \u0446\u044c\u043e\u0433\u043e \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0430.","Cannot move an item into itself.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0431\u0435.","Cannot move an item into its descendant folder.":"\u041d\u0435 \u043c\u043e\u0436\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u0434\u043e\u0447\u0456\u0440\u043d\u044e \u043f\u0430\u043f\u043a\u0443.","Configuration error occurred.":"\u0421\u0442\u0430\u043b\u0430\u0441\u044f \u043f\u043e\u043c\u0438\u043b\u043a\u0430 \u043a\u043e\u043d\u0444\u0456\u0433\u0443\u0440\u0430\u0446\u0456\u0457.",Moved:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e: {{names}}",move_success_summary:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",move_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Copied:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e: {{names}}",copy_success_summary:"\u0421\u043a\u043e\u043f\u0456\u0439\u043e\u0432\u0430\u043d\u043e {{successCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",copy_fail_summary:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0441\u043a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 {{failCount}} \u0437 {{totalCount}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Uploaded:"\u0417\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043e: {{names}}",Failed:"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438: {{names}}","Failed to upload":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0443","Failed to upload files":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 {{failCount}} \u0437 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",months:{january:"\u0441\u0456\u0447\u043d\u044f",february:"\u043b\u044e\u0442\u043e\u0433\u043e",march:"\u0431\u0435\u0440\u0435\u0437\u043d\u044f",april:"\u043a\u0432\u0456\u0442\u043d\u044f",may:"\u0442\u0440\u0430\u0432\u043d\u044f",june:"\u0447\u0435\u0440\u0432\u043d\u044f",july:"\u043b\u0438\u043f\u043d\u044f",august:"\u0441\u0435\u0440\u043f\u043d\u044f",september:"\u0432\u0435\u0440\u0435\u0441\u043d\u044f",october:"\u0436\u043e\u0432\u0442\u043d\u044f",november:"\u043b\u0438\u0441\u0442\u043e\u043f\u0430\u0434\u0430",december:"\u0433\u0440\u0443\u0434\u043d\u044f"},files:"\u0444\u0430\u0439\u043b\u0456\u0432","No available folders":"\u041d\u0435\u043c\u0430\u0454 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0438\u0445 \u043f\u0430\u043f\u043e\u043a","My files":"\u041c\u043e\u0457 \u0444\u0430\u0439\u043b\u0438",GIF:"GIF","Stock images":"\u0421\u0442\u043e\u043a\u043e\u0432\u0456 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",AI:"AI","AI image generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Search GIFs":"\u0417\u043d\u0430\u0439\u0442\u0438 GIF","That`s all we could find.":"\u0426\u0435 \u0432\u0441\u0435, \u0449\u043e \u043c\u0438 \u0437\u043c\u043e\u0433\u043b\u0438 \u0437\u043d\u0430\u0439\u0442\u0438.","Search image":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f",All:"\u0412\u0441\u0456",Landscape:"\u0413\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0456",Portrait:"\u0412\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0456",Squarish:"\u041a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0456",Black:"\u0427\u043e\u0440\u043d\u0438\u0439","Black and White":"\u0427\u043e\u0440\u043d\u043e-\u0431\u0456\u043b\u0438\u0439",White:"\u0411\u0456\u043b\u0438\u0439",Orange:"\u041f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",Red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439",Purple:"\u0424\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",Magenta:"\u041f\u0443\u0440\u043f\u0443\u0440\u043d\u0438\u0439",Green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439",Teal:"\u0411\u0456\u0440\u044e\u0437\u043e\u0432\u0438\u0439",Blue:"\u0421\u0438\u043d\u0456\u0439","Photo by":"\u0424\u043e\u0442\u043e",on:"\u043d\u0430","File Manager":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440","File Manager not configured":"\u0424\u0430\u0439\u043b\u043e\u0432\u0438\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043d\u0435 \u043d\u0430\u043b\u0430\u0448\u0442\u043e\u0432\u0430\u043d\u043e","Filter by type":"\u0424\u0456\u043b\u044c\u0442\u0440 \u0437\u0430 \u0442\u0438\u043f\u043e\u043c","All types":"\u0412\u0441\u0456 \u0442\u0438\u043f\u0438","File name":"\u041d\u0430\u0437\u0432\u0430 \u0444\u0430\u0439\u043b\u0443",Actions:"\u0414\u0456\u0457","Add file":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b","Add folder":"\u0414\u043e\u0434\u0430\u0442\u0438 \u043f\u0430\u043f\u043a\u0443","Add file by URL":"\u0414\u043e\u0434\u0430\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","File moved":"\u0424\u0430\u0439\u043b \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e","Error when moving a file":"\u041f\u043e\u043c\u0438\u043b\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043d\u0456 \u0444\u0430\u0439\u043b\u0443","Failed to download file":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0444\u0430\u0439\u043b","Failed to load JSON data":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0434\u0430\u043d\u0456 JSON","Invalid file URL":"\u041d\u0435\u043a\u043e\u0440\u0435\u043a\u0442\u043d\u0438\u0439 URL \u0444\u0430\u0439\u043b\u0443","Unable to validate file URL":"\u041d\u0435 \u0432\u0434\u0430\u043b\u043e\u0441\u044f \u043f\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0444\u0430\u0439\u043b \u0437\u0430 URL","Type to search...":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0448\u0443\u043a\u0443...",Submit:"\u041d\u0430\u0434\u0456\u0441\u043b\u0430\u0442\u0438","No folders yet":"\u041f\u0430\u043f\u043e\u043a \u043f\u043e\u043a\u0438 \u043d\u0435\u043c\u0430\u0454","Drag files to upload":"\u041f\u0435\u0440\u0435\u0442\u044f\u0433\u043d\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0434\u043b\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0435\u043d\u043d\u044f","Drop files here to upload":"\u0412\u0456\u0434\u043f\u0443\u0441\u0442\u0456\u0442\u044c \u0444\u0430\u0439\u043b\u0438 \u0442\u0443\u0442, \u0449\u043e\u0431 \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0438\u0442\u0438 \u0457\u0445","Newest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043d\u043e\u0432\u0456","Oldest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0441\u0442\u0430\u0440\u0456","Largest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u0432\u0435\u043b\u0438\u043a\u0456","Smallest first":"\u0421\u043f\u043e\u0447\u0430\u0442\u043a\u0443 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0456","A-Z":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u0410-\u042f","Z-A":"\u0417\u0430 \u0430\u043b\u0444\u0430\u0432\u0456\u0442\u043e\u043c \u042f-\u0410","By type":"\u0417\u0430 \u0442\u0438\u043f\u043e\u043c","Evaluating the task":"\u041e\u0446\u0456\u043d\u043a\u0430 \u0437\u0430\u0432\u0434\u0430\u043d\u043d\u044f","Something went wrong, please try again":"\u0429\u043e\u0441\u044c \u043f\u0456\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u0431\u0443\u0434\u044c \u043b\u0430\u0441\u043a\u0430, \u0441\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0449\u0435 \u0440\u0430\u0437","Sort by":"\u0421\u043e\u0440\u0442\u0443\u0432\u0430\u0442\u0438 \u0437\u0430","preview text":"\u0417\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0432\u0430\u043d\u0442\u0430\u0436\u0443\u0454\u0442\u044c\u0441\u044f ...","Use this variant":"\u0412\u0438\u043a\u043e\u0440\u0438\u0441\u0442\u0430\u0442\u0438 \u0446\u0435\u0439 \u0432\u0430\u0440\u0456\u0430\u043d\u0442","Confirm deletion":"\u041f\u0456\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0438 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Are you sure you want to delete the selected items?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438?","Move to Trash":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a","Are you sure you want to move the selected items to the Trash?":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a?","Permanently delete":"\u041f\u043e\u0432\u043d\u0435 \u0432\u0438\u0434\u0430\u043b\u0435\u043d\u043d\u044f","Delete permanently":"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"\u0412\u0438 \u0432\u043f\u0435\u0432\u043d\u0435\u043d\u0456, \u0449\u043e \u0445\u043e\u0447\u0435\u0442\u0435 \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043e\u0431\u0440\u0430\u043d\u0456 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438? \u0426\u044e \u0434\u0456\u044e \u043d\u0435 \u043c\u043e\u0436\u043d\u0430 \u0441\u043a\u0430\u0441\u0443\u0432\u0430\u0442\u0438.",delete_files_permanent_one:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b",delete_files_permanent_few:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0438",delete_files_permanent_many:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_files_permanent_other:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{count}} \u0444\u0430\u0439\u043b\u0456\u0432",delete_folder_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432.",delete_mixed_permanent:"\u0426\u044f \u0434\u0456\u044f \u0431\u0435\u0437\u043f\u043e\u0432\u043e\u0440\u043e\u0442\u043d\u043e \u0432\u0438\u0434\u0430\u043b\u0438\u0442\u044c {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 \u0432\u0441\u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c \u0432\u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0456 \u043d\u0438\u0445.",move_files_to_trash_one:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b.",move_files_to_trash_few:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438.",move_files_to_trash_many:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_files_to_trash_other:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432.",move_folder_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a \u043f\u0430\u043f\u043a\u0443 \xab{{name}}\xbb \u0456 \u0432\u0441\u0435 \u0457\u0457 \u0432\u043c\u0456\u0441\u0442 ({{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432).",move_mixed_to_trash:"\u0426\u044f \u0434\u0456\u044f \u043f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u044c \u0443 \u043a\u043e\u0448\u0438\u043a {{total}} \u043e\u0431\u0440\u0430\u043d\u0438\u0445 \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432, \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0447\u0438 {{folders}} \u043f\u0430\u043f\u043e\u043a \u0456 {{images}} \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c.",delete_count_confirm_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0432 \u043a\u043e\u0448\u0438\u043a {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_permanent_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_permanent_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_permanent_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 \u043d\u0430\u0437\u0430\u0432\u0436\u0434\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_one:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b?",delete_count_confirm_few:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0438?",delete_count_confirm_many:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",delete_count_confirm_other:"\u0412\u0438\u0434\u0430\u043b\u0438\u0442\u0438 {{count}} \u0444\u0430\u0439\u043b\u0456\u0432?",item:"\u0444\u0430\u0439\u043b",items:"\u0444\u0430\u0439\u043b\u0456\u0432",Trash:"\u0412\u0438\u0434\u0430\u043b\u0435\u043d\u0456",Choose:"\u041e\u0431\u0440\u0430\u0442\u0438",Stock:"\u0424\u043e\u0442\u043e\u0441\u0442\u043e\u043a","Select an image from our library":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437 \u043d\u0430\u0448\u043e\u0457 \u0431\u0456\u0431\u043b\u0456\u043e\u0442\u0435\u043a\u0438","AI generation":"AI \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0456\u044f","Creating an image on demand":"\u0421\u0442\u0432\u043e\u0440\u0435\u043d\u043d\u044f \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u043d\u0430 \u0437\u0430\u043c\u043e\u0432\u043b\u0435\u043d\u043d\u044f","Search file or folder":"\u0417\u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b \u0430\u0431\u043e \u043f\u0430\u043f\u043a\u0443","Select a file or drag and drop it here":"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044c \u0444\u0430\u0439\u043b \u0430\u0431\u043e \u043f\u0435\u0440\u0435\u0442\u044f\u0433\u043d\u0456\u0442\u044c \u0439\u043e\u0433\u043e \u0441\u044e\u0434\u0438","Supported files:":"\u041f\u0456\u0434\u0442\u0440\u0438\u043c\u0443\u0432\u0430\u043d\u0456 \u0444\u0430\u0439\u043b\u0438:","Create folder":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u043f\u0430\u043f\u043a\u0443",Done:"\u0413\u043e\u0442\u043e\u0432\u043e","Move here":"\u041f\u0435\u0440\u0435\u043c\u0456\u0441\u0442\u0438\u0442\u0438 \u0441\u044e\u0434\u0438","Copy here":"\u041a\u043e\u043f\u0456\u044e\u0432\u0430\u0442\u0438 \u0441\u044e\u0434\u0438","File URL":"URL \u0444\u0430\u0439\u043b\u0443","There are no files for your request.":"\u0424\u0430\u0439\u043b\u0456\u0432 \u0437\u0430 \u0432\u0430\u0448\u0438\u043c \u0437\u0430\u043f\u0438\u0442\u043e\u043c \u043d\u0435\u043c\u0430\u0454.","Millions of free stock images":"\u041c\u0456\u043b\u044c\u0439\u043e\u043d\u0438 \u0431\u0435\u0437\u043a\u043e\u0448\u0442\u043e\u0432\u043d\u0438\u0445 \u0441\u0442\u043e\u043a\u043e\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","Enter a search query and we'll find the perfect image for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u043f\u043e\u0448\u0443\u043a\u043e\u0432\u0438\u0439 \u0437\u0430\u043f\u0438\u0442, \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0456\u0434\u0435\u0430\u043b\u044c\u043d\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","Enter your query and we will find the right one for you":"\u0412\u0432\u0435\u0434\u0456\u0442\u044c \u0437\u0430\u043f\u0438\u0442 \u0456 \u043c\u0438 \u0437\u043d\u0430\u0439\u0434\u0435\u043c\u043e \u0434\u043b\u044f \u0432\u0430\u0441 \u0432\u0456\u0434\u043f\u043e\u0432\u0456\u0434\u043d\u0435","Over 350,000 live images":"\u041f\u043e\u043d\u0430\u0434 350 000 \u0436\u0438\u0432\u0438\u0445 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044c","The folder will be created in the root directory.":"\u041f\u0430\u043f\u043a\u0430 \u0431\u0443\u0434\u0435 \u0441\u0442\u0432\u043e\u0440\u0435\u043d\u0430 \u0432 \u043a\u043e\u0440\u0435\u043d\u0435\u0432\u043e\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0437\u0456.",undo:"\u0421\u041a\u0410\u0421\u0423\u0412\u0410\u0422\u0418",moved_to_trash_one:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_few:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_many:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",moved_to_trash_other:"\u041f\u0435\u0440\u0435\u043c\u0456\u0449\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432 \u0443 \u043a\u043e\u0448\u0438\u043a",restored_items_one:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442",restored_items_few:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0438",restored_items_many:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",restored_items_other:"\u0412\u0456\u0434\u043d\u043e\u0432\u043b\u0435\u043d\u043e {{count}} \u0435\u043b\u0435\u043c\u0435\u043d\u0442\u0456\u0432",Type:"\u0422\u0438\u043f","Generate image":"\u0421\u0442\u0432\u043e\u0440\u0438\u0442\u0438 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f","A beautiful image of a sunset over a calm ocean.":"\u041a\u0440\u0430\u0441\u0438\u0432\u0435 \u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043d\u044f \u0437\u0430\u0445\u043e\u0434\u0443 \u0441\u043e\u043d\u0446\u044f \u043d\u0430\u0434 \u0441\u043f\u043e\u043a\u0456\u0439\u043d\u0438\u043c \u043e\u043a\u0435\u0430\u043d\u043e\u043c."}},"pt-br":{translation:{Files:"Arquivos",selected:"selecionado(s)",Deselected:"Desmarcar",Rename:"Renomear","Rename file":"Renomear arquivo {{currentFileName}}","Select the destination folder":"Selecionar a pasta de destino","Selected files:":"Arquivos selecionados:","Selected files":"Arquivos selecionados: {{count}}",selected_files_one:"{{count}} arquivo selecionado",selected_files_few:"{{count}} arquivos selecionados",selected_files_many:"{{count}} arquivos selecionados",selected_files_other:"{{count}} arquivos selecionados",Copy:"Duplicar",Edit:"Editar","Move to":"Mover para",Delete:"Excluir","New folder":"Nova pasta","Image search...":"Busca de imagens...","By name":"Por nome","By size":"Por tamanho","By date":"Por data",List:"Lista",Grid:"Grade",Main:"Principal",Folders:"Pastas","total pages":"Total de {{total}} itens",Name:"Nome",Untitled:"Sem t\xedtulo",Size:"Tamanho",Dimensions:"Dimens\xf5es",Date:"Data",error:"erro",Folder:"Pasta",created:"criada","Failed to create folder":"Falha ao criar pasta","File deleted":"Arquivo exclu\xeddo","Error when deleting a file":"Erro ao excluir arquivo","Folder deleted":"Pasta exclu\xedda","Error when deleting a folder":"Erro ao excluir pasta","Delete folder":"Excluir pasta","Are you sure you want to delete this folder? This action will also delete all files and subfolders.":"Tem certeza que deseja excluir esta pasta? Esta a\xe7\xe3o tamb\xe9m excluir\xe1 todos os arquivos e subpastas.","API-endpoint for file upload is not configured":"Endpoint da API para upload de arquivos n\xe3o est\xe1 configurado","Please select an image file":"Por favor, selecione um arquivo de imagem",File:"Arquivo","has been successfully uploaded":"foi carregado com sucesso","The URL must point to an image":"A URL deve apontar para uma imagem","Image upload...":"Carregando imagem...",Unknown:"Desconhecido","Error downloading file by URL":"Erro ao baixar arquivo por URL","successfully uploaded":"carregado com sucesso","Error when downloading a file by URL":"Erro ao baixar arquivo por URL","File not found":"Arquivo n\xe3o encontrado","File renamed to":"Arquivo renomeado para","Failed to rename the file":"Falha ao renomear o arquivo","Folder renamed to":"Pasta renomeada para","Rename folder":"Renomear pasta","New folder name":"Novo nome da pasta","Enter a new folder name":"Digite um novo nome para a pasta","Please drag and drop image files only":"Por favor, arraste e solte apenas arquivos de imagem","Upload file by URL":"Carregar arquivo por URL","Upload file":"Carregar arquivo","Creating a new folder":"Criando uma nova pasta",Create:"Criar",Cancel:"Cancelar","Folder name":"Nome da pasta","Enter the name of the folder":"Digite o nome da pasta","A folder will be created inside:":"A pasta ser\xe1 criada dentro de:","selected folder":"pasta selecionada","The folder will be created in the root directory":"A pasta ser\xe1 criada no diret\xf3rio raiz","Failed to load folders":"N\xe3o foi poss\xedvel carregar as pastas","Folder name cannot be empty":"O nome da pasta n\xe3o pode estar vazio","Folder creation provider is not configured":"O provedor de cria\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Folder created":"Pasta criada","Folder rename is disabled by config":"Renomear pastas est\xe1 desabilitado pela configura\xe7\xe3o","Folder rename provider is not configured":"O provedor de renomea\xe7\xe3o de pastas n\xe3o est\xe1 configurado","Unexpected response when renaming folder":"Resposta inesperada ao renomear a pasta","Folder renamed":"Pasta renomeada","Failed to rename folder":"N\xe3o foi poss\xedvel renomear a pasta","Failed to load folder items count":"N\xe3o foi poss\xedvel obter a contagem de itens da pasta","Failed to load subfolders":"N\xe3o foi poss\xedvel carregar as subpastas",Download:"Baixar","image URL":"URL da imagem","Enter the URL of the image":"Digite a URL da imagem","Supported formats: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP":"Formatos suportados: JPG, JPEG, PNG, GIF, WEBP, SVG, BMP","New file name":"Novo nome do arquivo","Enter a new file name":"Digite um novo nome para o arquivo","Copy to folder":"Copiar para pasta",Added:"Adicionado em {{date}}","File uploaded successfully":"Arquivo carregado com sucesso","Successfully uploaded":"{{successCount}} de {{count}} arquivo carregado com sucesso","Successfully uploaded files":"{{successCount}} de {{count}} arquivos carregados com sucesso",uploads_success_summary:"Enviados {{successCount}} de {{totalCount}} arquivos",uploads_fail_summary:"Falhou ao enviar {{failCount}} de {{totalCount}} arquivos","File with this name already exists.":"J\xe1 existe um arquivo com esse nome.","File not found or no longer available.":"O arquivo n\xe3o foi encontrado ou j\xe1 foi exclu\xeddo.","You don't have permission to access this file.":"Voc\xea n\xe3o tem permiss\xe3o para acessar este arquivo.","File is too large to upload.":"O arquivo \xe9 grande demais para ser enviado.","This file type is not allowed.":"Este tipo de arquivo n\xe3o \xe9 permitido.","File name is not valid.":"O nome do arquivo n\xe3o \xe9 v\xe1lido.","Failed to read the file.":"N\xe3o foi poss\xedvel ler o arquivo.","Failed to write the file.":"N\xe3o foi poss\xedvel gravar o arquivo.","The file appears to be corrupted.":"O arquivo parece estar corrompido.","File integrity check failed.":"A verifica\xe7\xe3o de integridade do arquivo falhou.","Folder not found or no longer available.":"A pasta n\xe3o foi encontrada ou j\xe1 foi exclu\xedda.","Folder with this name already exists.":"J\xe1 existe uma pasta com esse nome.","You don't have permission to access this folder.":"Voc\xea n\xe3o tem permiss\xe3o para acessar esta pasta.","Folder name is not valid.":"O nome da pasta n\xe3o \xe9 v\xe1lido.","Failed to read the folder contents.":"N\xe3o foi poss\xedvel ler o conte\xfado da pasta.","Failed to write to the folder.":"N\xe3o foi poss\xedvel gravar na pasta.","Folder storage quota exceeded.":"A cota de armazenamento da pasta foi excedida.","Folder is not empty.":"A pasta n\xe3o est\xe1 vazia.","Server error while processing the folder.":"Erro do servidor ao processar a pasta.","Folder operation took too long.":"A opera\xe7\xe3o com a pasta demorou demais.","Network error. Please check your connection and try again.":"Erro de rede. Verifique sua conex\xe3o e tente novamente.","The operation took too long. Please try again.":"A opera\xe7\xe3o demorou demais. Tente novamente.","Server error. Please try again later.":"Erro no servidor. Tente novamente mais tarde.","Service is temporarily unavailable. Please try again later.":"O servi\xe7o est\xe1 temporariamente indispon\xedvel. Tente novamente mais tarde.","Too many requests. Please try again a bit later.":"Muitas solicita\xe7\xf5es. Tente novamente mais tarde.","Authentication failed. Please sign in again.":"Falha na autentica\xe7\xe3o. Fa\xe7a login novamente.","You are not allowed to perform this action.":"Voc\xea n\xe3o tem permiss\xe3o para executar esta a\xe7\xe3o.","Some of the provided data is invalid.":"Alguns dos dados fornecidos s\xe3o inv\xe1lidos.","This operation is not supported.":"Esta opera\xe7\xe3o n\xe3o \xe9 suportada.","Request payload is too large.":"O corpo da requisi\xe7\xe3o \xe9 grande demais.","This media type is not supported.":"Este tipo de m\xeddia n\xe3o \xe9 suportado.","You have exceeded the upload quota.":"Voc\xea excedeu a cota de upload de arquivos.","Network error while uploading the file.":"Erro de rede ao enviar o arquivo.","File upload took too long.":"O envio do arquivo demorou demais.","Server error while uploading the file.":"Erro do servidor ao enviar o arquivo.","The specified URL is not valid.":"A URL especificada n\xe3o \xe9 v\xe1lida.","The specified URL is not reachable.":"A URL especificada n\xe3o est\xe1 acess\xedvel.","Content type at the URL is not allowed.":"O tipo de conte\xfado na URL n\xe3o \xe9 permitido.","Failed to download file from the URL.":"N\xe3o foi poss\xedvel baixar o arquivo da URL.","Network error while downloading the file.":"Erro de rede ao baixar o arquivo.","File download took too long.":"O download do arquivo demorou demais.","Server error while downloading the file.":"Erro do servidor ao baixar o arquivo.","Some items could not be processed.":"Nem todos os itens foram processados com sucesso.","Failed to process all items in the batch.":"Nenhum item do lote p\xf4de ser processado.","Some items in the batch are in a conflicting state.":"Alguns itens do lote est\xe3o em estado de conflito.","Some items in the batch did not pass validation.":"Alguns itens do lote n\xe3o passaram na valida\xe7\xe3o.","AI service returned an invalid response.":"O servi\xe7o de IA retornou uma resposta inv\xe1lida.","Failed to generate image using AI.":"Falha ao gerar imagem usando IA.","You have reached the AI image generation limit.":"Voc\xea atingiu o limite de gera\xe7\xe3o de imagens por IA.","Error in external integration.":"Erro em uma integra\xe7\xe3o externa.","Error in a third-party service.":"Erro em um servi\xe7o de terceiros.","An unknown error occurred.":"Ocorreu um erro desconhecido.","Renaming is not allowed for this item.":"Renomear n\xe3o \xe9 permitido para este item.","Moving is not allowed for this item.":"Mover n\xe3o \xe9 permitido para este item.","Copying is not allowed for this item.":"Copiar n\xe3o \xe9 permitido para este item.","Deleting is not allowed for this item.":"Excluir n\xe3o \xe9 permitido para este item.","Cannot move an item into itself.":"N\xe3o \xe9 poss\xedvel mover um item para dentro de si mesmo.","Cannot move an item into its descendant folder.":"N\xe3o \xe9 poss\xedvel mover um item para sua pasta descendente.","Configuration error occurred.":"Ocorreu um erro de configura\xe7\xe3o.",Moved:"Movidos: {{names}}",move_success_summary:"Movidos {{successCount}} de {{totalCount}} itens",move_fail_summary:"Falhou ao mover {{failCount}} de {{totalCount}} itens",Copied:"Copiados: {{names}}",copy_success_summary:"Copiados {{successCount}} de {{totalCount}} itens",copy_fail_summary:"Falhou ao copiar {{failCount}} de {{totalCount}} itens",Uploaded:"Arquivos enviados: {{names}}",Failed:"Falha ao enviar: {{names}}","Failed to upload":"Falha ao carregar {{failCount}} de {{count}} arquivo","Failed to upload files":"Falha ao carregar {{failCount}} de {{count}} arquivos",months:{january:"janeiro",february:"fevereiro",march:"mar\xe7o",april:"abril",may:"maio",june:"junho",july:"julho",august:"agosto",september:"setembro",october:"outubro",november:"novembro",december:"dezembro"},files:"arquivos","No available folders":"Nenhuma pasta dispon\xedvel","My files":"Meus arquivos",GIF:"GIF","Stock images":"Imagens de stock",AI:"IA","AI image generation":"Gera\xe7\xe3o de imagens por IA","Search GIFs":"Buscar GIFs","That`s all we could find.":"Isso \xe9 tudo que conseguimos encontrar.","Search image":"Buscar imagem",All:"Todos",Landscape:"Paisagem",Portrait:"Retrato",Squarish:"Quadrados",Black:"Preto","Black and White":"Preto e branco",White:"Branco",Orange:"Laranja",Red:"Vermelho",Purple:"Roxo",Magenta:"Magenta",Green:"Verde",Teal:"Verde-azulado",Blue:"Azul","Photo by":"Foto por",on:"em","File Manager":"Gerenciador de arquivos","File Manager not configured":"Gerenciador de arquivos n\xe3o configurado","Filter by type":"Filtrar por tipo","All types":"Todos os tipos","File name":"Nome do arquivo",Actions:"A\xe7\xf5es","Add file":"Adicionar arquivo","Add folder":"Adicionar pasta","Add file by URL":"Adicionar arquivo por URL","File moved":"Arquivo movido","Error when moving a file":"Erro ao mover arquivo","Failed to download file":"N\xe3o foi poss\xedvel baixar o arquivo","Failed to load JSON data":"N\xe3o foi poss\xedvel carregar os dados JSON","Invalid file URL":"URL de arquivo inv\xe1lida","Unable to validate file URL":"N\xe3o foi poss\xedvel validar a URL do arquivo","Type to search...":"Digite para buscar...",Submit:"Enviar","No folders yet":"Nenhuma pasta ainda","Drag files to upload":"Arraste arquivos para carregar","Drop files here to upload":"Solte os arquivos aqui para carreg\xe1-los","Newest first":"Mais recentes primeiro","Oldest first":"Mais antigos primeiro","Largest first":"Maiores primeiro","Smallest first":"Menores primeiro","A-Z":"A-Z","Z-A":"Z-A","By type":"Por tipo","Evaluating the task":"Avaliando a tarefa","Something went wrong, please try again":"Algo deu errado, por favor tente novamente","Sort by":"Ordenar por","preview text":"Carregando imagem...","Use this variant":"Usar esta variante","Confirm deletion":"Confirmar exclus\xe3o","Are you sure you want to delete the selected items?":"Tem certeza que deseja excluir os itens selecionados?","Move to Trash":"Mover para lixeira","Are you sure you want to move the selected items to the Trash?":"Tem certeza que deseja mover os itens selecionados para a lixeira?","Permanently delete":"Exclus\xe3o permanente","Delete permanently":"Excluir permanentemente","Are you sure you want to permanently delete the selected items? This action cannot be undone.":"Tem certeza que deseja excluir permanentemente os itens selecionados? Esta a\xe7\xe3o n\xe3o pode ser desfeita.",delete_files_permanent_one:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivo",delete_files_permanent_few:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_many:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_files_permanent_other:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{count}} arquivos",delete_folder_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente a pasta \xab{{name}}\xbb e todo seu conte\xfado, incluindo {{count}} itens.",delete_mixed_permanent:"Esta a\xe7\xe3o excluir\xe1 permanentemente {{total}} itens selecionados, incluindo {{folders}} pastas e todas as {{images}} imagens dentro delas.",move_files_to_trash_one:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivo para a lixeira.",move_files_to_trash_few:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_many:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_files_to_trash_other:"Esta a\xe7\xe3o mover\xe1 {{count}} arquivos para a lixeira.",move_folder_to_trash:"Esta a\xe7\xe3o mover\xe1 a pasta \xab{{name}}\xbb e todo seu conte\xfado ({{count}} itens) para a lixeira.",move_mixed_to_trash:"Esta a\xe7\xe3o mover\xe1 {{total}} itens selecionados para a lixeira, incluindo {{folders}} pastas e {{images}} imagens.",delete_count_confirm_trash_one:"Mover {{count}} arquivo para a lixeira?",delete_count_confirm_trash_few:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_many:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_trash_other:"Mover {{count}} arquivos para a lixeira?",delete_count_confirm_permanent_one:"Excluir permanentemente {{count}} arquivo?",delete_count_confirm_permanent_few:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_many:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_permanent_other:"Excluir permanentemente {{count}} arquivos?",delete_count_confirm_one:"Excluir {{count}} arquivo?",delete_count_confirm_few:"Excluir {{count}} arquivos?",delete_count_confirm_many:"Excluir {{count}} arquivos?",delete_count_confirm_other:"Excluir {{count}} arquivos?",item:"arquivo",items:"arquivos",Trash:"Lixeira",Choose:"Escolher",Stock:"Banco de imagens","Select an image from our library":"Selecione uma imagem da nossa biblioteca","AI generation":"Gera\xe7\xe3o por IA","Creating an image on demand":"Criando uma imagem sob demanda","Search file or folder":"Buscar arquivo ou pasta","Select a file or drag and drop it here":"Selecione um arquivo ou arraste e solte aqui","Supported files:":"Arquivos suportados:","Create folder":"Criar pasta",Done:"Conclu\xeddo","Move here":"Mover aqui","Copy here":"Copiar aqui","File URL":"URL do arquivo","There are no files for your request.":"N\xe3o h\xe1 arquivos para sua solicita\xe7\xe3o.","Millions of free stock images":"Milh\xf5es de imagens de stock gratuitas","Enter a search query and we'll find the perfect image for you":"Digite uma consulta de busca e encontraremos a imagem perfeita para voc\xea","Enter your query and we will find the right one for you":"Digite sua consulta e n\xf3s encontraremos a ideal para voc\xea","Over 350,000 live images":"Mais de 350.000 imagens ao vivo","The folder will be created in the root directory.":"A pasta ser\xe1 criada no diret\xf3rio raiz.",undo:"DESFAZER",moved_to_trash_one:"{{count}} item movido para a lixeira",moved_to_trash_few:"{{count}} itens movidos para a lixeira",moved_to_trash_many:"{{count}} itens movidos para a lixeira",moved_to_trash_other:"{{count}} itens movidos para a lixeira",restored_items_one:"{{count}} item restaurado",restored_items_few:"{{count}} itens restaurados",restored_items_many:"{{count}} itens restaurados",restored_items_other:"{{count}} itens restaurados",Type:"Tipo","Generate image":"Gerar imagem","A beautiful image of a sunset over a calm ocean.":"Uma imagem bonita de um p\xf4r do sol sobre um oceano tranquilo."}}};rr.use(ln).init({resources:ur,debug:!0,lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});const dr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m6 9 6 6 6-6"}));dr.displayName="ChevronDown";const hr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M12 20.472a6 6 0 1 0 5.58-10.262m-11.16 0a6 6 0 1 0 7.16 3.58M18 8A6 6 0 1 1 6 8a6 6 0 0 1 12 0Z"}));hr.displayName="Colors";const fr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M16 16v2.8c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C14.48 22 13.92 22 12.8 22H5.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C2 20.48 2 19.92 2 18.8v-7.6c0-1.12 0-1.68.218-2.108a2 2 0 0 1 .874-.874C3.52 8 4.08 8 5.2 8H8m3.2 8h7.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 14.48 22 13.92 22 12.8V5.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 2 19.92 2 18.8 2h-7.6c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C8 3.52 8 4.08 8 5.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C9.52 16 10.08 16 11.2 16Z"}));fr.displayName="Copy04";const pr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M10 6h4.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C18 7.52 18 8.08 18 9.2V14M2 6h4m12 12v4m4-4H9.2c-1.12 0-1.68 0-2.108-.218a2 2 0 0 1-.874-.874C6 16.48 6 15.92 6 14.8V2"}));pr.displayName="Crop02";const gr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0-7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 14a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"}));gr.displayName="DotsVertical";const mr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7 3 3m0 0 3-3m-3 3v-6"}));mr.displayName="FolderDownload";const vr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm7 7h6"}));vr.displayName="FolderMinus";const yr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m13 7-1.116-2.231c-.32-.642-.481-.963-.72-1.198a2 2 0 0 0-.748-.462C10.1 3 9.74 3 9.022 3H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 4.52 2 5.08 2 6.2V7m0 0h15.2c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C22 9.28 22 10.12 22 11.8v4.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2V7Zm10 10v-6m-3 3h6"}));yr.displayName="FolderPlus";const br=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M8.4 3H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 3.76 3 4.04 3 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 10 4.04 10 4.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 9.24 10 8.96 10 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 3 8.96 3 8.4 3Zm11 0h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 3.76 14 4.04 14 4.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 10 15.04 10 15.6 10h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 9.24 21 8.96 21 8.4V4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 3 19.96 3 19.4 3Zm0 11h-3.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C14 14.76 14 15.04 14 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C14.76 21 15.04 21 15.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 20.24 21 19.96 21 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 14 19.96 14 19.4 14Zm-11 0H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 14.76 3 15.04 3 15.6v3.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 21 4.04 21 4.6 21h3.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C10 20.24 10 19.96 10 19.4v-3.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C9.24 14 8.96 14 8.4 14Z"}));br.displayName="Grid01";const wr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21Z"}));wr.displayName="Image03";const xr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m12.708 18.364-1.415 1.414a5 5 0 1 1-7.07-7.07l1.413-1.415m12.728 1.414 1.415-1.414a5 5 0 0 0-7.071-7.071l-1.415 1.414M8.5 15.5l7-7"}));xr.displayName="Link01";const Cr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M21 12H9m12-6H9m12 12H9m-4-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0-6a1 1 0 1 1-2 0 1 1 0 0 1 2 0Zm0 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}));Cr.displayName="List";const _r=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M9.5 8.965c0-.477 0-.716.1-.849a.5.5 0 0 1 .364-.199c.166-.012.367.117.769.375l4.72 3.035c.349.224.523.336.583.478a.5.5 0 0 1 0 .39c-.06.142-.234.254-.583.478l-4.72 3.035c-.402.258-.603.387-.769.375a.5.5 0 0 1-.364-.2c-.1-.132-.1-.371-.1-.848v-6.07Z"}),o.createElement("path",{d:"M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"}));_r.displayName="PlaySquare";const Sr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M12 8v8m-4-4h8m6 0c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));Sr.displayName="PlusCircle";const kr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M14 22H6.8m0 0c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 19.72 2 18.88 2 17.2M6.8 22h.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C12 19.72 12 18.88 12 17.2v-.4c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C9.72 12 8.88 12 7.2 12h-.4c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 14.28 2 15.12 2 16.8v.4m0 0V10m8-8h4m8 8v4m-4 8c.93 0 1.395 0 1.776-.102a3 3 0 0 0 2.122-2.122C22 19.395 22 18.93 22 18m0-12c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.122-2.122C19.395 2 18.93 2 18 2M6 2c-.93 0-1.395 0-1.776.102a3 3 0 0 0-2.122 2.122C2 4.605 2 5.07 2 6"}));kr.displayName="Scale01";const Ar=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"m21 21-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"}));Ar.displayName="SearchMd";const jr=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M4.5 22v-5m0-10V2M2 4.5h5m-5 15h5M13 3l-1.734 4.509c-.282.733-.423 1.1-.643 1.408a3 3 0 0 1-.706.707c-.308.219-.675.36-1.408.642L4 12l4.509 1.734c.733.282 1.1.423 1.408.643.273.194.512.433.707.706.219.308.36.675.642 1.408L13 21l1.734-4.509c.282-.733.423-1.1.643-1.408.194-.273.433-.512.706-.707.308-.219.675-.36 1.408-.642L22 12l-4.509-1.734c-.733-.282-1.1-.423-1.408-.642a3 3 0 0 1-.706-.707c-.22-.308-.36-.675-.643-1.408L13 3Z"}));jr.displayName="Stars02";const Er=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M13 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v3.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 17 4.08 17 5.2 17H13m4-10h1.8c1.12 0 1.68 0 2.108.218a2 2 0 0 1 .874.874C22 8.52 22 9.08 22 10.2v3.6c0 1.12 0 1.68-.218 2.108a2 2 0 0 1-.874.874C20.48 17 19.92 17 18.8 17H17m0 4V3m2.5 0h-5m5 18h-5"}));Er.displayName="TextInput";const Ir=({size:e=24,color:t="currentColor",...n})=>o.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:t,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...n},o.createElement("path",{d:"M9 3h6M3 6h18m-2 0-.701 10.52c-.105 1.578-.158 2.367-.499 2.965a3 3 0 0 1-1.298 1.215c-.62.3-1.41.3-2.993.3h-3.018c-1.582 0-2.373 0-2.993-.3A3 3 0 0 1 6.2 19.485c-.34-.598-.394-1.387-.499-2.966L5 6m5 4.5v5m4-5v5"}));Ir.displayName="Trash03";var Tr,Or={exports:{}},Fr=Or.exports,Pr=(Tr||(Tr=1,function(e,t){(function(){var n,r="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",a=32,s=128,l=1/0,c=9007199254740991,u=NaN,d=4294967295,h=[["ary",s],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",a],["partialRight",64],["rearg",256]],f="[object Arguments]",p="[object Array]",g="[object Boolean]",m="[object Date]",v="[object Error]",y="[object Function]",b="[object GeneratorFunction]",w="[object Map]",x="[object Number]",C="[object Object]",_="[object Promise]",S="[object RegExp]",k="[object Set]",A="[object String]",j="[object Symbol]",E="[object WeakMap]",I="[object ArrayBuffer]",T="[object DataView]",O="[object Float32Array]",F="[object Float64Array]",P="[object Int8Array]",M="[object Int16Array]",R="[object Int32Array]",L="[object Uint8Array]",D="[object Uint8ClampedArray]",N="[object Uint16Array]",z="[object Uint32Array]",B=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,U=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,$=RegExp(W.source),G=RegExp(H.source),Y=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,K=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Z=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q=/[\\^$.*+?()[\]{}|]/g,ee=RegExp(Q.source),te=/^\s+/,ne=/\s/,re=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ie=/\{\n\/\* \[wrapped with (.+)\] \*/,oe=/,? & /,ae=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,se=/[()=,{}\[\]\/\s]/,le=/\\(\\)?/g,ce=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ue=/\w*$/,de=/^[-+]0x[0-9a-f]+$/i,he=/^0b[01]+$/i,fe=/^\[object .+?Constructor\]$/,pe=/^0o[0-7]+$/i,ge=/^(?:0|[1-9]\d*)$/,me=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ve=/($^)/,ye=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xe="\\u2700-\\u27bf",Ce="a-z\\xdf-\\xf6\\xf8-\\xff",_e="A-Z\\xc0-\\xd6\\xd8-\\xde",Se="\\ufe0e\\ufe0f",ke="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ae="["+be+"]",je="["+ke+"]",Ee="["+we+"]",Ie="\\d+",Te="["+xe+"]",Oe="["+Ce+"]",Fe="[^"+be+ke+Ie+xe+Ce+_e+"]",Pe="\\ud83c[\\udffb-\\udfff]",Me="[^"+be+"]",Re="(?:\\ud83c[\\udde6-\\uddff]){2}",Le="[\\ud800-\\udbff][\\udc00-\\udfff]",De="["+_e+"]",Ne="\\u200d",ze="(?:"+Oe+"|"+Fe+")",Be="(?:"+De+"|"+Fe+")",Ve="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ue="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",We="(?:"+Ee+"|"+Pe+")?",He="["+Se+"]?",$e=He+We+"(?:"+Ne+"(?:"+[Me,Re,Le].join("|")+")"+He+We+")*",Ge="(?:"+[Te,Re,Le].join("|")+")"+$e,Ye="(?:"+[Me+Ee+"?",Ee,Re,Le,Ae].join("|")+")",qe=RegExp("['\u2019]","g"),Xe=RegExp(Ee,"g"),Ke=RegExp(Pe+"(?="+Pe+")|"+Ye+$e,"g"),Ze=RegExp([De+"?"+Oe+"+"+Ve+"(?="+[je,De,"$"].join("|")+")",Be+"+"+Ue+"(?="+[je,De+ze,"$"].join("|")+")",De+"?"+ze+"+"+Ve,De+"+"+Ue,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ie,Ge].join("|"),"g"),Je=RegExp("["+Ne+be+we+Se+"]"),Qe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,et=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tt=-1,nt={};nt[O]=nt[F]=nt[P]=nt[M]=nt[R]=nt[L]=nt[D]=nt[N]=nt[z]=!0,nt[f]=nt[p]=nt[I]=nt[g]=nt[T]=nt[m]=nt[v]=nt[y]=nt[w]=nt[x]=nt[C]=nt[S]=nt[k]=nt[A]=nt[E]=!1;var rt={};rt[f]=rt[p]=rt[I]=rt[T]=rt[g]=rt[m]=rt[O]=rt[F]=rt[P]=rt[M]=rt[R]=rt[w]=rt[x]=rt[C]=rt[S]=rt[k]=rt[A]=rt[j]=rt[L]=rt[D]=rt[N]=rt[z]=!0,rt[v]=rt[y]=rt[E]=!1;var it={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,st="object"==typeof Xt&&Xt&&Xt.Object===Object&&Xt,lt="object"==typeof self&&self&&self.Object===Object&&self,ct=st||lt||Function("return this")(),ut=t&&!t.nodeType&&t,dt=ut&&e&&!e.nodeType&&e,ht=dt&&dt.exports===ut,ft=ht&&st.process,pt=function(){try{return dt&&dt.require&&dt.require("util").types||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),gt=pt&&pt.isArrayBuffer,mt=pt&&pt.isDate,vt=pt&&pt.isMap,yt=pt&&pt.isRegExp,bt=pt&&pt.isSet,wt=pt&&pt.isTypedArray;function xt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Ct(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function _t(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function St(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function kt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function At(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function jt(e,t){return!(null==e||!e.length)&&Dt(e,t,0)>-1}function Et(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function It(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function Tt(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function Ot(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Ft(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function Pt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var Mt=Vt("length");function Rt(e,t,n){var r;return n(e,function(e,n,i){if(t(e,n,i))return r=n,!1}),r}function Lt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Dt(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):Lt(e,zt,n)}function Nt(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function zt(e){return e!=e}function Bt(e,t){var n=null==e?0:e.length;return n?Ht(e,t)/n:u}function Vt(e){return function(t){return null==t?n:t[e]}}function Ut(e){return function(t){return null==e?n:e[t]}}function Wt(e,t,n,r,i){return i(e,function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)}),n}function Ht(e,t){for(var r,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==n&&(r=r===n?a:r+a)}return r}function $t(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Gt(e){return e?e.slice(0,un(e)+1).replace(te,""):e}function Yt(e){return function(t){return e(t)}}function qt(e,t){return It(t,function(t){return e[t]})}function Kt(e,t){return e.has(t)}function Zt(e,t){for(var n=-1,r=e.length;++n<r&&Dt(t,e[n],0)>-1;);return n}function Jt(e,t){for(var n=e.length;n--&&Dt(t,e[n],0)>-1;);return n}var Qt=Ut({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),en=Ut({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function tn(e){return"\\"+it[e]}function nn(e){return Je.test(e)}function rn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function on(e,t){return function(n){return e(t(n))}}function an(e,t){for(var n=-1,r=e.length,i=0,a=[];++n<r;){var s=e[n];s!==t&&s!==o||(e[n]=o,a[i++]=n)}return a}function sn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function ln(e){return nn(e)?function(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}(e):Mt(e)}function cn(e){return nn(e)?function(e){return e.match(Ke)||[]}(e):function(e){return e.split("")}(e)}function un(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t}var dn=Ut({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hn=function e(t){var ne,be=(t=null==t?ct:hn.defaults(ct.Object(),t,hn.pick(ct,et))).Array,we=t.Date,xe=t.Error,Ce=t.Function,_e=t.Math,Se=t.Object,ke=t.RegExp,Ae=t.String,je=t.TypeError,Ee=be.prototype,Ie=Ce.prototype,Te=Se.prototype,Oe=t["__core-js_shared__"],Fe=Ie.toString,Pe=Te.hasOwnProperty,Me=0,Re=(ne=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+ne:"",Le=Te.toString,De=Fe.call(Se),Ne=ct._,ze=ke("^"+Fe.call(Pe).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=ht?t.Buffer:n,Ve=t.Symbol,Ue=t.Uint8Array,We=Be?Be.allocUnsafe:n,He=on(Se.getPrototypeOf,Se),$e=Se.create,Ge=Te.propertyIsEnumerable,Ye=Ee.splice,Ke=Ve?Ve.isConcatSpreadable:n,Je=Ve?Ve.iterator:n,it=Ve?Ve.toStringTag:n,st=function(){try{var e=so(Se,"defineProperty");return e({},"",{}),e}catch(e){}}(),lt=t.clearTimeout!==ct.clearTimeout&&t.clearTimeout,ut=we&&we.now!==ct.Date.now&&we.now,dt=t.setTimeout!==ct.setTimeout&&t.setTimeout,ft=_e.ceil,pt=_e.floor,Mt=Se.getOwnPropertySymbols,Ut=Be?Be.isBuffer:n,Xt=t.isFinite,fn=Ee.join,pn=on(Se.keys,Se),gn=_e.max,mn=_e.min,vn=we.now,yn=t.parseInt,bn=_e.random,wn=Ee.reverse,xn=so(t,"DataView"),Cn=so(t,"Map"),_n=so(t,"Promise"),Sn=so(t,"Set"),kn=so(t,"WeakMap"),An=so(Se,"create"),jn=kn&&new kn,En={},In=Mo(xn),Tn=Mo(Cn),On=Mo(_n),Fn=Mo(Sn),Pn=Mo(kn),Mn=Ve?Ve.prototype:n,Rn=Mn?Mn.valueOf:n,Ln=Mn?Mn.toString:n;function Dn(e){if(Za(e)&&!Ba(e)&&!(e instanceof Vn)){if(e instanceof Bn)return e;if(Pe.call(e,"__wrapped__"))return Ro(e)}return new Bn(e)}var Nn=function(){function e(){}return function(t){if(!Ka(t))return{};if($e)return $e(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function zn(){}function Bn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Vn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=d,this.__views__=[]}function Un(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Hn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Hn;++t<n;)this.add(e[t])}function Gn(e){var t=this.__data__=new Wn(e);this.size=t.size}function Yn(e,t){var n=Ba(e),r=!n&&za(e),i=!n&&!r&&Ha(e),o=!n&&!r&&!i&&os(e),a=n||r||i||o,s=a?$t(e.length,Ae):[],l=s.length;for(var c in e)!t&&!Pe.call(e,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||go(c,l))||s.push(c);return s}function qn(e){var t=e.length;return t?e[Hr(0,t-1)]:n}function Xn(e,t){return Oo(ki(e),ir(t,0,e.length))}function Kn(e){return Oo(ki(e))}function Zn(e,t,r){(r!==n&&!La(e[t],r)||r===n&&!(t in e))&&nr(e,t,r)}function Jn(e,t,r){var i=e[t];Pe.call(e,t)&&La(i,r)&&(r!==n||t in e)||nr(e,t,r)}function Qn(e,t){for(var n=e.length;n--;)if(La(e[n][0],t))return n;return-1}function er(e,t,n,r){return cr(e,function(e,i,o){t(r,e,n(e),o)}),r}function tr(e,t){return e&&Ai(t,js(t),e)}function nr(e,t,n){"__proto__"==t&&st?st(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function rr(e,t){for(var r=-1,i=t.length,o=be(i),a=null==e;++r<i;)o[r]=a?n:Cs(e,t[r]);return o}function ir(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function or(e,t,r,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(r&&(s=o?r(e,i,o,a):r(e)),s!==n)return s;if(!Ka(e))return e;var d=Ba(e);if(d){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Pe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return ki(e,s)}else{var h=uo(e),p=h==y||h==b;if(Ha(e))return bi(e,l);if(h==C||h==f||p&&!o){if(s=c||p?{}:fo(e),!l)return c?function(e,t){return Ai(e,co(e),t)}(e,function(e,t){return e&&Ai(t,Es(t),e)}(s,e)):function(e,t){return Ai(e,lo(e),t)}(e,tr(s,e))}else{if(!rt[h])return o?e:{};s=function(e,t,n){var r,i=e.constructor;switch(t){case I:return wi(e);case g:case m:return new i(+e);case T:return function(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case O:case F:case P:case M:case R:case L:case D:case N:case z:return xi(e,n);case w:return new i;case x:case A:return new i(e);case S:return function(e){var t=new e.constructor(e.source,ue.exec(e));return t.lastIndex=e.lastIndex,t}(e);case k:return new i;case j:return r=e,Rn?Se(Rn.call(r)):{}}}(e,h,l)}}a||(a=new Gn);var v=a.get(e);if(v)return v;a.set(e,s),ns(e)?e.forEach(function(n){s.add(or(n,t,r,n,e,a))}):Ja(e)&&e.forEach(function(n,i){s.set(i,or(n,t,r,i,e,a))});var _=d?n:(u?c?eo:Qi:c?Es:js)(e);return _t(_||e,function(n,i){_&&(n=e[i=n]),Jn(s,i,or(n,t,r,i,e,a))}),s}function ar(e,t,r){var i=r.length;if(null==e)return!i;for(e=Se(e);i--;){var o=r[i],a=t[o],s=e[o];if(s===n&&!(o in e)||!a(s))return!1}return!0}function sr(e,t,i){if("function"!=typeof e)throw new je(r);return jo(function(){e.apply(n,i)},t)}function lr(e,t,n,r){var i=-1,o=jt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=It(t,Yt(n))),r?(o=Et,a=!1):t.length>=200&&(o=Kt,a=!1,t=new $n(t));e:for(;++i<s;){var u=e[i],d=null==n?u:n(u);if(u=r||0!==u?u:0,a&&d==d){for(var h=c;h--;)if(t[h]===d)continue e;l.push(u)}else o(t,d,r)||l.push(u)}return l}Dn.templateSettings={escape:Y,evaluate:q,interpolate:X,variable:"",imports:{_:Dn}},Dn.prototype=zn.prototype,Dn.prototype.constructor=Dn,Bn.prototype=Nn(zn.prototype),Bn.prototype.constructor=Bn,Vn.prototype=Nn(zn.prototype),Vn.prototype.constructor=Vn,Un.prototype.clear=function(){this.__data__=An?An(null):{},this.size=0},Un.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Un.prototype.get=function(e){var t=this.__data__;if(An){var r=t[e];return r===i?n:r}return Pe.call(t,e)?t[e]:n},Un.prototype.has=function(e){var t=this.__data__;return An?t[e]!==n:Pe.call(t,e)},Un.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=An&&t===n?i:t,this},Wn.prototype.clear=function(){this.__data__=[],this.size=0},Wn.prototype.delete=function(e){var t=this.__data__,n=Qn(t,e);return!(n<0||(n==t.length-1?t.pop():Ye.call(t,n,1),--this.size,0))},Wn.prototype.get=function(e){var t=this.__data__,r=Qn(t,e);return r<0?n:t[r][1]},Wn.prototype.has=function(e){return Qn(this.__data__,e)>-1},Wn.prototype.set=function(e,t){var n=this.__data__,r=Qn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Hn.prototype.clear=function(){this.size=0,this.__data__={hash:new Un,map:new(Cn||Wn),string:new Un}},Hn.prototype.delete=function(e){var t=oo(this,e).delete(e);return this.size-=t?1:0,t},Hn.prototype.get=function(e){return oo(this,e).get(e)},Hn.prototype.has=function(e){return oo(this,e).has(e)},Hn.prototype.set=function(e,t){var n=oo(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},$n.prototype.add=$n.prototype.push=function(e){return this.__data__.set(e,i),this},$n.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Gn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Gn.prototype.get=function(e){return this.__data__.get(e)},Gn.prototype.has=function(e){return this.__data__.has(e)},Gn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!Cn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Hn(r)}return n.set(e,t),this.size=n.size,this};var cr=Ii(vr),ur=Ii(yr,!0);function dr(e,t){var n=!0;return cr(e,function(e,r,i){return n=!!t(e,r,i)}),n}function hr(e,t,r){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===n?s==s&&!is(s):r(s,l)))var l=s,c=a}return c}function fr(e,t){var n=[];return cr(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function pr(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=po),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?pr(s,t-1,n,r,i):Tt(i,s):r||(i[i.length]=s)}return i}var gr=Ti(),mr=Ti(!0);function vr(e,t){return e&&gr(e,t,js)}function yr(e,t){return e&&mr(e,t,js)}function br(e,t){return At(t,function(t){return Ya(e[t])})}function wr(e,t){for(var r=0,i=(t=gi(t,e)).length;null!=e&&r<i;)e=e[Po(t[r++])];return r&&r==i?e:n}function xr(e,t,n){var r=t(e);return Ba(e)?r:Tt(r,n(e))}function Cr(e){return null==e?e===n?"[object Undefined]":"[object Null]":it&&it in Se(e)?function(e){var t=Pe.call(e,it),r=e[it];try{e[it]=n;var i=!0}catch(e){}var o=Le.call(e);return i&&(t?e[it]=r:delete e[it]),o}(e):function(e){return Le.call(e)}(e)}function _r(e,t){return e>t}function Sr(e,t){return null!=e&&Pe.call(e,t)}function kr(e,t){return null!=e&&t in Se(e)}function Ar(e,t,r){for(var i=r?Et:jt,o=e[0].length,a=e.length,s=a,l=be(a),c=1/0,u=[];s--;){var d=e[s];s&&t&&(d=It(d,Yt(t))),c=mn(d.length,c),l[s]=!r&&(t||o>=120&&d.length>=120)?new $n(s&&d):n}d=e[0];var h=-1,f=l[0];e:for(;++h<o&&u.length<c;){var p=d[h],g=t?t(p):p;if(p=r||0!==p?p:0,!(f?Kt(f,g):i(u,g,r))){for(s=a;--s;){var m=l[s];if(!(m?Kt(m,g):i(e[s],g,r)))continue e}f&&f.push(g),u.push(p)}}return u}function jr(e,t,r){var i=null==(e=So(e,t=gi(t,e)))?e:e[Po(Go(t))];return null==i?n:xt(i,e,r)}function Er(e){return Za(e)&&Cr(e)==f}function Ir(e,t,r,i,o){return e===t||(null==e||null==t||!Za(e)&&!Za(t)?e!=e&&t!=t:function(e,t,r,i,o,a){var s=Ba(e),l=Ba(t),c=s?p:uo(e),u=l?p:uo(t),d=(c=c==f?C:c)==C,h=(u=u==f?C:u)==C,y=c==u;if(y&&Ha(e)){if(!Ha(t))return!1;s=!0,d=!1}if(y&&!d)return a||(a=new Gn),s||os(e)?Zi(e,t,r,i,o,a):function(e,t,n,r,i,o,a){switch(n){case T:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case I:return!(e.byteLength!=t.byteLength||!o(new Ue(e),new Ue(t)));case g:case m:case x:return La(+e,+t);case v:return e.name==t.name&&e.message==t.message;case S:case A:return e==t+"";case w:var s=rn;case k:var l=1&r;if(s||(s=sn),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var u=Zi(s(e),s(t),r,i,o,a);return a.delete(e),u;case j:if(Rn)return Rn.call(e)==Rn.call(t)}return!1}(e,t,c,r,i,o,a);if(!(1&r)){var b=d&&Pe.call(e,"__wrapped__"),_=h&&Pe.call(t,"__wrapped__");if(b||_){var E=b?e.value():e,O=_?t.value():t;return a||(a=new Gn),o(E,O,r,i,a)}}return!!y&&(a||(a=new Gn),function(e,t,r,i,o,a){var s=1&r,l=Qi(e),c=l.length;if(c!=Qi(t).length&&!s)return!1;for(var u=c;u--;){var d=l[u];if(!(s?d in t:Pe.call(t,d)))return!1}var h=a.get(e),f=a.get(t);if(h&&f)return h==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var g=s;++u<c;){var m=e[d=l[u]],v=t[d];if(i)var y=s?i(v,m,d,t,e,a):i(m,v,d,e,t,a);if(!(y===n?m===v||o(m,v,r,i,a):y)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,r,i,o,a))}(e,t,r,i,Ir,o))}function Tr(e,t,r,i){var o=r.length,a=o,s=!i;if(null==e)return!a;for(e=Se(e);o--;){var l=r[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=r[o])[0],u=e[c],d=l[1];if(s&&l[2]){if(u===n&&!(c in e))return!1}else{var h=new Gn;if(i)var f=i(u,d,c,e,t,h);if(!(f===n?Ir(d,u,3,i,h):f))return!1}}return!0}function Or(e){return!(!Ka(e)||(t=e,Re&&Re in t))&&(Ya(e)?ze:fe).test(Mo(e));var t}function Fr(e){return"function"==typeof e?e:null==e?Qs:"object"==typeof e?Ba(e)?Dr(e[0],e[1]):Lr(e):ll(e)}function Pr(e){if(!wo(e))return pn(e);var t=[];for(var n in Se(e))Pe.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Mr(e,t){return e<t}function Rr(e,t){var n=-1,r=Ua(e)?be(e.length):[];return cr(e,function(e,i,o){r[++n]=t(e,i,o)}),r}function Lr(e){var t=ao(e);return 1==t.length&&t[0][2]?Co(t[0][0],t[0][1]):function(n){return n===e||Tr(n,e,t)}}function Dr(e,t){return vo(e)&&xo(t)?Co(Po(e),t):function(r){var i=Cs(r,e);return i===n&&i===t?_s(r,e):Ir(t,i,3)}}function Nr(e,t,r,i,o){e!==t&&gr(t,function(a,s){if(o||(o=new Gn),Ka(a))!function(e,t,r,i,o,a,s){var l=ko(e,r),c=ko(t,r),u=s.get(c);if(u)Zn(e,r,u);else{var d=a?a(l,c,r+"",e,t,s):n,h=d===n;if(h){var f=Ba(c),p=!f&&Ha(c),g=!f&&!p&&os(c);d=c,f||p||g?Ba(l)?d=l:Wa(l)?d=ki(l):p?(h=!1,d=bi(c,!0)):g?(h=!1,d=xi(c,!0)):d=[]:es(c)||za(c)?(d=l,za(l)?d=fs(l):Ka(l)&&!Ya(l)||(d=fo(c))):h=!1}h&&(s.set(c,d),o(d,c,i,a,s),s.delete(c)),Zn(e,r,d)}}(e,t,s,r,Nr,i,o);else{var l=i?i(ko(e,s),a,s+"",e,t,o):n;l===n&&(l=a),Zn(e,s,l)}},Es)}function zr(e,t){var r=e.length;if(r)return go(t+=t<0?r:0,r)?e[t]:n}function Br(e,t,n){t=t.length?It(t,function(e){return Ba(e)?function(t){return wr(t,1===e.length?e[0]:e)}:e}):[Qs];var r=-1;t=It(t,Yt(io()));var i=Rr(e,function(e,n,i){var o=It(t,function(t){return t(e)});return{criteria:o,index:++r,value:e}});return function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(i,function(e,t){return function(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){var l=Ci(i[r],o[r]);if(l)return r>=s?l:l*("desc"==n[r]?-1:1)}return e.index-t.index}(e,t,n)})}function Vr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=wr(e,a);n(s,a)&&Xr(o,gi(a,e),s)}return o}function Ur(e,t,n,r){var i=r?Nt:Dt,o=-1,a=t.length,s=e;for(e===t&&(t=ki(t)),n&&(s=It(e,Yt(n)));++o<a;)for(var l=0,c=t[o],u=n?n(c):c;(l=i(s,u,l,r))>-1;)s!==e&&Ye.call(s,l,1),Ye.call(e,l,1);return e}function Wr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;go(i)?Ye.call(e,i,1):si(e,i)}}return e}function Hr(e,t){return e+pt(bn()*(t-e+1))}function $r(e,t){var n="";if(!e||t<1||t>c)return n;do{t%2&&(n+=e),(t=pt(t/2))&&(e+=e)}while(t);return n}function Gr(e,t){return Eo(_o(e,t,Qs),e+"")}function Yr(e){return qn(Ls(e))}function qr(e,t){var n=Ls(e);return Oo(n,ir(t,0,n.length))}function Xr(e,t,r,i){if(!Ka(e))return e;for(var o=-1,a=(t=gi(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Po(t[o]),u=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var d=l[c];(u=i?i(d,c,l):n)===n&&(u=Ka(d)?d:go(t[o+1])?[]:{})}Jn(l,c,u),l=l[c]}return e}var Kr=jn?function(e,t){return jn.set(e,t),e}:Qs,Zr=st?function(e,t){return st(e,"toString",{configurable:!0,enumerable:!1,value:Ks(t),writable:!0})}:Qs;function Jr(e){return Oo(Ls(e))}function Qr(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=be(i);++r<i;)o[r]=e[r+t];return o}function ei(e,t){var n;return cr(e,function(e,r,i){return!(n=t(e,r,i))}),!!n}function ti(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!is(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return ni(e,t,Qs,n)}function ni(e,t,r,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=r(t))!=t,l=null===t,c=is(t),u=t===n;o<a;){var d=pt((o+a)/2),h=r(e[d]),f=h!==n,p=null===h,g=h==h,m=is(h);if(s)var v=i||g;else v=u?g&&(i||f):l?g&&f&&(i||!p):c?g&&f&&!p&&(i||!m):!p&&!m&&(i?h<=t:h<t);v?o=d+1:a=d}return mn(a,4294967294)}function ri(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!La(s,l)){var l=s;o[i++]=0===a?0:a}}return o}function ii(e){return"number"==typeof e?e:is(e)?u:+e}function oi(e){if("string"==typeof e)return e;if(Ba(e))return It(e,oi)+"";if(is(e))return Ln?Ln.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function ai(e,t,n){var r=-1,i=jt,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=Et;else if(o>=200){var c=t?null:$i(e);if(c)return sn(c);a=!1,i=Kt,l=new $n}else l=t?[]:s;e:for(;++r<o;){var u=e[r],d=t?t(u):u;if(u=n||0!==u?u:0,a&&d==d){for(var h=l.length;h--;)if(l[h]===d)continue e;t&&l.push(d),s.push(u)}else i(l,d,n)||(l!==s&&l.push(d),s.push(u))}return s}function si(e,t){return null==(e=So(e,t=gi(t,e)))||delete e[Po(Go(t))]}function li(e,t,n,r){return Xr(e,t,n(wr(e,t)),r)}function ci(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Qr(e,r?0:o,r?o+1:i):Qr(e,r?o+1:0,r?i:o)}function ui(e,t){var n=e;return n instanceof Vn&&(n=n.value()),Ot(t,function(e,t){return t.func.apply(t.thisArg,Tt([e],t.args))},n)}function di(e,t,n){var r=e.length;if(r<2)return r?ai(e[0]):[];for(var i=-1,o=be(r);++i<r;)for(var a=e[i],s=-1;++s<r;)s!=i&&(o[i]=lr(o[i]||a,e[s],t,n));return ai(pr(o,1),t,n)}function hi(e,t,r){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:n;r(s,e[i],l)}return s}function fi(e){return Wa(e)?e:[]}function pi(e){return"function"==typeof e?e:Qs}function gi(e,t){return Ba(e)?e:vo(e,t)?[e]:Fo(ps(e))}var mi=Gr;function vi(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:Qr(e,t,r)}var yi=lt||function(e){return ct.clearTimeout(e)};function bi(e,t){if(t)return e.slice();var n=e.length,r=We?We(n):new e.constructor(n);return e.copy(r),r}function wi(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function xi(e,t){var n=t?wi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Ci(e,t){if(e!==t){var r=e!==n,i=null===e,o=e==e,a=is(e),s=t!==n,l=null===t,c=t==t,u=is(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!r&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&r&&o&&!i&&!a||l&&r&&o||!s&&o||!c)return-1}return 0}function _i(e,t,n,r){for(var i=-1,o=e.length,a=n.length,s=-1,l=t.length,c=gn(o-a,0),u=be(l+c),d=!r;++s<l;)u[s]=t[s];for(;++i<a;)(d||i<o)&&(u[n[i]]=e[i]);for(;c--;)u[s++]=e[i++];return u}function Si(e,t,n,r){for(var i=-1,o=e.length,a=-1,s=n.length,l=-1,c=t.length,u=gn(o-s,0),d=be(u+c),h=!r;++i<u;)d[i]=e[i];for(var f=i;++l<c;)d[f+l]=t[l];for(;++a<s;)(h||i<o)&&(d[f+n[a]]=e[i++]);return d}function ki(e,t){var n=-1,r=e.length;for(t||(t=be(r));++n<r;)t[n]=e[n];return t}function Ai(e,t,r,i){var o=!r;r||(r={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(r[l],e[l],l,r,e):n;c===n&&(c=e[l]),o?nr(r,l,c):Jn(r,l,c)}return r}function ji(e,t){return function(n,r){var i=Ba(n)?Ct:er,o=t?t():{};return i(n,e,io(r,2),o)}}function Ei(e){return Gr(function(t,r){var i=-1,o=r.length,a=o>1?r[o-1]:n,s=o>2?r[2]:n;for(a=e.length>3&&"function"==typeof a?(o--,a):n,s&&mo(r[0],r[1],s)&&(a=o<3?n:a,o=1),t=Se(t);++i<o;){var l=r[i];l&&e(t,l,i,a)}return t})}function Ii(e,t){return function(n,r){if(null==n)return n;if(!Ua(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Se(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ti(e){return function(t,n,r){for(var i=-1,o=Se(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(!1===n(o[l],l,o))break}return t}}function Oi(e){return function(t){var r=nn(t=ps(t))?cn(t):n,i=r?r[0]:t.charAt(0),o=r?vi(r,1).join(""):t.slice(1);return i[e]()+o}}function Fi(e){return function(t){return Ot(Ys(zs(t).replace(qe,"")),e,"")}}function Pi(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Nn(e.prototype),r=e.apply(n,t);return Ka(r)?r:n}}function Mi(e){return function(t,r,i){var o=Se(t);if(!Ua(t)){var a=io(r,3);t=js(t),r=function(e){return a(o[e],e,o)}}var s=e(t,r,i);return s>-1?o[a?t[s]:s]:n}}function Ri(e){return Ji(function(t){var i=t.length,o=i,a=Bn.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new je(r);if(a&&!l&&"wrapper"==no(s))var l=new Bn([],!0)}for(o=l?o:i;++o<i;){var c=no(s=t[o]),u="wrapper"==c?to(s):n;l=u&&yo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[no(u[0])].apply(l,u[3]):1==s.length&&yo(s)?l[c]():l.thru(s)}return function(){var e=arguments,n=e[0];if(l&&1==e.length&&Ba(n))return l.plant(n).value();for(var r=0,o=i?t[r].apply(this,e):n;++r<i;)o=t[r].call(this,o);return o}})}function Li(e,t,r,i,o,a,l,c,u,d){var h=t&s,f=1&t,p=2&t,g=24&t,m=512&t,v=p?n:Pi(e);return function s(){for(var y=arguments.length,b=be(y),w=y;w--;)b[w]=arguments[w];if(g)var x=ro(s),C=function(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}(b,x);if(i&&(b=_i(b,i,o,g)),a&&(b=Si(b,a,l,g)),y-=C,g&&y<d){var _=an(b,x);return Wi(e,t,Li,s.placeholder,r,b,_,c,u,d-y)}var S=f?r:this,k=p?S[e]:e;return y=b.length,c?b=function(e,t){for(var r=e.length,i=mn(t.length,r),o=ki(e);i--;){var a=t[i];e[i]=go(a,r)?o[a]:n}return e}(b,c):m&&y>1&&b.reverse(),h&&u<y&&(b.length=u),this&&this!==ct&&this instanceof s&&(k=v||Pi(k)),k.apply(S,b)}}function Di(e,t){return function(n,r){return function(e,t,n,r){return vr(e,function(e,i,o){t(r,n(e),i,o)}),r}(n,e,t(r),{})}}function Ni(e,t){return function(r,i){var o;if(r===n&&i===n)return t;if(r!==n&&(o=r),i!==n){if(o===n)return i;"string"==typeof r||"string"==typeof i?(r=oi(r),i=oi(i)):(r=ii(r),i=ii(i)),o=e(r,i)}return o}}function zi(e){return Ji(function(t){return t=It(t,Yt(io())),Gr(function(n){var r=this;return e(t,function(e){return xt(e,r,n)})})})}function Bi(e,t){var r=(t=t===n?" ":oi(t)).length;if(r<2)return r?$r(t,e):t;var i=$r(t,ft(e/ln(t)));return nn(t)?vi(cn(i),0,e).join(""):i.slice(0,e)}function Vi(e){return function(t,r,i){return i&&"number"!=typeof i&&mo(t,r,i)&&(r=i=n),t=cs(t),r===n?(r=t,t=0):r=cs(r),function(e,t,n,r){for(var i=-1,o=gn(ft((t-e)/(n||1)),0),a=be(o);o--;)a[r?o:++i]=e,e+=n;return a}(t,r,i=i===n?t<r?1:-1:cs(i),e)}}function Ui(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=hs(t),n=hs(n)),e(t,n)}}function Wi(e,t,r,i,o,s,l,c,u,d){var h=8&t;t|=h?a:64,4&(t&=~(h?64:a))||(t&=-4);var f=[e,t,o,h?s:n,h?l:n,h?n:s,h?n:l,c,u,d],p=r.apply(n,f);return yo(e)&&Ao(p,f),p.placeholder=i,Io(p,e,t)}function Hi(e){var t=_e[e];return function(e,n){if(e=hs(e),(n=null==n?0:mn(us(n),292))&&Xt(e)){var r=(ps(e)+"e").split("e");return+((r=(ps(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var $i=Sn&&1/sn(new Sn([,-0]))[1]==l?function(e){return new Sn(e)}:il;function Gi(e){return function(t){var n=uo(t);return n==w?rn(t):n==k?function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}(t):function(e,t){return It(t,function(t){return[t,e[t]]})}(t,e(t))}}function Yi(e,t,i,l,c,u,d,h){var f=2&t;if(!f&&"function"!=typeof e)throw new je(r);var p=l?l.length:0;if(p||(t&=-97,l=c=n),d=d===n?d:gn(us(d),0),h=h===n?h:us(h),p-=c?c.length:0,64&t){var g=l,m=c;l=c=n}var v=f?n:to(e),y=[e,t,i,l,c,g,m,u,d,h];if(v&&function(e,t){var n=e[1],r=t[1],i=n|r,a=i<131,l=r==s&&8==n||r==s&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!a&&!l)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var c=t[3];if(c){var u=e[3];e[3]=u?_i(u,c,t[4]):c,e[4]=u?an(e[3],o):t[4]}(c=t[5])&&(u=e[5],e[5]=u?Si(u,c,t[6]):c,e[6]=u?an(e[5],o):t[6]),(c=t[7])&&(e[7]=c),r&s&&(e[8]=null==e[8]?t[8]:mn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i}(y,v),e=y[0],t=y[1],i=y[2],l=y[3],c=y[4],!(h=y[9]=y[9]===n?f?0:e.length:gn(y[9]-p,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||16==t?function(e,t,r){var i=Pi(e);return function o(){for(var a=arguments.length,s=be(a),l=a,c=ro(o);l--;)s[l]=arguments[l];var u=a<3&&s[0]!==c&&s[a-1]!==c?[]:an(s,c);return(a-=u.length)<r?Wi(e,t,Li,o.placeholder,n,s,u,n,n,r-a):xt(this&&this!==ct&&this instanceof o?i:e,this,s)}}(e,t,h):t!=a&&33!=t||c.length?Li.apply(n,y):function(e,t,n,r){var i=1&t,o=Pi(e);return function t(){for(var a=-1,s=arguments.length,l=-1,c=r.length,u=be(c+s),d=this&&this!==ct&&this instanceof t?o:e;++l<c;)u[l]=r[l];for(;s--;)u[l++]=arguments[++a];return xt(d,i?n:this,u)}}(e,t,i,l);else var b=function(e,t,n){var r=1&t,i=Pi(e);return function t(){return(this&&this!==ct&&this instanceof t?i:e).apply(r?n:this,arguments)}}(e,t,i);return Io((v?Kr:Ao)(b,y),e,t)}function qi(e,t,r,i){return e===n||La(e,Te[r])&&!Pe.call(i,r)?t:e}function Xi(e,t,r,i,o,a){return Ka(e)&&Ka(t)&&(a.set(t,e),Nr(e,t,n,Xi,a),a.delete(t)),e}function Ki(e){return es(e)?n:e}function Zi(e,t,r,i,o,a){var s=1&r,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),d=a.get(t);if(u&&d)return u==t&&d==e;var h=-1,f=!0,p=2&r?new $n:n;for(a.set(e,t),a.set(t,e);++h<l;){var g=e[h],m=t[h];if(i)var v=s?i(m,g,h,t,e,a):i(g,m,h,e,t,a);if(v!==n){if(v)continue;f=!1;break}if(p){if(!Pt(t,function(e,t){if(!Kt(p,t)&&(g===e||o(g,e,r,i,a)))return p.push(t)})){f=!1;break}}else if(g!==m&&!o(g,m,r,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function Ji(e){return Eo(_o(e,n,Vo),e+"")}function Qi(e){return xr(e,js,lo)}function eo(e){return xr(e,Es,co)}var to=jn?function(e){return jn.get(e)}:il;function no(e){for(var t=e.name+"",n=En[t],r=Pe.call(En,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function ro(e){return(Pe.call(Dn,"placeholder")?Dn:e).placeholder}function io(){var e=Dn.iteratee||el;return e=e===el?Fr:e,arguments.length?e(arguments[0],arguments[1]):e}function oo(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function ao(e){for(var t=js(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,xo(i)]}return t}function so(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Or(r)?r:n}var lo=Mt?function(e){return null==e?[]:(e=Se(e),At(Mt(e),function(t){return Ge.call(e,t)}))}:dl,co=Mt?function(e){for(var t=[];e;)Tt(t,lo(e)),e=He(e);return t}:dl,uo=Cr;function ho(e,t,n){for(var r=-1,i=(t=gi(t,e)).length,o=!1;++r<i;){var a=Po(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Xa(i)&&go(a,i)&&(Ba(e)||za(e))}function fo(e){return"function"!=typeof e.constructor||wo(e)?{}:Nn(He(e))}function po(e){return Ba(e)||za(e)||!!(Ke&&e&&e[Ke])}function go(e,t){var n=typeof e;return!!(t=null==t?c:t)&&("number"==n||"symbol"!=n&&ge.test(e))&&e>-1&&e%1==0&&e<t}function mo(e,t,n){if(!Ka(n))return!1;var r=typeof t;return!!("number"==r?Ua(n)&&go(t,n.length):"string"==r&&t in n)&&La(n[t],e)}function vo(e,t){if(Ba(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!is(e))||Z.test(e)||!K.test(e)||null!=t&&e in Se(t)}function yo(e){var t=no(e),n=Dn[t];if("function"!=typeof n||!(t in Vn.prototype))return!1;if(e===n)return!0;var r=to(n);return!!r&&e===r[0]}(xn&&uo(new xn(new ArrayBuffer(1)))!=T||Cn&&uo(new Cn)!=w||_n&&uo(_n.resolve())!=_||Sn&&uo(new Sn)!=k||kn&&uo(new kn)!=E)&&(uo=function(e){var t=Cr(e),r=t==C?e.constructor:n,i=r?Mo(r):"";if(i)switch(i){case In:return T;case Tn:return w;case On:return _;case Fn:return k;case Pn:return E}return t});var bo=Oe?Ya:hl;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Te)}function xo(e){return e==e&&!Ka(e)}function Co(e,t){return function(r){return null!=r&&r[e]===t&&(t!==n||e in Se(r))}}function _o(e,t,r){return t=gn(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=gn(n.length-t,0),a=be(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=be(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),xt(e,this,s)}}function So(e,t){return t.length<2?e:wr(e,Qr(t,0,-1))}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ao=To(Kr),jo=dt||function(e,t){return ct.setTimeout(e,t)},Eo=To(Zr);function Io(e,t,n){var r=t+"";return Eo(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(re,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return _t(h,function(n){var r="_."+n[0];t&n[1]&&!jt(e,r)&&e.push(r)}),e.sort()}(function(e){var t=e.match(ie);return t?t[1].split(oe):[]}(r),n)))}function To(e){var t=0,r=0;return function(){var i=vn(),o=16-(i-r);if(r=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Oo(e,t){var r=-1,i=e.length,o=i-1;for(t=t===n?i:t;++r<t;){var a=Hr(r,o),s=e[a];e[a]=e[r],e[r]=s}return e.length=t,e}var Fo=function(){var e=Ta(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(J,function(e,n,r,i){t.push(r?i.replace(le,"$1"):n||e)}),t},function(e){return 500===t.size&&t.clear(),e}),t=e.cache;return e}();function Po(e){if("string"==typeof e||is(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Mo(e){if(null!=e){try{return Fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Ro(e){if(e instanceof Vn)return e.clone();var t=new Bn(e.__wrapped__,e.__chain__);return t.__actions__=ki(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Lo=Gr(function(e,t){return Wa(e)?lr(e,pr(t,1,Wa,!0)):[]}),Do=Gr(function(e,t){var r=Go(t);return Wa(r)&&(r=n),Wa(e)?lr(e,pr(t,1,Wa,!0),io(r,2)):[]}),No=Gr(function(e,t){var r=Go(t);return Wa(r)&&(r=n),Wa(e)?lr(e,pr(t,1,Wa,!0),n,r):[]});function zo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:us(n);return i<0&&(i=gn(r+i,0)),Lt(e,io(t,3),i)}function Bo(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return r!==n&&(o=us(r),o=r<0?gn(i+o,0):mn(o,i-1)),Lt(e,io(t,3),o,!0)}function Vo(e){return null!=e&&e.length?pr(e,1):[]}function Uo(e){return e&&e.length?e[0]:n}var Wo=Gr(function(e){var t=It(e,fi);return t.length&&t[0]===e[0]?Ar(t):[]}),Ho=Gr(function(e){var t=Go(e),r=It(e,fi);return t===Go(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Ar(r,io(t,2)):[]}),$o=Gr(function(e){var t=Go(e),r=It(e,fi);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?Ar(r,n,t):[]});function Go(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Yo=Gr(qo);function qo(e,t){return e&&e.length&&t&&t.length?Ur(e,t):e}var Xo=Ji(function(e,t){var n=null==e?0:e.length,r=rr(e,t);return Wr(e,It(t,function(e){return go(e,n)?+e:e}).sort(Ci)),r});function Ko(e){return null==e?e:wn.call(e)}var Zo=Gr(function(e){return ai(pr(e,1,Wa,!0))}),Jo=Gr(function(e){var t=Go(e);return Wa(t)&&(t=n),ai(pr(e,1,Wa,!0),io(t,2))}),Qo=Gr(function(e){var t=Go(e);return t="function"==typeof t?t:n,ai(pr(e,1,Wa,!0),n,t)});function ea(e){if(!e||!e.length)return[];var t=0;return e=At(e,function(e){if(Wa(e))return t=gn(e.length,t),!0}),$t(t,function(t){return It(e,Vt(t))})}function ta(e,t){if(!e||!e.length)return[];var r=ea(e);return null==t?r:It(r,function(e){return xt(t,n,e)})}var na=Gr(function(e,t){return Wa(e)?lr(e,t):[]}),ra=Gr(function(e){return di(At(e,Wa))}),ia=Gr(function(e){var t=Go(e);return Wa(t)&&(t=n),di(At(e,Wa),io(t,2))}),oa=Gr(function(e){var t=Go(e);return t="function"==typeof t?t:n,di(At(e,Wa),n,t)}),aa=Gr(ea),sa=Gr(function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,ta(e,r)});function la(e){var t=Dn(e);return t.__chain__=!0,t}function ca(e,t){return t(e)}var ua=Ji(function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,o=function(t){return rr(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Vn&&go(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:ca,args:[o],thisArg:n}),new Bn(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(n),e})):this.thru(o)}),da=ji(function(e,t,n){Pe.call(e,n)?++e[n]:nr(e,n,1)}),ha=Mi(zo),fa=Mi(Bo);function pa(e,t){return(Ba(e)?_t:cr)(e,io(t,3))}function ga(e,t){return(Ba(e)?St:ur)(e,io(t,3))}var ma=ji(function(e,t,n){Pe.call(e,n)?e[n].push(t):nr(e,n,[t])}),va=Gr(function(e,t,n){var r=-1,i="function"==typeof t,o=Ua(e)?be(e.length):[];return cr(e,function(e){o[++r]=i?xt(t,e,n):jr(e,t,n)}),o}),ya=ji(function(e,t,n){nr(e,n,t)});function ba(e,t){return(Ba(e)?It:Rr)(e,io(t,3))}var wa=ji(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),xa=Gr(function(e,t){if(null==e)return[];var n=t.length;return n>1&&mo(e,t[0],t[1])?t=[]:n>2&&mo(t[0],t[1],t[2])&&(t=[t[0]]),Br(e,pr(t,1),[])}),Ca=ut||function(){return ct.Date.now()};function _a(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Yi(e,s,n,n,n,n,t)}function Sa(e,t){var i;if("function"!=typeof t)throw new je(r);return e=us(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=n),i}}var ka=Gr(function(e,t,n){var r=1;if(n.length){var i=an(n,ro(ka));r|=a}return Yi(e,r,t,n,i)}),Aa=Gr(function(e,t,n){var r=3;if(n.length){var i=an(n,ro(Aa));r|=a}return Yi(t,r,e,n,i)});function ja(e,t,i){var o,a,s,l,c,u,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new je(r);function g(t){var r=o,i=a;return o=a=n,d=t,l=e.apply(i,r)}function m(e){var r=e-u;return u===n||r>=t||r<0||f&&e-d>=s}function v(){var e=Ca();if(m(e))return y(e);c=jo(v,function(e){var n=t-(e-u);return f?mn(n,s-(e-d)):n}(e))}function y(e){return c=n,p&&o?g(e):(o=a=n,l)}function b(){var e=Ca(),r=m(e);if(o=arguments,a=this,u=e,r){if(c===n)return function(e){return d=e,c=jo(v,t),h?g(e):l}(u);if(f)return yi(c),c=jo(v,t),g(u)}return c===n&&(c=jo(v,t)),l}return t=hs(t)||0,Ka(i)&&(h=!!i.leading,s=(f="maxWait"in i)?gn(hs(i.maxWait)||0,t):s,p="trailing"in i?!!i.trailing:p),b.cancel=function(){c!==n&&yi(c),d=0,o=u=a=c=n},b.flush=function(){return c===n?l:y(Ca())},b}var Ea=Gr(function(e,t){return sr(e,1,t)}),Ia=Gr(function(e,t,n){return sr(e,hs(t)||0,n)});function Ta(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new je(r);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ta.Cache||Hn),n}function Oa(e){if("function"!=typeof e)throw new je(r);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Ta.Cache=Hn;var Fa=mi(function(e,t){var n=(t=1==t.length&&Ba(t[0])?It(t[0],Yt(io())):It(pr(t,1),Yt(io()))).length;return Gr(function(r){for(var i=-1,o=mn(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return xt(e,this,r)})}),Pa=Gr(function(e,t){var r=an(t,ro(Pa));return Yi(e,a,n,t,r)}),Ma=Gr(function(e,t){var r=an(t,ro(Ma));return Yi(e,64,n,t,r)}),Ra=Ji(function(e,t){return Yi(e,256,n,n,n,t)});function La(e,t){return e===t||e!=e&&t!=t}var Da=Ui(_r),Na=Ui(function(e,t){return e>=t}),za=Er(function(){return arguments}())?Er:function(e){return Za(e)&&Pe.call(e,"callee")&&!Ge.call(e,"callee")},Ba=be.isArray,Va=gt?Yt(gt):function(e){return Za(e)&&Cr(e)==I};function Ua(e){return null!=e&&Xa(e.length)&&!Ya(e)}function Wa(e){return Za(e)&&Ua(e)}var Ha=Ut||hl,$a=mt?Yt(mt):function(e){return Za(e)&&Cr(e)==m};function Ga(e){if(!Za(e))return!1;var t=Cr(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!es(e)}function Ya(e){if(!Ka(e))return!1;var t=Cr(e);return t==y||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function qa(e){return"number"==typeof e&&e==us(e)}function Xa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function Ka(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Za(e){return null!=e&&"object"==typeof e}var Ja=vt?Yt(vt):function(e){return Za(e)&&uo(e)==w};function Qa(e){return"number"==typeof e||Za(e)&&Cr(e)==x}function es(e){if(!Za(e)||Cr(e)!=C)return!1;var t=He(e);if(null===t)return!0;var n=Pe.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Fe.call(n)==De}var ts=yt?Yt(yt):function(e){return Za(e)&&Cr(e)==S},ns=bt?Yt(bt):function(e){return Za(e)&&uo(e)==k};function rs(e){return"string"==typeof e||!Ba(e)&&Za(e)&&Cr(e)==A}function is(e){return"symbol"==typeof e||Za(e)&&Cr(e)==j}var os=wt?Yt(wt):function(e){return Za(e)&&Xa(e.length)&&!!nt[Cr(e)]},as=Ui(Mr),ss=Ui(function(e,t){return e<=t});function ls(e){if(!e)return[];if(Ua(e))return rs(e)?cn(e):ki(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=uo(e);return(t==w?rn:t==k?sn:Ls)(e)}function cs(e){return e?(e=hs(e))===l||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function us(e){var t=cs(e),n=t%1;return t==t?n?t-n:t:0}function ds(e){return e?ir(us(e),0,d):0}function hs(e){if("number"==typeof e)return e;if(is(e))return u;if(Ka(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ka(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Gt(e);var n=he.test(e);return n||pe.test(e)?at(e.slice(2),n?2:8):de.test(e)?u:+e}function fs(e){return Ai(e,Es(e))}function ps(e){return null==e?"":oi(e)}var gs=Ei(function(e,t){if(wo(t)||Ua(t))Ai(t,js(t),e);else for(var n in t)Pe.call(t,n)&&Jn(e,n,t[n])}),ms=Ei(function(e,t){Ai(t,Es(t),e)}),vs=Ei(function(e,t,n,r){Ai(t,Es(t),e,r)}),ys=Ei(function(e,t,n,r){Ai(t,js(t),e,r)}),bs=Ji(rr),ws=Gr(function(e,t){e=Se(e);var r=-1,i=t.length,o=i>2?t[2]:n;for(o&&mo(t[0],t[1],o)&&(i=1);++r<i;)for(var a=t[r],s=Es(a),l=-1,c=s.length;++l<c;){var u=s[l],d=e[u];(d===n||La(d,Te[u])&&!Pe.call(e,u))&&(e[u]=a[u])}return e}),xs=Gr(function(e){return e.push(n,Xi),xt(Ts,n,e)});function Cs(e,t,r){var i=null==e?n:wr(e,t);return i===n?r:i}function _s(e,t){return null!=e&&ho(e,t,kr)}var Ss=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=n},Ks(Qs)),ks=Di(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Pe.call(e,t)?e[t].push(n):e[t]=[n]},io),As=Gr(jr);function js(e){return Ua(e)?Yn(e):Pr(e)}function Es(e){return Ua(e)?Yn(e,!0):function(e){if(!Ka(e))return function(e){var t=[];if(null!=e)for(var n in Se(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var r in e)("constructor"!=r||!t&&Pe.call(e,r))&&n.push(r);return n}(e)}var Is=Ei(function(e,t,n){Nr(e,t,n)}),Ts=Ei(function(e,t,n,r){Nr(e,t,n,r)}),Os=Ji(function(e,t){var n={};if(null==e)return n;var r=!1;t=It(t,function(t){return t=gi(t,e),r||(r=t.length>1),t}),Ai(e,eo(e),n),r&&(n=or(n,7,Ki));for(var i=t.length;i--;)si(n,t[i]);return n}),Fs=Ji(function(e,t){return null==e?{}:function(e,t){return Vr(e,t,function(t,n){return _s(e,n)})}(e,t)});function Ps(e,t){if(null==e)return{};var n=It(eo(e),function(e){return[e]});return t=io(t),Vr(e,n,function(e,n){return t(e,n[0])})}var Ms=Gi(js),Rs=Gi(Es);function Ls(e){return null==e?[]:qt(e,js(e))}var Ds=Fi(function(e,t,n){return t=t.toLowerCase(),e+(n?Ns(t):t)});function Ns(e){return Gs(ps(e).toLowerCase())}function zs(e){return(e=ps(e))&&e.replace(me,Qt).replace(Xe,"")}var Bs=Fi(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Vs=Fi(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),Us=Oi("toLowerCase"),Ws=Fi(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Hs=Fi(function(e,t,n){return e+(n?" ":"")+Gs(t)}),$s=Fi(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Gs=Oi("toUpperCase");function Ys(e,t,r){return e=ps(e),(t=r?n:t)===n?function(e){return Qe.test(e)}(e)?function(e){return e.match(Ze)||[]}(e):function(e){return e.match(ae)||[]}(e):e.match(t)||[]}var qs=Gr(function(e,t){try{return xt(e,n,t)}catch(e){return Ga(e)?e:new xe(e)}}),Xs=Ji(function(e,t){return _t(t,function(t){t=Po(t),nr(e,t,ka(e[t],e))}),e});function Ks(e){return function(){return e}}var Zs=Ri(),Js=Ri(!0);function Qs(e){return e}function el(e){return Fr("function"==typeof e?e:or(e,1))}var tl=Gr(function(e,t){return function(n){return jr(n,e,t)}}),nl=Gr(function(e,t){return function(n){return jr(e,n,t)}});function rl(e,t,n){var r=js(t),i=br(t,r);null!=n||Ka(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=br(t,js(t)));var o=!(Ka(n)&&"chain"in n&&!n.chain),a=Ya(e);return _t(i,function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=ki(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Tt([this.value()],arguments))})}),e}function il(){}var ol=zi(It),al=zi(kt),sl=zi(Pt);function ll(e){return vo(e)?Vt(Po(e)):function(e){return function(t){return wr(t,e)}}(e)}var cl=Vi(),ul=Vi(!0);function dl(){return[]}function hl(){return!1}var fl,pl=Ni(function(e,t){return e+t},0),gl=Hi("ceil"),ml=Ni(function(e,t){return e/t},1),vl=Hi("floor"),yl=Ni(function(e,t){return e*t},1),bl=Hi("round"),wl=Ni(function(e,t){return e-t},0);return Dn.after=function(e,t){if("function"!=typeof t)throw new je(r);return e=us(e),function(){if(--e<1)return t.apply(this,arguments)}},Dn.ary=_a,Dn.assign=gs,Dn.assignIn=ms,Dn.assignInWith=vs,Dn.assignWith=ys,Dn.at=bs,Dn.before=Sa,Dn.bind=ka,Dn.bindAll=Xs,Dn.bindKey=Aa,Dn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ba(e)?e:[e]},Dn.chain=la,Dn.chunk=function(e,t,r){t=(r?mo(e,t,r):t===n)?1:gn(us(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=be(ft(i/t));o<i;)s[a++]=Qr(e,o,o+=t);return s},Dn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Dn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=be(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Tt(Ba(n)?ki(n):[n],pr(t,1))},Dn.cond=function(e){var t=null==e?0:e.length,n=io();return e=t?It(e,function(e){if("function"!=typeof e[1])throw new je(r);return[n(e[0]),e[1]]}):[],Gr(function(n){for(var r=-1;++r<t;){var i=e[r];if(xt(i[0],this,n))return xt(i[1],this,n)}})},Dn.conforms=function(e){return function(e){var t=js(e);return function(n){return ar(n,e,t)}}(or(e,1))},Dn.constant=Ks,Dn.countBy=da,Dn.create=function(e,t){var n=Nn(e);return null==t?n:tr(n,t)},Dn.curry=function e(t,r,i){var o=Yi(t,8,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},Dn.curryRight=function e(t,r,i){var o=Yi(t,16,n,n,n,n,n,r=i?n:r);return o.placeholder=e.placeholder,o},Dn.debounce=ja,Dn.defaults=ws,Dn.defaultsDeep=xs,Dn.defer=Ea,Dn.delay=Ia,Dn.difference=Lo,Dn.differenceBy=Do,Dn.differenceWith=No,Dn.drop=function(e,t,r){var i=null==e?0:e.length;return i?Qr(e,(t=r||t===n?1:us(t))<0?0:t,i):[]},Dn.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?Qr(e,0,(t=i-(t=r||t===n?1:us(t)))<0?0:t):[]},Dn.dropRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0,!0):[]},Dn.dropWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!0):[]},Dn.fill=function(e,t,r,i){var o=null==e?0:e.length;return o?(r&&"number"!=typeof r&&mo(e,t,r)&&(r=0,i=o),function(e,t,r,i){var o=e.length;for((r=us(r))<0&&(r=-r>o?0:o+r),(i=i===n||i>o?o:us(i))<0&&(i+=o),i=r>i?0:ds(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},Dn.filter=function(e,t){return(Ba(e)?At:fr)(e,io(t,3))},Dn.flatMap=function(e,t){return pr(ba(e,t),1)},Dn.flatMapDeep=function(e,t){return pr(ba(e,t),l)},Dn.flatMapDepth=function(e,t,r){return r=r===n?1:us(r),pr(ba(e,t),r)},Dn.flatten=Vo,Dn.flattenDeep=function(e){return null!=e&&e.length?pr(e,l):[]},Dn.flattenDepth=function(e,t){return null!=e&&e.length?pr(e,t=t===n?1:us(t)):[]},Dn.flip=function(e){return Yi(e,512)},Dn.flow=Zs,Dn.flowRight=Js,Dn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Dn.functions=function(e){return null==e?[]:br(e,js(e))},Dn.functionsIn=function(e){return null==e?[]:br(e,Es(e))},Dn.groupBy=ma,Dn.initial=function(e){return null!=e&&e.length?Qr(e,0,-1):[]},Dn.intersection=Wo,Dn.intersectionBy=Ho,Dn.intersectionWith=$o,Dn.invert=Ss,Dn.invertBy=ks,Dn.invokeMap=va,Dn.iteratee=el,Dn.keyBy=ya,Dn.keys=js,Dn.keysIn=Es,Dn.map=ba,Dn.mapKeys=function(e,t){var n={};return t=io(t,3),vr(e,function(e,r,i){nr(n,t(e,r,i),e)}),n},Dn.mapValues=function(e,t){var n={};return t=io(t,3),vr(e,function(e,r,i){nr(n,r,t(e,r,i))}),n},Dn.matches=function(e){return Lr(or(e,1))},Dn.matchesProperty=function(e,t){return Dr(e,or(t,1))},Dn.memoize=Ta,Dn.merge=Is,Dn.mergeWith=Ts,Dn.method=tl,Dn.methodOf=nl,Dn.mixin=rl,Dn.negate=Oa,Dn.nthArg=function(e){return e=us(e),Gr(function(t){return zr(t,e)})},Dn.omit=Os,Dn.omitBy=function(e,t){return Ps(e,Oa(io(t)))},Dn.once=function(e){return Sa(2,e)},Dn.orderBy=function(e,t,r,i){return null==e?[]:(Ba(t)||(t=null==t?[]:[t]),Ba(r=i?n:r)||(r=null==r?[]:[r]),Br(e,t,r))},Dn.over=ol,Dn.overArgs=Fa,Dn.overEvery=al,Dn.overSome=sl,Dn.partial=Pa,Dn.partialRight=Ma,Dn.partition=wa,Dn.pick=Fs,Dn.pickBy=Ps,Dn.property=ll,Dn.propertyOf=function(e){return function(t){return null==e?n:wr(e,t)}},Dn.pull=Yo,Dn.pullAll=qo,Dn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?Ur(e,t,io(n,2)):e},Dn.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Ur(e,t,n,r):e},Dn.pullAt=Xo,Dn.range=cl,Dn.rangeRight=ul,Dn.rearg=Ra,Dn.reject=function(e,t){return(Ba(e)?At:fr)(e,Oa(io(t,3)))},Dn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=io(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return Wr(e,i),n},Dn.rest=function(e,t){if("function"!=typeof e)throw new je(r);return Gr(e,t=t===n?t:us(t))},Dn.reverse=Ko,Dn.sampleSize=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:us(t),(Ba(e)?Xn:qr)(e,t)},Dn.set=function(e,t,n){return null==e?e:Xr(e,t,n)},Dn.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Xr(e,t,r,i)},Dn.shuffle=function(e){return(Ba(e)?Kn:Jr)(e)},Dn.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&mo(e,t,r)?(t=0,r=i):(t=null==t?0:us(t),r=r===n?i:us(r)),Qr(e,t,r)):[]},Dn.sortBy=xa,Dn.sortedUniq=function(e){return e&&e.length?ri(e):[]},Dn.sortedUniqBy=function(e,t){return e&&e.length?ri(e,io(t,2)):[]},Dn.split=function(e,t,r){return r&&"number"!=typeof r&&mo(e,t,r)&&(t=r=n),(r=r===n?d:r>>>0)?(e=ps(e))&&("string"==typeof t||null!=t&&!ts(t))&&!(t=oi(t))&&nn(e)?vi(cn(e),0,r):e.split(t,r):[]},Dn.spread=function(e,t){if("function"!=typeof e)throw new je(r);return t=null==t?0:gn(us(t),0),Gr(function(n){var r=n[t],i=vi(n,0,t);return r&&Tt(i,r),xt(e,this,i)})},Dn.tail=function(e){var t=null==e?0:e.length;return t?Qr(e,1,t):[]},Dn.take=function(e,t,r){return e&&e.length?Qr(e,0,(t=r||t===n?1:us(t))<0?0:t):[]},Dn.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?Qr(e,(t=i-(t=r||t===n?1:us(t)))<0?0:t,i):[]},Dn.takeRightWhile=function(e,t){return e&&e.length?ci(e,io(t,3),!1,!0):[]},Dn.takeWhile=function(e,t){return e&&e.length?ci(e,io(t,3)):[]},Dn.tap=function(e,t){return t(e),e},Dn.throttle=function(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new je(r);return Ka(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),ja(e,t,{leading:i,maxWait:t,trailing:o})},Dn.thru=ca,Dn.toArray=ls,Dn.toPairs=Ms,Dn.toPairsIn=Rs,Dn.toPath=function(e){return Ba(e)?It(e,Po):is(e)?[e]:ki(Fo(ps(e)))},Dn.toPlainObject=fs,Dn.transform=function(e,t,n){var r=Ba(e),i=r||Ha(e)||os(e);if(t=io(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Ka(e)&&Ya(o)?Nn(He(e)):{}}return(i?_t:vr)(e,function(e,r,i){return t(n,e,r,i)}),n},Dn.unary=function(e){return _a(e,1)},Dn.union=Zo,Dn.unionBy=Jo,Dn.unionWith=Qo,Dn.uniq=function(e){return e&&e.length?ai(e):[]},Dn.uniqBy=function(e,t){return e&&e.length?ai(e,io(t,2)):[]},Dn.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?ai(e,n,t):[]},Dn.unset=function(e,t){return null==e||si(e,t)},Dn.unzip=ea,Dn.unzipWith=ta,Dn.update=function(e,t,n){return null==e?e:li(e,t,pi(n))},Dn.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:li(e,t,pi(r),i)},Dn.values=Ls,Dn.valuesIn=function(e){return null==e?[]:qt(e,Es(e))},Dn.without=na,Dn.words=Ys,Dn.wrap=function(e,t){return Pa(pi(t),e)},Dn.xor=ra,Dn.xorBy=ia,Dn.xorWith=oa,Dn.zip=aa,Dn.zipObject=function(e,t){return hi(e||[],t||[],Jn)},Dn.zipObjectDeep=function(e,t){return hi(e||[],t||[],Xr)},Dn.zipWith=sa,Dn.entries=Ms,Dn.entriesIn=Rs,Dn.extend=ms,Dn.extendWith=vs,rl(Dn,Dn),Dn.add=pl,Dn.attempt=qs,Dn.camelCase=Ds,Dn.capitalize=Ns,Dn.ceil=gl,Dn.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=hs(r))==r?r:0),t!==n&&(t=(t=hs(t))==t?t:0),ir(hs(e),t,r)},Dn.clone=function(e){return or(e,4)},Dn.cloneDeep=function(e){return or(e,5)},Dn.cloneDeepWith=function(e,t){return or(e,5,t="function"==typeof t?t:n)},Dn.cloneWith=function(e,t){return or(e,4,t="function"==typeof t?t:n)},Dn.conformsTo=function(e,t){return null==t||ar(e,t,js(t))},Dn.deburr=zs,Dn.defaultTo=function(e,t){return null==e||e!=e?t:e},Dn.divide=ml,Dn.endsWith=function(e,t,r){e=ps(e),t=oi(t);var i=e.length,o=r=r===n?i:ir(us(r),0,i);return(r-=t.length)>=0&&e.slice(r,o)==t},Dn.eq=La,Dn.escape=function(e){return(e=ps(e))&&G.test(e)?e.replace(H,en):e},Dn.escapeRegExp=function(e){return(e=ps(e))&&ee.test(e)?e.replace(Q,"\\$&"):e},Dn.every=function(e,t,r){var i=Ba(e)?kt:dr;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},Dn.find=ha,Dn.findIndex=zo,Dn.findKey=function(e,t){return Rt(e,io(t,3),vr)},Dn.findLast=fa,Dn.findLastIndex=Bo,Dn.findLastKey=function(e,t){return Rt(e,io(t,3),yr)},Dn.floor=vl,Dn.forEach=pa,Dn.forEachRight=ga,Dn.forIn=function(e,t){return null==e?e:gr(e,io(t,3),Es)},Dn.forInRight=function(e,t){return null==e?e:mr(e,io(t,3),Es)},Dn.forOwn=function(e,t){return e&&vr(e,io(t,3))},Dn.forOwnRight=function(e,t){return e&&yr(e,io(t,3))},Dn.get=Cs,Dn.gt=Da,Dn.gte=Na,Dn.has=function(e,t){return null!=e&&ho(e,t,Sr)},Dn.hasIn=_s,Dn.head=Uo,Dn.identity=Qs,Dn.includes=function(e,t,n,r){e=Ua(e)?e:Ls(e),n=n&&!r?us(n):0;var i=e.length;return n<0&&(n=gn(i+n,0)),rs(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Dt(e,t,n)>-1},Dn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:us(n);return i<0&&(i=gn(r+i,0)),Dt(e,t,i)},Dn.inRange=function(e,t,r){return t=cs(t),r===n?(r=t,t=0):r=cs(r),function(e,t,n){return e>=mn(t,n)&&e<gn(t,n)}(e=hs(e),t,r)},Dn.invoke=As,Dn.isArguments=za,Dn.isArray=Ba,Dn.isArrayBuffer=Va,Dn.isArrayLike=Ua,Dn.isArrayLikeObject=Wa,Dn.isBoolean=function(e){return!0===e||!1===e||Za(e)&&Cr(e)==g},Dn.isBuffer=Ha,Dn.isDate=$a,Dn.isElement=function(e){return Za(e)&&1===e.nodeType&&!es(e)},Dn.isEmpty=function(e){if(null==e)return!0;if(Ua(e)&&(Ba(e)||"string"==typeof e||"function"==typeof e.splice||Ha(e)||os(e)||za(e)))return!e.length;var t=uo(e);if(t==w||t==k)return!e.size;if(wo(e))return!Pr(e).length;for(var n in e)if(Pe.call(e,n))return!1;return!0},Dn.isEqual=function(e,t){return Ir(e,t)},Dn.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Ir(e,t,n,r):!!i},Dn.isError=Ga,Dn.isFinite=function(e){return"number"==typeof e&&Xt(e)},Dn.isFunction=Ya,Dn.isInteger=qa,Dn.isLength=Xa,Dn.isMap=Ja,Dn.isMatch=function(e,t){return e===t||Tr(e,t,ao(t))},Dn.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Tr(e,t,ao(t),r)},Dn.isNaN=function(e){return Qa(e)&&e!=+e},Dn.isNative=function(e){if(bo(e))throw new xe("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Or(e)},Dn.isNil=function(e){return null==e},Dn.isNull=function(e){return null===e},Dn.isNumber=Qa,Dn.isObject=Ka,Dn.isObjectLike=Za,Dn.isPlainObject=es,Dn.isRegExp=ts,Dn.isSafeInteger=function(e){return qa(e)&&e>=-9007199254740991&&e<=c},Dn.isSet=ns,Dn.isString=rs,Dn.isSymbol=is,Dn.isTypedArray=os,Dn.isUndefined=function(e){return e===n},Dn.isWeakMap=function(e){return Za(e)&&uo(e)==E},Dn.isWeakSet=function(e){return Za(e)&&"[object WeakSet]"==Cr(e)},Dn.join=function(e,t){return null==e?"":fn.call(e,t)},Dn.kebabCase=Bs,Dn.last=Go,Dn.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=us(r))<0?gn(i+o,0):mn(o,i-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,o):Lt(e,zt,o,!0)},Dn.lowerCase=Vs,Dn.lowerFirst=Us,Dn.lt=as,Dn.lte=ss,Dn.max=function(e){return e&&e.length?hr(e,Qs,_r):n},Dn.maxBy=function(e,t){return e&&e.length?hr(e,io(t,2),_r):n},Dn.mean=function(e){return Bt(e,Qs)},Dn.meanBy=function(e,t){return Bt(e,io(t,2))},Dn.min=function(e){return e&&e.length?hr(e,Qs,Mr):n},Dn.minBy=function(e,t){return e&&e.length?hr(e,io(t,2),Mr):n},Dn.stubArray=dl,Dn.stubFalse=hl,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=yl,Dn.nth=function(e,t){return e&&e.length?zr(e,us(t)):n},Dn.noConflict=function(){return ct._===this&&(ct._=Ne),this},Dn.noop=il,Dn.now=Ca,Dn.pad=function(e,t,n){e=ps(e);var r=(t=us(t))?ln(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Bi(pt(i),n)+e+Bi(ft(i),n)},Dn.padEnd=function(e,t,n){e=ps(e);var r=(t=us(t))?ln(e):0;return t&&r<t?e+Bi(t-r,n):e},Dn.padStart=function(e,t,n){e=ps(e);var r=(t=us(t))?ln(e):0;return t&&r<t?Bi(t-r,n)+e:e},Dn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),yn(ps(e).replace(te,""),t||0)},Dn.random=function(e,t,r){if(r&&"boolean"!=typeof r&&mo(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=cs(e),t===n?(t=e,e=0):t=cs(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var o=bn();return mn(e+o*(t-e+ot("1e-"+((o+"").length-1))),t)}return Hr(e,t)},Dn.reduce=function(e,t,n){var r=Ba(e)?Ot:Wt,i=arguments.length<3;return r(e,io(t,4),n,i,cr)},Dn.reduceRight=function(e,t,n){var r=Ba(e)?Ft:Wt,i=arguments.length<3;return r(e,io(t,4),n,i,ur)},Dn.repeat=function(e,t,r){return t=(r?mo(e,t,r):t===n)?1:us(t),$r(ps(e),t)},Dn.replace=function(){var e=arguments,t=ps(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Dn.result=function(e,t,r){var i=-1,o=(t=gi(t,e)).length;for(o||(o=1,e=n);++i<o;){var a=null==e?n:e[Po(t[i])];a===n&&(i=o,a=r),e=Ya(a)?a.call(e):a}return e},Dn.round=bl,Dn.runInContext=e,Dn.sample=function(e){return(Ba(e)?qn:Yr)(e)},Dn.size=function(e){if(null==e)return 0;if(Ua(e))return rs(e)?ln(e):e.length;var t=uo(e);return t==w||t==k?e.size:Pr(e).length},Dn.snakeCase=Ws,Dn.some=function(e,t,r){var i=Ba(e)?Pt:ei;return r&&mo(e,t,r)&&(t=n),i(e,io(t,3))},Dn.sortedIndex=function(e,t){return ti(e,t)},Dn.sortedIndexBy=function(e,t,n){return ni(e,t,io(n,2))},Dn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=ti(e,t);if(r<n&&La(e[r],t))return r}return-1},Dn.sortedLastIndex=function(e,t){return ti(e,t,!0)},Dn.sortedLastIndexBy=function(e,t,n){return ni(e,t,io(n,2),!0)},Dn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ti(e,t,!0)-1;if(La(e[n],t))return n}return-1},Dn.startCase=Hs,Dn.startsWith=function(e,t,n){return e=ps(e),n=null==n?0:ir(us(n),0,e.length),t=oi(t),e.slice(n,n+t.length)==t},Dn.subtract=wl,Dn.sum=function(e){return e&&e.length?Ht(e,Qs):0},Dn.sumBy=function(e,t){return e&&e.length?Ht(e,io(t,2)):0},Dn.template=function(e,t,r){var i=Dn.templateSettings;r&&mo(e,t,r)&&(t=n),e=ps(e),t=vs({},t,i,qi);var o,a,s=vs({},t.imports,i.imports,qi),l=js(s),c=qt(s,l),u=0,d=t.interpolate||ve,h="__p += '",f=ke((t.escape||ve).source+"|"+d.source+"|"+(d===X?ce:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(Pe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tt+"]")+"\n";e.replace(f,function(t,n,r,i,s,l){return r||(r=i),h+=e.slice(u,l).replace(ye,tn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),s&&(a=!0,h+="';\n"+s+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=l+t.length,t}),h+="';\n";var g=Pe.call(t,"variable")&&t.variable;if(g){if(se.test(g))throw new xe("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(a?h.replace(B,""):h).replace(V,"$1").replace(U,"$1;"),h="function("+(g||"obj")+") {\n"+(g?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var m=qs(function(){return Ce(l,p+"return "+h).apply(n,c)});if(m.source=h,Ga(m))throw m;return m},Dn.times=function(e,t){if((e=us(e))<1||e>c)return[];var n=d,r=mn(e,d);t=io(t),e-=d;for(var i=$t(r,t);++n<e;)t(n);return i},Dn.toFinite=cs,Dn.toInteger=us,Dn.toLength=ds,Dn.toLower=function(e){return ps(e).toLowerCase()},Dn.toNumber=hs,Dn.toSafeInteger=function(e){return e?ir(us(e),-9007199254740991,c):0===e?e:0},Dn.toString=ps,Dn.toUpper=function(e){return ps(e).toUpperCase()},Dn.trim=function(e,t,r){if((e=ps(e))&&(r||t===n))return Gt(e);if(!e||!(t=oi(t)))return e;var i=cn(e),o=cn(t);return vi(i,Zt(i,o),Jt(i,o)+1).join("")},Dn.trimEnd=function(e,t,r){if((e=ps(e))&&(r||t===n))return e.slice(0,un(e)+1);if(!e||!(t=oi(t)))return e;var i=cn(e);return vi(i,0,Jt(i,cn(t))+1).join("")},Dn.trimStart=function(e,t,r){if((e=ps(e))&&(r||t===n))return e.replace(te,"");if(!e||!(t=oi(t)))return e;var i=cn(e);return vi(i,Zt(i,cn(t))).join("")},Dn.truncate=function(e,t){var r=30,i="...";if(Ka(t)){var o="separator"in t?t.separator:o;r="length"in t?us(t.length):r,i="omission"in t?oi(t.omission):i}var a=(e=ps(e)).length;if(nn(e)){var s=cn(e);a=s.length}if(r>=a)return e;var l=r-ln(i);if(l<1)return i;var c=s?vi(s,0,l).join(""):e.slice(0,l);if(o===n)return c+i;if(s&&(l+=c.length-l),ts(o)){if(e.slice(l).search(o)){var u,d=c;for(o.global||(o=ke(o.source,ps(ue.exec(o))+"g")),o.lastIndex=0;u=o.exec(d);)var h=u.index;c=c.slice(0,h===n?l:h)}}else if(e.indexOf(oi(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Dn.unescape=function(e){return(e=ps(e))&&$.test(e)?e.replace(W,dn):e},Dn.uniqueId=function(e){var t=++Me;return ps(e)+t},Dn.upperCase=$s,Dn.upperFirst=Gs,Dn.each=pa,Dn.eachRight=ga,Dn.first=Uo,rl(Dn,(fl={},vr(Dn,function(e,t){Pe.call(Dn.prototype,t)||(fl[t]=e)}),fl),{chain:!1}),Dn.VERSION="4.17.21",_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){Dn[e].placeholder=Dn}),_t(["drop","take"],function(e,t){Vn.prototype[e]=function(r){r=r===n?1:gn(us(r),0);var i=this.__filtered__&&!t?new Vn(this):this.clone();return i.__filtered__?i.__takeCount__=mn(r,i.__takeCount__):i.__views__.push({size:mn(r,d),type:e+(i.__dir__<0?"Right":"")}),i},Vn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var n=t+1,r=1==n||3==n;Vn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:io(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}}),_t(["head","last"],function(e,t){var n="take"+(t?"Right":"");Vn.prototype[e]=function(){return this[n](1).value()[0]}}),_t(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");Vn.prototype[e]=function(){return this.__filtered__?new Vn(this):this[n](1)}}),Vn.prototype.compact=function(){return this.filter(Qs)},Vn.prototype.find=function(e){return this.filter(e).head()},Vn.prototype.findLast=function(e){return this.reverse().find(e)},Vn.prototype.invokeMap=Gr(function(e,t){return"function"==typeof e?new Vn(this):this.map(function(n){return jr(n,e,t)})}),Vn.prototype.reject=function(e){return this.filter(Oa(io(e)))},Vn.prototype.slice=function(e,t){e=us(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Vn(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=us(t))<0?r.dropRight(-t):r.take(t-e)),r)},Vn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Vn.prototype.toArray=function(){return this.take(d)},vr(Vn.prototype,function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Dn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Dn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Vn,c=s[0],u=l||Ba(t),d=function(e){var t=o.apply(Dn,Tt([e],s));return i&&h?t[0]:t};u&&r&&"function"==typeof c&&1!=c.length&&(l=u=!1);var h=this.__chain__,f=!!this.__actions__.length,p=a&&!h,g=l&&!f;if(!a&&u){t=g?t:new Vn(this);var m=e.apply(t,s);return m.__actions__.push({func:ca,args:[d],thisArg:n}),new Bn(m,h)}return p&&g?e.apply(this,s):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Ee[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Dn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(Ba(i)?i:[],e)}return this[n](function(n){return t.apply(Ba(n)?n:[],e)})}}),vr(Vn.prototype,function(e,t){var n=Dn[t];if(n){var r=n.name+"";Pe.call(En,r)||(En[r]=[]),En[r].push({name:t,func:n})}}),En[Li(n,2).name]=[{name:"wrapper",func:n}],Vn.prototype.clone=function(){var e=new Vn(this.__wrapped__);return e.__actions__=ki(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=ki(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=ki(this.__views__),e},Vn.prototype.reverse=function(){if(this.__filtered__){var e=new Vn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Vn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=Ba(e),r=t<0,i=n?e.length:0,o=function(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=mn(t,e+a);break;case"takeRight":e=gn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,l=s-a,c=r?s:a-1,u=this.__iteratees__,d=u.length,h=0,f=mn(l,this.__takeCount__);if(!n||!r&&i==l&&f==l)return ui(e,this.__actions__);var p=[];e:for(;l--&&h<f;){for(var g=-1,m=e[c+=t];++g<d;){var v=u[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue e;break e}}p[h++]=m}return p},Dn.prototype.at=ua,Dn.prototype.chain=function(){return la(this)},Dn.prototype.commit=function(){return new Bn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===n&&(this.__values__=ls(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Dn.prototype.plant=function(e){for(var t,r=this;r instanceof zn;){var i=Ro(r);i.__index__=0,i.__values__=n,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t},Dn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Vn){var t=e;return this.__actions__.length&&(t=new Vn(this)),(t=t.reverse()).__actions__.push({func:ca,args:[Ko],thisArg:n}),new Bn(t,this.__chain__)}return this.thru(Ko)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return ui(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Je&&(Dn.prototype[Je]=function(){return this}),Dn}();dt?((dt.exports=hn)._=hn,ut._=hn):ct._=hn}).call(Fr)}(Or,Or.exports)),Or.exports);const Mr=(0,o.createContext)({state:{},actions:{},options:{}}),Rr=()=>(0,o.useContext)(Mr),Lr=({children:e,options:t})=>{var n;const[r,a]=(0,o.useState)([]),[s,l]=(0,o.useState)([]),[c,u]=(0,o.useState)(null),[d,h]=(0,o.useState)(t.searchQuery||""),[f,p]=(0,o.useState)(t.sortBySize||"name"),{config:g}=t,[m,v]=(0,o.useState)("date"),[b,w]=(0,o.useState)("desc"),[x,C]=(0,o.useState)([{id:"folders",name:"\u041f\u0430\u043f\u043a\u0438"}]),[_,S]=(0,o.useState)(new Set),[k,A]=(0,o.useState)("");o.useEffect(()=>{S(new Set)},[]);const j=o.useRef(null);o.useEffect(()=>{if(t.onChangeSelection&&j.current!==_){if(null!==j.current){const e=(Array.isArray(s)?s:[]).filter(e=>_.has(e.id));t.onChangeSelection(e)}j.current=_}},[s,_,t.onChangeSelection,t]);const[E,I]=(0,o.useState)(!1),[T,O]=(0,o.useState)(jt);(0,o.useEffect)(()=>{(null==g?void 0:g.activeLibraryItem)&&O&&O(null==g?void 0:g.activeLibraryItem)},[null==g?void 0:g.activeLibraryItem,O]);const[F,P]=(0,o.useState)({current:1,pageSize:12,total:0}),[M]=y.A.useForm(),[R]=y.A.useForm(),[L]=y.A.useForm(),[D]=y.A.useForm(),[N]=y.A.useForm(),[z]=y.A.useForm(),[B,V]=(0,o.useState)(!1),[U,W]=(0,o.useState)(!1),[H,$]=(0,o.useState)(!1),[G,Y]=(0,o.useState)(!1),[q,X]=(0,o.useState)(!1),[K,Z]=(0,o.useState)(!1),[J,Q]=(0,o.useState)(!1),[ee,te]=(0,o.useState)(null),[ne,re]=(0,o.useState)(null),[ie,oe]=(0,o.useState)(null),ae=(0,o.useCallback)(e=>{P(t=>Object.assign(Object.assign({},t),e))},[P]),se=(0,o.useCallback)(e=>{S(null!=e?e:new Set)},[S]);(0,o.useEffect)(()=>{se()},[T,se]);const le={folders:r,files:s,selectedFolder:c,searchTerm:d,sortField:f,sortBy:m,sortOrder:b,pathHistory:x,selectedFiles:_,currentMenuFile:k,loading:E,pagination:F,isModalVisible:B,isUrlModalVisible:U,isRenameModalVisible:H,isMoveModalVisible:G,isRenameFolderModalVisible:q,isCopyModalVisible:K,isDeleteConfirmVisible:J,form:M,urlForm:R,renameForm:L,moveForm:D,renameFolderForm:N,copyForm:z,fileToRename:ee,folderToRename:ne,activeLibraryItem:T,multiSelect:null===(n=null==g?void 0:g.multiSelect)||void 0===n||n,undoDeletion:ie},ce={setFolders:a,setFiles:l,setSelectedFolder:u,setSearchTerm:h,setSortField:p,setSortBy:v,setSortOrder:w,setPathHistory:C,setSelectedFiles:se,setLoading:I,setPagination:ae,setIsModalVisible:V,setIsUrlModalVisible:W,setIsRenameModalVisible:$,setIsMoveModalVisible:Y,setIsRenameFolderModalVisible:X,setIsCopyModalVisible:Z,setIsDeleteConfirmVisible:Q,setFileToRename:te,setFolderToRename:re,setUndoDeletion:oe,updatePathHistoryOnFolderRename:(e,t)=>{C(n=>n.map(n=>n.id===e?Object.assign(Object.assign({},n),{name:t}):n))},setActiveLibraryItem:O,setCurrentMenuFile:A},ue={state:le,actions:ce,options:t};return(0,i.jsx)(Mr.Provider,{value:ue,children:e})},Dr=e=>null===e.parentId||"null"===e.parentId||!e.parentId,Nr=e=>{var t,n,r,i;const{state:a,actions:s,options:l}=Rr(),{searchTerm:c,sortBy:u,sortOrder:d,selectedFolder:h,pagination:f}=a,{setSearchTerm:p,setSortBy:g,setSortOrder:m,setPagination:v}=s,y=e||s.fetchFiles,b=(0,o.useRef)(null),w=(0,o.useRef)(Pr.debounce(e=>{const t=JSON.stringify(e);b.current!==t&&(b.current=t,null==y||y(e))},150)).current,x=(0,o.useCallback)(()=>{var e;const t=null===(e=null==l?void 0:l.config)||void 0===e?void 0:e.disablePagination;return{folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:t?void 0:f.current,limit:t?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}},[h,c,f.current,f.pageSize,u,d,null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination]),C=(0,o.useCallback)(e=>{var t,n;if(p&&p(e),v&&v({current:1,pageSize:f.pageSize,total:0}),y){const r={folderId:h||"",search:(null==e?void 0:e.trim())||void 0,page:(null===(t=null==l?void 0:l.config)||void 0===t?void 0:t.disablePagination)?void 0:1,limit:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:f.pageSize,sortBy:u,sortOrder:d,itemType:"all"};y(r)}},[p,v,f.pageSize,y,h,u,d,null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination]),_=(0,o.useCallback)((e,t)=>{var n,r;null==g||g(e),null==m||m(t),y&&w({folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)?void 0:f.current,limit:(null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination)?void 0:f.pageSize,sortBy:e,sortOrder:t,itemType:"all"})},[g,m,w,h,c,f.current,f.pageSize,null===(r=null==l?void 0:l.config)||void 0===r?void 0:r.disablePagination]),S=(0,o.useCallback)((e,t)=>{var n;(null===(n=null==l?void 0:l.config)||void 0===n?void 0:n.disablePagination)||(v&&v({current:e,pageSize:t||f.pageSize,total:f.total}),y&&w({folderId:h||"",search:(null==c?void 0:c.trim())||void 0,page:e,limit:t||f.pageSize,sortBy:u,sortOrder:d,itemType:"all"}))},[v,f.pageSize,f.total,w,h,c,u,d,null===(i=null==l?void 0:l.config)||void 0===i?void 0:i.disablePagination]);return(0,o.useEffect)(()=>{if(y){const e=x();w(Object.assign(Object.assign({},e),{page:1}))}},[h]),(0,o.useEffect)(()=>{y&&w(x())},[]),(0,o.useEffect)(()=>()=>{var e;null===(e=w.cancel)||void 0===e||e.call(w)},[w]),{state:{searchTerm:c||"",sortBy:u||"name",sortOrder:d||"asc"},actions:{setSearchTerm:p||(()=>{}),setSortBy:g||(()=>{}),setSortOrder:m||(()=>{}),handleSearch:C,handleSort:_,handlePaginationChange:S,getCurrentQueryParams:x}}},zr=()=>{var e;const{notification:t}=l.A.useApp(),n=Rr(),{options:r}=n,i=(0,o.useCallback)(async e=>{let t;if(r.handleNotify){if(t=await r.handleNotify(e),!1===t)return!1;"object"==typeof t&&t&&(e=t)}if("error"===e.type&&r.handleError){if(t=await r.handleError(e),!1===t)return!1;"object"==typeof t&&t&&(e=t)}return("success"!==e.type||!r.handleSuccess||(t=await r.handleSuccess(e),!t))&&t},[r]),a=(0,o.useCallback)(async function(e,n=!1){var o;const a=await i(e);if(!1===a||n||!1===(null===(o=r.config)||void 0===o?void 0:o.showNotifications))return;"object"==typeof a&&(e=a);const s=t[e.type];"function"==typeof s&&s(e)},[t,i,null===(e=r.config)||void 0===e?void 0:e.showNotifications]);return(0,o.useMemo)(()=>({error(e){a(Object.assign(Object.assign({},e),{type:"error"}))},success(e){a(Object.assign(Object.assign({},e),{type:"success"}))},warning(e){a(Object.assign(Object.assign({},e),{type:"warning"}))},notify:a}),[a])},Br={FileNotFound:"File not found or no longer available.",FileAlreadyExists:"File with this name already exists.",FileInvalidName:"File name is not valid.",FileAccessDenied:"You don't have permission to access this file.",FileReadError:"Failed to read the file.",FileWriteError:"Failed to write the file.",FileTooLarge:"File is too large to upload.",FileTypeNotAllowed:"This file type is not allowed.",FileCorrupted:"The file appears to be corrupted.",FileChecksumMismatch:"File integrity check failed.",FolderNotFound:"Folder not found or no longer available.",FolderAlreadyExists:"Folder with this name already exists.",FolderInvalidName:"Folder name is not valid.",FolderAccessDenied:"You don't have permission to access this folder.",FolderReadError:"Failed to read the folder contents.",FolderWriteError:"Failed to write to the folder.",FolderQuotaExceeded:"Folder storage quota exceeded.",FolderNotEmpty:"Folder is not empty.",FolderBackendError:"Server error while processing the folder.",FolderTimeout:"Folder operation took too long.",RenameNotAllowed:"Renaming is not allowed for this item.",MoveNotAllowed:"Moving is not allowed for this item.",CopyNotAllowed:"Copying is not allowed for this item.",DeleteNotAllowed:"Deleting is not allowed for this item.",MoveIntoSelf:"Cannot move an item into itself.",MoveIntoDescendant:"Cannot move an item into its descendant folder.",UnsupportedOperation:"This operation is not supported.",ConfigError:"Configuration error occurred.",FileUploadQuotaExceeded:"You have exceeded the upload quota.",FileUploadNetworkError:"Network error while uploading the file.",FileUploadTimeout:"File upload took too long.",FileUploadBackendError:"Server error while uploading the file.",UploadUrlInvalid:"The specified URL is not valid.",UploadUrlNotReachable:"The specified URL is not reachable.",UploadUrlContentTypeNotAllowed:"Content type at the URL is not allowed.",UploadUrlDownloadFailed:"Failed to download file from the URL.",FileDownloadNetworkError:"Network error while downloading the file.",FileDownloadTimeout:"File download took too long.",FileDownloadBackendError:"Server error while downloading the file.",BatchPartialFailure:"Some items could not be processed.",BatchAllFailed:"Failed to process all items in the batch.",BatchConflict:"Some items in the batch are in a conflicting state.",BatchValidationFailed:"Some items in the batch did not pass validation.",ValidationError:"Some of the provided data is invalid.",PayloadTooLarge:"Request payload is too large.",UnsupportedMediaType:"This media type is not supported.",NetworkError:"Network error. Please check your connection and try again.",BackendError:"Server error. Please try again later.",Timeout:"The operation took too long. Please try again.",AuthenticationFailed:"Authentication failed. Please sign in again.",AuthorizationFailed:"You are not allowed to perform this action.",RateLimitExceeded:"Too many requests. Please try again a bit later.",ServiceUnavailable:"Service is temporarily unavailable. Please try again later.",AIResponseInvalid:"AI service returned an invalid response.",AIImageGenerationFailed:"Failed to generate image using AI.",AIImageGenerationLimitExceeded:"You have reached the AI image generation limit.",IntegrationError:"Error in external integration.",ThirdPartyError:"Error in a third-party service.",UnknownError:"An unknown error occurred."},Vr=(e,t)=>{if(!e)return;const n=Br[e];return n?t(n):void 0},Ur=e=>{if(e&&"object"==typeof e)return e.code?e:void 0},Wr=()=>{var e,t;const{state:n,actions:r,options:i}=Rr(),{t:a}=hn(),s=zr(),{folders:l,selectedFolder:c,form:u,loading:d,isModalVisible:h}=n,{setFolders:f,setLoading:p,setIsModalVisible:g}=r,{dataProviders:m,config:v}=i,y=(0,o.useCallback)(e=>(Array.isArray(e)?e:[]).filter(e=>e&&e.id&&e.name).map(e=>({id:e.id,name:e.name,parentId:e.folderId?e.folderId:null})),[]),b=(0,o.useCallback)(async()=>{null==p||p(!0);try{let e=[];const t="lazy"===(null==v?void 0:v.folderTreeLoading);if(null==m?void 0:m.getFolders){const n=!t;e=await m.getFolders({parentId:null,deep:n})}else{if(!(null==m?void 0:m.getFiles))return;{const n=async e=>{const{files:r}=await m.getFiles({itemType:"folder",folderId:e||void 0}),i=y(r);if(t)return i;const o=await Promise.all(i.map(e=>n(e.id)));return[...i,...o.flat()]},r=await n(null),i=new Map(r.map(e=>[e.id,e]));e=Array.from(i.values())}}const n=Array.isArray(e)?e:[];null==f||f(n);const r=n.filter(e=>e.id===e.parentId);r.length}catch(e){const n=Ur(e),r=Vr(null==n?void 0:n.code,a);s.error({id:"FOLDERS_FETCH_FAILED",message:null!=r?r:a("Failed to load folders"),placement:"bottomRight",innerException:e,data:{reason:e instanceof Error?e.message:String(e)}})}finally{null==p||p(!1)}},[null==m?void 0:m.getFiles,null==m?void 0:m.getFolders,f,p,null==v?void 0:v.folderTreeLoading,y,s,a]),w=(0,o.useCallback)(async e=>{try{if(null==m?void 0:m.getFolders){const t=await m.getFolders({parentId:e,deep:!1}),n=Array.isArray(l)?l:[],r=new Map(n.map(e=>[e.id,e]));return t.forEach(e=>r.set(e.id,e)),null==f||f(Array.from(r.values())),t}if(null==m?void 0:m.getFiles){const{files:t}=await m.getFiles({itemType:"folder",folderId:e||void 0}),n=y(t),r=Array.isArray(l)?l:[],i=new Map(r.map(e=>[e.id,e]));return n.forEach(e=>i.set(e.id,e)),null==f||f(Array.from(i.values())),n}return[]}catch(e){return[]}},[null==m?void 0:m.getFiles,null==m?void 0:m.getFolders,l,f,y]),x=(0,o.useCallback)(()=>{var e;const t=null!==(e=null==v?void 0:v.defaultFolderName)&&void 0!==e?e:a("\u041d\u043e\u0432\u0430\u044f \u043f\u0430\u043f\u043a\u0430");u.setFieldsValue({folderName:t}),null==g||g(!0)},[u,g,a,null==v?void 0:v.defaultFolderName]),C=(0,o.useCallback)(e=>{const t=[...(Array.isArray(l)?l:[]).filter(t=>t.id!==e.id),e];if(null==f||f(t),r.setSelectedFolder&&r.setSelectedFolder(e.id),r.setPathHistory){const t=[...n.pathHistory||[],{id:e.id,name:e.name}];r.setPathHistory(t)}},[l,f,r,n.pathHistory]),_=(0,o.useCallback)(async e=>{try{if(null==m?void 0:m.getFolders){const t=await m.getFolders();return(Array.isArray(t)?t:[]).some(t=>t.id===e)}if(null==m?void 0:m.getFiles){const t=new Set,n=async r=>{const{files:i}=await m.getFiles({itemType:"folder",folderId:r||void 0}),o=y(i);for(const a of o)if(!t.has(a.id)){if(t.add(a.id),a.id===e)return!0;if(await n(a.id))return!0}return!1};return await n(null)}}catch(e){}return!1},[null==m?void 0:m.getFolders,null==m?void 0:m.getFiles,y]),S=(0,o.useCallback)(async e=>{var t;let n,r=null;try{const i=await(e?e.validateFields():u.validateFields());if(n=i.folderName.trim(),!n){const e=i.targetFolder||(c&&"folders"!==c?c:null);return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderName:n,folderId:null!=e?e:null,reason:"emptyName"}})}let o;if(r=i.targetFolder||(c&&"folders"!==c?c:null),!(null==m?void 0:m.createFolder))return void s.error({id:"FOLDER_CREATE_PROVIDER_NOT_CONFIGURED",message:a("Folder creation provider is not configured"),placement:"bottomRight",data:{folderName:n,folderId:null!=r?r:null}});if(o=await m.createFolder({name:n,parentId:r}),(e=>{if(!e||!e.id)throw new Error("\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043e\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430: \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 ID \u043f\u0430\u043f\u043a\u0438");if(e.id===e.parentId&&e.parentId)throw new Error("\u041e\u0448\u0438\u0431\u043a\u0430: \u043f\u0430\u043f\u043a\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f")})(o),C(o),s.success({id:"FOLDER_CREATE_SUCCESS",message:a("Folder created"),placement:"bottomRight",data:{itemIds:[o.id],folderId:null!==(t=o.parentId)&&void 0!==t?t:null,folderName:o.name}}),await b(),await new Promise(e=>setTimeout(e,200)),await _(o.id),e)return o;null==g||g(!1)}catch(e){const t=Ur(e),i=Vr(null==t?void 0:t.code,a);s.error({id:"FOLDER_CREATE_FAILED",message:null!=i?i:a("Failed to create folder"),placement:"bottomRight",innerException:e,data:{folderName:n,folderId:null!=r?r:null,reason:e instanceof Error?e.message:String(e)}})}},[u,c,m,C,b,_,g,s,a]),k=(0,o.useCallback)(()=>{null==g||g(!1)},[g]),A=(0,o.useCallback)((e,t=new Set)=>{const n=Array.isArray(l)?l:[];return e.map(e=>{if(t.has(e.id))return{key:e.id,label:e.name+" (\u043e\u0448\u0438\u0431\u043a\u0430)",icon:o.createElement(K.A,{style:{color:"red"}})};const r=new Set(t);r.add(e.id);const i=n.filter(t=>t.parentId===e.id&&t.id!==e.id);return{key:e.id,label:e.name,children:i.length>0?A(i,r):void 0}})},[l]),j=(0,o.useCallback)(()=>{const e=Array.isArray(l)?l:[],t={key:"folders",label:a("Folders"),children:[]},n=e.filter(e=>null===e.parentId||!e.parentId);return t.children=A(n),[t]},[l,a,A]),E=(0,o.useCallback)(async(e,t)=>{var n,o,c,u;try{const d=t.trim(),h=null==l?void 0:l.find(t=>t.id===e);if(!d)return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:e,folderName:t,reason:"emptyName"}});if(!1===(null===(n=null==v?void 0:v.features)||void 0===n?void 0:n.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:e,itemName:null!==(o=null==h?void 0:h.name)&&void 0!==o?o:d}});if(!(null===(c=i.dataProviders)||void 0===c?void 0:c.renameFolder))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Folder rename provider is not configured"),placement:"bottomRight",data:{itemId:e,itemName:d,reason:"providerNotConfigured"}});const f=await i.dataProviders.renameFolder(e,d);if(!(null==f?void 0:f.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:e,itemName:d,reason:"invalidResponse"}});await b(),e!==f.id&&r.setSelectedFolder&&r.setSelectedFolder(f.id),s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:f.id,itemName:f.name,folderId:null!==(u=f.parentId)&&void 0!==u?u:null}})}catch(n){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:n,data:{itemId:e,itemName:t,reason:n instanceof Error?n.message:String(n)}})}},[b,l,null===(e=i.dataProviders)||void 0===e?void 0:e.renameFolder,null===(t=null==v?void 0:v.features)||void 0===t?void 0:t.enableRenameFolder,r.setSelectedFolder,s,a]);return{state:{folders:l,isCreatingFolder:h,loading:d},actions:{fetchFolders:b,fetchChildFolders:w,handleCreateFolder:x,handleModalOk:S,handleModalCancel:k,generateMenuItems:j,renameFolder:E}}},Hr=()=>{var e,t;const{state:n,actions:r,options:i}=Rr(),a=Nr(),{sortBy:s,sortOrder:l}=a.state,{actions:{fetchFolders:c}}=Wr(),{t:u}=hn(),d=zr(),{selectedFolder:h,urlForm:f,pagination:p,files:g}=n,m=o.useRef(null);m.current=p;const{setFiles:v,setLoading:y,setIsUrlModalVisible:b,setSelectedFiles:w,setActiveLibraryItem:x,setPagination:C}=r,{dataProviders:_}=i,S=(0,o.useCallback)(async e=>{var t,n,r;if(!(null==_?void 0:_.getFiles))return[];const o=null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.disablePagination,{files:a,pagination:s}=await _.getFiles({folderId:"folders"!==(null==e?void 0:e.folderId)?null==e?void 0:e.folderId:void 0,search:(null===(n=null==e?void 0:e.search)||void 0===n?void 0:n.trim())||void 0,sortBy:null==e?void 0:e.sortBy,sortOrder:null==e?void 0:e.sortOrder,page:o||null==e?void 0:e.page,limit:o||null==e?void 0:e.limit,itemType:(null==e?void 0:e.itemType)||"all"});return C&&((null===(r=null==i?void 0:i.config)||void 0===r?void 0:r.disablePagination)?C({current:1,pageSize:a.length||1,total:a.length||0}):s&&C({current:s.page,pageSize:s.limit,total:s.total})),a},[_,null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.disablePagination,C]),k=(0,o.useCallback)(async e=>{try{null==y||y(!0);let t=[];if(!(null==_?void 0:_.getFiles))return;t=await S(e);const n=null!=e?e:{folderId:h||"",itemType:"all"};"file"!==n.itemType&&(t=await(async(e,t,n)=>{var r;if("file"===(null==t?void 0:t.itemType))return e;let i=[];if(!n)return e;{const e=await n({parentId:t.folderId});i=Array.isArray(e)?e:[]}let o=((e,t)=>{const n=Array.isArray(e)?e:[];return(r=t.folderId)&&"root"!==r&&"folders"!==r&&"null"!==r&&null!==r?n.filter(e=>e.parentId===t.folderId):n.filter(Dr);var r})(i,t);if(null===(r=null==t?void 0:t.search)||void 0===r?void 0:r.trim()){const e=t.search.trim().toLowerCase();o=o.filter(t=>{var n;return null===(n=t.name)||void 0===n?void 0:n.toLowerCase().includes(e)})}if(0===o.length)return e;const a=o.map(e=>({id:e.id,name:e.name,size:void 0,date:"-",isFolder:!0,folderId:e.parentId||"",type:"",selected:!1,extension:""}));return"folder"===(null==t?void 0:t.itemType)?a:[...a,...e]})(t,n,null==_?void 0:_.getFolders)),"Trash"!==(h||"")&&(t=t.filter(e=>!(e.isFolder&&"Trash"===e.id))),null==v||v(t),null==w||w(new Set)}catch(t){const r=Ur(t),i=Vr(null==r?void 0:r.code,u);d.error({id:"FILES_FETCH_FAILED",message:null!=i?i:"\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b",placement:"bottomRight",innerException:t,data:{params:e}})}finally{null==y||y(!1)}},[_,v,y,w,S,h,d]),A=(0,o.useCallback)(async e=>{var t,n;const r=m.current;try{const i=h||null;if(null==_?void 0:_.deleteItems){const r=await _.deleteItems([e]);if(!r.success&&!(null===(t=r.detailed)||void 0===t?void 0:t.every(e=>e.success))){const t=Ur(r.error),o=Vr(null==t?void 0:t.code,u);throw d.error({id:"FILES_DELETE_ERROR",message:null!=o?o:u("Files deleted"),innerException:r.error,placement:"bottomRight",data:{failCount:1,totalCount:1,itemIds:[e],folderId:i,errors:null===(n=r.detailed)||void 0===n?void 0:n.filter(e=>!e.success).map(e=>({itemId:e.requestId,reason:e.error?String(e.error):void 0,code:e.code}))}}),new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u044b")}d.success({id:"FILES_DELETE_SUCCESS",message:u("Files deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:i}})}else{if(!(null==_?void 0:_.deleteFile))return void d.error({id:"FILES_DELETE_ERROR",message:"DataProvider \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d",placement:"bottomRight",data:{failCount:1,totalCount:1,itemIds:[e],folderId:i}});if(!await _.deleteFile(e))throw new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0444\u0430\u0439\u043b");d.success({id:"FILES_DELETE_SUCCESS",message:u("File deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:i}})}await k({folderId:h||"",page:g.length>=1?r.current:r.current-1,limit:r.pageSize,sortBy:s,sortOrder:l})}catch(t){d.error({id:"FILES_DELETE_ERROR",message:u("Error when deleting a file"),placement:"bottomRight",innerException:t,data:{failCount:1,totalCount:1,itemIds:[e],folderId:h||null,errors:[{itemId:e,reason:t instanceof Error?t.message:String(t)}]}})}},[_,k,h,u,d,g,s,l]),j=(0,o.useCallback)(async e=>{try{const t=m.current;if(!(null==_?void 0:_.deleteFolder))return void d.error({id:"FOLDER_DELETE_ERROR",message:"DataProvider \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d",placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e}});if(!await _.deleteFolder(e))throw new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443");d.success({id:"FOLDER_DELETE_SUCCESS",message:u("Folder deleted"),placement:"bottomRight",data:{successCount:1,totalCount:1,itemIds:[e],folderId:e}}),h===e?await k({page:t.current,limit:t.pageSize,sortBy:s,sortOrder:l}):await k({folderId:h||"",sortBy:s,sortOrder:l,page:t.current,limit:t.pageSize})}catch(t){d.error({id:"FOLDER_DELETE_ERROR",message:u("Error when deleting a folder"),innerException:t,placement:"bottomRight",data:{totalCount:1,failCount:1,itemIds:[e],folderId:e,errors:[{itemId:e,reason:t instanceof Error?t.message:String(t)}]}})}},[_,h,d,u,k,s,l]),E=(0,o.useCallback)(async e=>{var t,n;try{if(null==_?void 0:_.getFileData){const t=await _.getFileData(e);if(t)return t;throw new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b")}{const t=await fetch(`/api/files/${e.id}/content`);if(!t.ok)throw new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430");return await t.blob()}}catch(r){d.error({id:"FILE_DOWNLOAD_FAILED",message:u("Failed to download file"),placement:"bottomRight",description:e.name,innerException:r,data:{itemId:e.id,itemName:e.name,folderId:null!==(t=e.folderId)&&void 0!==t?t:null,thumbnail:null!==(n=e.thumbnail)&&void 0!==n?n:null}})}},[_,d,u]),I=(0,o.useCallback)(async(e,t)=>{if(!(null==_?void 0:_.uploadFile))return;const n=e.name.split(".").pop()||"",r=await _.uploadFile({name:e.name,size:e.size,type:e.type,folderId:null!=t?t:h||"",data:e,extension:n});return x&&x(jt),r},[_,h,x]),T=(0,o.useCallback)(async(e,t)=>{var n;if(!(null==_?void 0:_.getFolders)||!(null==_?void 0:_.createFolder))return e||"";try{const r=await _.getFolders(),i=Array.isArray(r)?r:[],o=(e,t)=>i.find(n=>{var r;return(null!==(r=n.parentId)&&void 0!==r?r:null)===(null!=e?e:null)&&n.name===t});let a=null!=e?e:"";for(const e of t){if(!e)continue;let t=o(a,e);if(!t){const n=await _.createFolder({name:e,parentId:null!=a?a:null});i.push(n),t=n}a=t.id}return null!==(n=a)&&void 0!==n?n:e||""}catch(t){return e||""}},[_]),O=(0,o.useCallback)(async(e,t)=>{var n,r,i;if(!(null===(r=null===(n=e.type)||void 0===n?void 0:n.startsWith)||void 0===r?void 0:r.call(n,"image/")))return null!=t?t:null;const o=null==e?void 0:e.webkitRelativePath;let a=t||"";if(o&&o.includes("/")){const e=o.split("/");e.pop();const n=e.filter(Boolean);n.length&&(a=await T(t||"",n)||t||"")}return null!==(i=a)&&void 0!==i?i:null!=t?t:null},[T]),F=(0,o.useCallback)(async e=>{var t,n,r,i,o,a,s,l,c,u,d;const{file:h,selectedFolderId:f,uploadFn:p,progressCallbacks:g}=e;if(!(null===(n=null===(t=h.type)||void 0===t?void 0:t.startsWith)||void 0===n?void 0:n.call(t,"image/")))return{success:!0,fileName:h.name,folderId:null!=f?f:null};const m=null!==(r=await O(h,f))&&void 0!==r?r:null!=f?f:null,v=null!==(i=null!=m?m:f)&&void 0!==i?i:null;let y;null===(o=null==g?void 0:g.onStart)||void 0===o||o.call(g,h);try{if(null==g?void 0:g.onProgress){let e=0;y=window.setInterval(()=>{var t;e=Math.min(e+10+Math.floor(Date.now()%10),90),null===(t=null==g?void 0:g.onProgress)||void 0===t||t.call(g,h.name,e)},200)}const e=await p(h,null!=v?v:void 0);return(null==g?void 0:g.onProgress)&&(null===(a=null==g?void 0:g.onProgress)||void 0===a||a.call(g,h.name,100)),null===(s=null==g?void 0:g.onComplete)||void 0===s||s.call(g,h.name),{success:!0,fileName:h.name,fileId:null==e?void 0:e.id,folderId:null!==(c=null!==(l=null==e?void 0:e.folderId)&&void 0!==l?l:v)&&void 0!==c?c:null}}catch(e){const t=e instanceof Error?e.message:String(e);return null===(u=null==g?void 0:g.onError)||void 0===u||u.call(g,h.name,t),{success:!1,fileName:h.name,folderId:null!==(d=null!=v?v:f)&&void 0!==d?d:null,error:t}}finally{void 0!==y&&clearInterval(y)}},[O]),P=(0,o.useCallback)(async(e,t)=>{var n,r,i,o,a,s,l,c,f,p,g,m,v,y,b,w,C,S,k,A,j,E,T,P,M,R,L,D,N,z;if(0===e.length)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};null===(n=null==t?void 0:t.onStartBatch)||void 0===n||n.call(t,e);const B=e=>{const t=e.filter(Boolean);return t.length>0&&t.length<=5?t.join(", "):null},V=[];for(let u=0;u<e.length;u++){const n=e[u];if(!(null===(i=null===(r=n.type)||void 0===r?void 0:r.startsWith)||void 0===i?void 0:i.call(r,"image/"))){d.warning({id:"FILES_UPLOAD_UNSUPPORTED_TYPE",message:`\u0424\u0430\u0439\u043b ${n.name} \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d`,placement:"bottomRight",data:{itemName:n.name,fileType:n.type,folderId:h||null}}),null===(o=null==t?void 0:t.onError)||void 0===o||o.call(t,n.name,"Unsupported file type");continue}const s=`${Date.now()}-${u}-${Math.random().toString(36).slice(2,8)}`,l=await O(n,h);null===(a=null==t?void 0:t.onStart)||void 0===a||a.call(t,n),V.push({file:n,targetFolderId:l,requestId:s})}const U=V.length;if(0===U)return{successCount:0,failCount:0,successes:[],errors:[],totalCount:0};const W=1===U,H=[],$=[],G=[],Y=[];let q=0,X=0;const K=(e,n,r,i)=>{var o,a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=i?i:{};q++,H.push(e),$.push(null!=r?r:e),s&&(null===(o=null==t?void 0:t.onProgress)||void 0===o||o.call(t,e,100),null===(a=null==t?void 0:t.onComplete)||void 0===a||a.call(t,e)),l&&((e,t,n)=>{var r;d.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${u("File")} ${e} ${u("has been successfully uploaded")}`,placement:"bottomRight",data:{itemId:n,itemName:e,folderId:null!==(r=null!=t?t:h)&&void 0!==r?r:null}})})(e,n,r)},Z=(e,n,r,i,o)=>{var a;const{emitProgress:s=!0,emitNotification:l=!0}=null!=o?o:{};X++,G.push({fileName:e,error:r});const c=Ur(i);Y.push({itemId:void 0,itemName:e,reason:r,code:null==c?void 0:c.code,httpStatus:null==c?void 0:c.httpStatus}),s&&(null===(a=null==t?void 0:t.onError)||void 0===a||a.call(t,e,r)),l&&((e,t,n,r)=>{var i;const o=Ur(r),a=Vr(null==o?void 0:o.code,u);d.error({id:"FILE_UPLOAD_ITEM_FAILED",message:null!=a?a:`\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430 ${e}`,placement:"bottomRight",data:{itemName:e,folderId:null!==(i=null!=t?t:h)&&void 0!==i?i:null,error:n,errorCode:null==o?void 0:o.code,httpStatus:null==o?void 0:o.httpStatus},innerException:r})})(e,n,r,i)};if(null==_?void 0:_.uploadFiles)try{const e=await _.uploadFiles({items:V.map(e=>{var t,n;return{requestId:e.requestId,name:e.file.name,size:e.file.size,type:e.file.type,folderId:null!==(n=null!==(t=e.targetFolderId)&&void 0!==t?t:h)&&void 0!==n?n:null,data:e.file,extension:e.file.name.split(".").pop()||""}}),folderId:null!=h?h:null}),t=null!==(s=e.detailed)&&void 0!==s?s:[],n=new Map(t.filter(e=>e.requestId).map(e=>[e.requestId,e]));if(t.length>0)for(let r=0;r<V.length;r++){const e=V[r],i=null!==(l=e.requestId?n.get(e.requestId):void 0)&&void 0!==l?l:t[r];if(i&&i.success){const t=i.data,n=null!==(c=null==t?void 0:t.name)&&void 0!==c?c:e.file.name;K(n,null!==(g=null!==(p=null!==(f=null==t?void 0:t.folderId)&&void 0!==f?f:e.targetFolderId)&&void 0!==p?p:h)&&void 0!==g?g:null,null==t?void 0:t.id,{emitNotification:W})}else{const t=(null==i?void 0:i.error)?String(i.error):"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430",n=null==i?void 0:i.data;Z(null!==(m=null==n?void 0:n.name)&&void 0!==m?m:e.file.name,null!==(b=null!==(y=null!==(v=null==n?void 0:n.folderId)&&void 0!==v?v:e.targetFolderId)&&void 0!==y?y:h)&&void 0!==b?b:null,t,null==i?void 0:i.error,{emitNotification:W})}}else if(e.success)for(const r of V){K(r.file.name,null!==(C=null!==(w=r.targetFolderId)&&void 0!==w?w:h)&&void 0!==C?C:null,void 0,{emitNotification:W})}else{const t=e.error?String(e.error):"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430";for(const n of V){Z(n.file.name,null!==(k=null!==(S=n.targetFolderId)&&void 0!==S?S:h)&&void 0!==k?k:null,t,e.error,{emitNotification:W})}}}catch(e){const t=e instanceof Error?e.message:String(e);for(const n of V)Z(n.file.name,null!==(j=null!==(A=n.targetFolderId)&&void 0!==A?A:h)&&void 0!==j?j:null,t,e,{emitNotification:W})}else{if(!(null==_?void 0:_.uploadFile))return d.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:"DataProvider \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d",placement:"bottomRight"}),{successCount:0,failCount:U,successes:[],errors:[],totalCount:U};for(const e of V){const n=await F({file:e.file,selectedFolderId:h,uploadFn:I,progressCallbacks:t});if(n.success)K(n.fileName,null!==(P=null!==(T=null!==(E=n.folderId)&&void 0!==E?E:e.targetFolderId)&&void 0!==T?T:h)&&void 0!==P?P:null,n.fileId,{emitProgress:!1,emitNotification:W});else{const t=null!==(M=n.error)&&void 0!==M?M:"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u0444\u0430\u0439\u043b\u0430";Z(n.fileName,null!==(D=null!==(L=null!==(R=n.folderId)&&void 0!==R?R:e.targetFolderId)&&void 0!==L?L:h)&&void 0!==D?D:null,t,n.error,{emitProgress:!1,emitNotification:W})}}}if(q>0&&(x&&x(jt),U>1)){const e=B(H),t=e?u("Uploaded",{names:e}):u("uploads_success_summary",{successCount:q,totalCount:U});d.success({id:"FILES_UPLOAD_BATCH_SUCCESS",message:t,placement:"bottomRight",data:{successCount:q,totalCount:U,itemIds:$,itemNames:H,folderId:null!=h?h:null}})}if(X>0)if(U>1){const e=G.map(e=>e.fileName),t=B(e),n=t?u("Failed",{names:t}):u("uploads_fail_summary",{failCount:X,totalCount:U});d.error({id:"FILES_UPLOAD_BATCH_FAILED",message:n,placement:"bottomRight",data:{failCount:X,totalCount:U,itemNames:e,folderId:null!=h?h:null,errors:Y}})}else if(1===U&&Y.length>0&&Y[0].code){const e=Vr(Y[0].code,u),t=null!==(z=null===(N=G[0])||void 0===N?void 0:N.fileName)&&void 0!==z?z:"",n=null!=e?e:t?`${u("Failed to upload files")}: ${t}`:u("Failed to upload files");d.error({id:"FILES_UPLOAD_BATCH_FAILED",message:n,placement:"bottomRight",data:{failCount:X,totalCount:U,itemNames:[t],folderId:null!=h?h:null,errors:Y}})}return{successCount:q,failCount:X,successes:H,errors:G,totalCount:U}},[null==_?void 0:_.uploadFiles,null==_?void 0:_.uploadFile,d,O,h,x,u,F,I]),M=(0,o.useCallback)(async e=>{var t;if(!(null==_?void 0:_.uploadFile)&&!(null==_?void 0:_.uploadFiles))return void d.error({id:"FILES_UPLOAD_PROVIDER_NOT_CONFIGURED",message:"DataProvider \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d",placement:"bottomRight"});const n=m.current,r=document.createElement("input");r.type="file",r.accept="image/*",r.multiple=!0;try{(null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.features)&&i.config.features.enableDirectoryUpload&&(r.webkitdirectory=!0)}catch(e){}r.onchange=async t=>{var r;const i=t.target.files;if(!i||0===i.length)return;const o=Array.from(i);try{null==y||y(!0);const{successes:t,errors:i}=await P(o,e);null===(r=null==e?void 0:e.onBatchComplete)||void 0===r||r.call(e,{files:o,successes:t,errors:i}),await c(),await k({folderId:h||"",sortBy:s,sortOrder:l,page:n.current,limit:n.pageSize})}catch(e){}finally{null==y||y(!1)}},r.click()},[null==_?void 0:_.uploadFile,null==_?void 0:_.uploadFiles,h,d,u,y,k,c,s,l,P,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.features]),R=(0,o.useCallback)(async(e,t)=>{const n=m.current;let r,i,o;try{if(i=await(null==f?void 0:f.validateFields()),r=null!=e?e:null==i?void 0:i.fileUrl,!r)return void d.error({id:"FILES_UPLOAD_URL_VALIDATION_FAILED",message:"\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0432\u0441\u0435 \u043f\u043e\u043b\u044f",placement:"bottomRight",data:{url:null!=r?r:null,folderId:h||null}});if(null==y||y(!0),!(null==_?void 0:_.uploadFileByUrl))return void d.error({id:"FILES_UPLOAD_URL_NOT_SUPPORTED",message:"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043f\u043e URL \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f",placement:"bottomRight",data:{url:r,folderId:h||null}});o=await _.uploadFileByUrl({url:r,folderId:h||"",noFolder:t});const a=(null==i?void 0:i.name)||(null==o?void 0:o.name)||"unnamed file";return d.success({id:"FILE_UPLOAD_ITEM_SUCCESS",message:`${u("File")} ${a} ${u("successfully uploaded")}`,placement:"bottomRight",data:{itemName:a,itemId:null==o?void 0:o.id,folderId:h||null}}),null==b||b(!1),null==f||f.resetFields(),x&&x(jt),await k({folderId:h||"",sortBy:s,sortOrder:l,page:n.current,limit:n.pageSize}),o}catch(e){d.error({id:"FILES_UPLOAD_BY_URL_FAILED",message:u("Error when downloading a file by URL"),placement:"bottomRight",data:{url:null!=r?r:null,folderId:h||null,reason:e instanceof Error?e.message:String(e)},innerException:e})}finally{null==y||y(!1)}},[f,y,_,d,u,b,x,k,h,s,l]),L=(0,o.useCallback)(async e=>{if(!e.length)return;const t=m.current;await P(e),await k({folderId:h||"",sortBy:s,sortOrder:l,page:t.current,limit:t.pageSize})},[k,h,s,l,P]);return{fetchFiles:k,handleDeleteFile:A,handleDeleteFolder:j,handleAddFile:M,handleAddFileByUrl:R,handleDroppedFiles:L,getFileData:E,uploadFileWithProvider:I}},$r="filemanager_sidebar_width",Gr=({onSearch:e,placeholder:t="\u041f\u043e\u0438\u0441\u043a \u0444\u0430\u0439\u043b\u043e\u0432...",className:n})=>{const[r,a]=(0,o.useState)(""),s=(0,o.useRef)(null),{options:l}=Rr(),{config:c}=l;return(0,o.useEffect)(()=>(s.current=Pr.debounce(t=>{e(t)},500),()=>{var e;null===(e=s.current)||void 0===e||e.cancel()}),[e]),(0,i.jsx)(w.A,{value:r,onChange:e=>{var t;const n=e.target.value;a(n),null===(t=s.current)||void 0===t||t.call(s,n)},placeholder:t,prefix:(0,i.jsx)(Ar,{size:16,strokeWidth:null==c?void 0:c.iconStrokeWidth}),className:n,allowClear:!0,onClear:()=>{a(""),e("")}})},Yr=new Map,qr=e=>{if(e.type&&e.type.startsWith("image/"))return!0;if(e.name){const t=e.name.toLowerCase().split(".").pop();return Lt.includes(t||"")}return!1},Xr=({src:e,alt:t,className:n,width:r,height:a,preview:s=!1,file:l})=>{const c=Hr(),[u,d]=(0,o.useState)(!1),[h,f]=(0,o.useState)(e),[p,g]=(0,o.useState)(!1),m=(0,o.useCallback)(e=>{f(e),d(!1),g(!1)},[]),v=(0,o.useCallback)(e=>{f(void 0),d(!0),g(!1)},[]),y=(0,o.useCallback)(()=>{f(Dt),d(!0)},[]),w=(0,o.useCallback)(e=>{f(e),d(!1)},[]),x=(0,o.useCallback)(e=>{const t=e.split(",")[1];t&&t.length>20?f(e):y()},[y]),C=(0,o.useCallback)(async e=>{if(t=e.id,Yr.has(t))return(e=>Yr.get(e))(e.id);var t;if(!e||!qr(e))return y(),Dt;try{const t=await c.getFileData(e);if(!t)throw new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430");return new Promise((n,r)=>{const i=new FileReader;i.onload=()=>{const t=i.result;((e,t)=>{Yr.set(e,t),Yr.size>350&&Array.from(Yr.keys()).slice(0,50).forEach(e=>Yr.delete(e))})(e.id,t),n(t)},i.onerror=()=>r(new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430")),i.readAsDataURL(t)})}catch(e){throw e}},[l,y,c]),_=(0,o.useCallback)(()=>{(null==l?void 0:l.id)&&qr(l)?C(l).then(m).catch(v):l&&!qr(l)&&y()},[l,C,m,v,y]),S=(0,o.useCallback)(e=>{l&&qr(l)?(f(e),d(!1)):y()},[l,y,qr]),k=(0,o.useCallback)(()=>{(null==l?void 0:l.id)&&qr(l)?(g(!0),C(l).then(m).catch(v)):l&&!qr(l)?y():f(void 0)},[l,e,C,m,v,y]);return(0,o.useEffect)(()=>{g(!1),e?e.startsWith("data:image/")?x(e):e.startsWith("blob:")?S(e):e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?w(e):k():_()},[e,_,x,S,w,k]),(0,i.jsx)(b.A,{className:n,src:h,alt:t,width:r,height:a,preview:s&&!u&&{src:h,toolbarRender:()=>null,destroyOnHidden:!0,mask:(0,i.jsx)(G.A,{style:{fontSize:"20px"}})},onError:()=>{d(!0)},fallback:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCA4MCA4MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjgwIiBoZWlnaHQ9IjgwIiBmaWxsPSIjRjVGNUY1Ii8+CjxwYXRoIGQ9Ik0yNCAzMkw0MCA0OEw1NiAzMkw2NCA0MEw2NCA2NEgyNFYzMloiIGZpbGw9IiNEOUQ5RDkiLz4KPC9zdmc+",loading:p?"lazy":void 0})},Kr="filemanager_view_mode",Zr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"mixed-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h2v2H1V1zm0 4h2v2H1V5zm0 4h2v2H1V9zm4-8h2v2H5V1zm0 4h2v2H5V5zm0 4h2v2H5V9zm4-8h2v2H9V1zm0 4h2v2H9V5zm0 4h2v2H9V9z"})}),Jr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"landscape-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 3h10v6H1V3zm1 1v4h8V4H2z"})}),Qr=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"portrait-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 1h6v10H3V1zm1 1v8h4V2H4z"})}),ei=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"square-view",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M1 1h10v10H1V1zm1 1v8h8V2H2z"})}),ti=()=>(0,i.jsxs)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"ai-icon",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M2.45454 11.7273C2.45454 11.7273 2.16994 10.446 1.66154 9.88113C1.15314 9.31625 0 9 0 9C0 9 1.15314 8.68374 1.66154 8.11887C2.16994 7.554 2.45454 6.27273 2.45454 6.27273C2.45454 6.27273 2.73915 7.554 3.24755 8.11887C3.75594 8.68374 4.90909 9 4.90909 9C4.90909 9 3.75594 9.31625 3.24755 9.88113C2.73915 10.446 2.45454 11.7273 2.45454 11.7273Z"}),(0,i.jsx)("path",{d:"M7.63636 9C7.63636 9 7.1304 6.94996 6.22658 6.04614C5.32276 5.14233 3.27273 4.63636 3.27273 4.63636C3.27273 4.63636 5.32276 4.1304 6.22658 3.22657C7.1304 2.32275 7.63636 0.272728 7.63636 0.272728C7.63636 0.272728 8.14233 2.32275 9.04615 3.22657C9.94996 4.1304 12 4.63636 12 4.63636C12 4.63636 9.94996 5.14233 9.04615 6.04614C8.14233 6.94996 7.63636 9 7.63636 9Z"}),(0,i.jsx)("path",{d:"M1.63636 4.09091C1.63636 4.09091 1.44663 3.19402 1.10769 2.7986C0.768758 2.40318 0 2.18182 0 2.18182C0 2.18182 0.768758 1.96046 1.10769 1.56503C1.44663 1.16961 1.63636 0.272728 1.63636 0.272728C1.63636 0.272728 1.8261 1.16961 2.16503 1.56503C2.50397 1.96046 3.27273 2.18182 3.27273 2.18182C3.27273 2.18182 2.50397 2.40318 2.16503 2.7986C1.8261 3.19402 1.63636 4.09091 1.63636 4.09091Z"}),(0,i.jsx)("path",{d:"M10.6364 11.7273C10.6364 11.7273 10.4782 11.0866 10.1958 10.8042C9.91336 10.5218 9.27273 10.3636 9.27273 10.3636C9.27273 10.3636 9.91336 10.2055 10.1958 9.92307C10.4782 9.64064 10.6364 9 10.6364 9C10.6364 9 10.7945 9.64064 11.0769 9.92307C11.3594 10.2055 12 10.3636 12 10.3636C12 10.3636 11.3594 10.5218 11.0769 10.8042C10.7945 11.0866 10.6364 11.7273 10.6364 11.7273Z"})]}),ni=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"light-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 7.81819C6.50303 7.81819 6.93182 7.64092 7.28637 7.28637C7.64092 6.93182 7.81819 6.50303 7.81819 6C7.81819 5.49697 7.64092 5.06818 7.28637 4.71363C6.93182 4.35908 6.50303 4.18181 6 4.18181C5.49697 4.18181 5.06818 4.35908 4.71363 4.71363C4.35908 5.06818 4.18181 5.49697 4.18181 6C4.18181 6.50303 4.35908 6.93182 4.71363 7.28637C5.06818 7.64092 5.49697 7.81819 6 7.81819ZM6 8.72727C5.24545 8.72727 4.60227 8.46136 4.07045 7.92955C3.53864 7.39773 3.27273 6.75455 3.27273 6C3.27273 5.24545 3.53864 4.60227 4.07045 4.07045C4.60227 3.53864 5.24545 3.27273 6 3.27273C6.75455 3.27273 7.39773 3.53864 7.92955 4.07045C8.46136 4.60227 8.72727 5.24545 8.72727 6C8.72727 6.75455 8.46136 7.39773 7.92955 7.92955C7.39773 8.46136 6.75455 8.72727 6 8.72727ZM2.18182 6.45454H0V5.54546H2.18182V6.45454ZM12 6.45454H9.81818V5.54546H12V6.45454ZM5.54546 2.18182V0H6.45454V2.18182H5.54546ZM5.54546 12V9.81818H6.45454V12H5.54546ZM3 3.6091L1.63182 2.28637L2.28181 1.61819L3.5909 2.98182L3 3.6091ZM9.72727 10.3727L8.39546 9.00454L9.0091 8.38182L10.3682 9.71363L9.72727 10.3727ZM8.38182 2.9909L9.71363 1.63182L10.3818 2.27273L9.02727 3.6L8.38182 2.9909ZM1.62727 9.71819L2.98636 8.38636L3.61818 9.0091L2.28637 10.3682L1.62727 9.71819Z"})}),ri=()=>(0,i.jsx)("svg",{viewBox:"0 0 12 12",focusable:"false","data-icon":"dark-mode",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M6 11C4.61111 11 3.43056 10.5139 2.45833 9.54167C1.48611 8.56944 1 7.38889 1 6C1 4.61111 1.48611 3.43056 2.45833 2.45833C3.43056 1.48611 4.61111 1 6 1C6.09259 1 6.1875 1.00309 6.28472 1.00926C6.38194 1.01543 6.49382 1.02469 6.62036 1.03704C6.2716 1.32408 5.99769 1.68442 5.79861 2.11806C5.59954 2.55169 5.5 3.01234 5.5 3.5C5.5 4.33333 5.79167 5.04167 6.375 5.625C6.95833 6.20833 7.66667 6.5 8.5 6.5C8.99074 6.5 9.45216 6.40509 9.88426 6.21528C10.3164 6.02546 10.6759 5.76544 10.963 5.43519C10.9753 5.54939 10.9846 5.65047 10.9907 5.73843C10.9969 5.82639 11 5.91358 11 6C11 7.38889 10.5139 8.56944 9.54167 9.54167C8.56944 10.5139 7.38889 11 6 11ZM6 10.0741C6.94444 10.0741 7.77469 9.7909 8.49075 9.22454C9.20681 8.65818 9.67594 7.97376 9.89815 7.17129C9.68211 7.25463 9.45474 7.3179 9.21606 7.36111C8.97737 7.40431 8.73869 7.42592 8.5 7.42592C7.41242 7.42592 6.4862 7.0435 5.72135 6.27865C4.9565 5.5138 4.57408 4.58758 4.57408 3.5C4.57408 3.29012 4.59414 3.06944 4.63426 2.83796C4.67438 2.60648 4.74229 2.35185 4.83797 2.07407C3.99229 2.3395 3.29552 2.83487 2.74768 3.56018C2.19984 4.28549 1.92592 5.09876 1.92592 6C1.92592 7.12963 2.32252 8.09105 3.11574 8.88426C3.90895 9.67748 4.87037 10.0741 6 10.0741Z"})}),ii=()=>(0,i.jsxs)("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{opacity:"0.5",d:"M6 19H49C54.5229 19 59 23.4772 59 29V46C59 51.5228 54.5228 56 49 56H14C9.58172 56 6 52.4183 6 48V19Z",fill:"#91CAFF"}),(0,i.jsx)("path",{d:"M6 19L34.866 18.5L30.7172 11.0737C29.6569 9.17588 27.6531 8 25.4792 8H10C7.79086 8 6 9.79086 6 12V19Z",stroke:"currentColor"}),(0,i.jsx)("path",{d:"M34.6663 18.6667L31.6916 12.7171C30.8354 11.0048 30.4073 10.1486 29.7687 9.5231C29.2039 8.96995 28.5232 8.54926 27.7759 8.29149C26.9308 8 25.9736 8 24.0591 8H13.8663C10.8794 8 9.38592 8 8.24506 8.5813C7.24153 9.09262 6.42563 9.90852 5.91431 10.9121C5.33301 12.0529 5.33301 13.5464 5.33301 16.5333V18.6667M5.33301 18.6667H45.8663C50.3468 18.6667 52.587 18.6667 54.2983 19.5386C55.8036 20.3056 57.0274 21.5294 57.7944 23.0347C58.6663 24.746 58.6663 26.9862 58.6663 31.4667V43.2C58.6663 47.6804 58.6663 49.9206 57.7944 51.6319C57.0274 53.1372 55.8036 54.3611 54.2983 55.1281C52.587 56 50.3468 56 45.8663 56H18.133C13.6526 56 11.4124 56 9.70108 55.1281C8.19579 54.3611 6.97194 53.1372 6.20496 51.6319C5.33301 49.9206 5.33301 47.6804 5.33301 43.2V18.6667Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),oi=()=>(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M10.8337 5.83333L9.90404 3.9741C9.6365 3.439 9.50271 3.17144 9.30313 2.97597C9.12664 2.80311 8.91393 2.67164 8.68039 2.59109C8.4163 2.5 8.11716 2.5 7.5189 2.5H4.33366C3.40024 2.5 2.93353 2.5 2.57701 2.68166C2.2634 2.84144 2.00844 3.09641 1.84865 3.41002C1.66699 3.76654 1.66699 4.23325 1.66699 5.16667V5.83333M1.66699 5.83333H14.3337C15.7338 5.83333 16.4339 5.83333 16.9686 6.10582C17.439 6.3455 17.8215 6.72795 18.0612 7.19836C18.3337 7.73314 18.3337 8.4332 18.3337 9.83333V13.5C18.3337 14.9001 18.3337 15.6002 18.0612 16.135C17.8215 16.6054 17.439 16.9878 16.9686 17.2275C16.4339 17.5 15.7338 17.5 14.3337 17.5H5.66699C4.26686 17.5 3.5668 17.5 3.03202 17.2275C2.56161 16.9878 2.17916 16.6054 1.93948 16.135C1.66699 15.6002 1.66699 14.9001 1.66699 13.5V5.83333Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),ai=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M32 24.5L24 16.5M24 16.5L16 24.5M24 16.5V34.9C24 37.6814 24 39.0721 25.101 40.6292C25.8326 41.6638 27.9388 42.9406 29.1944 43.1108C31.0842 43.3668 31.8019 42.9924 33.2371 42.2437C39.6333 38.9071 44 32.2135 44 24.5C44 13.4543 35.0457 4.5 24 4.5C12.9543 4.5 4 13.4543 4 24.5C4 31.9028 8.02199 38.3663 14 41.8244",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),si=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#8946FB"}),(0,i.jsx)("path",{d:"M28 36.4722C29.0615 37.4223 30.4633 38 32 38C35.3137 38 38 35.3137 38 32C38 29.2331 36.1271 26.9036 33.5798 26.2102M22.4202 26.2102C19.8729 26.9036 18 29.2331 18 32C18 35.3137 20.6863 38 24 38C27.3137 38 30 35.3137 30 32C30 31.2195 29.851 30.4738 29.5798 29.7898M34 24C34 27.3137 31.3137 30 28 30C24.6863 30 22 27.3137 22 24C22 20.6863 24.6863 18 28 18C31.3137 18 34 20.6863 34 24Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),li=()=>(0,i.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("rect",{width:"56",height:"56",rx:"24",fill:"#7ED846"}),(0,i.jsx)("path",{d:"M20.5 38V33M20.5 23V18M18 20.5H23M18 35.5H23M29 19L27.2658 23.5089C26.9838 24.2421 26.8428 24.6087 26.6235 24.9171C26.4292 25.1904 26.1904 25.4292 25.9171 25.6235C25.6087 25.8428 25.2421 25.9838 24.5089 26.2658L20 28L24.5089 29.7342C25.2421 30.0162 25.6087 30.1572 25.9171 30.3765C26.1904 30.5708 26.4292 30.8096 26.6235 31.0829C26.8428 31.3913 26.9838 31.7579 27.2658 32.4911L29 37L30.7342 32.4911C31.0162 31.7579 31.1572 31.3913 31.3765 31.0829C31.5708 30.8096 31.8096 30.5708 32.0829 30.3765C32.3913 30.1572 32.7579 30.0162 33.4911 29.7342L38 28L33.4911 26.2658C32.7579 25.9838 32.3913 25.8428 32.0829 25.6235C31.8096 25.4292 31.5708 25.1904 31.3765 24.9171C31.1572 24.6087 31.0162 24.2421 30.7342 23.5089L29 19Z",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ci=()=>(0,i.jsxs)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,i.jsx)("path",{d:"M19 18.4307C19 17.4761 19 16.9988 19.1995 16.7324C19.3733 16.5001 19.6394 16.3549 19.9288 16.3342C20.2608 16.3105 20.6622 16.5686 21.4652 17.0848L30.9064 23.1541C31.6032 23.602 31.9516 23.826 32.0719 24.1108C32.177 24.3596 32.177 24.6404 32.0719 24.8892C31.9516 25.174 31.6032 25.398 30.9064 25.8459L21.4652 31.9152C20.6622 32.4314 20.2608 32.6895 19.9288 32.6658C19.6394 32.6451 19.3733 32.4998 19.1995 32.2676C19 32.0012 19 31.5239 19 30.5693V18.4307Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M6 16.1C6 12.7397 6 11.0595 6.65396 9.77606C7.2292 8.64708 8.14708 7.7292 9.27606 7.15396C10.5595 6.5 12.2397 6.5 15.6 6.5H32.4C35.7603 6.5 37.4405 6.5 38.7239 7.15396C39.8529 7.7292 40.7708 8.64708 41.346 9.77606C42 11.0595 42 12.7397 42 16.1V32.9C42 36.2603 42 37.9405 41.346 39.2239C40.7708 40.3529 39.8529 41.2708 38.7239 41.846C37.4405 42.5 35.7603 42.5 32.4 42.5H15.6C12.2397 42.5 10.5595 42.5 9.27606 41.846C8.14708 41.2708 7.2292 40.3529 6.65396 39.2239C6 37.9405 6 36.2603 6 32.9V16.1Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})]}),ui=()=>(0,i.jsx)("svg",{width:"48",height:"49",viewBox:"0 0 48 49",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{d:"M24 41.4444C26.123 43.3446 28.9266 44.5 32 44.5C38.6274 44.5 44 39.1274 44 32.5C44 26.9662 40.2541 22.3072 35.1596 20.9203M12.8404 20.9203C7.74587 22.3072 4 26.9661 4 32.5C4 39.1274 9.37258 44.5 16 44.5C22.6274 44.5 28 39.1274 28 32.5C28 30.939 27.7019 29.4476 27.1596 28.0797M36 16.5C36 23.1274 30.6274 28.5 24 28.5C17.3726 28.5 12 23.1274 12 16.5C12 9.87258 17.3726 4.5 24 4.5C30.6274 4.5 36 9.87258 36 16.5Z",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeLinejoin:"round"})}),di=e=>(0,i.jsx)(N.A,Object.assign({component:Zr},e)),hi=e=>(0,i.jsx)(N.A,Object.assign({component:Jr},e)),fi=e=>(0,i.jsx)(N.A,Object.assign({component:Qr},e)),pi=e=>(0,i.jsx)(N.A,Object.assign({component:ei},e)),gi=e=>(0,i.jsx)(N.A,Object.assign({component:ti},e)),mi=e=>(0,i.jsx)(N.A,Object.assign({component:ni},e)),vi=e=>(0,i.jsx)(N.A,Object.assign({component:ri},e)),yi=e=>(0,i.jsx)(N.A,Object.assign({component:ii},e)),bi=e=>(0,i.jsx)(N.A,Object.assign({component:oi},e)),wi=e=>(0,i.jsx)(N.A,Object.assign({component:ai},e)),xi=e=>(0,i.jsx)(N.A,Object.assign({component:si},e)),Ci=e=>(0,i.jsx)(N.A,Object.assign({component:li},e)),_i=e=>(0,i.jsx)(N.A,Object.assign({component:ci},e)),Si=e=>(0,i.jsx)(N.A,Object.assign({component:ui},e)),ki=()=>{const{options:e}=Rr(),{customIcons:t}=e,n=(e,n,r)=>{const i=null==t?void 0:t[e];return i?o.createElement(i,r):o.createElement(n,r)};return{RootFolderIcon:e=>n("rootFolder",K.A,e),FolderIcon:e=>n("folder",K.A,e),FolderOpenIcon:e=>n("folderOpen",X.A,e),AddFolderIcon:e=>n("addFolder",q.A,e),FileIcon:e=>n("file",Y.A,e),UploadIcon:e=>n("upload",te.A,e),UploadByUrlIcon:e=>n("uploadByUrl",J.A,e),ExpandArrowIcon:e=>n("expandArrow",ee.A,e),CollapseArrowIcon:e=>n("collapseArrow",$.A,e),ExpandFolderIcon:e=>n("expandArrow",yr,e),CollapseFolderIcon:e=>n("collapseArrow",vr,e),FolderPreviewIcon:e=>n("folderPreview",yi,e),EmptyFolderIcon:e=>n("folderPreview",bi,e),GridViewIcon:e=>n("gridView",z.A,e),ListViewIcon:e=>n("listView",U.A,e),DropZoneFileIcon:e=>n("folderPreview",wi,e),BigStockIcon:e=>n("folderPreview",xi,e),BigAIIcon:e=>n("folderPreview",Ci,e),GifPlayIcon:e=>n("folderPreview",_i,e),StockBigIcon:e=>n("folderPreview",Si,e),MixedViewIcon:e=>n("mixedView",di,e),LandscapeViewIcon:e=>n("landscapeView",hi,e),PortraitViewIcon:e=>n("portraitView",fi,e),SquareViewIcon:e=>n("squareView",pi,e),LightModeIcon:e=>n("lightMode",mi,e),DarkModeIcon:e=>n("darkMode",vi,e),AiIcon_2:e=>n("aiIcon_2",gi,e),getCustomIcon:n}};var Ai={headerContainer:"headerContainer",actionsContainer:"actionsContainer",filesContainer:"filesContainer",paginationContainer:"paginationContainer",uploadIcon:"uploadIcon",tableContainer:"tableContainer",imagePreview:"imagePreview",fileManagerTableFolder:"fileManagerTableFolder",fileManagerTableFolderInner:"fileManagerTableFolderInner",sortSelect:"sortSelect",fileNameCol:"fileNameCol",fileItemCount:"fileItemCount",fileSize:"fileSize",fileDate:"fileDate",tableMenu:"tableMenu",tableImagePreview:"tableImagePreview",tableFolderIcon:"tableFolderIcon",buttonDeselected:"buttonDeselected",gridRow:"gridRow",gridCard:"gridCard",selectedRow:"selectedRow",gridCardSelected:"gridCardSelected",gridCheckbox:"gridCheckbox",gridCardContent:"gridCardContent",gridPreviewContainer:"gridPreviewContainer",gridPreviewContainerFolder:"gridPreviewContainerFolder",gridFolderIcon:"gridFolderIcon",gridFolderIconImage:"gridFolderIconImage",gridFileName:"gridFileName",gridFileInfo:"gridFileInfo",gridFileMenu:"gridFileMenu",gridFileMenuButton:"gridFileMenuButton",actionsBox:"actionsBox",uploadContainer:"uploadContainer",uploadArea:"uploadArea",active:"active",blockText:"blockText",textTitle:"textTitle",textDescription:"textDescription",buttons:"buttons",btnAi:"btnAi",btnPhoto:"btnPhoto",dragOverlay:"dragOverlay",dragOverlayInner:"dragOverlayInner",noFiles:"noFiles"};const{Text:ji}=L.A,{Option:Ei}=E.A,Ii=({files:e,searchTerm:t,handleSearch:n,handleSort:r,sortBy:a,sortOrder:s,handleSortOptionChange:l,pagination:d,setPagination:g,loading:y,handleItemClick:b,selectedFiles:w,toggleFileSelection:x,handleDroppedFiles:C,onRename:_,onDelete:k,onCopy:T,onMove:F,onEdit:P,fileUpload:R,handleAddFile:L})=>{var D,N,z;const{t:B}=hn(),{DropZoneFileIcon:V,BigStockIcon:U,BigAIIcon:W,FolderIcon:H}=ki(),{options:$,actions:G}=Rr();zr();const Y=null===(D=null==$?void 0:$.config)||void 0===D?void 0:D.disablePagination,{dataProviders:q}=$,{setCurrentMenuFile:X,setSelectedFiles:K,setActiveLibraryItem:Z}=G,{viewMode:J,setViewMode:Q}=(()=>{const[e,t]=(0,o.useState)(()=>{try{return localStorage.getItem(Kr)||"table"}catch(e){return"table"}}),n=(0,o.useCallback)(e=>{t(e);try{localStorage.setItem(Kr,e)}catch(e){}},[]),r=(0,o.useCallback)(()=>{n("table"===e?"grid":"table")},[e,n]);return{viewMode:e,setViewMode:n,toggleViewMode:r}})(),[ee,te]=(0,o.useState)(!1),[ne,re]=(0,o.useState)({}),[ie,oe]=(0,o.useState)(null),[ae,se]=(0,o.useState)(!1),le=(0,o.useRef)(0);(0,o.useEffect)(()=>{const e=()=>{se(window.innerWidth<1200)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const ce=w.size,ue=(null===(N=$.config)||void 0===N?void 0:N.features)||{},de=o.useMemo(()=>Array.from(w)[0],[w]),he=o.useMemo(()=>de?e.find(e=>e.id===de):void 0,[de,e]),fe=(null==he?void 0:he.isFolder)?!1!==(null==ue?void 0:ue.enableRenameFolder):!1!==(null==ue?void 0:ue.enableRenameFile),pe=null===(z=$.config)||void 0===z?void 0:z.iconStrokeWidth,ge=o.useMemo(()=>{var e;if(1!==ce||!he||he.isFolder)return!1;let t=!1;if(he.type&&he.type.startsWith("image/"))t=!0;else if(he.extension){const e=he.extension.toLowerCase();t=Lt.includes(e)}else{const n=null===(e=he.name.split(".").pop())||void 0===e?void 0:e.toLowerCase();t=!!n&&Lt.includes(n)}return t},[ce,he]),me=`${a}-${s}`,ve=o.useMemo(()=>Array.isArray(e)&&e.some(e=>(e=>{if(!e)return!1;const t=new Date(e);return!Number.isNaN(t.getTime())})(e.date)),[e]),ye=(0,o.useCallback)(async e=>{try{if(null==q?void 0:q.getChildrenCount)return await q.getChildrenCount("folders"===e?void 0:e);if(null==q?void 0:q.getFiles){const{files:t,pagination:n}=await q.getFiles({folderId:"folders"===e?void 0:e,itemType:"all"});return(null==n?void 0:n.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return 0}},[q]),be=(0,o.useCallback)(async()=>{const t=e.filter(e=>e.isFolder);if(0===t.length)return;const n={},r=t.map(async e=>{n[e.id]=await ye(e.id)});await Promise.all(r),re(n)},[e,ye]);(0,o.useEffect)(()=>{be()},[be]);const we=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),le.current+=1,e.dataTransfer.types&&e.dataTransfer.types.includes("Files")&&te(!0)},[]),xe=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),le.current-=1,0===le.current&&te(!1)},[]),Ce=(0,o.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),_e=(0,o.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),te(!1),le.current=0,e.dataTransfer.files&&e.dataTransfer.files.length>0){const t=Array.from(e.dataTransfer.files);C(t).catch(e=>{})}},[C]),Se=(0,o.useCallback)((e=()=>{})=>{if(ie)return;const t=setTimeout(()=>{e(),oe(null)},300);oe(t)},[ie]),ke=(0,o.useCallback)(e=>{ie&&(clearTimeout(ie),oe(null)),e()},[ie]),Ae=(0,o.useCallback)(e=>{const t=[];return e.isFolder||!1===(null==ue?void 0:ue.enableEdit)||t.push({key:"edit",label:B("Edit"),icon:(0,i.jsx)(pr,{size:16,strokeWidth:pe})}),(e.isFolder?!1!==(null==ue?void 0:ue.enableMoveFolder):!1!==(null==ue?void 0:ue.enableMoveItem))&&t.push({key:"move",label:B("Move to"),icon:(0,i.jsx)(mr,{size:16,strokeWidth:pe})}),(e.isFolder?!1!==(null==ue?void 0:ue.enableCopyFolder):!1!==(null==ue?void 0:ue.enableCopyItem))&&t.push({key:"copy",label:B("Copy"),icon:(0,i.jsx)(fr,{size:16,strokeWidth:pe})}),(e.isFolder?!1!==(null==ue?void 0:ue.enableRenameFolder):!1!==(null==ue?void 0:ue.enableRenameFile))&&t.push({key:"rename",label:B("Rename"),icon:(0,i.jsx)(Er,{size:16,strokeWidth:pe})}),!1!==ue.enableDelete&&t.push({key:"delete",label:B("Delete"),icon:(0,i.jsx)(Ir,{size:16,strokeWidth:pe}),style:{color:"#ff4d4f"}}),t},[ue,B,pe]),je=t=>({key:n})=>{const r=e.find(e=>e.id===t);switch(X&&(null==r?void 0:r.id)&&X(null==r?void 0:r.id),n){case"edit":P(r);break;case"move":F();break;case"copy":T();break;case"rename":_(t);break;case"delete":k(r);break;default:X&&X("")}},Ee=[{key:"selection",width:46,render:(e,t)=>(0,i.jsx)(h.A,{checked:w.has(t.id),onChange:()=>x(t.id)})},{key:"preview",width:60,render:(e,t)=>t.isFolder?(0,i.jsx)("div",{className:Ai.fileManagerTableFolder,children:(0,i.jsx)("div",{className:Ai.fileManagerTableFolderInner,children:(0,i.jsx)(H,{className:Ai.tableFolderIcon,style:{width:40,height:40}})})}):(0,i.jsx)(Xr,{className:`${Ai.imagePreview} ${Ai.tableImagePreview}`,src:t.thumbnail||t.thumbnailUrl||t.url,alt:t.name,width:40,height:40,preview:!0,file:t})},{title:B("Name"),width:"calc(100% - 430px)",dataIndex:"name",key:"name",className:Ai.fileNameCol,render:(e,t)=>{const n=t.isFolder&&ne[t.id]||0,r=B(1===n?"item":"items");return(0,i.jsxs)("div",{className:Ai.fileName,children:[e||B("No name"),t.isFolder&&(0,i.jsxs)("div",{className:Ai.fileItemCount,children:[n," ",r]})]})}},{title:B("Dimensions"),key:"dimensions",width:100,render:(e,t)=>t.dimensions&&(0,i.jsx)("div",{className:Ai.fileSize,children:t.dimensions})},{title:B("Size"),key:"size",width:90,render:(e,t)=>!!(null==t?void 0:t.size)&&!t.isFolder&&(0,i.jsx)("div",{className:Ai.fileSize,children:`${(t.size/1e6).toFixed(2)}MB`})},{title:B("Type"),key:"type",width:90,render:(e,t)=>(0,i.jsx)("div",{className:Ai.fileSize,children:t.isFolder?B("Folder"):(null==t?void 0:t.extension)||""})},...ve?[{title:B("Date"),dataIndex:"date",key:"date",width:180,render:(e,t)=>{const n=t.date;if(!n)return null;const r=new Date(n);if(isNaN(r.getTime()))return null;const o=e=>`${e.getDate()} ${[B("months.january"),B("months.february"),B("months.march"),B("months.april"),B("months.may"),B("months.june"),B("months.july"),B("months.august"),B("months.september"),B("months.october"),B("months.november"),B("months.december")][e.getMonth()]} ${e.getFullYear()}`;return(0,i.jsx)(M.A,{title:B("Added",{date:o(r)}),placement:"bottom",className:Ai.fileDate,children:B("Added",{date:o(r)})})}}]:[],{width:40,title:"",dataIndex:"",key:"x",onCell:()=>({style:{padding:0}}),render:(e,t)=>(0,i.jsx)(m.A,{arrow:!0,placement:"bottom",menu:{items:Ae(t),onClick:je(t.id)},trigger:["hover"],children:(0,i.jsx)("span",{className:`${Ai.tableMenu} tableMenuButton`,onClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,i.jsx)(gr,{size:16,strokeWidth:pe})})})}],Ie="table"===J?(0,i.jsx)(p.Ay,{renderEmpty:()=>(0,i.jsx)(v.A,{image:(0,i.jsx)(i.Fragment,{}),description:""}),children:(0,i.jsx)(O.A,{dataSource:e,columns:Ee,rowKey:"id",pagination:!1,loading:y,rowClassName:e=>(null==w?void 0:w.has(e.id))?Ai.selectedRow:"",tableLayout:"fixed",onRow:e=>({onClick:t=>{const n=t.target;Se(()=>{t.stopPropagation(),t.preventDefault();const r=!!n.closest(".ant-image")||!!n.closest(".ant-image-preview-wrap"),i=!!n.closest(".tableMenuButton"),o=!!n.closest(".ant-dropdown-menu");r||i||o||x(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{ke(()=>{t.stopPropagation(),t.preventDefault();const n=t.target;n.closest(".ant-checkbox-wrapper")||n.closest(".tableMenu")||(e.isFolder?b(e):n.closest(".ant-image")||n.closest(".ant-image-preview-wrap")||!$.onEditorOk||$.onEditorOk(e))})}}),showHeader:!1})}):(0,i.jsx)(A.A,{gutter:[16,16],className:Ai.gridRow,style:{gap:20,padding:"0 24px 24px",margin:0},children:e.map(e=>(0,i.jsx)(f.A,{className:Ai.gridCard_col,style:{padding:0},children:(0,i.jsxs)(u.A,{hoverable:!0,cover:(0,i.jsx)("div",{className:e.isFolder?Ai.gridPreviewContainerFolder:Ai.gridPreviewContainer,onClick:t=>{t.stopPropagation(),e.isFolder&&Se(()=>{x(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey})})},onDoubleClick:t=>{t.stopPropagation(),ke(()=>{e.isFolder&&b(e)})},children:e.isFolder?(0,i.jsx)("div",{className:Ai.gridFolderIcon,children:(0,i.jsx)(H,{className:Ai.gridFolderIconImage})}):(0,i.jsx)(Xr,{src:e.thumbnail||e.thumbnailUrl||e.url,alt:e.name,className:Ai.gridImagePreview,preview:!0,file:e})}),className:`${Ai.gridCard} ${(null==w?void 0:w.has(e.id))?Ai.gridCardSelected:""}`,onClick:t=>{t.stopPropagation(),t.preventDefault();const n=t.target;n.closest(".gridFileMenuButton")||n.closest(".ant-dropdown-menu")||Se(()=>x(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}))},onDoubleClick:t=>{t.stopPropagation(),ke(()=>{e.isFolder&&b(e)})},children:[(0,i.jsxs)("div",{className:Ai.gridCardContent,onDoubleClick:t=>{t.stopPropagation(),t.preventDefault(),ke(()=>{$.onEditorOk&&$.onEditorOk(e)})},onClick:t=>{t.stopPropagation(),t.preventDefault();const n=t.target;n.closest(".gridFileMenuButton")||n.closest(".ant-dropdown-menu")||Se(()=>x(e.id,{metaKey:t.metaKey,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey}))},children:[(0,i.jsx)("div",{className:Ai.gridFileName,children:e.name||B("Untitled")}),(0,i.jsx)("div",{className:Ai.gridFileInfo,children:e.isFolder?(()=>{const t=ne[e.id]||0;return`${t} ${B(1===t?"item":"items")}`})():(0,i.jsxs)(i.Fragment,{children:[e.dimensions&&`${e.dimensions} \u2022 `,e.size&&`${(e.size/1e6).toFixed(2)} MB \u2022 `,e.extension&&`${e.extension}`]})})]}),(0,i.jsx)("div",{className:Ai.gridFileMenu,children:(0,i.jsx)(m.A,{menu:{items:Ae(e),onClick:je(e.id)},arrow:!0,placement:"bottom",trigger:["hover"],children:(0,i.jsx)(c.Ay,{type:"default",className:`${Ai.gridFileMenuButton} gridFileMenuButton`,onClick:()=>{},children:(0,i.jsx)(gr,{size:16,strokeWidth:pe})})},e.id)}),(0,i.jsx)("div",{onClick:e=>{e.stopPropagation()},className:Ai.gridCheckbox,children:(0,i.jsx)(h.A,{checked:w.has(e.id),style:{height:20},onChange:t=>{t.stopPropagation(),x(e.id)}})})]})},e.id))});return(0,i.jsx)("div",{className:"content-layout",children:(0,i.jsxs)("div",{className:Ai.filesContainer,onDragOver:Ce,onDragLeave:xe,onDragEnter:we,onDrop:_e,children:[ee&&0!==(null==e?void 0:e.length)&&(0,i.jsx)("div",{className:Ai.dragOverlay,children:(0,i.jsxs)("div",{className:Ai.dragOverlayInner,children:[(0,i.jsx)("div",{className:Ai.uploadIcon,children:(0,i.jsx)(V,{})}),(0,i.jsx)("div",{className:Ai.textTitle,children:B("Drop files to upload")}),(0,i.jsx)("div",{className:Ai.textDescription,children:B("Supported files:")+" jpeg, .svg, .png"})]})}),y||0!==(null==e?void 0:e.length)||t?(0,i.jsxs)("div",{className:Ai.tableContainer,children:[(0,i.jsxs)("div",ce?{className:`header-container ${Ai.headerContainer}`,children:[(0,i.jsxs)(ji,{type:"secondary",className:"selected-text",children:[(0,i.jsxs)("div",{children:[ce," ",B("selected")]}),(0,i.jsx)(M.A,{title:ae?B("Deselected"):null,children:(0,i.jsx)(c.Ay,{className:Ai.buttonDeselected,icon:(0,i.jsx)(kr,{size:16,strokeWidth:pe}),onClick:()=>K&&K(new Set),children:B("Deselected")})})]}),(0,i.jsxs)(I.A,{children:[ge&&!1!==(null==ue?void 0:ue.enableEdit)&&(0,i.jsx)(M.A,{title:ae?B("Edit"):null,children:(0,i.jsx)(c.Ay,{icon:(0,i.jsx)(pr,{size:16,strokeWidth:pe}),onClick:()=>{P(he)},disabled:!ge,children:B("Edit")})}),Array.from(w).every(t=>{const n=e.find(e=>e.id===t);return!!n&&(n.isFolder?!1!==(null==ue?void 0:ue.enableMoveFolder):!1!==(null==ue?void 0:ue.enableMoveItem))})&&(0,i.jsx)(M.A,{title:ae?B("Move to"):null,children:(0,i.jsx)(c.Ay,{icon:(0,i.jsx)(mr,{size:16,strokeWidth:pe}),onClick:F,children:B("Move to")})}),Array.from(w).every(t=>{const n=e.find(e=>e.id===t);return!!n&&(n.isFolder?!1!==(null==ue?void 0:ue.enableCopyFolder):!1!==(null==ue?void 0:ue.enableCopyItem))})&&(0,i.jsx)(M.A,{title:ae?B("Copy"):null,children:(0,i.jsx)(c.Ay,{icon:(0,i.jsx)(fr,{size:16,strokeWidth:pe}),onClick:T,children:B("Copy")})}),1===ce&&fe&&(0,i.jsx)(M.A,{title:ae?B("Rename"):null,children:(0,i.jsx)(c.Ay,{icon:(0,i.jsx)(Er,{size:16,strokeWidth:pe}),onClick:()=>_(),disabled:1!==ce||!fe,children:B("Rename")})}),!1!==(null==ue?void 0:ue.enableDelete)&&(0,i.jsx)(M.A,{title:ae?B("Delete"):null,children:(0,i.jsx)(c.Ay,{danger:!0,icon:(0,i.jsx)(Ir,{size:16,strokeWidth:pe}),onClick:e=>{e.stopPropagation(),e.preventDefault(),k()},children:B("Delete")})})]})]}:{className:Ai.headerContainer,children:[(0,i.jsx)("div",{className:"search-container",children:(0,i.jsx)(Gr,{placeholder:B("Search file or folder"),onSearch:n,className:Ai.searchInput})}),(0,i.jsxs)("div",{className:Ai.actionsBox,children:[(0,i.jsx)("div",{className:"sort-container",children:(0,i.jsxs)(E.A,{value:me,onChange:l,className:Ai.sortSelect,popupMatchSelectWidth:!1,suffixIcon:(0,i.jsx)(dr,{size:16,strokeWidth:pe}),children:[(0,i.jsx)(Ei,{value:"date-desc",children:B("Newest first")}),(0,i.jsx)(Ei,{value:"date-asc",children:B("Oldest first")}),(0,i.jsx)(Ei,{value:"size-desc",children:B("Largest first")}),(0,i.jsx)(Ei,{value:"size-asc",children:B("Smallest first")}),(0,i.jsx)(Ei,{value:"name-asc",children:B("A-Z")}),(0,i.jsx)(Ei,{value:"name-desc",children:B("Z-A")}),(0,i.jsx)(Ei,{value:"type-asc",children:B("By type")})]})}),(0,i.jsx)("div",{className:Ai.actionsContainer,children:(0,i.jsx)(j.A,{options:[{value:"grid",icon:(0,i.jsx)(br,{size:16,strokeWidth:pe})},{value:"table",icon:(0,i.jsx)(Cr,{size:20,strokeWidth:pe})}],value:J,onChange:e=>Q(e)})})]})]}),t&&!e.length?(0,i.jsx)("div",{className:Ai.noFiles,children:B("There are no files for your request.")}):Ie,!Y&&d.total>d.pageSize&&(0,i.jsx)("div",{className:Ai.paginationContainer,children:(0,i.jsx)(S.A,{current:d.current,pageSize:d.pageSize,total:d.total,onChange:(e,t)=>g({current:e,pageSize:t,total:d.total}),showSizeChanger:!0,showTotal:e=>B("total pages",{total:e})})})]}):(0,i.jsxs)("div",{className:Ai.uploadContainer,children:[(0,i.jsxs)("div",{className:`${Ai.uploadArea} ${ee?Ai.active:""}`,onClick:L,onDragOver:Ce,onDragLeave:xe,onDragEnter:we,onDrop:_e,children:[(0,i.jsx)("div",{className:Ai.uploadIcon,children:(0,i.jsx)(V,{})}),(0,i.jsx)("div",{className:Ai.textTitle,children:B("Select a file or drag and drop it here")}),(0,i.jsx)("div",{className:Ai.textDescription,children:B("Supported files:")+" jpeg, .svg, .png"})]}),(0,i.jsxs)("div",{className:Ai.buttons,children:[(0,i.jsxs)("button",{className:Ai.btnPhoto,onClick:()=>{Z&&Z(It)},children:[(0,i.jsx)("div",{className:Ai.icon,children:(0,i.jsx)(U,{})}),(0,i.jsxs)("div",{className:Ai.blockText,children:[(0,i.jsx)("div",{className:Ai.textTitle,children:B("Stock")}),(0,i.jsx)("div",{className:Ai.textDescription,children:B("Select an image from our library")})]})]}),(0,i.jsxs)("button",{className:Ai.btnAi,onClick:()=>{Z&&Z(Tt)},children:[(0,i.jsx)("div",{className:Ai.icon,children:(0,i.jsx)(W,{})}),(0,i.jsxs)("div",{className:Ai.blockText,children:[(0,i.jsx)("div",{className:Ai.textTitle,children:B("AI generation")}),(0,i.jsx)("div",{className:Ai.textDescription,children:B("Creating an image on demand")})]})]})]})]})]})})};var Ti={"em-filemanager":"em-filemanager",folderTree:"folderTree",emptyFolderContainer:"emptyFolderContainer",folderItemContainer:"folderItemContainer",folderLabel:"folderLabel",folderLabelItem:"folderLabelItem",fileCount:"fileCount",foldersTitle:"foldersTitle",foldersTitleItem:"foldersTitleItem",folderSelectionTree:"folderSelectionTree",folderMenu:"folderMenu",folderIcon:"folderIcon"};const Oi=({selectedFolder:e,onSelect:t,onExpand:n,generateMenuItems:r,fetchChildFolders:a,disabledFolders:s=[],showFileCounts:l=!1,folderFileCounts:c={},className:u="",expandedKeys:d,setExpandedKeys:h,showTrashFolder:f=!1,mode:p="navigation",defaultExpandAll:g=!1})=>{const{t:m}=hn(),{options:v}=Rr(),{config:y}=v,{ExpandArrowIcon:b,CollapseArrowIcon:w,CollapseFolderIcon:x,ExpandFolderIcon:C,EmptyFolderIcon:_}=ki(),S=(0,o.useCallback)(e=>{const t=[],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[k,A]=(0,o.useState)(()=>{if(g||"selection"===p&&g){const e=r();return S(e)}return[]}),j=void 0!==d?d:k,E=void 0!==h?h:A,I=(0,o.useCallback)(async e=>{const n=e[0];n&&"empty"!==n&&(null==t||t(e),await(null==a?void 0:a("folders"===n?null:n)))},[t,a]),T=(0,o.useCallback)(async(e,t)=>{var r;if(E(e),null==n||n(e,t),"lazy"!==(null==y?void 0:y.folderTreeLoading))return;const i=(null===(r=null==t?void 0:t.node)||void 0===r?void 0:r.key)||void 0;if(i&&"folders"!==i)try{await(null==a?void 0:a(i))}catch(e){}},[null==y?void 0:y.folderTreeLoading,a,n,E]),O=(0,o.useCallback)(()=>{var t;const n=r(),o=e=>e.filter(e=>"Trash"!==e.key).map(e=>Object.assign(Object.assign({},e),{children:e.children?o(e.children):void 0})),a=f?o(n):n,u=t=>{"selection"!==p?(j.includes(t)&&e===t?E(j.filter(e=>e!==t)):j.includes(t)||E([...j,t]),e!==t&&I([t])):I([t])};if(0===a.length||1===a.length&&(!a[0].children||0===a[0].children.length))return[{key:"empty",title:(0,i.jsx)("div",{className:Ti.emptyFolderContainer,children:m("No folders yet")}),disabled:!0}];const d=e=>{var t;const n=l&&c[e.key]||0,r=j.includes(e.key),o=s.includes(e.key),a=(()=>{var t;return(null===(t=e.children)||void 0===t?void 0:t.length)?(0,i.jsx)(r?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}):(0,i.jsx)(_,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth})})(),h=(0,i.jsxs)("div",{className:`${Ti.folderItemContainer} folder-item-container`,onClick:()=>!o&&u(e.key),style:{opacity:o?.5:1,cursor:o?"not-allowed":"pointer"},children:[(0,i.jsxs)("div",{className:Ti.folderLabel,children:[e.icon||a,(0,i.jsx)("span",{className:Ti.folderLabelItem,children:e.label})]}),l&&(0,i.jsx)("div",{className:Ti.fileCount,title:`${n} ${1===n?"file":"files"}`,children:n})]});return{key:e.key,title:h,children:null===(t=e.children)||void 0===t?void 0:t.map(d),disabled:o}},h=j.includes("folders"),g=(0,i.jsx)("div",{className:Ti.foldersTitle,onClick:()=>u("folders"),children:(0,i.jsxs)("div",{className:Ti.foldersTitleItem,children:[(0,i.jsx)(h?x:C,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:`${Ti.folderLabelItem} folder-label-item`,children:"folders"===a[0].key?a[0].label:m("Folders")})]})});if(a.length>0&&"folders"===a[0].key){const e=[{key:"folders",title:g,children:null===(t=a[0].children)||void 0===t?void 0:t.map(d)}];return f&&e.push({key:"Trash",title:(0,i.jsx)("div",{className:Ti.foldersTitle,onClick:()=>u("Trash"),children:(0,i.jsxs)("div",{className:Ti.foldersTitleItem,children:[(0,i.jsx)(Ir,{size:20,strokeWidth:null==y?void 0:y.iconStrokeWidth}),(0,i.jsx)("span",{className:Ti.folderLabelItem,children:m("Trash")})]})}),children:void 0}),e}return a.map(d)},[r,j,x,null==y?void 0:y.iconStrokeWidth,C,m,e,I,l,c,_,s,f,p,E]),F=(0,o.useMemo)(()=>O(),[O]);return(0,i.jsx)(R.A,{className:`${Ti.folderTree} ${Ti.folderMenu} ${Ti[u]}`,selectedKeys:e?[e]:[],expandedKeys:j,onSelect:I,onExpand:T,treeData:F,switcherIcon:({expanded:e})=>(0,i.jsx)(e?w:b,{}),showLine:!1})};var Fi={formFooter:"formFooter",folderButton:"folderButton",foldersWrapper:"foldersWrapper",formItem:"formItem",folderToolsField:"folderToolsField"};const Pi=(0,o.memo)(({folderId:e,activeFormField:t,EmptyFolderIcon:n,targetForm:r,handleModalOk:a,onComplete:s,t:l})=>{const u=(0,o.useCallback)(()=>{r.setFieldsValue({folderName:""})},[r]),d=(0,o.useCallback)(()=>{a(r).then(e=>{s(null==e?void 0:e.id)})},[a,r,s]);return(0,i.jsx)(y.A.Item,{className:"form-item form-item-moveto "+(t===e?"form-item_active":""),name:"folderName",initialValue:l("New folder"),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(l("Enter the name of the folder"))):Promise.resolve()}],children:(0,i.jsx)(w.A,{className:"form-input",autoFocus:!0,prefix:(0,i.jsx)(n,{style:{marginRight:6}}),suffix:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(M.A,{placement:"top",title:"Clean",children:(0,i.jsx)(c.Ay,{icon:(0,i.jsx)(H.A,{style:{fontSize:10}}),className:Fi.inputButtonClose,type:"text",onClick:u})}),(0,i.jsx)(c.Ay,{className:Fi.inputButtonOk,type:"text",onClick:d,children:"\u0421\u043e\u0437\u0434\u0430\u0442\u044c"})]})})})});Pi.displayName="CustomFolderInput";const Mi=({isModalVisible:e,handleModalOk:t,handleModalCancel:n,form:r,selectedFolder:a,folders:s,isUrlModalVisible:l,setIsUrlModalVisible:u,handleAddFileByUrl:d,urlForm:h,isRenameModalVisible:f,handleRenameOk:p,handleRenameCancel:g,renameForm:m,fileToRename:v,files:b,isMoveModalVisible:x,handleMoveOk:C,handleMoveCancel:S,moveForm:k,selectedFiles:A,isRenameFolderModalVisible:j,handleRenameFolderOk:E,handleRenameFolderCancel:I,renameFolderForm:T,folderToRename:O,isCopyModalVisible:F,handleCopyOk:P,handleCopyCancel:M,copyForm:R,isDeleteConfirmVisible:L,handleDeleteConfirmOk:D,handleDeleteConfirmCancel:N,fetchChildFolders:z})=>{var B,V,U;const{t:W}=hn(),{state:H,actions:$,options:G}=Rr(),{setCurrentMenuFile:Y}=$,{config:q}=G,{currentMenuFile:X}=H,K=y.A.useWatch("folderName",r),{EmptyFolderIcon:Z}=ki(),[J,Q]=(0,o.useState)(""),ee=!K||0===String(K).trim().length,te=(0,o.useMemo)(()=>Array.isArray(b)?b:[],[b]),ne=v?null===(B=te.find(e=>e.id===v))||void 0===B?void 0:B.name:"",re=Array.isArray(s)?s:[],ie=O?null===(V=re.find(e=>e.id===O))||void 0===V?void 0:V.name:"",oe=v?te.find(e=>e.id===v):null,ae=(null==oe?void 0:oe.isFolder)||(null==v?void 0:v.startsWith("folder_")),se=(0,o.useCallback)(async e=>{e.length>0&&(k.setFieldsValue({targetFolder:e[0]}),J!==e[0].toString()&&Q(""))},[k,J]),le=(0,o.useCallback)(async e=>{e.length>0&&(R.setFieldsValue({targetFolder:e[0]}),J!==e[0].toString()&&Q(""))},[J,R]),ce=(0,o.useMemo)(()=>Array.from(A).filter(e=>{const t=te.find(t=>t.id===e);return(null==t?void 0:t.isFolder)||s.some(t=>t.id===e)}),[A,te,s]),ue=(0,o.useCallback)((e,n)=>{const r=r=>(0,i.jsx)(Pi,{folderId:r,activeFormField:J,EmptyFolderIcon:Z,targetForm:e,handleModalOk:t,onComplete:n,t:W},r);return r.displayName="CustomInputComponent",r},[Z,J,t,W]),de=(0,o.useCallback)(e=>{const{folderId:t,targetForm:n,onTreeSelect:r,onComplete:i}=e;return{handleAddFolder:e=>{e.preventDefault(),e.stopPropagation(),Q(t),n.setFieldsValue({folderName:W("New folder"),targetFolder:t})},handleSelectFolder:e=>{e.preventDefault(),e.stopPropagation(),r([t]).then(()=>i(t))}}},[W]),he=(0,o.useCallback)(e=>{const{targetForm:t,onTreeSelect:n,onComplete:r,actionButtonText:o}=e,l=ue(t,r),u=(e=null,d=new Set)=>s.filter(t=>{const n=null===e&&!t.parentId,r=t.parentId===e;return n||r}).map(e=>{if(d.has(e.id))return{key:e.id,label:`${e.name} (\u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0441\u0441\u044b\u043b\u043a\u0430)`};const s=new Set(d);s.add(e.id);const h=u(e.id,s),{handleAddFolder:f,handleSelectFolder:p}=de({folderId:e.id,targetForm:t,onTreeSelect:n,onComplete:r});return{key:e.id,label:(0,i.jsxs)(i.Fragment,{children:[e.name,a!==e.id&&(0,i.jsxs)("div",{className:`${Fi.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(c.Ay,{onClick:f,children:"+"}),(0,i.jsx)(c.Ay,{onClick:p,children:o})]}),J===e.id&&l(e.id)]}),children:h.length>0?h:void 0}}),d=u(),{handleAddFolder:h,handleSelectFolder:f}=de({folderId:"folders",targetForm:t,onTreeSelect:n,onComplete:r});return[{key:"folders",label:(0,i.jsxs)(i.Fragment,{children:[W("Folders"),"folders"!==a&&null!==a&&(0,i.jsxs)("div",{className:`${Fi.folderToolsField} folder-tools-field`,children:[(0,i.jsx)(c.Ay,{onClick:h,children:"+"}),(0,i.jsx)(c.Ay,{onClick:f,children:o})]}),"folders"===J&&l("folders")]}),children:d}]},[W,a,J,s,ue,de]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(_.A,{title:(0,i.jsx)("div",{className:"modal-title",children:W("Creating a new folder")}),open:e,onOk:()=>t(),onCancel:n,okText:W("Create"),cancelText:W("Cancel"),okButtonProps:{disabled:ee},children:(0,i.jsxs)(y.A,{form:r,layout:"vertical",children:[(0,i.jsx)(y.A.Item,{name:"folderName",label:(0,i.jsx)("div",{className:"form-label",children:W("Folder name")}),rules:[{required:!0,validator:(e,t)=>"string"==typeof t&&0===t.trim().length?Promise.reject(new Error(W("Enter the name of the folder"))):Promise.resolve()}],initialValue:W("New folder"),className:"form-item",style:{marginBottom:5},children:(0,i.jsx)(w.A,{autoFocus:!0,className:"form-input"})}),(0,i.jsx)("div",{children:a&&"folders"!==a?(0,i.jsxs)("p",{className:"fm-note",children:[W("A folder will be created inside:")," ",(null===(U=re.find(e=>e.id===a))||void 0===U?void 0:U.name)||W("selected folder"),"."]}):(0,i.jsx)("p",{className:"fm-note",children:W("The folder will be created in the root directory.")})})]})}),(0,i.jsx)(_.A,{title:(0,i.jsx)("div",{className:"modal-title",children:W("Upload file by URL")}),open:l,onOk:()=>d(null),onCancel:()=>u(!1),okText:W("Download"),cancelText:W("Cancel"),children:(0,i.jsx)(y.A,{form:h,layout:"vertical",children:(0,i.jsx)(y.A.Item,{name:"fileUrl",label:(0,i.jsx)("div",{className:"form-label",children:W("File URL")}),rules:[{required:!0,message:W("Enter the URL of the image")}],className:"form-item",children:(0,i.jsx)(w.A,{autoFocus:!0,placeholder:"https://example.com/image.jpg",className:"form-input"})})})}),(0,i.jsx)(_.A,{title:(0,i.jsx)("div",{className:"modal-title",children:ae?`${W("Rename folder")} ${ne}`:W("Rename file",{currentFileName:ne})}),open:f,onOk:p,onCancel:g,okText:W("Rename"),cancelText:W("Cancel"),afterClose:()=>{Y&&Y("")},children:(0,i.jsx)(y.A,{form:m,layout:"vertical",children:(0,i.jsx)(y.A.Item,{name:"newFileName",label:(0,i.jsx)("div",{className:"form-label",children:W(ae?"New folder name":"New file name")}),rules:[{required:!0,message:W(ae?"Enter a new folder name":"Enter a new file name")}],className:"form-item",children:(0,i.jsx)(w.A,{autoFocus:!0,className:"form-input"})})})}),(0,i.jsx)(_.A,{title:(0,i.jsx)("div",{className:"modal-title",children:W("Move to")}),open:x,onCancel:S,footer:(0,i.jsxs)("div",{className:Fi.formFooter,children:[(0,i.jsxs)(c.Ay,{className:Fi.folderButton,onClick:()=>t(k),children:[(0,i.jsx)(yr,{size:18,strokeWidth:null==q?void 0:q.iconStrokeWidth}),W("Create folder")]}),(0,i.jsx)(c.Ay,{type:"primary",className:Fi.folderButton,onClick:S,children:W("Done")})]}),afterClose:()=>{Y&&Y(""),Q("")},children:(0,i.jsx)(y.A,{form:k,layout:"vertical",children:(0,i.jsx)("div",{className:Fi.foldersWrapper,children:(0,i.jsx)(y.A.Item,{name:"targetFolder",rules:[{required:!0,message:W("Select the destination folder")}],className:Fi.formItem,children:(0,i.jsx)(Oi,{onSelect:se,generateMenuItems:()=>he({targetForm:k,onTreeSelect:se,onComplete:C,actionButtonText:W("Move here")}),fetchChildFolders:z,disabledFolders:ce,mode:"selection",className:Fi.folderSelectionTree,defaultExpandAll:!0})})})})}),(0,i.jsx)(_.A,{title:(0,i.jsx)("div",{className:"modal-title",children:W("Copy to folder")}),open:F,onCancel:M,footer:(0,i.jsxs)("div",{className:Fi.formFooter,children:[(0,i.jsxs)(c.Ay,{className:Fi.folderButton,onClick:()=>t(R),children:[(0,i.jsx)(yr,{size:18,strokeWidth:null==q?void 0:q.iconStrokeWidth}),W("Create folder")]}),(0,i.jsx)(c.Ay,{type:"primary",className:Fi.folderButton,onClick:M,children:W("Done")})]}),afterClose:()=>{Y&&Y(""),Q("")},children:(0,i.jsx)(y.A,{form:R,layout:"vertical",children:(0,i.jsx)("div",{className:Fi.foldersWrapper,children:(0,i.jsx)(y.A.Item,{name:"targetFolder",rules:[{required:!0,message:W("Select the destination folder")}],className:Fi.formItem,children:(0,i.jsx)(Oi,{onSelect:le,generateMenuItems:()=>he({targetForm:R,onTreeSelect:le,onComplete:P,actionButtonText:W("Copy here")}),fetchChildFolders:z,disabledFolders:ce,mode:"selection",className:Fi.folderSelectionTree,defaultExpandAll:!0})})})})}),(0,i.jsx)(_.A,{title:(0,i.jsxs)("div",{className:"modal-title",children:[W("Rename folder")," ",ie]}),open:j,onOk:E,onCancel:I,okText:W("Rename"),cancelText:W("Cancel"),afterClose:()=>{Y&&Y("")},children:(0,i.jsx)(y.A,{form:T,layout:"vertical",children:(0,i.jsx)(y.A.Item,{name:"newFolderName",label:(0,i.jsx)("div",{className:"form-label",children:W("New folder name")}),rules:[{required:!0,message:W("Enter a new folder name")}],className:"form-item",children:(0,i.jsx)(w.A,{autoFocus:!0,className:"form-input"})})})}),(0,i.jsx)(_.A,{title:(()=>{const e=!!(null==q?void 0:q.enableTrashFolder)&&"Trash"===a||!(null==q?void 0:q.enableTrashFolder),t=W(e?"Permanently delete":"Move to Trash");return(0,i.jsx)("div",{className:"modal-title",children:t})})(),open:!!L,onOk:()=>D&&D(),onCancel:()=>N&&N(),okText:(null==q?void 0:q.enableTrashFolder)&&"Trash"===a?W("Delete permanently"):(null==q?void 0:q.enableTrashFolder)?W("Move to Trash"):W("Delete"),cancelText:W("Cancel"),okButtonProps:{danger:!(null==q?void 0:q.enableTrashFolder)||"Trash"===a},afterClose:()=>{Y&&Y("")},children:(()=>{var e,t;const n=(X?[X]:Array.from(A||[])).map(e=>te.find(t=>t.id===e)).filter(e=>!!e),r=n.filter(e=>e.isFolder||e.id.startsWith("folder_")),o=n.filter(e=>!(e.isFolder||e.id.startsWith("folder_"))),s=n.length,l=r.length,c=o.length,u=!!(null==q?void 0:q.enableTrashFolder);if(!u||u&&"Trash"===a){if(1===s&&1===l){const t=r[0],n=(null==t?void 0:t.name)||"",o=null!==(e=null==t?void 0:t.childCount)&&void 0!==e?e:0;return(0,i.jsx)("div",{children:W("delete_folder_permanent",{name:n,count:o})})}return(0,i.jsx)("div",0===l&&c>0?{children:W("delete_files_permanent",{count:c})}:{children:W("delete_mixed_permanent",{total:s,folders:l,images:c})})}if(1===s&&1===l){const e=r[0],n=(null==e?void 0:e.name)||"",o=null!==(t=null==e?void 0:e.childCount)&&void 0!==t?t:0;return(0,i.jsx)("div",{children:W("move_folder_to_trash",{name:n,count:o})})}return(0,i.jsx)("div",0===l&&c>0?{children:W("move_files_to_trash",{count:c})}:{children:W("move_mixed_to_trash",{total:s,folders:l,images:c})})})()})]})};var Ri={button:"button",folderActions:"folderActions",uploadButton:"uploadButton",folderMenu:"folderMenu",foldersContainer:"foldersContainer",buttonWrapper:"buttonWrapper",uploadButtonTitle:"uploadButtonTitle"};const Li=(0,o.memo)((0,o.forwardRef)(({selectedFolder:e,generateMenuItems:t,onFolderSelect:n,folders:r,fetchFolders:a,fetchChildFolders:s,handleAddFile:l,setIsUrlModalVisible:u,handleCreateFolder:d,activeLibraryItem:h,setActiveLibraryItem:f},p)=>{const m=(0,o.useMemo)(()=>Array.isArray(r)?r:[],[r]),{t:v}=hn(),y=zr(),[b,w]=(0,o.useState)({}),{options:x}=Rr(),{dataProviders:_,config:S}=x;ki();const k=(0,o.useCallback)(e=>{const t=[],n=e=>{e.forEach(e=>{t.push(e.key),e.children&&n(e.children)})};return n(e),t},[]),[A,j]=(0,o.useState)(()=>{if(!0===(null==S?void 0:S.expandAllFoldersOnInit)&&"lazy"!==(null==S?void 0:S.folderTreeLoading)){const e=t();return k(e)}return!0===(null==S?void 0:S.expandRootFolderOnInit)?["folders"]:[]}),E=(0,o.useRef)(!1),I=(0,o.useRef)(!1);(0,o.useEffect)(()=>{E.current||"lazy"===(null==S?void 0:S.folderTreeLoading)&&!0===(null==S?void 0:S.expandRootFolderOnInit)&&(E.current=!0,(async()=>{try{await(null==s?void 0:s(null))}catch(bt){}})())},[null==S?void 0:S.folderTreeLoading,null==S?void 0:S.expandRootFolderOnInit,s]),(0,o.useEffect)(()=>{!0===(null==S?void 0:S.expandRootFolderOnInit)&&Array.isArray(m)&&m.length>0&&(I.current||(I.current=!0,j(["folders"])))},[null==S?void 0:S.expandRootFolderOnInit,m]),(0,o.useEffect)(()=>{if(!0===(null==S?void 0:S.expandAllFoldersOnInit)&&"lazy"!==(null==S?void 0:S.folderTreeLoading)){const e=t(),n=k(e);return void j(n)}!0===(null==S?void 0:S.expandRootFolderOnInit)&&j(e=>e&&e.length>0?[...e]:["folders"])},[m,t,k,null==S?void 0:S.expandAllFoldersOnInit,null==S?void 0:S.folderTreeLoading,null==S?void 0:S.expandRootFolderOnInit]);const T=(0,o.useCallback)(async e=>{try{if(null==_?void 0:_.getChildrenCount)return await _.getChildrenCount("folders"===e?void 0:e);if(null==_?void 0:_.getFiles){const{files:t,pagination:n}=await _.getFiles({folderId:"folders"===e?void 0:e,itemType:"all"});return(null==n?void 0:n.total)||t.filter(e=>!e.isFolder).length}return 0}catch(t){return y.error({id:"FOLDER_CHILDREN_COUNT_FAILED",message:v("Failed to load folder items count"),placement:"bottomRight",innerException:t,data:{folderId:"folders"===e?null:e,reason:t instanceof Error?t.message:String(t)}}),0}},[_,y,v]),O=(0,o.useCallback)(async()=>{if(0===m.length)return;const e={};e.folders=await T("folders");const t=m.map(async t=>{const n=await T(t.id);e[t.id]=n});await Promise.all(t),w(e)},[m,T]),F=(0,o.useCallback)(async e=>{const t=await T(e);w(n=>Object.assign(Object.assign({},n),{[e]:t}))},[T]);(0,o.useImperativeHandle)(p,()=>({refreshFileCounts:O}),[O]),(0,o.useEffect)(()=>{O()},[O]);const P=(0,o.useCallback)(async()=>{await l(),e?await F(e):await F("folders")},[l,e,F]),M=[{key:jt,label:v("My files"),icon:(0,i.jsx)(wr,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth})},{key:Et,label:v("GIF"),icon:(0,i.jsx)(_r,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth})},{key:It,label:v("Stock images"),icon:(0,i.jsx)(hr,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth})},{key:Tt,label:v("AI"),icon:(0,i.jsx)(jr,{size:20,strokeWidth:null==S?void 0:S.iconStrokeWidth}),disabled:!(null==S?void 0:S.sseQuery)}],R=(0,o.useCallback)(async e=>{const t=e[0];t&&"empty"!==t&&(h!==jt&&f(jt),null==n||n(t),await(null==s?void 0:s(t)))},[n,h,f,s]),L=(0,o.useCallback)(({key:e})=>{f(e)},[f]),D=(0,o.useCallback)(async(e,t)=>{var n;if(j(e),"lazy"!==(null==S?void 0:S.folderTreeLoading))return;const r=(null===(n=null==t?void 0:t.node)||void 0===n?void 0:n.key)||void 0;if(r&&"folders"!==r)try{await(null==s?void 0:s(r))}catch(e){y.error({id:"FOLDER_CHILDREN_FETCH_FAILED",message:v("Failed to load subfolders"),placement:"bottomRight",innerException:e,data:{folderId:r,reason:e instanceof Error?e.message:String(e)}})}},[null==S?void 0:S.folderTreeLoading,s,y,v]);return(0,i.jsxs)("div",{className:"sidebar-container",children:[(0,i.jsxs)("div",{className:Ri.buttonWrapper,children:[(0,i.jsx)(c.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(Sr,{size:24,strokeWidth:null==S?void 0:S.iconStrokeWidth}),onClick:P,className:Ri.uploadButton,style:{whiteSpace:"nowrap"},children:(0,i.jsx)("span",{className:Ri.uploadButtonTitle,children:v("Upload file")})}),(0,i.jsx)(c.Ay,{type:"primary",size:"large",icon:(0,i.jsx)(xr,{size:24,strokeWidth:null==S?void 0:S.iconStrokeWidth}),onClick:()=>null==u?void 0:u(!0),className:Ri.uploadByURLButton,style:{whiteSpace:"nowrap"}})]}),(0,i.jsx)(C.A,{className:"folder-menu",items:M,defaultSelectedKeys:[jt],onSelect:({key:e})=>L({key:e}),selectedKeys:[h]}),(0,i.jsx)(g.A,{className:Ri.divider}),(0,i.jsxs)("div",{className:Ri.foldersContainer,children:[(0,i.jsx)(Oi,{className:`${Ri.folderMenu} ${Ri.folderTree}`,selectedFolder:e,onSelect:R,onExpand:D,generateMenuItems:t,fetchChildFolders:s,showFileCounts:!0,folderFileCounts:b,expandedKeys:A,setExpandedKeys:j,showTrashFolder:null==S?void 0:S.enableTrashFolder}),(0,i.jsx)("div",{className:Ri.folderActions,children:(0,i.jsx)(c.Ay,{onClick:e=>{e.stopPropagation(),d()},className:Ri.button,icon:(0,i.jsx)(yr,{size:18,strokeWidth:null==S?void 0:S.iconStrokeWidth}),size:"middle"})})]})]})}));Li.displayName="FolderSidebar";var Di=Object.defineProperty,Ni=(e,t,n)=>(((e,t,n)=>{t in e?Di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);function zi(e,t){return void 0===t&&(t=15),+parseFloat(Number(e).toPrecision(t))}function Bi(e){var t=e.toString().split(/[eE]/),n=(t[0].split(".")[1]||"").length-+(t[1]||0);return n>0?n:0}function Vi(e){if(-1===e.toString().indexOf("e"))return Number(e.toString().replace(".",""));var t=Bi(e);return t>0?zi(Number(e)*Math.pow(10,t)):Number(e)}function Ui(e){Gi&&(e>Number.MAX_SAFE_INTEGER||Number.MIN_SAFE_INTEGER)}function Wi(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t.slice(1).reduce(function(t,n){return e(t,n)},r)}}var Hi=Wi(function(e,t){var n=Vi(e),r=Vi(t),i=Bi(e)+Bi(t),o=n*r;return Ui(o),o/Math.pow(10,i)}),$i=(Wi(function(e,t){var n=Math.pow(10,Math.max(Bi(e),Bi(t)));return(Hi(e,n)+Hi(t,n))/n}),Wi(function(e,t){var n=Math.pow(10,Math.max(Bi(e),Bi(t)));return(Hi(e,n)-Hi(t,n))/n}),Wi(function(e,t){var n=Vi(e),r=Vi(t);return Ui(n),Ui(r),Hi(n/r,zi(Math.pow(10,Bi(t)-Bi(e))))})),Gi=!0,Yi=function(e,t){var n=Math.pow(10,t),r=$i(Math.round(Math.abs(Hi(e,n))),n);return e<0&&0!==r&&(r=Hi(r,-1)),r},qi=function(e){void 0===e&&(e=!0),Gi=e};const Xi=Object.prototype.toString;function Ki(e){switch(Xi.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return ao(e,Error)}}function Zi(e,t){return Xi.call(e)===`[object ${t}]`}function Ji(e){return Zi(e,"ErrorEvent")}function Qi(e){return Zi(e,"DOMError")}function eo(e){return Zi(e,"String")}function to(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function no(e){return null===e||to(e)||"object"!=typeof e&&"function"!=typeof e}function ro(e){return Zi(e,"Object")}function io(e){return typeof Event<"u"&&ao(e,Event)}function oo(e){return!(!e||!e.then||"function"!=typeof e.then)}function ao(e,t){try{return e instanceof t}catch{return!1}}function so(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function lo(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function co(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const t=e[r];try{so(t)?n.push("[VueViewModel]"):n.push(String(t))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function uo(e,t=[],n=!1){return t.some(t=>function(e,t,n=!1){return!!eo(e)&&(function(e){return Zi(e,"RegExp")}(t)?t.test(e):!!eo(t)&&(n?e===t:e.includes(t)))}(e,t,n))}function ho(e,t,n=250,r,i,o,a){if(!(o.exception&&o.exception.values&&a&&ao(a.originalException,Error)))return;const s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=function(e,t){return e.map(e=>(e.value&&(e.value=lo(e.value,t)),e))}(fo(e,t,i,a.originalException,r,o.exception.values,s,0),n))}function fo(e,t,n,r,i,o,a,s){if(o.length>=n+1)return o;let l=[...o];if(ao(r[i],Error)){po(a,s);const o=e(t,r[i]),c=l.length;go(o,i,c,s),l=fo(e,t,n,r[i],i,[o,...l],o,c)}return Array.isArray(r.errors)&&r.errors.forEach((r,o)=>{if(ao(r,Error)){po(a,s);const c=e(t,r),u=l.length;go(c,`errors[${o}]`,u,s),l=fo(e,t,n,r,i,[c,...l],c,u)}}),l}function po(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function go(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function mo(e){return e&&e.Math==Math?e:void 0}const vo="object"==typeof globalThis&&mo(globalThis)||"object"==typeof window&&mo(window)||"object"==typeof self&&mo(self)||"object"==typeof n.g&&mo(n.g)||function(){return this}()||{};function yo(){return vo}function bo(e,t,n){const r=n||vo,i=r.__SENTRY__=r.__SENTRY__||{};return i[e]||(i[e]=t())}const wo=yo();function xo(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,i=[];let o=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&o++<r&&(c=Co(n,u),!("html"===c||o>1&&a+i.length*l+c.length>=d));)i.push(c),a+=c.length,n=n.parentNode;return i.reverse().join(s)}catch{return"<unknown>"}}function Co(e,t){const n=e,r=[];let i,o,a,s,l;if(!n||!n.tagName)return"";if(wo.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(c&&c.length)c.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&eo(i))for(o=i.split(/\s+/),l=0;l<o.length;l++)r.push(`.${o[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}const _o=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,So=["debug","info","warn","error","log","assert","trace"],ko={};function Ao(e){if(!("console"in vo))return e();const t=vo.console,n={},r=Object.keys(ko);r.forEach(e=>{const r=ko[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}const jo=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return _o?So.forEach(n=>{t[n]=(...t)=>{e&&Ao(()=>{vo.console[n](`Sentry Logger [${n}]:`,...t)})}}):So.forEach(e=>{t[e]=()=>{}}),t}(),Eo=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Io(e,t=!1){const{host:n,path:r,pass:i,port:o,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${a}`}function To(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}class Oo extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function Fo(e,t,n){if(!(t in e))return;const r=e[t],i=n(r);"function"==typeof i&&Mo(i,r),e[t]=i}function Po(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{_o&&jo.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Mo(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Po(e,"__sentry_original__",t)}catch{}}function Ro(e){return e.__sentry_original__}function Lo(e){if(Ki(e))return{message:e.message,name:e.name,stack:e.stack,...No(e)};if(io(e)){const t={type:e.type,target:Do(e.target),currentTarget:Do(e.currentTarget),...No(e)};return typeof CustomEvent<"u"&&ao(e,CustomEvent)&&(t.detail=e.detail),t}return e}function Do(e){try{return function(e){return typeof Element<"u"&&ao(e,Element)}(e)?xo(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function No(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function zo(e){return Bo(e,new Map)}function Bo(e,t){if(function(e){if(!ro(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch{return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const i of Object.keys(e))typeof e[i]<"u"&&(r[i]=Bo(e[i],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach(e=>{r.push(Bo(e,t))}),r}return e}const Vo=/\(error: (.*)\)/,Uo=/captureMessage|captureException/;function Wo(...e){const t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0)=>{const r=[],i=e.split("\n");for(let o=n;o<i.length;o++){const e=i[o];if(e.length>1024)continue;const n=Vo.test(e)?e.replace(Vo,"$1"):e;if(!n.match(/\S*Error: /)){for(const e of t){const t=e(n);if(t){r.push(t);break}}if(r.length>=50)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),Uo.test(t[t.length-1].function||"")&&(t.pop(),Uo.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,50).map(e=>({...e,filename:e.filename||t[t.length-1].filename,function:e.function||"?"}))}(r)}}function Ho(e){return Array.isArray(e)?Wo(...e):e}const $o="<anonymous>";function Go(e){try{return e&&"function"==typeof e&&e.name||$o}catch{return $o}}const Yo={},qo={};function Xo(e,t){Yo[e]=Yo[e]||[],Yo[e].push(t)}function Ko(e,t){qo[e]||(t(),qo[e]=!0)}function Zo(e,t){const n=e&&Yo[e];if(n)for(const r of n)try{r(t)}catch(t){_o&&jo.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${Go(r)}\nError:`,t)}}function Jo(){"console"in vo&&So.forEach(function(e){e in vo.console&&Fo(vo.console,e,function(t){return ko[e]=t,function(...t){Zo("console",{args:t,level:e});const n=ko[e];n&&n.apply(vo.console,t)}})})}function Qo(){const e=vo,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch{}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function ea(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ta(e){const{message:t,event_id:n}=e;if(t)return t;const r=ea(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function na(e,t,n){const r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function ra(e,t){const n=ea(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function ia(e){if(e&&e.__sentry_captured__)return!0;try{Po(e,"__sentry_captured__",!0)}catch{}return!1}function oa(e){return Array.isArray(e)?e:[e]}const aa=vo;let sa,la,ca;function ua(){if(!aa.document)return;const e=Zo.bind(null,"dom"),t=da(e,!0);aa.document.addEventListener("click",t,!1),aa.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=aa[t]&&aa[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Fo(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,o=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},a=o[n]=o[n]||{refCount:0};if(!a.handler){const r=da(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),Fo(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},o=i[t];o&&(o.refCount--,o.refCount<=0&&(e.call(this,t,o.handler,r),o.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function da(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return!("keypress"!==e||t&&t.tagName&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable))}(n.type,r))return;Po(n,"_sentryCaptured",!0),r&&!r._sentryId&&Po(r,"_sentryId",Qo());const i="keypress"===n.type?"input":n.type;(function(e){if(e.type!==la)return!1;try{if(!e.target||e.target._sentryId!==ca)return!1}catch{}return!0})(n)||(e({event:n,name:i,global:t}),la=n.type,ca=r?r._sentryId:void 0),clearTimeout(sa),sa=aa.setTimeout(()=>{ca=void 0,la=void 0},1e3)}}const ha=yo();function fa(){if(!("fetch"in ha))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function pa(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ga(){(function(){if("string"==typeof EdgeRuntime)return!0;if(!fa())return!1;if(pa(ha.fetch))return!0;let e=!1;const t=ha.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=pa(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){_o&&jo.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e})()&&Fo(vo,"fetch",function(e){return function(...t){const{method:n,url:r}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:va(t),method:ma(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:va(t),method:ma(t,"method")?String(t.method).toUpperCase():"GET"}}(t),i={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Zo("fetch",{...i}),e.apply(vo,t).then(e=>(Zo("fetch",{...i,endTimestamp:Date.now(),response:e}),e),e=>{throw Zo("fetch",{...i,endTimestamp:Date.now(),error:e}),e})}})}function ma(e,t){return!!e&&"object"==typeof e&&!!e[t]}function va(e){return"string"==typeof e?e:e?ma(e,"url")?e.url:e.toString?e.toString():"":""}let ya=null;function ba(){ya=vo.onerror,vo.onerror=function(e,t,n,r,i){return Zo("error",{column:r,error:i,line:n,msg:e,url:t}),!(!ya||ya.__SENTRY_LOADER__)&&ya.apply(this,arguments)},vo.onerror.__SENTRY_INSTRUMENTED__=!0}let wa=null;function xa(){wa=vo.onunhandledrejection,vo.onunhandledrejection=function(e){return Zo("unhandledrejection",e),!(wa&&!wa.__SENTRY_LOADER__)||wa.apply(this,arguments)},vo.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Ca=yo(),_a=vo;let Sa;function ka(e){const t="history";Xo(t,e),Ko(t,Aa)}function Aa(){if(!function(){const e=Ca.chrome,t=e&&e.app&&e.app.runtime,n="history"in Ca&&!!Ca.history.pushState&&!!Ca.history.replaceState;return!t&&n}())return;const e=_a.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=Sa,t=String(n);Sa=t,Zo("history",{from:e,to:t})}return e.apply(this,t)}}_a.onpopstate=function(...t){const n=_a.location.href,r=Sa;if(Sa=n,Zo("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch{}},Fo(_a.history,"pushState",t),Fo(_a.history,"replaceState",t)}const ja=vo,Ea="__sentry_xhr_v3__";function Ia(){if(!ja.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;Fo(e,"open",function(e){return function(...t){const n=Date.now(),r=eo(t[0])?t[0].toUpperCase():void 0,i=function(e){if(eo(e))return e;try{return e.toString()}catch{}}(t[1]);if(!r||!i)return e.apply(this,t);this[Ea]={method:r,url:i,request_headers:{}},"POST"===r&&i.match(/sentry_key/)&&(this.__sentry_own_request__=!0);const o=()=>{const e=this[Ea];if(e&&4===this.readyState){try{e.status_code=this.status}catch{}Zo("xhr",{args:[r,i],endTimestamp:Date.now(),startTimestamp:n,xhr:this})}};return"onreadystatechange"in this&&"function"==typeof this.onreadystatechange?Fo(this,"onreadystatechange",function(e){return function(...t){return o(),e.apply(this,t)}}):this.addEventListener("readystatechange",o),Fo(this,"setRequestHeader",function(e){return function(...t){const[n,r]=t,i=this[Ea];return i&&eo(n)&&eo(r)&&(i.request_headers[n.toLowerCase()]=r),e.apply(this,t)}}),e.apply(this,t)}}),Fo(e,"send",function(e){return function(...t){const n=this[Ea];return n?(void 0!==t[0]&&(n.body=t[0]),Zo("xhr",{args:[n.method,n.url],startTimestamp:Date.now(),xhr:this}),e.apply(this,t)):e.apply(this,t)}})}function Ta(e,t=100,n=1/0){try{return Fa("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Oa(e,t=3,n=102400){const r=Ta(e,t);return function(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}(r)>n?Oa(e,t-1,n):r}function Fa(e,t,r=1/0,i=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[a,s]=o;if(null==t||["number","boolean","string"].includes(typeof t)&&!function(e){return"number"==typeof e&&e!=e}(t))return t;const l=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(typeof n.g<"u"&&t===n.g)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(so(t))return"[VueViewModel]";if(function(e){return ro(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if("function"==typeof t)return`[Function: ${Go(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===c)return l.replace("object ","");if(a(t))return"[Circular ~]";const u=t;if(u&&"function"==typeof u.toJSON)try{return Fa("",u.toJSON(),c-1,i,o)}catch{}const d=Array.isArray(t)?[]:{};let h=0;const f=Lo(t);for(const n in f){if(!Object.prototype.hasOwnProperty.call(f,n))continue;if(h>=i){d[n]="[MaxProperties ~]";break}const e=f[n];d[n]=Fa(n,e,c-1,i,o),h++}return s(t),d}var Pa;function Ma(e){return new La(t=>{t(e)})}function Ra(e){return new La((t,n)=>{n(e)})}!function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"}(Pa||(Pa={}));class La{constructor(e){La.prototype.__init.call(this),La.prototype.__init2.call(this),La.prototype.__init3.call(this),La.prototype.__init4.call(this),this._state=Pa.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new La((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new La((t,n)=>{let r,i;return this.then(t=>{i=!1,r=t,e&&e()},t=>{i=!0,r=t,e&&e()}).then(()=>{i?n(r):t(r)})})}__init(){this._resolve=e=>{this._setResult(Pa.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Pa.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{if(this._state===Pa.PENDING){if(oo(t))return void t.then(this._resolve,this._reject);this._state=e,this._value=t,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Pa.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(this._state===Pa.RESOLVED&&e[1](this._value),this._state===Pa.REJECTED&&e[2](this._value),e[0]=!0)})}}}function Da(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const Na=["fatal","error","warning","log","info","debug"];function za(e){return"warn"===e?"warning":Na.includes(e)?e:"log"}function Ba(){return Date.now()/1e3}const Va=function(){const{performance:e}=vo;if(!e||!e.now)return Ba;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function Ua(e,t=[]){return[e,t]}function Wa(e,t){const[n,r]=e;return[n,[...r,t]]}function Ha(e,t){const n=e[1];for(const r of n)if(t(r,r[0].type))return!0;return!1}function $a(e,t){return(t||new TextEncoder).encode(e)}function Ga(e,t){const[n,r]=e;let i=JSON.stringify(n);function o(e){"string"==typeof i?i="string"==typeof e?i+e:[$a(i,t),e]:i.push("string"==typeof e?$a(e,t):e)}for(const a of r){const[e,t]=a;if(o(`\n${JSON.stringify(e)}\n`),"string"==typeof t||t instanceof Uint8Array)o(t);else{let e;try{e=JSON.stringify(t)}catch{e=JSON.stringify(Ta(t))}o(e)}}return"string"==typeof i?i:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const i of e)n.set(i,r),r+=i.length;return n}(i)}function Ya(e,t){const n="string"==typeof e.data?$a(e.data,t):e.data;return[zo({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=vo;if(!e||!e.now)return;const t=36e5,n=e.now(),r=Date.now(),i=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=i<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(o||s<t)&&i<=s&&e.timeOrigin})();const qa={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function Xa(e){return qa[e]}function Ka(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const Za=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ja="production";function Qa(){return bo("globalEventProcessors",()=>[])}function es(e){Qa().push(e)}function ts(e,t,n,r=0){return new La((i,o)=>{const a=e[r];if(null===t||"function"!=typeof a)i(t);else{const s=a({...t},n);Za&&a.id&&null===s&&jo.log(`Event processor "${a.id}" dropped event`),oo(s)?s.then(t=>ts(e,t,n,r+1).then(i)).then(null,o):ts(e,s,n,r+1).then(i).then(null,o)}})}function ns(e){const t=Va(),n={sid:Qo(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return zo({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&rs(n,e),n}function rs(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Va(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:Qo()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function is(e,t){let n={};"ok"===e.status&&(n={status:"exited"}),rs(e,n)}function os(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:o,status:a,tags:s,origin:l}=as(e);return zo({data:r,op:i,parent_span_id:o,span_id:t,status:a,tags:s,trace_id:n,origin:l})}function as(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}const ss=new WeakMap;function ls(e,t){return Os().captureEvent(e,t)}function cs(e,t){Os().addBreadcrumb(e,t)}function us(){return Os().getClient()}function ds(){return Os().getScope()}function hs(e){const t=us(),n=Fs(),r=ds(),{release:i,environment:o=Ja}=t&&t.getOptions()||{},{userAgent:a}=vo.navigator||{},s=ns({release:i,environment:o,user:r.getUser()||n.getUser(),...a&&{userAgent:a},...e}),l=n.getSession();return l&&"ok"===l.status&&rs(l,{status:"exited"}),fs(),n.setSession(s),r.setSession(s),s}function fs(){const e=Fs(),t=ds(),n=t.getSession()||e.getSession();n&&is(n),ps(),e.setSession(),t.setSession()}function ps(){const e=Fs(),t=ds(),n=us(),r=t.getSession()||e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}function gs(e=!1){e?fs():ps()}function ms(e){return e.transaction}function vs(e,t,n){const r=t.getOptions(),{publicKey:i}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},a=zo({environment:r.environment||Ja,release:r.release,user_segment:o,public_key:i,trace_id:e});return t.emit&&t.emit("createDsc",a),a}function ys(e){const t=us();if(!t)return{};const n=vs(as(e).trace_id||"",t,ds()),r=ms(e);if(!r)return n;const i=r&&r._frozenDynamicSamplingContext;if(i)return i;const{sampleRate:o,source:a}=r.metadata;null!=o&&(n.sample_rate=`${o}`);const s=as(r);return a&&"url"!==a&&(n.transaction=s.description),n.sampled=String(function(e){const{traceFlags:t}=e.spanContext();return!!(1&t)}(r)),t.emit&&t.emit("createDsc",n),n}function bs(e,t){const{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=t;(function(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,transactionName:s}=t,l=zo(n);l&&Object.keys(l).length&&(e.extra={...l,...e.extra});const c=zo(r);c&&Object.keys(c).length&&(e.tags={...c,...e.tags});const u=zo(i);u&&Object.keys(u).length&&(e.user={...u,...e.user});const d=zo(o);d&&Object.keys(d).length&&(e.contexts={...d,...e.contexts}),a&&(e.level=a),s&&(e.transaction=s)})(e,t),r&&function(e,t){e.contexts={trace:os(t),...e.contexts};const n=ms(t);if(n){e.sdkProcessingMetadata={dynamicSamplingContext:ys(t),...e.sdkProcessingMetadata};const r=as(n).description;r&&(e.tags={transaction:r,...e.tags})}}(e,r),function(e,t){e.fingerprint=e.fingerprint?oa(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,i),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,o)}function ws(e,t){const{extra:n,tags:r,user:i,contexts:o,level:a,sdkProcessingMetadata:s,breadcrumbs:l,fingerprint:c,eventProcessors:u,attachments:d,propagationContext:h,transactionName:f,span:p}=t;xs(e,"extra",n),xs(e,"tags",r),xs(e,"user",i),xs(e,"contexts",o),xs(e,"sdkProcessingMetadata",s),a&&(e.level=a),f&&(e.transactionName=f),p&&(e.span=p),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),c.length&&(e.fingerprint=[...e.fingerprint,...c]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...h}}function xs(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}let Cs;class _s{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=Ss()}static clone(e){return e?e.clone():new _s}clone(){const e=new _s;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},e._user=this._user,e._level=this._level,e._span=this._span,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e}setClient(e){this._client=e}getClient(){return this._client}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,segment:void 0,username:void 0},this._session&&rs(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e;if(t instanceof _s){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(ro(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this._attachments=[],this._propagationContext=Ss(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:Ba(),...e},i=this._breadcrumbs;return i.push(r),this._breadcrumbs=i.length>n?i.slice(-n):i,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:i,_user:o,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:c,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:i,user:o,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:c,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},n=[]){return bs(e,this.getScopeData()),ts([...n,...Qa(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:Qo();if(!this._client)return jo.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:Qo();if(!this._client)return jo.warn("No client configured on scope - will not capture message!"),r;const i=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Qo();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(jo.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Ss(){return{traceId:Qo(),spanId:Qo().substring(16)}}const ks="7.116.0",As=parseFloat(ks),js=100;class Es{constructor(e,t,n,r=As){let i,o;this._version=r,t?i=t:(i=new _s,i.setClient(e)),n?o=n:(o=new _s,o.setClient(e)),this._stack=[{scope:i}],e&&this.bindClient(e),this._isolationScope=o}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(e){throw this.popScope(),e}return oo(n)?n.then(e=>(this.popScope(),e),e=>{throw this.popScope(),e}):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:Qo(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:Qo(),i=new Error(e);return this.getScope().captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:Qo();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:o=js}=r.getOptions&&r.getOptions()||{};if(o<=0)return;const a={timestamp:Ba(),...e},s=i?Ao(()=>i(a,t)):a;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,o))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Ts(this);try{e(this)}finally{Ts(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch{return Za&&jo.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);return Za&&!n&&(this.getClient()?jo.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):jo.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")),n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&is(t),this._sendSessionUpdate(),e.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:i=Ja}=n&&n.getOptions()||{},{userAgent:o}=vo.navigator||{},a=ns({release:r,environment:i,user:t.getUser(),...o&&{userAgent:o},...e}),s=t.getSession&&t.getSession();return s&&"ok"===s.status&&rs(s,{status:"exited"}),this.endSession(),t.setSession(a),a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return!(!t||!t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop(),n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_callExtensionMethod(e,...t){const n=Is().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);Za&&jo.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function Is(){return vo.__SENTRY__=vo.__SENTRY__||{extensions:{},hub:void 0},vo}function Ts(e){const t=Is(),n=Ps(t);return Ms(t,e),n}function Os(){const e=Is();if(e.__SENTRY__&&e.__SENTRY__.acs){const t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return function(e=Is()){return(!function(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}(e)||Ps(e).isOlderThan(As))&&Ms(e,new Es),Ps(e)}(e)}function Fs(){return Os().getIsolationScope()}function Ps(e){return bo("hub",()=>new Es,e)}function Ms(e,t){return!!e&&((e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0)}const Rs=[];function Ls(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach(e=>{e.isDefaultInstance=!0}),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?oa(n(t)):t;const i=function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.keys(t).map(e=>t[e])}(r),o=function(e,t){for(let n=0;n<e.length;n++)if(!0===t(e[n]))return n;return-1}(i,e=>"Debug"===e.name);if(-1!==o){const[e]=i.splice(o,1);i.push(e)}return i}function Ds(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Ns(e,t,n){if(n[t.name])Za&&jo.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,-1===Rs.indexOf(t.name)&&(t.setupOnce(es,Os),Rs.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),e.on&&"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if(e.addEventProcessor&&"function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}Za&&jo.log(`Integration installed: ${t.name}`)}}function zs(e,t){return Object.assign(function(...e){return t(...e)},{id:e})}const Bs="Not capturing exception because it's already been captured.";class Vs{constructor(e){if(this._options=e,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=function(e){const t="string"==typeof e?function(e){const t=Eo.exec(e);if(!t)return void Ao(()=>{});const[n,r,i="",o,a="",s]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return To({host:o,pass:i,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):To(e);if(t&&function(e){if(!_o)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(jo.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(jo.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(jo.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(jo.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}(e.dsn):Za&&jo.warn("No DSN provided, client will not send events."),this._dsn){const t=function(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){return function(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}({sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}})}(e,r)}`}(this._dsn,e);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}}captureException(e,t,n){if(ia(e))return void(Za&&jo.log(Bs));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then(e=>this._captureEvent(e,t,n)).then(e=>{r=e})),r}captureMessage(e,t,n,r){let i=n&&n.event_id;const o=to(e)?e:String(e),a=no(e)?this.eventFromMessage(o,t,n):this.eventFromException(e,n);return this._process(a.then(e=>this._captureEvent(e,n,r)).then(e=>{i=e})),i}captureEvent(e,t,n){if(t&&t.originalException&&ia(t.originalException))return void(Za&&jo.log(Bs));let r=t&&t.event_id;const i=(e.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(e,t,i||n).then(e=>{r=e})),r}captureSession(e){"string"!=typeof e.release?Za&&jo.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),rs(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){const t=this._transport;return t?(this.metricsAggregator&&this.metricsAggregator.flush(),this._isClientDoneProcessing(e).then(n=>t.flush(e).then(e=>n&&e))):Ma(!0)}close(e){return this.flush(e).then(e=>(this.getOptions().enabled=!1,this.metricsAggregator&&this.metricsAggregator.close(),e))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&this._setupIntegrations()}init(){this._isEnabled()&&this._setupIntegrations()}getIntegrationById(e){return this.getIntegrationByName(e)}getIntegrationByName(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch{return Za&&jo.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){const t=this._integrations[e.name];Ns(this,e,this._integrations),t||Ds(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const i=Ka(n),o=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const i=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Io(r)},...i&&{trace:zo({...i})}}}(e,i,r,t);return delete e.sdkProcessingMetadata,Ua(a,[[{type:o},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const i of t.attachments||[])n=Wa(n,Ya(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));const r=this._sendEnvelope(n);r&&r.then(t=>this.emit("afterSendEvent",e,t),null)}sendSession(e){const t=function(e,t,n,r){const i=Ka(n);return Ua({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:Io(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}recordDroppedEvent(e,t,n){if(this._options.sendClientReports){const n=`${e}:${t}`;Za&&jo.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}captureAggregateMetrics(e){Za&&jo.log(`Flushing aggregated metrics, number of metrics: ${e.length}`);const t=function(e,t,n,r){const i={sent_at:(new Date).toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&t&&(i.dsn=Io(t));const o=function(e){const t=function(e){let t="";for(const n of e){const e=Object.entries(n.tags),r=e.length>0?`|#${e.map(([e,t])=>`${e}:${t}`).join(",")}`:"";t+=`${n.name}@${n.unit}:${n.metric}|${n.metricType}${r}|T${n.timestamp}\n`}return t}(e);return[{type:"statsd",length:t.length},t]}(e);return Ua(i,[o])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}on(e,t){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t)}emit(e,...t){this._hooks[e]&&this._hooks[e].forEach(e=>e(...t))}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{t&&Ns(e,t,n)}),n}(this,e),Ds(this,e),this._integrationsInitialized=!0}_updateSessionFromEvent(e,t){let n=!1,r=!1;const i=t.exception&&t.exception.values;if(i){r=!0;for(const e of i){const t=e.mechanism;if(t&&!1===t.handled){n=!0;break}}}const o="ok"===e.status;(o&&0===e.errors||o&&n)&&(rs(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new La(t=>{let n=0;const r=setInterval(()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))},1)})}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r=Fs()){const i=this.getOptions(),o=Object.keys(this._integrations);return!t.integrations&&o.length>0&&(t.integrations=o),this.emit("preprocessEvent",e,t),function(e,t,n,r,i,o){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||n.event_id||Qo(),timestamp:t.timestamp||Ba()},c=n.integrations||e.integrations.map(e=>e.name);(function(e,t){const{environment:n,release:r,dist:i,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:Ja),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==i&&(e.dist=i),e.message&&(e.message=lo(e.message,o));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=lo(a.value,o));const s=e.request;s&&s.url&&(s.url=lo(s.url,o))})(l,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(l,c),void 0===t.type&&function(e,t){const n=vo._sentryDebugIds;if(!n)return;let r;const i=ss.get(t);i?r=i:(r=new Map,ss.set(t,r));const o=Object.keys(n).reduce((e,i)=>{let o;const a=r.get(i);a?o=a:(o=t(i),r.set(i,o));for(let t=o.length-1;t>=0;t--){const r=o[t];if(r.filename){e[r.filename]=n[i];break}}return e},{});try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.filename&&(e.debug_id=o[e.filename])})})}catch{}}(l,e.stackParser);const u=function(e,t){if(!t)return e;const n=e?e.clone():new _s;return n.update(t),n}(r,n.captureContext);n.mechanism&&ra(l,n.mechanism);const d=i&&i.getEventProcessors?i.getEventProcessors():[],h=(Cs||(Cs=new _s),Cs).getScopeData();o&&ws(h,o.getScopeData()),u&&ws(h,u.getScopeData());const f=[...n.attachments||[],...h.attachments];return f.length&&(n.attachments=f),bs(l,h),ts([...d,...Qa(),...h.eventProcessors],l,n).then(e=>(e&&function(e){const t={};try{e.exception.values.forEach(e=>{e.stacktrace.frames.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})})}catch{}if(0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.keys(t).forEach(e=>{n.push({type:"sourcemap",code_file:e,debug_id:t[e]})})}(e),"number"==typeof a&&a>0?function(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:Ta(e.data,t,n)}}))},...e.user&&{user:Ta(e.user,t,n)},...e.contexts&&{contexts:Ta(e.contexts,t,n)},...e.extra&&{extra:Ta(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ta(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>{const r=as(e).data;return r&&(e.data=Ta(r,t,n)),e})),r}(e,a,s):e))}(i,e,t,n,this,r).then(e=>{if(null===e)return e;const t={...r.getPropagationContext(),...n?n.getPropagationContext():void 0};if((!e.contexts||!e.contexts.trace)&&t){const{traceId:r,spanId:i,parentSpanId:o,dsc:a}=t;e.contexts={trace:{trace_id:r,span_id:i,parent_span_id:o},...e.contexts};const s=a||vs(r,this,n);e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata}}return e})}_captureEvent(e,t={},n){return this._processEvent(e,t,n).then(e=>e.event_id,e=>{if(Za){const t=e;"log"===t.logLevel?jo.log(t.message):jo.warn(t)}})}_processEvent(e,t,n){const r=this.getOptions(),{sampleRate:i}=r,o=Ws(e),a=Us(e),s=e.type||"error",l=`before send for type \`${s}\``;if(a&&"number"==typeof i&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),Ra(new Oo(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));const c="replay_event"===s?"replay":s,u=(e.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(e,t,n,u).then(n=>{if(null===n)throw this.recordDroppedEvent("event_processor",c,e),new Oo("An event processor returned `null`, will not send event.","log");if(t.data&&!0===t.data.__sentry__)return n;const i=function(e,t,n){const{beforeSend:r,beforeSendTransaction:i}=e;return Us(t)&&r?r(t,n):Ws(t)&&i?i(t,n):t}(r,n,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(oo(e))return e.then(e=>{if(!ro(e)&&null!==e)throw new Oo(n);return e},e=>{throw new Oo(`${t} rejected with ${e}`)});if(!ro(e)&&null!==e)throw new Oo(n);return e}(i,l)}).then(r=>{if(null===r)throw this.recordDroppedEvent("before_send",c,e),new Oo(`${l} returned \`null\`, will not send event.`,"log");const i=n&&n.getSession();!o&&i&&this._updateSessionFromEvent(i,r);const a=r.transaction_info;if(o&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e}}return this.sendEvent(r,t),r}).then(null,e=>{throw e instanceof Oo?e:(this.captureException(e,{data:{__sentry__:!0},originalException:e}),new Oo(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e){this._numProcessing++,e.then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,e=>{Za&&jo.error("Error while sending event:",e)});Za&&jo.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map(t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}})}}function Us(e){return void 0===e.type}function Ws(e){return"transaction"===e.type}function Hs(e,t,n=function(e){const t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return Ra(new Oo("Not adding Promise because buffer limit was reached."));const i=r();return-1===t.indexOf(i)&&t.push(i),i.then(()=>n(i)).then(null,()=>n(i).then(null,()=>{})),i},drain:function(e){return new La((n,r)=>{let i=t.length;if(!i)return n(!0);const o=setTimeout(()=>{e&&e>0&&n(!1)},e);t.forEach(e=>{Ma(e).then(()=>{--i||(clearTimeout(o),n(!0))},r)})})}}}(e.bufferSize||30)){let r={};function i(i){const o=[];if(Ha(i,(t,n)=>{const i=Xa(n);if(function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,i)){const r=$s(t,n);e.recordDroppedEvent("ratelimit_backoff",i,r)}else o.push(t)}),0===o.length)return Ma();const a=Ua(i[0],o),s=t=>{Ha(a,(n,r)=>{const i=$s(n,r);e.recordDroppedEvent(t,Xa(r),i)})};return n.add(()=>t({body:Ga(a,e.textEncoder)}).then(e=>(void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&Za&&jo.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=function(e,{statusCode:t,headers:n},r=Date.now()){const i={...e},o=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(o)for(const s of o.trim().split(",")){const[e,t,,,n]=s.split(":",5),o=parseInt(e,10),a=1e3*(isNaN(o)?60:o);if(t)for(const s of t.split(";"))"metric_bucket"===s?(!n||n.split(";").includes("custom"))&&(i[s]=r+a):i[s]=r+a;else i.all=r+a}else a?i.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(i.all=r+6e4);return i}(r,e),e),e=>{throw s("network_error"),e})).then(e=>e,e=>{if(e instanceof Oo)return Za&&jo.error("Skipped sending event because buffer is full."),s("queue_overflow"),Ma();throw e})}return i.__sentry__baseTransport__=!0,{send:i,flush:e=>n.drain(e)}}function $s(e,t){if("event"===t||"transaction"===t)return Array.isArray(e)?e[1]:void 0}function Gs(e,t,n=[t],r="npm"){const i=e._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${t}`,packages:n.map(e=>({name:`${r}:@sentry/${e}`,version:ks})),version:ks}),e._metadata=i}const Ys=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/],qs=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Xs="InboundFilters",Ks=(e={})=>({name:Xs,setupOnce(){},processEvent(t,n,r){const i=r.getOptions(),o=function(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ys],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:qs],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(e,i);return function(e,t){return t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch{}return!1}(e)?(Za&&jo.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ta(e)}`),!0):function(e,t){return!(e.type||!t||!t.length)&&function(e){const t=[];let n;e.message&&t.push(e.message);try{n=e.exception.values[e.exception.values.length-1]}catch{}return n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`)),Za&&0===t.length&&jo.error(`Could not extract message for event ${ta(e)}`),t}(e).some(e=>uo(e,t))}(e,t.ignoreErrors)?(Za&&jo.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ta(e)}`),!0):function(e,t){if("transaction"!==e.type||!t||!t.length)return!1;const n=e.transaction;return!!n&&uo(n,t)}(e,t.ignoreTransactions)?(Za&&jo.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${ta(e)}`),!0):function(e,t){if(!t||!t.length)return!1;const n=Zs(e);return!!n&&uo(n,t)}(e,t.denyUrls)?(Za&&jo.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ta(e)}.\nUrl: ${Zs(e)}`),!0):!function(e,t){if(!t||!t.length)return!0;const n=Zs(e);return!n||uo(n,t)}(e,t.allowUrls)&&(Za&&jo.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ta(e)}.\nUrl: ${Zs(e)}`),!0)}(t,o)?null:t}});function Zs(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(t):null}catch{return Za&&jo.error(`Cannot extract url for event ${ta(e)}`),null}}let Js;zs(Xs,Ks);const Qs="FunctionToString",el=new WeakMap,tl=()=>({name:Qs,setupOnce(){Js=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Ro(this),n=el.has(us())&&void 0!==t?t:this;return Js.apply(n,e)}}catch{}},setup(e){el.set(e,!0)}});zs(Qs,tl);const nl=vo;let rl=0;function il(){return rl>0}function ol(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(Ro(e))return e}catch{return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map(e=>ol(e,t));return e.apply(this,i)}catch(e){throw rl++,setTimeout(()=>{rl--}),function(...e){const t=Os();if(2===e.length){const[n,r]=e;return n?t.withScope(()=>(t.getStackTop().scope=n,r(n))):t.withScope(r)}t.withScope(e[0])}(i=>{i.addEventProcessor(e=>(t.mechanism&&(na(e,void 0),ra(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),function(e){Os().captureException(e,void 0)}(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Mo(r,e),Po(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch{}return r}const al=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function sl(e,t){const n=cl(e,t),r={type:t&&t.name,value:dl(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function ll(e,t){return{exception:{values:[sl(e,t)]}}}function cl(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(ul.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch{}return[]}const ul=/Minified React error #\d+;/i;function dl(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function hl(e,t,n,r,i){let o;if(Ji(t)&&t.error)return ll(e,t.error);if(Qi(t)||function(e){return Zi(e,"DOMException")}(t)){const i=t;if("stack"in t)o=ll(e,t);else{const t=i.name||(Qi(i)?"DOMError":"DOMException"),a=i.message?`${t}: ${i.message}`:t;o=fl(e,a,n,r),na(o,a)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Ki(t)?ll(e,t):ro(t)||io(t)?(o=function(e,t,n,r){const i=us(),o=i&&i.getOptions().normalizeDepth,a={exception:{values:[{type:io(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:pl(t,{isUnhandledRejection:r})}]},extra:{__serialized__:Oa(t,o)}};if(n){const t=cl(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,i),ra(o,{synthetic:!0}),o):(o=fl(e,t,n,r),na(o,`${t}`),ra(o,{synthetic:!0}),o)}function fl(e,t,n,r){const i={};if(r&&n){const r=cl(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]})}if(to(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function pl(e,{isUnhandledRejection:t}){const n=function(e,t=40){const n=Object.keys(Lo(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return lo(n[0],t);for(let r=n.length;r>0;r--){const e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:lo(e,t)}return""}(e),r=t?"promise rejection":"exception";return Ji(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:io(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}class gl extends Vs{constructor(e){Gs(e,"browser",["browser"],nl.SENTRY_SDK_SOURCE||"npm"),super(e),e.sendClientReports&&nl.document&&nl.document.addEventListener("visibilitychange",()=>{"hidden"===nl.document.visibilityState&&this._flushOutcomes()})}eventFromException(e,t){return function(e,t,n,r){const i=hl(e,t,n&&n.syntheticException||void 0,r);return ra(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Ma(i)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,i){const o=fl(e,t,r&&r.syntheticException||void 0,i);return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ma(o)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled())return void(al&&jo.warn("SDK not enabled, will not capture user feedback."));const t=function(e,{metadata:t,tunnel:n,dsn:r}){const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:Io(r)}},o=function(e){return[{type:"user_report"},e]}(e);return Ua(i,[o])}(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this._sendEnvelope(t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes();if(0===e.length)return void(al&&jo.log("No outcomes to send"));if(!this._dsn)return void(al&&jo.log("No dsn provided, will not send outcomes"));al&&jo.log("Sending outcomes:",e);const t=function(e,t){return Ua(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:Ba(),discarded_events:e}]])}(e,this._options.tunnel&&Io(this._dsn));this._sendEnvelope(t)}}let ml;function vl(e,t=function(){if(ml)return ml;if(pa(nl.fetch))return ml=nl.fetch.bind(nl);const e=nl.document;let t=nl.fetch;if(e&&"function"==typeof e.createElement)try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){al&&jo.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return ml=t.bind(nl)}()){let n=0,r=0;return Hs(e,function(i){const o=i.body.length;n+=o,r++;const a={body:i.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{return t(e.url,a).then(e=>(n-=o,r--,{statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}}))}catch(e){return ml=void 0,n-=o,r--,Ra(e)}})}function yl(e){return Hs(e,function(t){return new La((n,r)=>{const i=new XMLHttpRequest;i.onerror=r,i.onreadystatechange=()=>{4===i.readyState&&n({statusCode:i.status,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")}})},i.open("POST",e.url);for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&i.setRequestHeader(t,e.headers[t]);i.send(t.body)})})}const bl="?";function wl(e,t,n,r){const i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const xl=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Cl=/\((\S*)(?::(\d+))(?::(\d+))\)/,_l=[30,e=>{const t=xl.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Cl.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Tl(t[1]||bl,t[2]);return wl(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Sl=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kl=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Al=[50,e=>{const t=Sl.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=kl.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||bl;return[n,e]=Tl(n,e),wl(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],jl=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,El=[40,e=>{const t=jl.exec(e);return t?wl(t[2],t[1]||bl,+t[3],t[4]?+t[4]:void 0):void 0}],Il=Wo(_l,Al,El),Tl=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:bl,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ol="Breadcrumbs",Fl=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Ol,setupOnce(){},setup(e){t.console&&function(e){const t="console";Xo(t,e),Ko(t,Jo)}(function(e){return function(t){if(us()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:za(t.level),message:co(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${co(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}cs(n,{input:t.args,level:t.level})}}(e)),t.dom&&function(e){Xo("dom",e),Ko("dom",ua)}(function(e,t){return function(n){if(us()!==e)return;let r,i,o="object"==typeof t?t.serializeAttribute:void 0,a="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;a&&a>1024&&(al&&jo.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${a} was configured. Sentry will use 1024 instead.`),a=1024),"string"==typeof o&&(o=[o]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=xo(t,{keyAttrs:o,maxStringLength:a}),i=function(e){if(!wo.HTMLElement)return null;let t=e;for(let n=0;n<5;n++){if(!t)return null;if(t instanceof HTMLElement&&t.dataset.sentryComponent)return t.dataset.sentryComponent;t=t.parentNode}return null}(t)}catch{r="<unknown>"}if(0===r.length)return;const s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),cs(s,{event:n.event,name:n.name,global:n.global})}}(e,t.dom)),t.xhr&&function(e){Xo("xhr",e),Ko("xhr",Ia)}(function(e){return function(t){if(us()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[Ea];if(!n||!r||!i)return;const{method:o,url:a,status_code:s,body:l}=i;cs({category:"xhr",data:{method:o,url:a,status_code:s},type:"http"},{xhr:t.xhr,input:l,startTimestamp:n,endTimestamp:r})}}(e)),t.fetch&&function(e){const t="fetch";Xo(t,e),Ko(t,ga)}(function(e){return function(t){if(us()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error)cs({category:"fetch",data:t.fetchData,level:"error",type:"http"},{data:t.error,input:t.args,startTimestamp:n,endTimestamp:r});else{const e=t.response;cs({category:"fetch",data:{...t.fetchData,status_code:e&&e.status},type:"http"},{input:t.args,response:e,startTimestamp:n,endTimestamp:r})}}}(e)),t.history&&ka(function(e){return function(t){if(us()!==e)return;let n=t.from,r=t.to;const i=Da(nl.location.href);let o=n?Da(n):void 0;const a=Da(r);(!o||!o.path)&&(o=i),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),cs({category:"navigation",data:{from:n,to:r}})}}(e)),t.sentry&&e.on&&e.on("beforeSendEvent",function(e){return function(t){us()===e&&cs({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:ta(t)},{event:t})}}(e))}}};zs(Ol,Fl);const Pl="Dedupe",Ml=()=>{let e;return{name:Pl,setupOnce(){},processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&!(!function(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Ll(e,t)||!Rl(e,t))}(e,t)&&!function(e,t){const n=Dl(t),r=Dl(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&Ll(e,t)&&Rl(e,t))}(e,t))}(t,e))return al&&jo.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Rl(e,t){let n=Nl(e),r=Nl(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(let i=0;i<r.length;i++){const e=r[i],t=n[i];if(e.filename!==t.filename||e.lineno!==t.lineno||e.colno!==t.colno||e.function!==t.function)return!1}return!0}function Ll(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return n.join("")===r.join("")}catch{return!1}}function Dl(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Nl(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch{return}}zs(Pl,Ml);const zl="GlobalHandlers",Bl=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:zl,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(function(e){!function(e){const t="error";Xo(t,e),Ko(t,ba)}(t=>{const{stackParser:n,attachStacktrace:r}=Wl();if(us()!==e||il())return;const{msg:i,url:o,line:a,column:s,error:l}=t,c=void 0===l&&eo(i)?function(e,t,n,r){let i=Ji(e)?e.message:e,o="Error";const a=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);return a&&(o=a[1],i=a[2]),Vl({exception:{values:[{type:o,value:i}]}},t,n,r)}(i,o,a,s):Vl(hl(n,l||i,void 0,r,!1),o,a,s);c.level="error",ls(c,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}(e),Ul("onerror")),t.onunhandledrejection&&(function(e){!function(e){const t="unhandledrejection";Xo(t,e),Ko(t,xa)}(t=>{const{stackParser:n,attachStacktrace:r}=Wl();if(us()!==e||il())return;const i=function(e){if(no(e))return e;const t=e;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return e}(t),o=no(i)?function(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}(i):hl(n,i,void 0,r,!0);o.level="error",ls(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}(e),Ul("onunhandledrejection"))}}};function Vl(e,t,n,r){const i=e.exception=e.exception||{},o=i.values=i.values||[],a=o[0]=o[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,d=eo(t)&&t.length>0?t:function(){try{return wo.document.location.href}catch{return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function Ul(e){al&&jo.log(`Global Handler attached: ${e}`)}function Wl(){const e=us();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}zs(zl,Bl);const Hl="HttpContext",$l=()=>({name:Hl,setupOnce(){},preprocessEvent(e){if(!nl.navigator&&!nl.location&&!nl.document)return;const t=e.request&&e.request.url||nl.location&&nl.location.href,{referrer:n}=nl.document||{},{userAgent:r}=nl.navigator||{},i={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:i};e.request=o}});zs(Hl,$l);const Gl="LinkedErrors",Yl=(e={})=>{const t=e.limit||5,n=e.key||"cause";return{name:Gl,setupOnce(){},preprocessEvent(e,r,i){const o=i.getOptions();ho(sl,o.stackParser,o.maxValueLength,n,t,e,r)}}};zs(Gl,Yl);const ql=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],Xl="TryCatch",Kl=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e};return{name:Xl,setupOnce(){t.setTimeout&&Fo(nl,"setTimeout",Zl),t.setInterval&&Fo(nl,"setInterval",Zl),t.requestAnimationFrame&&Fo(nl,"requestAnimationFrame",Jl),t.XMLHttpRequest&&"XMLHttpRequest"in nl&&Fo(XMLHttpRequest.prototype,"send",Ql);const e=t.eventTarget;e&&(Array.isArray(e)?e:ql).forEach(ec)}}};function Zl(e){return function(...t){const n=t[0];return t[0]=ol(n,{mechanism:{data:{function:Go(e)},handled:!1,type:"instrument"}}),e.apply(this,t)}}function Jl(e){return function(t){return e.apply(this,[ol(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Go(e)},handled:!1,type:"instrument"}})])}}function Ql(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in n&&"function"==typeof n[e]&&Fo(n,e,function(t){const n={mechanism:{data:{function:e,handler:Go(t)},handled:!1,type:"instrument"}},r=Ro(t);return r&&(n.mechanism.data.handler=Go(r)),ol(t,n)})}),e.apply(this,t)}}function ec(e){const t=nl,n=t[e]&&t[e].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Fo(n,"addEventListener",function(t){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=ol(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Go(r),target:e},handled:!1,type:"instrument"}}))}catch{}return t.apply(this,[n,ol(r,{mechanism:{data:{function:"addEventListener",handler:Go(r),target:e},handled:!1,type:"instrument"}}),i])}}),Fo(n,"removeEventListener",function(e){return function(t,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch{}return e.call(this,t,i,r)}}))}zs(Xl,Kl);const tc=[Ks(),tl(),Kl(),Fl(),Bl(),Yl(),Ml(),$l()];function nc(e={}){void 0===e.defaultIntegrations&&(e.defaultIntegrations=[...tc]),void 0===e.release&&("string"==typeof __SENTRY_RELEASE__&&(e.release=__SENTRY_RELEASE__),nl.SENTRY_RELEASE&&nl.SENTRY_RELEASE.id&&(e.release=nl.SENTRY_RELEASE.id)),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:Ho(e.stackParser||Il),integrations:Ls(e),transport:e.transport||(fa()?vl:yl)};(function(e,t){!0===t.debug&&(Za?jo.enable():Ao(()=>{})),ds().update(t.initialScope);const n=new e(t);(function(e){const t=Os().getStackTop();t.client=e,t.scope.setClient(e)})(n),function(e){e.init?e.init():e.setupIntegrations&&e.setupIntegrations()}(n)})(gl,t),e.autoSessionTracking&&(typeof nl.document>"u"?al&&jo.warn("Session tracking in non-browser environment with @sentry/browser is not supported."):(hs({ignoreDuration:!0}),gs(),ka(({from:e,to:t})=>{void 0!==e&&e!==t&&(hs({ignoreDuration:!0}),gs())})))}var rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof n.g<"u"?n.g:typeof self<"u"?self:{};function ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oc=(e=>(e.INLINE="inline",e.OVERLAY="overlay",e))(oc||{}),ac=(e=>(e.TOP="top",e.BOTTOM="bottom",e.HIDDEN="",e))(ac||{});function sc(e,t){return{...t,message:e}}const lc={emoticons:sc("Emoticons"),doodles:sc("Doodles"),landmarks:sc("Landmarks"),bubbles:sc("Bubbles"),transportation:sc("Transportation"),beach:sc("Beach")},cc={fill:"#1565C0",opacity:1,backgroundColor:null,strokeWidth:.05,stroke:"#000"},uc=[1,8,15,20,25];var dc=(e=>(e.DARK="dark",e.LIGHT="light",e))(dc||{});const hc=[{name:dc.LIGHT,colors:{"--be-foreground-base":"0 0 0","--be-primary-light":"191 219 254","--be-primary":"59 130 246","--be-primary-dark":"37 99 235","--be-on-primary":"255 255 255","--be-danger":"179 38 30","--be-on-danger":"255 255 255","--be-background":"255 255 255","--be-background-alt":"250 250 250","--be-paper":"255 255 255","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"26%","--be-hover-opacity":"4%","--be-focus-opacity":"12%","--be-selected-opacity":"8%","--be-text-main-opacity":"87%","--be-text-muted-opacity":"60%","--be-divider-opacity":"12%"}},{name:dc.DARK,isDark:!0,colors:{"--be-foreground-base":"255 255 255","--be-primary-light":"239 246 255","--be-primary":"191 219 254","--be-primary-dark":"147 197 253","--be-on-primary":"56 30 114","--be-danger":"242 184 181","--be-on-danger":"96 20 16","--be-background":"20 21 23","--be-background-alt":"26 27 30","--be-paper":"44 46 51","--be-disabled-bg-opacity":"12%","--be-disabled-fg-opacity":"30%","--be-hover-opacity":"8%","--be-focus-opacity":"12%","--be-selected-opacity":"16%","--be-text-main-opacity":"100%","--be-text-muted-opacity":"70%","--be-divider-opacity":"12%"}}];var fc=(e=>(e.FILTER="filter",e.RESIZE="resize",e.CROP="crop",e.DRAW="draw",e.TEXT="text",e.SHAPES="shapes",e.STICKERS="stickers",e.FRAME="frame",e.CORNERS="corners",e.MERGE="merge",e))(fc||{});function pc(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=pc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function gc(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=pc(e))&&(r&&(r+=" "),r+=t);return r}const mc=(0,o.forwardRef)((e,t)=>{const{attr:n,size:r,title:o,className:a,color:s,style:l,children:c,viewBox:u,width:d,height:h,...f}=e;return(0,i.jsxs)("svg",{"aria-hidden":!o,focusable:!1,xmlns:"http://www.w3.org/2000/svg",viewBox:u||"0 0 24 24",...n,...f,className:gc("svg-icon",a,vc(r)),style:{color:s,...l},ref:t,height:h||"1em",width:d||"1em",children:[o&&(0,i.jsx)("title",{children:o}),c]})});function vc(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":return"icon-sm";case"md":return"icon-md";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return e}}function yc(e,t="",n){return o.memo(o.forwardRef((r,o)=>(0,i.jsx)(mc,{"data-testid":`${t}Icon`,ref:o,viewBox:n,...r,size:r.size||"md",children:e})))}function bc(e,t=""){return yc(wc(e),t)}function wc(e){return(null==e?void 0:e.map)&&e.map((e,t)=>o.createElement(e.tag,{key:t,...e.attr},wc(e.child)))}const xc=yc((0,i.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"}),"TuneOutlined"),Cc=yc((0,i.jsx)("path",{d:"M21 15h2v2h-2v-2zm0-4h2v2h-2v-2zm2 8h-2v2c1 0 2-1 2-2zM13 3h2v2h-2V3zm8 4h2v2h-2V7zm0-4v2h2c0-1-1-2-2-2zM1 7h2v2H1V7zm16-4h2v2h-2V3zm0 16h2v2h-2v-2zM3 3C2 3 1 4 1 5h2V3zm6 0h2v2H9V3zM5 3h2v2H5V3zm-4 8v8c0 1.1.9 2 2 2h12V11H1zm2 8 2.5-3.21 1.79 2.15 2.5-3.22L13 19H3z"}),"PhotoSizeSelectLargeOutlined"),_c=yc((0,i.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"}),"CropOutlined"),Sc=yc((0,i.jsx)("path",{d:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z"}),"TextFieldsOutlined"),kc=yc((0,i.jsx)("path",{d:"M10.5 4.5c.28 0 .5.22.5.5v2h6v6h2c.28 0 .5.22.5.5s-.22.5-.5.5h-2v6h-2.12c-.68-1.75-2.39-3-4.38-3s-3.7 1.25-4.38 3H4v-2.12c1.75-.68 3-2.39 3-4.38 0-1.99-1.24-3.7-2.99-4.38L4 7h6V5c0-.28.22-.5.5-.5m0-2C9.12 2.5 8 3.62 8 5H4c-1.1 0-1.99.9-1.99 2v3.8h.29c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-.3c0-1.49 1.21-2.7 2.7-2.7s2.7 1.21 2.7 2.7v.3H17c1.1 0 2-.9 2-2v-4c1.38 0 2.5-1.12 2.5-2.5S20.38 11 19 11V7c0-1.1-.9-2-2-2h-4c0-1.38-1.12-2.5-2.5-2.5z"}),"ExtensionOutlined"),Ac=yc((0,i.jsx)("path",{d:"M10.25 13c0 .69-.56 1.25-1.25 1.25S7.75 13.69 7.75 13s.56-1.25 1.25-1.25 1.25.56 1.25 1.25zM15 11.75c-.69 0-1.25.56-1.25 1.25s.56 1.25 1.25 1.25 1.25-.56 1.25-1.25-.56-1.25-1.25-1.25zm7 .25c0 5.52-4.48 10-10 10S2 17.52 2 12 6.48 2 12 2s10 4.48 10 10zM10.66 4.12C12.06 6.44 14.6 8 17.5 8c.46 0 .91-.05 1.34-.12C17.44 5.56 14.9 4 12 4c-.46 0-.91.05-1.34.12zM4.42 9.47c1.71-.97 3.03-2.55 3.66-4.44C6.37 6 5.05 7.58 4.42 9.47zM20 12c0-.78-.12-1.53-.33-2.24-.7.15-1.42.24-2.17.24-3.13 0-5.92-1.44-7.76-3.69C8.69 8.87 6.6 10.88 4 11.86c.01.04 0 .09 0 .14 0 4.41 3.59 8 8 8s8-3.59 8-8z"}),"FaceOutlined"),jc=yc((0,i.jsx)("path",{d:"M20 4h-4l-4-4-4 4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H4V6h4.52l3.52-3.5L15.52 6H20v14zM6 18h12V8H6v10zm2-8h8v6H8v-6z"}),"FilterFramesOutlined"),Ec=yc((0,i.jsx)("path",{d:"M6.41 21 5 19.59l4.83-4.83c.75-.75 1.17-1.77 1.17-2.83v-5.1L9.41 8.41 8 7l4-4 4 4-1.41 1.41L13 6.83v5.1c0 1.06.42 2.08 1.17 2.83L19 19.59 17.59 21 12 15.41 6.41 21z"}),"MergeOutlined"),Ic=yc((0,i.jsx)("path",{d:"M19 19h2v2h-2v-2zm0-2h2v-2h-2v2zM3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm0-4h2V3H3v2zm4 0h2V3H7v2zm8 16h2v-2h-2v2zm-4 0h2v-2h-2v2zm4 0h2v-2h-2v2zm-8 0h2v-2H7v2zm-4 0h2v-2H3v2zM21 8c0-2.76-2.24-5-5-5h-5v2h5c1.65 0 3 1.35 3 3v5h2V8z"}),"RoundedCornerOutlined"),Tc=yc((0,i.jsx)("path",{d:"M20 4v12H8V4h12m0-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 9.67 1.69 2.26 2.48-3.1L19 15H9zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z"}),"PhotoLibraryOutlined"),Oc=yc((0,i.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined"),Fc=yc([(0,i.jsx)("path",{d:"m2.53 19.65 1.34.56v-9.03l-2.43 5.86c-.41 1.02.08 2.19 1.09 2.61zm19.5-3.7L17.07 3.98c-.31-.75-1.04-1.21-1.81-1.23-.26 0-.53.04-.79.15L7.1 5.95c-.75.31-1.21 1.03-1.23 1.8-.01.27.04.54.15.8l4.96 11.97c.31.76 1.05 1.22 1.83 1.23.26 0 .52-.05.77-.15l7.36-3.05c1.02-.42 1.51-1.59 1.09-2.6zm-9.2 3.8L7.87 7.79l7.35-3.04h.01l4.95 11.95-7.35 3.05z"},"0"),(0,i.jsx)("circle",{cx:"11",cy:"9",r:"1"},"1"),(0,i.jsx)("path",{d:"M5.88 19.75c0 1.1.9 2 2 2h1.45l-3.45-8.34v6.34z"},"2")],"StyleOutlined"),Pc=yc((0,i.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"}),"DeleteOutlined"),Mc=yc((0,i.jsx)("path",{d:"M18.85,10.39l1.06-1.06c0.78-0.78,0.78-2.05,0-2.83L18.5,5.09c-0.78-0.78-2.05-0.78-2.83,0l-1.06,1.06L18.85,10.39z M14.61,11.81L7.41,19H6v-1.41l7.19-7.19L14.61,11.81z M13.19,7.56L4,16.76V21h4.24l9.19-9.19L13.19,7.56L13.19,7.56z M19,17.5 c0,2.19-2.54,3.5-5,3.5c-0.55,0-1-0.45-1-1s0.45-1,1-1c1.54,0,3-0.73,3-1.5c0-0.47-0.48-0.87-1.23-1.2l1.48-1.48 C18.32,15.45,19,16.29,19,17.5z M4.58,13.35C3.61,12.79,3,12.06,3,11c0-1.8,1.89-2.63,3.56-3.36C7.59,7.18,9,6.56,9,6 c0-0.41-0.78-1-2-1C5.74,5,5.2,5.61,5.17,5.64C4.82,6.05,4.19,6.1,3.77,5.76C3.36,5.42,3.28,4.81,3.62,4.38C3.73,4.24,4.76,3,7,3 c2.24,0,4,1.32,4,3c0,1.87-1.93,2.72-3.64,3.47C6.42,9.88,5,10.5,5,11c0,0.31,0.43,0.6,1.07,0.86L4.58,13.35z"}),"Draw"),Rc=yc((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3 2 12h3v8h6v-6h2v6h6v-8h3L12 3z"}),"HomeOutlined"),Lc={[fc.FILTER]:{name:sc("Applied Filters"),icon:xc},[fc.RESIZE]:{name:sc("Resized Image"),icon:Cc},[fc.CROP]:{name:sc("Cropped Image"),icon:_c},[fc.DRAW]:{name:sc("Added Drawing"),icon:Mc},[fc.TEXT]:{name:sc("Added Text"),icon:Sc},[fc.SHAPES]:{name:sc("Added Shape"),icon:kc},[fc.STICKERS]:{name:sc("Added Sticker"),icon:Ac},[fc.FRAME]:{name:sc("Added Frame"),icon:jc},[fc.MERGE]:{name:sc("Merged Objects"),icon:Ec},[fc.CORNERS]:{name:sc("Rounded Corner"),icon:Ic},bgImage:{name:sc("Replaced Background Image"),icon:Tc},overlayImage:{name:sc("Added Image"),icon:Tc},initial:{name:sc("Initial"),icon:Rc},loadedState:{name:sc("Loaded State"),icon:Oc},objectStyle:{name:sc("Changed Style"),icon:Fc},deletedObject:{name:sc("Deleted object"),icon:Pc}},Dc=Object.values(fc).map(e=>({name:e,icon:Lc[e].icon,action:e===fc.MERGE?e=>{e.tools.merge.apply()}:e})),Nc={filter:sc("filter"),resize:sc("resize"),crop:sc("crop"),draw:sc("draw"),text:sc("text"),shapes:sc("shapes"),stickers:sc("stickers"),frame:sc("frame"),corners:sc("corners"),merge:sc("merge")},zc=yc((0,i.jsx)("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"}),"FileDownloadOutlined"),Bc={selector:"pixie-editor",textureSize:4096,activeLanguage:"en",ui:{visible:!0,mode:oc.INLINE,forceOverlayModeOnMobile:!0,activeTheme:dc.LIGHT,themes:hc,allowEditorClose:!0,menubar:{items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:Oc,align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:zc,label:sc("Done"),align:"right",action:e=>{var t;null!=(t=e.state.config.ui)&&t.showExportPanel?e.state.togglePanel("export",!0):e.tools.export.save()}}]},nav:{position:ac.BOTTOM,items:[...Dc]},openImageDialog:{show:!0,sampleImages:[{url:"images/samples/sample1.jpg",thumbnail:"images/samples/sample1_thumbnail.jpg"},{url:"images/samples/sample2.jpg",thumbnail:"images/samples/sample2_thumbnail.jpg"},{url:"images/samples/sample3.jpg",thumbnail:"images/samples/sample3_thumbnail.jpg"}]},colorPresets:{items:["rgb(0,0,0)","rgb(255, 255, 255)","rgb(242, 38, 19)","rgb(249, 105, 14)","rgb(253, 227, 167)","rgb(4, 147, 114)","rgb(30, 139, 195)","rgb(142, 68, 173)"]}},objectDefaults:{global:{...cc},sticker:{fill:void 0},text:{textAlign:"initial",underline:!1,linethrough:!1,fontStyle:"normal",fontFamily:"Times New Roman",fontWeight:"normal",stroke:void 0,fontSize:40}},tools:{filter:{items:["grayscale","blackWhite","sharpen","invert","vintage","polaroid","kodachrome","technicolor","brownie","sepia","removeColor","brightness","gamma","noise","pixelate","blur","emboss","blendColor"]},zoom:{allowUserZoom:!0,fitImageToScreen:!0},crop:{allowCustomRatio:!0,defaultRatio:"1:1",presets:[{ratio:null,name:"Custom"},{ratio:"1:1",name:"Square"},{ratio:"4:3"},{ratio:"16:9"},{ratio:"5:3"},{ratio:"5:4"},{ratio:"6:4"},{ratio:"7:5"},{ratio:"10:8"}]},text:{defaultText:"Double click to edit",controlsPadding:6,items:[{family:"Roboto",src:"fonts/open-sans-v27-latin-ext_latin-regular.woff2"},{family:"Fuzzy Bubbles",src:"fonts/fuzzy-bubbles-v3-latin-700.woff2",descriptors:{weight:"700"}},{family:"Aleo Bold",src:"fonts/aleo-v4-latin-ext_latin-700.woff2",descriptors:{weight:"700"}},{family:"Amatic SC",src:"fonts/amatic-sc-v16-latin-ext_latin-regular.woff2"},{family:"Corinthia Bold",src:"fonts/corinthia-v7-latin-ext_latin-700.woff2"},{family:"Bungee Inline",src:"fonts/bungee-inline-v6-latin-ext_latin-regular.woff2"},{family:"Robot Slab Bold",src:"fonts/roboto-slab-v16-latin-ext_latin-500.woff2"},{family:"Carter One",src:"fonts/carter-one-v12-latin-regular.woff2"},{family:"Cody Star",src:"fonts/codystar-v10-latin-ext_latin-regular.woff2"},{family:"Fira Sans",src:"fonts/fira-sans-v11-latin-ext_latin_cyrillic-regular.woff2"},{family:"Krona One",src:"fonts/krona-one-v9-latin-ext_latin-regular.woff2"},{family:"Kumar One Outline",src:"fonts/kumar-one-outline-v8-latin-ext_latin-regular.woff2"},{family:"Lobster Two",src:"fonts/lobster-two-v13-latin-regular.woff2"},{family:"Molle Italic",src:"fonts/molle-v11-latin-ext_latin-italic.woff2"},{family:"Monoton",src:"fonts/monoton-v10-latin-regular.woff2"},{family:"Nixie One",src:"fonts/nixie-one-v11-latin-regular.woff2"},{family:"Permanent Marker",src:"fonts/permanent-marker-v10-latin-regular.woff2"},{family:"Sancreek",src:"fonts/sancreek-v13-latin-ext_latin-regular.woff2"},{family:"Stint Ultra Expanded",src:"fonts/stint-ultra-expanded-v10-latin-regular.woff2"},{family:"VT323",src:"fonts/vt323-v12-latin-ext_latin-regular.woff2"},{family:"Trash Hand",src:"fonts/TrashHand.ttf"}]},draw:{brushSizes:uc,brushTypes:["PencilBrush","EraserBrush","SprayBrush","CircleBrush","DiamondBrush","VLineBrush","HLineBrush","SquareBrush"]},shapes:{items:[{name:"circle",type:"Circle"},{name:"square",type:"Rect",options:{lockUniScaling:!1}},{name:"triangle",type:"Triangle"},{name:"ellipse",type:"Ellipse",options:{lockUniScaling:!1}},{name:"Arrow #1",type:"Path",options:{path:"M 294.9 16.4 l 15.7 42.2 c -171.4 70.3 -294 242.3 -289.1 437.4 l 14.7 -1 c 9.1 -0.6 18.1 -1.2 27.1 -1.9 l 14.7 -1 c -4.3 -170.1 102.5 -320 252 -381.3 l 15.7 42.2 c 34.7 -40.5 83.1 -76.6 144.8 -99.8 c -58.1 -26.2 -124.9 -39.6 -195.6 -36.8 z"}},{name:"Arrow #2",type:"Path",options:{path:"M 16 248.4 v 14.9 h 447.5 l -93.2 82.5 l 11.9 10.5 l 113.8 -100.2 l -113.6 -100.4 l -11.8 10.5 l 92.9 82.2 z"}},{name:"Arrow #3",type:"Path",options:{path:"M 496 256 l -118.6 -66 v 40.8 h -361.4 v 50.4 h 361.4 v 40.8 l 118.6 -66 z"}},{name:"Line",type:"Path",options:{path:"M 16 256 h 480",strokeWidth:10,stroke:"#000",padding:10}},{name:"Star",type:"Path",options:{path:"M 256 406.3 l 148.3 78 l -28.3 -165.2 l 120 -117 l -165.8 -24.1 l -74.2 -150.3 l -74.2 150.3 l -165.8 24.1 l 120 117 l -28.3 165.2 z"}},{name:"Polygon",type:"Path",options:{path:"M 256 19.6 l 156.6 57.1 l 83.4 144.3 l -28.9 164.2 l -127.7 107.2 h -166.8 l -127.7 -107.2 l -28.9 -164.2 l 83.4 -144.3 z"}},{name:"Badge",type:"Path",options:{path:"M 257.3 16.2 s -148 58.2 -204.4 81.4 c 0 75.7 -16.8 303.5 204.4 398.2 c 218.7 -94.6 201.9 -322.4 201.9 -398.2 c -62.1 -23.6 -201.9 -81.4 -201.9 -81.4 z"}}].slice()},stickers:{items:[{name:"emoticons",list:["afro-1","afro","agent","alien-1","alien","angel","angry-1","angry-2","angry-3","angry-4","angry-5","angry","arguing","arrogant","asian-1","asian","avatar","baby-1","baby-2","baby","bully","burglar","businessman","cheeky-1","cheeky","clown","confused-1","confused-2","confused-3","confused","creepy","crying-1","crying-2","crying-3","crying","dazed-1","dazed-2","dazed-3","dazed","dead-1","dead-2","dead-3","dead-4","dead-5","dead-6","dead","desperate-1","desperate","detective","dissapointment","doctor","drunk","dumb","emo-1","emo-2","emo","emoticon","evil","faint-1","faint","flirt-1","flirt-2","flirt","flirty","gangster","geek-1","geek","gentleman-1","gentleman-2","gentleman-3","gentleman-4","gentleman","ginger","girl-1","girl","goofy-1","goofy-2","goofy-3","goofy-4","goofy","grubby-1","grubby","happy-1","happy-10","happy-11","happy-12","happy-13","happy-14","happy-15","happy-16","happy-2","happy-3","happy-4","happy-5","happy-6","happy-7","happy-8","happy-9","happy","harry-potter","heisenberg","hipster-1","hipster-2","hipster","in-love-1","in-love-2","in-love-3","in-love-4","in-love-5","in-love-6","in-love","japan","jew","joyful-1","joyful-2","joyful","kiss-1","kiss-2","kiss-3","kiss-4","kiss","laughing-1","laughing-2","laughing-3","laughing","listening","love","manly","miserly-1","miserly","nerd-1","nerd-2","nerd-3","nerd-4","nerd","ninja","pirate-1","pirate-2","pirate","punk-1","punk-2","punk","rapper","relieved","rich-1","rich-2","rich","rockstar","sad-1","sad-2","sad-3","sad-4","sad-5","sad-6","sad","scared-1","scared-2","scared-3","scared","sceptic-1","sceptic-2","sceptic-3","sceptic-4","sceptic-5","sceptic-6","sceptic-7","sceptic","secret","shocked-1","shocked-2","shocked-3","shocked","sick-1","sick-2","sick-3","sick-4","sick","silent","skeleton","smile","smiling-1","smiling","smoked","smug-1","smug-2","smug-3","smug-4","smug-5","smug-6","smug","sporty","stunned","superhero-1","superhero-2","superhero-3","superhero-4","superhero","surprised-1","surprised","thinking","tired-1","tired-2","tired-3","tired","tough-1","tough","trendy","vampire-1","vampire","wink-1","wink-2","wink","winking-1","winking","yawning-1","yawning-2","yawning-3","yawning","yelling","zombie"],type:"svg",thumbnailUrl:"images/stickers/categories/emoticon.svg"},{name:"doodles",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/doodles.svg"},{name:"landmarks",items:100,type:"svg",thumbnailUrl:"images/stickers/categories/landmark.svg",invertPreview:!0},{name:"bubbles",items:104,type:"png",thumbnailUrl:"images/stickers/categories/speech-bubble.svg"},{name:"transportation",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/transportation.svg",invertPreview:!0},{name:"beach",items:22,type:"svg",thumbnailUrl:"images/stickers/categories/beach.svg",invertPreview:!0}]},import:{validImgExtensions:["png","jpg","jpeg","svg","gif"],fitOverlayToScreen:!0,openDroppedImageAsBackground:!1},export:{defaultFormat:"png",defaultQuality:.8,defaultName:"image"},frame:{items:[{name:"basic",mode:"basic",size:{min:1,max:35,default:10}},{name:"pine",mode:"stretch",size:{min:1,max:35,default:15}},{name:"oak",mode:"stretch",size:{min:1,max:35,default:15}},{name:"rainbow",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge1",display_name:"grunge #1",mode:"stretch",size:{min:1,max:35,default:15}},{name:"grunge2",display_name:"grunge #2",mode:"stretch",size:{min:1,max:35,default:20}},{name:"ebony",mode:"stretch",size:{min:1,max:35,default:15}},{name:"art1",display_name:"Art #1",mode:"repeat",size:{min:10,max:70,default:55}},{name:"art2",display_name:"Art #2",mode:"repeat",size:{min:10,max:70,default:55}}]}}},Vc=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=r??("object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,o={setState:r,getState:i,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},a=t=e(r,i,o);return o};var Uc={exports:{}},Wc={},Hc={exports:{}},$c={},Gc=o,Yc="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},qc=Gc.useState,Xc=Gc.useEffect,Kc=Gc.useLayoutEffect,Zc=Gc.useDebugValue;function Jc(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yc(e,n)}catch{return!0}}var Qc=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?function(e,t){return t()}:function(e,t){var n=t(),r=qc({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Kc(function(){i.value=n,i.getSnapshot=t,Jc(i)&&o({inst:i})},[e,n,t]),Xc(function(){return Jc(i)&&o({inst:i}),e(function(){Jc(i)&&o({inst:i})})},[e]),Zc(n),n};$c.useSyncExternalStore=void 0!==Gc.useSyncExternalStore?Gc.useSyncExternalStore:Qc,Hc.exports=$c;var eu=Hc.exports,tu=o,nu=eu,ru="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},iu=nu.useSyncExternalStore,ou=tu.useRef,au=tu.useEffect,su=tu.useMemo,lu=tu.useDebugValue;Wc.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=ou(null);if(null===o.current){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=su(function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&a.hasValue){var t=a.value;if(i(t,e))return s=t}return s=e}if(t=s,ru(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,s=n)}var o,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,i]);var s=iu(e,o[0],o[1]);return au(function(){a.hasValue=!0,a.value=s},[s]),lu(s),s},Uc.exports=Wc;const cu=ic(Uc.exports),{useDebugValue:uu}=o,{useSyncExternalStoreWithSelector:du}=cu,hu=e=>e,fu=e=>{const t="function"==typeof e?(e=>e?Vc(e):Vc)(e):e,n=(e,n)=>function(e,t=hu,n){const r=du(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return uu(r),r}(t,e,n);return Object.assign(n,t),n},pu=e=>fu;var gu=Symbol.for("immer-nothing"),mu=Symbol.for("immer-draftable"),vu=Symbol.for("immer-state");function yu(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var bu=Object.getPrototypeOf;function wu(e){return!!e&&!!e[vu]}function xu(e){var t;return!!e&&(_u(e)||Array.isArray(e)||!!e[mu]||!(null==(t=e.constructor)||!t[mu])||Eu(e)||Iu(e))}var Cu=Object.prototype.constructor.toString();function _u(e){if(!e||"object"!=typeof e)return!1;const t=bu(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Cu}function Su(e,t){0===ku(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ku(e){const t=e[vu];return t?t.type_:Array.isArray(e)?1:Eu(e)?2:Iu(e)?3:0}function Au(e,t){return 2===ku(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ju(e,t,n){const r=ku(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Eu(e){return e instanceof Map}function Iu(e){return e instanceof Set}function Tu(e){return e.copy_||e.base_}function Ou(e,t){if(Eu(e))return new Map(e);if(Iu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=_u(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[vu];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(bu(e),t)}{const t=bu(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Fu(e,t=!1){return Mu(e)||wu(e)||!xu(e)||(ku(e)>1&&(e.set=e.add=e.clear=e.delete=Pu),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>Fu(t,!0))),e}function Pu(){yu(2)}function Mu(e){return Object.isFrozen(e)}var Ru,Lu={};function Du(e){const t=Lu[e];return t||yu(0),t}function Nu(){return Ru}function zu(e,t){t&&(Du("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bu(e){Vu(e),e.drafts_.forEach(Wu),e.drafts_=null}function Vu(e){e===Ru&&(Ru=e.parent_)}function Uu(e){return Ru=function(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}(Ru,e)}function Wu(e){const t=e[vu];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Hu(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[vu].modified_&&(Bu(t),yu(4)),xu(e)&&(e=$u(t,e),t.parent_||Yu(t,e)),t.patches_&&Du("Patches").generateReplacementPatches_(n[vu].base_,e,t.patches_,t.inversePatches_)):e=$u(t,n,[]),Bu(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gu?e:void 0}function $u(e,t,n){if(Mu(t))return t;const r=t[vu];if(!r)return Su(t,(i,o)=>Gu(e,r,t,i,o,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Yu(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let i=t,o=!1;3===r.type_&&(i=new Set(t),t.clear(),o=!0),Su(i,(i,a)=>Gu(e,r,t,i,a,n,o)),Yu(e,t,!1),n&&e.patches_&&Du("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Gu(e,t,n,r,i,o,a){if(wu(i)){const a=$u(e,i,o&&t&&3!==t.type_&&!Au(t.assigned_,r)?o.concat(r):void 0);if(ju(n,r,a),!wu(a))return;e.canAutoFreeze_=!1}else a&&n.add(i);if(xu(i)&&!Mu(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;$u(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof r&&Object.prototype.propertyIsEnumerable.call(n,r)&&Yu(e,i)}}function Yu(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Fu(t,n)}var qu={get(e,t){if(t===vu)return e;const n=Tu(e);if(!Au(n,t))return function(e,t,n){var r;const i=Zu(t,n);return i?"value"in i?i.value:null==(r=i.get)?void 0:r.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!xu(r)?r:r===Ku(e.base_,t)?(Qu(e),e.copy_[t]=ed(r,e)):r},has:(e,t)=>t in Tu(e),ownKeys:e=>Reflect.ownKeys(Tu(e)),set(e,t,n){const r=Zu(Tu(e),t);if(null!=r&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Ku(Tu(e),t),i=null==r?void 0:r[vu];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,r)&&(void 0!==n||Au(e.base_,t)))return!0;Qu(e),Ju(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Ku(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Qu(e),Ju(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Tu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}},defineProperty(){yu(11)},getPrototypeOf:e=>bu(e.base_),setPrototypeOf(){yu(12)}},Xu={};function Ku(e,t){const n=e[vu];return(n?Tu(n):e)[t]}function Zu(e,t){if(!(t in e))return;let n=bu(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=bu(n)}}function Ju(e){e.modified_||(e.modified_=!0,e.parent_&&Ju(e.parent_))}function Qu(e){e.copy_||(e.copy_=Ou(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function ed(e,t){const n=Eu(e)?Du("MapSet").proxyMap_(e,t):Iu(e)?Du("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Nu(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,o=qu;n&&(i=[r],o=Xu);const{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:Nu()).drafts_.push(n),n}function td(e){if(!xu(e)||Mu(e))return e;const t=e[vu];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ou(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ou(e,!0);return Su(n,(e,t)=>{ju(n,e,td(t))}),t&&(t.finalized_=!1),n}Su(qu,(e,t)=>{Xu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Xu.deleteProperty=function(e,t){return Xu.set.call(this,e,t,void 0)},Xu.set=function(e,t,n){return qu.set.call(this,e[0],t,n,e[0])};var nd=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}let r;if("function"!=typeof t&&yu(6),void 0!==n&&"function"!=typeof n&&yu(7),xu(e)){const i=Uu(this),o=ed(e,void 0);let a=!0;try{r=t(o),a=!1}finally{a?Bu(i):Vu(i)}return zu(i,n),Hu(r,i)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===gu&&(r=void 0),this.autoFreeze_&&Fu(r,!0),n){const t=[],i=[];Du("Patches").generateReplacementPatches_(e,r,t,i),n(t,i)}return r}yu(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof(null==e?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){xu(e)||yu(8),wu(e)&&(e=function(e){return wu(e)||yu(10),td(e)}(e));const t=Uu(this),n=ed(e,void 0);return n[vu].isManual_=!0,Vu(t),n}finishDraft(e,t){const n=e&&e[vu];(!n||!n.isManual_)&&yu(9);const{scope_:r}=n;return zu(r,t),Hu(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Du("Patches").applyPatches_;return wu(e)?r(e,t):this.produce(e,e=>r(e,t))}},rd=nd.produce;nd.produceWithPatches.bind(nd),nd.setAutoFreeze.bind(nd),nd.setUseStrictShallowCopy.bind(nd),nd.applyPatches.bind(nd),nd.createDraft.bind(nd),nd.finishDraft.bind(nd);var id=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===od}(e)}(e)},od="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function ad(e,t){return!1!==t.clone&&t.isMergeableObject(e)?ud(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function sd(e,t,n){return e.concat(t).map(function(e){return ad(e,n)})}function ld(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function cd(e,t){try{return t in e}catch{return!1}}function ud(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||sd,n.isMergeableObject=n.isMergeableObject||id,n.cloneUnlessOtherwiseSpecified=ad;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):function(e,t,n){var r={};return n.isMergeableObject(e)&&ld(e).forEach(function(t){r[t]=ad(e[t],n)}),ld(t).forEach(function(i){(function(e,t){return cd(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(cd(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return ud;var n=t.customMerge(e);return"function"==typeof n?n:ud}(i,n)(e[i],t[i],n):r[i]=ad(t[i],n))}),r}(e,t,n):ad(t,n)}ud.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,n){return ud(e,n,t)},{})};const dd=ic(ud);function hd(e,t){return fd(dd(t,e),e)}function fd(e,t){return Object.keys(e).forEach(n=>{if(n.startsWith("replaceDefault")&&e[n]){const r=function(e){return e.charAt(0).toLowerCase()+e.slice(1)}(n.replace("replaceDefault","")||"items");e[r]=t?t[r]:[],delete e[n]}else"object"==typeof e[n]&&null!==e[n]&&fd(e[n],null==t?void 0:t[n])}),e}const pd=(e,t)=>({history:{...gd,updatePointerById:e=>{const n=t().history.items.findIndex(t=>t.id===e);t().history.update(n)},update:(t,n)=>{e(e=>{e.history.pointer=t,n&&(e.history.items=n),e.history.canUndo=e.history.pointer>0,e.history.canRedo=e.history.items.length>e.history.pointer+1})},reset:n=>{e({history:{...t().history,...n??gd}})}}}),gd={items:[],pointer:0,canUndo:!1,canRedo:!1};var md=(e=>(e.Filter="filter",e.Frame="frame",e.ActiveObject="activeObj",e.Text="text",e))(md||{});const vd=(e,t)=>({filter:{...yd,select(t,n=!1){e(e=>{e.filter.selected=t,e.activeToolOverlay=n?md.Filter:null,e.dirty=!0})},deselect(n){t().filter.selected===n&&e(e=>{e.filter.selected=null,e.activeToolOverlay=null,e.dirty=!0})},reset(){e({filter:{...t().filter,...yd}})}}}),yd={selected:null,applied:[]},bd=(e,t)=>({crop:{...wd,setCropzoneRect:t=>{e(e=>{e.crop.zoneRect=t})},setAspectRatio:t=>{e(e=>{e.crop.selectedAspectRatio=t})},setTransformAngle:t=>{e(e=>{e.crop.straightenAngle=t})},apply:async()=>{const e=t().crop.zoneRect;if(e){const n={width:Math.ceil(e.width/t().zoom),height:Math.ceil(e.height/t().zoom),left:Math.ceil(e.left/t().zoom),top:Math.ceil(e.top/t().zoom)};await t().editor.tools.crop.apply(n)}},reset:()=>{e({crop:{...t().crop,...wd}})}}}),wd={zoneRect:null,selectedAspectRatio:null,straightenAngle:0};function xd(e){return"i-text"===(null==e?void 0:e.type)}var Cd=(e=>(e.Text="text",e.Shape="shape",e.Sticker="sticker",e.Drawing="drawing",e.Image="image",e.MainImage="mainImage",e.StraightenAnchor="straightenHelper",e))(Cd||{});const _d={text:{name:sc("Text"),icon:Lc.text.icon},shape:{name:sc("Shape"),icon:Lc.shapes.icon},sticker:{name:sc("Sticker"),icon:Lc.stickers.icon},drawing:{name:sc("Drawing"),icon:Lc.draw.icon},image:{name:sc("Image"),icon:Lc.overlayImage.icon},mainImage:{name:sc("Background Image"),icon:Lc.bgImage.icon}},Sd={isMoving:!1,editableProps:{},id:null,isText:!1,isImage:!1,name:null},kd=(e,t)=>({objects:{...Ad,setActiveIsMoving:t=>{e(e=>{e.objects.active.isMoving=t})},setIsEditingText:t=>{e(e=>{e.objects.isEditingText=t})},setActive:n=>{e(n?e=>{e.objects.active.editableProps=function(e){if(!e)return{};const t={fill:e.fill,opacity:e.opacity,backgroundColor:e.backgroundColor,stroke:e.stroke,strokeWidth:e.strokeWidth},n=e.shadow;return n&&(t.shadow={color:n.color,blur:n.blur,offsetX:n.offsetX,offsetY:n.offsetY}),xd(e)&&(t.textAlign=e.textAlign,t.underline=e.underline,t.linethrough=e.linethrough,t.fontStyle=e.fontStyle,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize),t}(n),e.objects.active.id=n.data.id,e.objects.active.name=n.name??null,e.objects.active.isText=xd(n),e.objects.active.isImage=function(e){return e.name===Cd.Image}(n)}:e=>{var n,r,i,o,a;const s={...null==(n=t().config.objectDefaults)?void 0:n.global,fontFamily:null==(i=null==(r=t().config.objectDefaults)?void 0:r.text)?void 0:i.fontFamily,fontSize:null==(a=null==(o=t().config.objectDefaults)?void 0:o.text)?void 0:a.fontSize};e.objects.active={...Sd,editableProps:s}})},reset(){e({objects:{...t().objects,...Ad}})}}}),Ad={all:[],isEditingText:!1,active:Sd},jd=(e,t)=>({frame:{...Ed,select:n=>{e(e=>{e.frame.active=n}),t().frame.showOptionsPanel()},deselect:()=>{e(e=>{e.frame.active=null,e.activeToolOverlay=null})},showOptionsPanel:()=>{t().activeTool===fc.FRAME&&e(e=>{e.activeToolOverlay=md.Frame})},reset(){e({frame:{...t().frame,...Ed}})}}}),Ed={active:null},Id=(e,t)=>({resize:{...Td,setFormValue:t=>{e(e=>{Object.entries(t).forEach(([t,n])=>{e.resize.formValue[t]=n})})},apply(){const e=t().resize.formValue,n=t().original;if(e.width===n.width&&e.height===n.height)return!1;t().editor.tools.resize.apply(e)},reset(){e({resize:{...t().resize,...Td}})}}}),Td={formValue:{width:1,height:1,maintainAspect:!0,usePercentages:!1}},Od=(e,t)=>({corners:{...Fd,setRadius:t=>{e(e=>{e.corners.radius=t})},apply:()=>t().editor.tools.corners.apply(t().corners.radius),reset(){e({corners:{...t().corners,...Fd}})}}}),Fd={radius:50},Pd=e=>(t,n,r)=>(r.setState=(e,n,...r)=>{const i="function"==typeof e?rd(e):e;return t(i,n,...r)},e(r.setState,n,r));var Md={exports:{}},Rd={exports:{}},Ld=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))},Dd=Array.prototype.concat,Nd=Array.prototype.slice,zd=Rd.exports=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];Ld(i)?t=Dd.call(t,Nd.call(i)):t.push(i)}return t};zd.wrap=function(e){return function(){return e(zd(arguments))}};var Bd=Rd.exports,Vd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ud=Bd,Wd=Object.hasOwnProperty,Hd=Object.create(null);for(var $d in Vd)Wd.call(Vd,$d)&&(Hd[Vd[$d]]=$d);var Gd=Md.exports={to:{},get:{}};function Yd(e,t,n){return Math.min(Math.max(t,e),n)}function qd(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}Gd.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=Gd.get.hsl(e),n="hsl";break;case"hwb":t=Gd.get.hwb(e),n="hwb";break;default:t=Gd.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},Gd.get.rgb=function(e){if(!e)return null;var t,n,r,i=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=t[2],t=t[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(t.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(r=(t=t[1])[3],n=0;n<3;n++)i[n]=parseInt(t[n]+t[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(t[n+1],0);t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:Wd.call(Vd,t[1])?((i=Vd[t[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?i[3]=.01*parseFloat(t[4]):i[3]=parseFloat(t[4]))}for(n=0;n<3;n++)i[n]=Yd(i[n],0,255);return i[3]=Yd(i[3],0,1),i},Gd.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,Yd(parseFloat(t[2]),0,100),Yd(parseFloat(t[3]),0,100),Yd(isNaN(n)?1:n,0,1)]}return null},Gd.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,Yd(parseFloat(t[2]),0,100),Yd(parseFloat(t[3]),0,100),Yd(isNaN(n)?1:n,0,1)]}return null},Gd.to.hex=function(){var e=Ud(arguments);return"#"+qd(e[0])+qd(e[1])+qd(e[2])+(e[3]<1?qd(Math.round(255*e[3])):"")},Gd.to.rgb=function(){var e=Ud(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Gd.to.rgb.percent=function(){var e=Ud(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},Gd.to.hsl=function(){var e=Ud(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Gd.to.hwb=function(){var e=Ud(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},Gd.to.keyword=function(e){return Hd[e.slice(0,3)]};var Xd=Md.exports;const Kd={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Zd={};for(const YT of Object.keys(Kd))Zd[Kd[YT]]=YT;const Jd={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var Qd=Jd;for(const YT of Object.keys(Jd)){if(!("channels"in Jd[YT]))throw new Error("missing channels property: "+YT);if(!("labels"in Jd[YT]))throw new Error("missing channel labels property: "+YT);if(Jd[YT].labels.length!==Jd[YT].channels)throw new Error("channel and label counts mismatch: "+YT);const{channels:e,labels:t}=Jd[YT];delete Jd[YT].channels,delete Jd[YT].labels,Object.defineProperty(Jd[YT],"channels",{value:e}),Object.defineProperty(Jd[YT],"labels",{value:t})}function eh(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}Jd.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=o-i;let s,l;o===i?s=0:t===o?s=(n-r)/a:n===o?s=2+(r-t)/a:r===o&&(s=4+(t-n)/a),s=Math.min(60*s,360),s<0&&(s+=360);const c=(i+o)/2;return l=o===i?0:c<=.5?a/(o+i):a/(2-o-i),[s,100*l,100*c]},Jd.rgb.hsv=function(e){let t,n,r,i,o;const a=e[0]/255,s=e[1]/255,l=e[2]/255,c=Math.max(a,s,l),u=c-Math.min(a,s,l),d=function(e){return(c-e)/6/u+.5};return 0===u?(i=0,o=0):(o=u/c,t=d(a),n=d(s),r=d(l),a===c?i=r-n:s===c?i=1/3+t-r:l===c&&(i=2/3+n-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*o,100*c]},Jd.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const i=Jd.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[i,100*o,100*r]},Jd.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(1-t,1-n,1-r);return[100*((1-t-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*i]},Jd.rgb.keyword=function(e){const t=Zd[e];if(t)return t;let n,r=1/0;for(const i of Object.keys(Kd)){const t=eh(e,Kd[i]);t<r&&(r=t,n=i)}return n},Jd.keyword.rgb=function(e){return Kd[e]},Jd.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;return t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,[100*(.4124*t+.3576*n+.1805*r),100*(.2126*t+.7152*n+.0722*r),100*(.0193*t+.1192*n+.9505*r)]},Jd.rgb.lab=function(e){const t=Jd.rgb.xyz(e);let n=t[0],r=t[1],i=t[2];return n/=95.047,r/=100,i/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,[116*r-16,500*(n-r),200*(r-i)]},Jd.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let i,o,a;if(0===n)return a=255*r,[a,a,a];i=r<.5?r*(1+n):r+n-r*n;const s=2*r-i,l=[0,0,0];for(let c=0;c<3;c++)o=t+1/3*-(c-1),o<0&&o++,o>1&&o--,a=6*o<1?s+6*(i-s)*o:2*o<1?i:3*o<2?s+(i-s)*(2/3-o)*6:s,l[c]=255*a;return l},Jd.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,i=n;const o=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,i*=o<=1?o:2-o,[t,100*(0===r?2*i/(o+i):2*n/(r+n)),(r+n)/2*100]},Jd.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const i=Math.floor(t)%6,o=t-Math.floor(t),a=255*r*(1-n),s=255*r*(1-n*o),l=255*r*(1-n*(1-o));switch(r*=255,i){case 0:return[r,l,a];case 1:return[s,r,a];case 2:return[a,r,l];case 3:return[a,s,r];case 4:return[l,a,r];case 5:return[r,a,s]}},Jd.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,i=Math.max(r,.01);let o,a;a=(2-n)*r;const s=(2-n)*i;return o=n*i,o/=s<=1?s:2-s,o=o||0,a/=2,[t,100*o,100*a]},Jd.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const i=n+r;let o;i>1&&(n/=i,r/=i);const a=Math.floor(6*t),s=1-r;o=6*t-a,1&a&&(o=1-o);const l=n+o*(s-n);let c,u,d;switch(a){default:case 6:case 0:c=s,u=l,d=n;break;case 1:c=l,u=s,d=n;break;case 2:c=n,u=s,d=l;break;case 3:c=n,u=l,d=s;break;case 4:c=l,u=n,d=s;break;case 5:c=s,u=n,d=l}return[255*c,255*u,255*d]},Jd.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i))]},Jd.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let i,o,a;return i=3.2406*t+-1.5372*n+-.4986*r,o=-.9689*t+1.8758*n+.0415*r,a=.0557*t+-.204*n+1.057*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,i=Math.min(Math.max(0,i),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[255*i,255*o,255*a]},Jd.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];return t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,[116*n-16,500*(t-n),200*(n-r)]},Jd.lab.xyz=function(e){let t,n,r;n=(e[0]+16)/116,t=e[1]/500+n,r=n-e[2]/200;const i=n**3,o=t**3,a=r**3;return n=i>.008856?i:(n-16/116)/7.787,t=o>.008856?o:(t-16/116)/7.787,r=a>.008856?a:(r-16/116)/7.787,t*=95.047,n*=100,r*=108.883,[t,n,r]},Jd.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let i;return i=360*Math.atan2(r,n)/2/Math.PI,i<0&&(i+=360),[t,Math.sqrt(n*n+r*r),i]},Jd.lch.lab=function(e){const t=e[0],n=e[1],r=e[2]/360*2*Math.PI;return[t,n*Math.cos(r),n*Math.sin(r)]},Jd.rgb.ansi16=function(e,t=null){const[n,r,i]=e;let o=null===t?Jd.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let a=30+(Math.round(i/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===o&&(a+=60),a},Jd.hsv.ansi16=function(e){return Jd.rgb.ansi16(Jd.hsv.rgb(e),e[2])},Jd.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},Jd.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},Jd.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},Jd.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},Jd.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const r=parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},Jd.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.max(Math.max(t,n),r),o=Math.min(Math.min(t,n),r),a=i-o;let s,l;return s=a<1?o/(1-a):0,l=a<=0?0:i===t?(n-r)/a%6:i===n?2+(r-t)/a:4+(t-n)/a,l/=6,l%=1,[360*l,100*a,100*s]},Jd.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let i=0;return r<1&&(i=(n-.5*r)/(1-r)),[e[0],100*r,100*i]},Jd.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},Jd.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(0===n)return[255*r,255*r,255*r];const i=[0,0,0],o=t%1*6,a=o%1,s=1-a;let l=0;switch(Math.floor(o)){case 0:i[0]=1,i[1]=a,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=a;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=a,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-n)*r,[255*(n*i[0]+l),255*(n*i[1]+l),255*(n*i[2]+l)]},Jd.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let r=0;return n>0&&(r=t/n),[e[0],100*r,100*n]},Jd.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let r=0;return n>0&&n<.5?r=t/(2*n):n>=.5&&n<1&&(r=t/(2*(1-n))),[e[0],100*r,100*n]},Jd.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},Jd.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,r=n-t;let i=0;return r<1&&(i=(n-r)/(1-r)),[e[0],100*r,100*i]},Jd.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},Jd.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},Jd.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},Jd.gray.hsl=function(e){return[0,0,e[0]]},Jd.gray.hsv=Jd.gray.hsl,Jd.gray.hwb=function(e){return[0,100,e[0]]},Jd.gray.cmyk=function(e){return[0,0,0,e[0]]},Jd.gray.lab=function(e){return[e[0],0,0]},Jd.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},Jd.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const th=Qd;function nh(e,t){return function(n){return t(e(n))}}function rh(e,t){const n=[t[e].parent,e];let r=th[t[e].parent][e],i=t[e].parent;for(;t[i].parent;)n.unshift(t[i].parent),r=nh(th[t[i].parent][i],r),i=t[i].parent;return r.conversion=n,r}const ih=Qd,oh=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(th);for(let n=t.length,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),r=Object.keys(th[e]);for(let i=r.length,o=0;o<i;o++){const i=r[o],a=t[i];-1===a.distance&&(a.distance=t[e].distance+1,a.parent=e,n.unshift(i))}}return t}(e),n={},r=Object.keys(t);for(let i=r.length,o=0;o<i;o++){const e=r[o];null!==t[e].parent&&(n[e]=rh(e,t))}return n},ah={};Object.keys(ih).forEach(e=>{ah[e]={},Object.defineProperty(ah[e],"channels",{value:ih[e].channels}),Object.defineProperty(ah[e],"labels",{value:ih[e].labels});const t=oh(e);Object.keys(t).forEach(n=>{const r=t[n];ah[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const r=e(t);if("object"==typeof r)for(let e=r.length,i=0;i<e;i++)r[i]=Math.round(r[i]);return r};return"conversion"in e&&(t.conversion=e.conversion),t}(r),ah[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(r)})});const sh=Xd,lh=ah,ch=["keyword","gray","hex"],uh={};for(const YT of Object.keys(lh))uh[[...lh[YT].labels].sort().join("")]=YT;const dh={};function hh(e,t){if(!(this instanceof hh))return new hh(e,t);if(t&&t in ch&&(t=null),t&&!(t in lh))throw new Error("Unknown model: "+t);let n,r;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof hh)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=sh.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,r=lh[this.model].channels,this.color=t.value.slice(0,r),this.valpha="number"==typeof t.value[r]?t.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=lh[this.model].channels;const n=Array.prototype.slice.call(e,0,r);this.color=vh(n,r),this.valpha="number"==typeof e[r]?e[r]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const r=t.sort().join("");if(!(r in uh))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=uh[r];const{labels:i}=lh[this.model],o=[];for(n=0;n<i.length;n++)o.push(e[i[n]]);this.color=vh(o)}if(dh[this.model])for(r=lh[this.model].channels,n=0;n<r;n++){const e=dh[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}hh.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in sh.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return sh.to[t.model](n)},percentString(e){const t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[...t.color,this.valpha];return sh.to.rgb.percent(n)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=lh[this.model],{labels:n}=lh[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new hh([...this.color.map(fh(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new hh([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:ph("rgb",0,gh(255)),green:ph("rgb",1,gh(255)),blue:ph("rgb",2,gh(255)),hue:ph(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:ph("hsl",1,gh(100)),lightness:ph("hsl",2,gh(100)),saturationv:ph("hsv",1,gh(100)),value:ph("hsv",2,gh(100)),chroma:ph("hcg",1,gh(100)),gray:ph("hcg",2,gh(100)),white:ph("hwb",1,gh(100)),wblack:ph("hwb",2,gh(100)),cyan:ph("cmyk",0,gh(100)),magenta:ph("cmyk",1,gh(100)),yellow:ph("cmyk",2,gh(100)),black:ph("cmyk",3,gh(100)),x:ph("xyz",0,gh(95.047)),y:ph("xyz",1,gh(100)),z:ph("xyz",2,gh(108.833)),l:ph("lab",0,gh(100)),a:ph("lab",1),b:ph("lab",2),keyword(e){return void 0!==e?new hh(e):lh[this.model].keyword(this.color)},hex(e){return void 0!==e?new hh(e):sh.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new hh(e);const t=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),sh.to.hex(t)+n},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const e=r/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return hh.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),i=void 0===t?.5:t,o=2*i-1,a=n.alpha()-r.alpha(),s=((o*a===-1?o:(o+a)/(1+o*a))+1)/2,l=1-s;return hh.rgb(s*n.red()+l*r.red(),s*n.green()+l*r.green(),s*n.blue()+l*r.blue(),n.alpha()*i+r.alpha()*(1-i))}};for(const YT of Object.keys(lh)){if(ch.includes(YT))continue;const{channels:e}=lh[YT];hh.prototype[YT]=function(...e){return this.model===YT?new hh(this):e.length>0?new hh(e,YT):new hh([...mh(lh[this.model][YT].raw(this.color)),this.valpha],YT)},hh[YT]=function(...t){let n=t[0];return"number"==typeof n&&(n=vh(t,e)),new hh(n,YT)}}function fh(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function ph(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(dh[r]||(dh[r]=[]))[t]=n;return e=e[0],function(r){let i;return void 0!==r?(n&&(r=n(r)),i=this[e](),i.color[t]=r,i):(i=this[e]().color[t],n&&(i=n(i)),i)}}function gh(e){return function(t){return Math.max(0,Math.min(e,t))}}function mh(e){return Array.isArray(e)?e:[e]}function vh(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const yh=ic(hh);function bh(e){return e.endsWith("%")||3===e.split(" ").length?e:yh(e).rgb().array().slice(0,3).join(" ")}let wh=typeof document<"u"?document.getElementById("root")??document.body:void 0,xh=typeof document<"u"?document.documentElement:void 0;const Ch=pu()(e=>({data:typeof window<"u"&&window.bootstrapData?Sh(window.bootstrapData):null,setData:t=>{const n="string"==typeof t?Sh(t):t;e({data:n})},mergeData:t=>{e(e=>({data:{...e.data,...t}}))}}));Ch.getState().setData;const _h=Ch.getState().mergeData;function Sh(e){return"string"==typeof e?JSON.parse(e):e}const kh={top:0,right:0,bottom:0,left:0,width:0,height:0},Ah=pu()((e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=(e,t,n)=>{let o=e;if(t){const i=(null==n?void 0:n.equalityFn)||Object.is;let a=e(r.getState());o=n=>{const r=e(n);if(!i(a,r)){const e=a;t(a=r,e)}},null!=n&&n.fireImmediately&&t(a,a)}return i(o)},e(t,n,r)})(Pd((e,t)=>({editor:null,fabric:null,config:Bc,zoom:1,dirty:!1,original:{width:1,height:1},stageSize:kh,canvasSize:kh,canvasRef:null,activeTool:null,activeToolOverlay:null,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1},...pd(e,t),...kd(e,t),...vd(e,t),...bd(e,t),...jd(e,t),...Id(e,t),...Od(e,t),setZoom:t=>e(e=>{e.zoom=t}),setOriginal:(t,n)=>e(e=>{e.original={width:t,height:n}}),setDirty:t=>e(e=>{e.dirty=t}),toggleLoading:t=>e(e=>{e.loading=t}),setStageSize:t=>e(e=>{e.stageSize=t}),setCanvasSize:t=>e(e=>{e.canvasSize=t}),setActiveTool:(t,n)=>{e(e=>{e.activeTool=t,e.activeToolOverlay=n})},setConfig:n=>e(e=>{var r,i;const o=hd(n,t().config);e.config=o;const a=o.activeLanguage||"en",s=null==(r=o.languages)?void 0:r[a],l=((null==(i=o.ui)?void 0:i.themes)||[]).map(e=>function(e){const t=e.isDark?hc.find(e=>e.isDark):hc.find(e=>!e.isDark),n={...t,...e,colors:{...null==t?void 0:t.colors,...e.colors}},r=Object.entries(n.colors).map(([e,t])=>[e,bh(t)]);return{id:n.name,name:n.name,values:Object.fromEntries(r),is_dark:n.isDark}}(e)),c=l.find(e=>{var t;return e.id===(null==(t=o.ui)?void 0:t.activeTheme)});c&&function(e){Object.entries(e.values).forEach(([e,t])=>{!function(e,t){null==xh||xh.style.setProperty(e,t)}(e,t)}),e.is_dark?xh.classList.add("dark"):xh.classList.remove("dark")}(c),_h({i18n:{language:a,name:a,id:0,lines:s},themes:{all:l}})}),togglePanel:(t,n)=>e(e=>{e.openPanels[t]=n??!e.openPanels[t]}),applyChanges:async()=>{var n;const r=t().activeTool;if(!r)return;const i=t()[r],o=await(null==(n=null==i?void 0:i.apply)?void 0:n.call(i));e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),!1!==o&&t().editor.tools.history.addHistoryItem({name:r}),null==i||i.reset()},cancelChanges:async()=>{const n=t().activeTool;if(!n)return;const r=t().dirty;e(e=>{e.dirty=!1,e.activeTool=null,e.activeToolOverlay=null}),r&&await t().editor.tools.history.reload();const i=t()[n];null==i||i.reset()},reset:()=>{t().editor.tools.transform.resetStraightenAnchor(),e({activeTool:null,activeToolOverlay:null,zoom:1,dirty:!1,loading:!1,openPanels:{newImage:!1,history:!1,objects:!1,export:!1}}),t().history.reset(),t().objects.reset(),t().filter.reset(),t().crop.reset(),t().frame.reset(),t().resize.reset(),t().corners.reset()}}))));function jh(){return Ah.getState()}function Eh(){return jh().editor.tools}function Ih(){return jh().fabric}function Th(e){var t,n,r,i,o;Eh().canvas.clear(),Eh().frame.remove();const a=!(null!=(t=jh().config.ui)&&t.visible);return jh().setConfig({image:void 0,blankCanvasSize:void 0,...e}),jh().reset(),null!=(n=jh().config.ui)&&n.defaultTool&&jh().setActiveTool(null==(r=jh().config.ui)?void 0:r.defaultTool,null),a&&(null==(o=(i=jh().config).onOpen)||o.call(i)),new Promise(e=>setTimeout(e))}async function Oh(e){return(await fetch(e)).json()}const Fh={selectable:!1,evented:!1,lockMovementX:!0,lockMovementY:!0,lockRotation:!0,lockScalingX:!0,lockScalingY:!0,lockUniScaling:!0,hasControls:!1,hasBorders:!1,hasRotatingPoint:!1,strokeWidth:0};function Ph(e=[]){var t;e=[...Object.keys(Fh),"crossOrigin","name","displayName","data",...e];const n=Ih().toJSON(e);return n.objects=n.objects.filter(e=>!e.data.pixieInternal).map(e=>("image"===e.type&&jh().config.crossOrigin&&(e.crossOrigin="anonymous"),xd(e)&&(e.selectable=!0,e.lockMovementX=!1,e.lockMovementY=!1,e.lockUniScaling=!1),{...e,data:e.data?{...e.data}:{}})),{canvas:n,editor:{frame:Eh().frame.active.config?{name:Eh().frame.active.config.name,sizePercent:Eh().frame.active.currentSizeInPercent}:null,zoom:jh().zoom,activeObjectId:(null==(t=jh().objects.active)?void 0:t.id)||null},canvasWidth:jh().original.width,canvasHeight:jh().original.height}}function Mh(e=null){if(jh().dirty)return;Eh().zoom.fitToScreen();const[t,n]=Rh(Ih().getActiveObject());e?jh().setActiveTool(e,t===e?n:null):jh().setActiveTool(t,n)}function Rh(e){switch(null==e?void 0:e.name){case Cd.Text:return[fc.TEXT,md.Text];case Cd.Sticker:return[fc.STICKERS,md.ActiveObject];case Cd.Image:return[null,md.ActiveObject];case Cd.Shape:return[fc.SHAPES,md.ActiveObject];default:return[null,null]}}let Lh=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};class Dh{constructor(e,t){Ni(this,"timerId"),Ni(this,"createdAt",0),this.callback=e,this.remaining=t,this.resume()}pause(){clearTimeout(this.timerId),this.remaining-=Date.now()-this.createdAt}resume(){this.createdAt=Date.now(),this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout(this.callback,this.remaining)}clear(){clearTimeout(this.timerId)}}const Nh=pu()(Pd((e,t)=>({toasts:[],add:(n,r)=>{const i=t().toasts.length+1-1;i>0&&e(e=>{e.toasts.splice(0,i)});const o=(null==r?void 0:r.id)||Lh(6),a=(null==r?void 0:r.type)||"positive",s=(null==r?void 0:r.duration)??function(e){switch(e){case"danger":return 8e3;case"loading":return 0;default:return 3e3}}(a),l={timer:s>0?new Dh(()=>t().remove(o),s):null,message:n,...r,id:o,type:a,position:(null==r?void 0:r.position)||"bottom-center",duration:s,disableExitAnimation:null==r?void 0:r.disableExitAnimation,disableEnterAnimation:null==r?void 0:r.disableEnterAnimation},c=t().toasts.findIndex(e=>e.id===l.id);e(c>-1?e=>{e.toasts[c]=l}:e=>{e.toasts.push(l)})},remove:n=>{const r=t().toasts.filter(e=>{var t;return n!==e.id||(null==(t=e.timer)||t.clear(),!1)});e(e=>{e.toasts=r})}})));function zh(){return Nh.getState()}function Bh(e,t){zh().add(e,t)}Bh.danger=(e,t)=>{zh().add(e,{...t,type:"danger"})},Bh.positive=(e,t)=>{zh().add(e,{...t,type:"positive"})},Bh.loading=(e,t)=>{zh().add(e,{...t,type:"loading"})};const Vh=(0,o.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Uh=(0,o.createContext)({}),Wh=(0,o.createContext)(null),Hh=typeof document<"u",$h=Hh?o.useLayoutEffect:o.useEffect,Gh=(0,o.createContext)({strict:!1}),Yh=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),qh="data-"+Yh("framerAppearId");function Xh(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Kh(e){return"string"==typeof e||Array.isArray(e)}function Zh(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Jh=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Qh=["initial",...Jh];function ef(e){return Zh(e.animate)||Qh.some(t=>Kh(e[t]))}function tf(e){return!(!ef(e)&&!e.variants)}function nf(e){return Array.isArray(e)?e.join(" "):e}const rf={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},of={};for(const YT in rf)of[YT]={isEnabled:e=>rf[YT].some(t=>!!e[t])};function af(e){for(const t in e)of[t]={...of[t],...e[t]}}const sf=(0,o.createContext)({}),lf=(0,o.createContext)({}),cf=Symbol.for("motionComponentSymbol");function uf({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&af(e);const a=(0,o.forwardRef)(function(a,s){let l;const c={...(0,o.useContext)(Vh),...a,layoutId:df(a)},{isStatic:u}=c,d=function(e){const{initial:t,animate:n}=function(e,t){if(ef(e)){const{initial:t,animate:n}=e;return{initial:!1===t||Kh(t)?t:void 0,animate:Kh(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,o.useContext)(Uh));return(0,o.useMemo)(()=>({initial:t,animate:n}),[nf(t),nf(n)])}(a),h=r(a,u);if(!u&&Hh){d.visualElement=function(e,t,n,r){const{visualElement:i}=(0,o.useContext)(Uh),a=(0,o.useContext)(Gh),s=(0,o.useContext)(Wh),l=(0,o.useContext)(Vh).reducedMotion,c=(0,o.useRef)();r=r||a.renderer,!c.current&&r&&(c.current=r(e,{visualState:t,parent:i,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:l}));const u=c.current;(0,o.useInsertionEffect)(()=>{u&&u.update(n,s)});const d=(0,o.useRef)(!(!n[qh]||window.HandoffComplete));return $h(()=>{u&&(u.render(),d.current&&u.animationState&&u.animationState.animateChanges())}),(0,o.useEffect)(()=>{u&&(u.updateFeatures(),!d.current&&u.animationState&&u.animationState.animateChanges(),d.current&&(d.current=!1,window.HandoffComplete=!0))}),u}(i,h,c,t);const n=(0,o.useContext)(lf),r=(0,o.useContext)(Gh).strict;d.visualElement&&(l=d.visualElement.loadFeatures(c,r,e,n))}return o.createElement(Uh.Provider,{value:d},l&&d.visualElement?o.createElement(l,{visualElement:d.visualElement,...c}):null,n(i,a,function(e,t,n){return(0,o.useCallback)(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):Xh(n)&&(n.current=r))},[t])}(h,d.visualElement,s),h,u,d.visualElement))});return a[cf]=i,a}function df({layoutId:e}){const t=(0,o.useContext)(sf).id;return t&&void 0!==e?t+"-"+e:e}const hf=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ff(e){return"string"==typeof e&&!e.includes("-")&&!!(hf.indexOf(e)>-1||/[A-Z]/.test(e))}const pf={},gf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mf=new Set(gf);function vf(e,{layout:t,layoutId:n}){return mf.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!pf[e]||"opacity"===e)}const yf=e=>!(!e||!e.getVelocity),bf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},wf=gf.length,xf=e=>t=>"string"==typeof t&&t.startsWith(e),Cf=xf("--"),_f=xf("var(--"),Sf=(e,t)=>t&&"number"==typeof e?t.transform(e):e,kf=(e,t,n)=>Math.min(Math.max(n,e),t),Af={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},jf={...Af,transform:e=>kf(0,1,e)},Ef={...Af,default:1},If=e=>Math.round(1e5*e)/1e5,Tf=/(-)?([\d]*\.?[\d])+/g,Of=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,Ff=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Pf(e){return"string"==typeof e}const Mf=e=>({test:t=>Pf(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Rf=Mf("deg"),Lf=Mf("%"),Df=Mf("px"),Nf=Mf("vh"),zf=Mf("vw"),Bf={...Lf,parse:e=>Lf.parse(e)/100,transform:e=>Lf.transform(100*e)},Vf={...Af,transform:Math.round},Uf={borderWidth:Df,borderTopWidth:Df,borderRightWidth:Df,borderBottomWidth:Df,borderLeftWidth:Df,borderRadius:Df,radius:Df,borderTopLeftRadius:Df,borderTopRightRadius:Df,borderBottomRightRadius:Df,borderBottomLeftRadius:Df,width:Df,maxWidth:Df,height:Df,maxHeight:Df,size:Df,top:Df,right:Df,bottom:Df,left:Df,padding:Df,paddingTop:Df,paddingRight:Df,paddingBottom:Df,paddingLeft:Df,margin:Df,marginTop:Df,marginRight:Df,marginBottom:Df,marginLeft:Df,rotate:Rf,rotateX:Rf,rotateY:Rf,rotateZ:Rf,scale:Ef,scaleX:Ef,scaleY:Ef,scaleZ:Ef,skew:Rf,skewX:Rf,skewY:Rf,distance:Df,translateX:Df,translateY:Df,translateZ:Df,x:Df,y:Df,z:Df,perspective:Df,transformPerspective:Df,opacity:jf,originX:Bf,originY:Bf,originZ:Df,zIndex:Vf,fillOpacity:jf,strokeOpacity:jf,numOctaves:Vf};function Wf(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,c=!1,u=!0;for(const d in t){const e=t[d];if(Cf(d)){o[d]=e;continue}const n=Uf[d],r=Sf(e,n);if(mf.has(d)){if(l=!0,a[d]=r,!u)continue;e!==(n.default||0)&&(u=!1)}else d.startsWith("origin")?(c=!0,s[d]=r):i[d]=r}if(t.transform||(l||r?i.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;a<wf;a++){const t=gf[a];void 0!==e[t]&&(o+=`${bf[t]||t}(${e[t]}) `)}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}(e.transform,n,u,r):i.transform&&(i.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:n=0}=s;i.transformOrigin=`${e} ${t} ${n}`}}function Hf(e,t,n){for(const r in t)!yf(t[r])&&!vf(r,n)&&(e[r]=t[r])}function $f(e,t,n){const r={},i=function(e,t,n){const r={};return Hf(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,o.useMemo)(()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return Wf(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}(e,t,n)),e.transformValues?e.transformValues(r):r}(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const Gf=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Yf(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Gf.has(e)}let qf=e=>!Yf(e);try{!function(e){e&&(qf=t=>t.startsWith("on")?!Yf(t):e(t))}(n(81214).A)}catch{}function Xf(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(qf(i)||!0===n&&Yf(i)||!t&&!Yf(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function Kf(e,t,n){return"string"==typeof e?e:Df.transform(t+n*e)}const Zf={offset:"stroke-dashoffset",array:"stroke-dasharray"},Jf={offset:"strokeDashoffset",array:"strokeDasharray"};function Qf(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...c},u,d,h){if(Wf(e,c,u,h),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:p,dimensions:g}=e;f.transform&&(g&&(p.transform=f.transform),delete f.transform),g&&(void 0!==i||void 0!==o||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Kf(t,e.x,e.width)} ${Kf(n,e.y,e.height)}`}(g,void 0!==i?i:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==a&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?Zf:Jf;e[o.offset]=Df.transform(-r);const a=Df.transform(t),s=Df.transform(n);e[o.array]=`${a} ${s}`}(f,a,s,l,!1)}const ep=e=>"string"==typeof e&&"svg"===e.toLowerCase();function tp(e,t,n,r){const i=(0,o.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Qf(n,t,{enableHardwareAcceleration:!1},ep(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};Hf(t,e.style,e),i.style={...t,...i.style}}return i}function np(e=!1){return(t,n,r,{latestValues:i},a)=>{const s=(ff(t)?tp:$f)(n,i,a,t),l={...Xf(n,"string"==typeof t,e),...s,ref:r},{children:c}=n,u=(0,o.useMemo)(()=>yf(c)?c.get():c,[c]);return(0,o.createElement)(t,{...l,children:u})}}function rp(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const ip=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function op(e,t,n,r){rp(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(ip.has(i)?i:Yh(i),t.attrs[i])}function ap(e,t){const{style:n}=e,r={};for(const i in n)(yf(n[i])||t.style&&yf(t.style[i])||vf(i,e))&&(r[i]=n[i]);return r}function sp(e,t){const n=ap(e,t);for(const r in e)(yf(e[r])||yf(t[r]))&&(n[-1!==gf.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]);return n}function lp(e,t,n,r={},i={}){return"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,i)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==n?n:e.custom,r,i)),t}function cp(e){const t=(0,o.useRef)(null);return null===t.current&&(t.current=e()),t.current}const up=e=>Array.isArray(e),dp=e=>up(e)?e[e.length-1]||0:e;function hp(e){const t=yf(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const fp=e=>(t,n)=>{const r=(0,o.useContext)(Uh),i=(0,o.useContext)(Wh),a=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:pp(r,i,o,e),renderState:t()};return n&&(a.mount=e=>n(r,e,a)),a}(e,t,r,i);return n?a():cp(a)};function pp(e,t,n,r){const i={},o=r(e,{});for(const h in o)i[h]=hp(o[h]);let{initial:a,animate:s}=e;const l=ef(e),c=tf(e);t&&c&&!l&&!1!==e.inherit&&(void 0===a&&(a=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===a;const d=u?s:a;return d&&"boolean"!=typeof d&&!Zh(d)&&(Array.isArray(d)?d:[d]).forEach(t=>{const n=lp(e,t);if(!n)return;const{transitionEnd:r,transition:o,...a}=n;for(const e in a){let t=a[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(i[e]=t)}for(const e in r)i[e]=r[e]}),i}const gp=e=>e;class mp{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const vp=["prepare","read","update","preRender","render","postRender"],{schedule:yp,cancel:bp,state:wp}=function(e){let t=!1,n=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=vp.reduce((e,n)=>(e[n]=function(e){let t=new mp,n=new mp,r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(e,o=!1,s=!1)=>{const l=s&&i,c=l?t:n;return o&&a.add(e),c.add(e)&&l&&i&&(r=t.order.length),e},cancel:e=>{n.remove(e),a.delete(e)},process:l=>{if(i)o=!0;else{if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){const r=t.order[n];r(l),a.has(r)&&(s.schedule(r),e())}i=!1,o&&(o=!1,s.process(l))}}};return s}(()=>t=!0),e),{}),o=e=>i[e].process(r),a=()=>{const i=performance.now();t=!1,r.delta=n?1e3/60:Math.max(Math.min(i-r.timestamp,40),1),r.timestamp=i,r.isProcessing=!0,vp.forEach(o),r.isProcessing=!1,t&&(n=!1,e(a))};return{schedule:vp.reduce((o,s)=>{const l=i[s];return o[s]=(i,o=!1,s=!1)=>(t||(t=!0,n=!0,r.isProcessing||e(a)),l.schedule(i,o,s)),o},{}),cancel:e=>vp.forEach(t=>i[t].cancel(e)),state:r,steps:i}}(typeof requestAnimationFrame<"u"?requestAnimationFrame:gp),xp={useVisualState:fp({scrapeMotionValuesFromProps:sp,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onMount:(e,t,{renderState:n,latestValues:r})=>{yp.read(()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),yp.render(()=>{Qf(n,r,{enableHardwareAcceleration:!1},ep(t.tagName),e.transformTemplate),op(t,n)})}})},Cp={useVisualState:fp({scrapeMotionValuesFromProps:ap,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function _p(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sp(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}function kp(e,t,n,r){return _p(e,t,(e=>t=>(e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary)(t)&&e(t,Sp(t)))(n),r)}const Ap=(e,t)=>n=>t(e(n)),jp=(...e)=>e.reduce(Ap);function Ep(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const Ip=Ep("dragHorizontal"),Tp=Ep("dragVertical");function Op(){const e=function(){let e=!1;{const t=Ip(),n=Tp();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}();return!e||(e(),!1)}class Fp{constructor(e){this.isMounted=!1,this.node=e}update(){}}function Pp(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End");return kp(e.current,n,(n,i)=>{if("touch"===n.pointerType||Op())return;const o=e.getProps();e.animationState&&o.whileHover&&e.animationState.setActive("whileHover",t),o[r]&&yp.update(()=>o[r](n,i))},{passive:!e.getProps()[r]})}const Mp=(e,t)=>!!t&&(e===t||Mp(e,t.parentElement));function Rp(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Sp(n))}const Lp=new WeakMap,Dp=new WeakMap,Np=e=>{const t=Lp.get(e.target);t&&t(e)},zp=e=>{e.forEach(Np)};const Bp={some:0,all:1},Vp={inView:{Feature:class extends Fp{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Bp[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;Dp.has(n)||Dp.set(n,{});const r=Dp.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(zp,{root:e,...t})),r[i]}(t);return Lp.set(e,n),r.observe(e),()=>{Lp.delete(e),r.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=t?n:r;o&&o(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Fp{constructor(){super(...arguments),this.removeStartListeners=gp,this.removeEndListeners=gp,this.removeAccessibleListeners=gp,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=kp(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps();yp.update(()=>{i||Mp(this.node.current,e.target)?n&&n(e,t):r&&r(e,t)})},{passive:!(n.onTap||n.onPointerUp)}),i=kp(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=jp(r,i),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=_p(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=_p(this.node.current,"keyup",e=>{"Enter"!==e.key||!this.checkPressEnd()||Rp("up",(e,t)=>{const{onTap:n}=this.node.getProps();n&&yp.update(()=>n(e,t))})}),Rp("down",(e,t)=>{this.startPress(e,t)}))}),t=_p(this.node.current,"blur",()=>{this.isPressing&&Rp("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=jp(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&yp.update(()=>n(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Op()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&yp.update(()=>n(e,t))}mount(){const e=this.node.getProps(),t=kp(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=_p(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=jp(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends Fp{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=jp(_p(this.node.current,"focus",()=>this.onFocus()),_p(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Fp{mount(){this.unmount=jp(Pp(this.node,!0),Pp(this.node,!1))}unmount(){}}}};function Up(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function Wp(e,t,n){const r=e.getProps();return lp(r,t,void 0!==n?n:r.custom,function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.get()),t}(e),function(e){const t={};return e.values.forEach((e,n)=>t[n]=e.getVelocity()),t}(e))}let Hp=gp;const $p=e=>1e3*e,Gp=e=>e/1e3,Yp=e=>Array.isArray(e)&&"number"==typeof e[0];function qp(e){return!!(!e||"string"==typeof e&&Kp[e]||Yp(e)||Array.isArray(e)&&e.every(qp))}const Xp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Kp={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Xp([0,.65,.55,1]),circOut:Xp([.55,0,1,.45]),backIn:Xp([.31,.01,.66,-.59]),backOut:Xp([.33,1.53,.69,.99])};function Zp(e){if(e)return Yp(e)?Xp(e):Array.isArray(e)?e.map(Zp):Kp[e]}const Jp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Qp(e,t,n,r){if(e===t&&n===r)return gp;const i=t=>function(e,t,n,r,i){let o,a,s=0;do{a=t+(n-t)/2,o=Jp(a,r,i)-e,o>0?n=a:t=a}while(Math.abs(o)>1e-7&&++s<12);return a}(t,0,1,e,n);return e=>0===e||1===e?e:Jp(i(e),t,r)}const eg=Qp(.42,0,1,1),tg=Qp(0,0,.58,1),ng=Qp(.42,0,.58,1),rg=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,ig=e=>t=>1-e(1-t),og=e=>1-Math.sin(Math.acos(e)),ag=ig(og),sg=rg(og),lg=Qp(.33,1.53,.69,.99),cg=ig(lg),ug=rg(cg),dg={linear:gp,easeIn:eg,easeInOut:ng,easeOut:tg,circIn:og,circInOut:sg,circOut:ag,backIn:cg,backInOut:ug,backOut:lg,anticipate:e=>(e*=2)<1?.5*cg(e):.5*(2-Math.pow(2,-10*(e-1)))},hg=e=>{if(Array.isArray(e)){Hp(4===e.length);const[t,n,r,i]=e;return Qp(t,n,r,i)}return"string"==typeof e?dg[e]:e},fg=(e,t)=>n=>!!(Pf(n)&&Ff.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),pg=(e,t,n)=>r=>{if(!Pf(r))return r;const[i,o,a,s]=r.match(Tf);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:void 0!==s?parseFloat(s):1}},gg={...Af,transform:e=>Math.round((e=>kf(0,255,e))(e))},mg={test:fg("rgb","red"),parse:pg("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+gg.transform(e)+", "+gg.transform(t)+", "+gg.transform(n)+", "+If(jf.transform(r))+")"},vg={test:fg("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:mg.transform},yg={test:fg("hsl","hue"),parse:pg("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Lf.transform(If(t))+", "+Lf.transform(If(n))+", "+If(jf.transform(r))+")"},bg={test:e=>mg.test(e)||vg.test(e)||yg.test(e),parse:e=>mg.test(e)?mg.parse(e):yg.test(e)?yg.parse(e):vg.parse(e),transform:e=>Pf(e)?e:e.hasOwnProperty("red")?mg.transform(e):yg.transform(e)},wg=(e,t,n)=>-n*e+n*t+e;function xg(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const Cg=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},_g=[vg,mg,yg];function Sg(e){const t=(e=>_g.find(t=>t.test(e)))(e);let n=t.parse(e);return t===yg&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,o=0,a=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=xg(s,r,e+1/3),o=xg(s,r,e),a=xg(s,r,e-1/3)}else i=o=a=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*a),alpha:r}}(n)),n}const kg=(e,t)=>{const n=Sg(e),r=Sg(t),i={...n};return e=>(i.red=Cg(n.red,r.red,e),i.green=Cg(n.green,r.green,e),i.blue=Cg(n.blue,r.blue,e),i.alpha=wg(n.alpha,r.alpha,e),mg.transform(i))},Ag={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:gp},jg={regex:Of,countKey:"Colors",token:"${c}",parse:bg.parse},Eg={regex:Tf,countKey:"Numbers",token:"${n}",parse:Af.parse};function Ig(e,{regex:t,countKey:n,token:r,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+n]=o.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...o.map(i)))}function Tg(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ig(n,Ag),Ig(n,jg),Ig(n,Eg),n}function Og(e){return Tg(e).values}function Fg(e){const{values:t,numColors:n,numVars:r,tokenised:i}=Tg(e),o=t.length;return e=>{let t=i;for(let i=0;i<o;i++)t=i<r?t.replace(Ag.token,e[i]):i<r+n?t.replace(jg.token,bg.transform(e[i])):t.replace(Eg.token,If(e[i]));return t}}const Pg=e=>"number"==typeof e?0:e,Mg={test:function(e){var t,n;return isNaN(e)&&Pf(e)&&((null===(t=e.match(Tf))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Of))||void 0===n?void 0:n.length)||0)>0},parse:Og,createTransformer:Fg,getAnimatableNone:function(e){const t=Og(e);return Fg(e)(t.map(Pg))}},Rg=(e,t)=>n=>`${n>0?t:e}`;function Lg(e,t){return"number"==typeof e?n=>wg(e,t,n):bg.test(e)?kg(e,t):e.startsWith("var(")?Rg(e,t):zg(e,t)}const Dg=(e,t)=>{const n=[...e],r=n.length,i=e.map((e,n)=>Lg(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}},Ng=(e,t)=>{const n={...e,...t},r={};for(const i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=Lg(e[i],t[i]));return e=>{for(const t in r)n[t]=r[t](e);return n}},zg=(e,t)=>{const n=Mg.createTransformer(t),r=Tg(e),i=Tg(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?jp(Dg(r.values,i.values),n):Rg(e,t)},Bg=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Vg=(e,t)=>n=>wg(e,t,n);function Ug(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(Hp(o===t.length),1===o)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=function(e,t,n){const r=[],i=n||function(e){return"number"==typeof e?Vg:"string"==typeof e?bg.test(e)?kg:zg:Array.isArray(e)?Dg:"object"==typeof e?Ng:Vg}(e[0]),o=e.length-1;for(let a=0;a<o;a++){let n=i(e[a],e[a+1]);if(t){const e=Array.isArray(t)?t[a]||gp:t;n=jp(e,n)}r.push(n)}return r}(t,r,i),s=a.length,l=t=>{let n=0;if(s>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const r=Bg(e[n],e[n+1],t);return a[n](r)};return n?t=>l(kf(e[0],e[o-1],t)):l}function Wg(e,t){return e.map(()=>t||ng).splice(0,e.length-1)}function Hg({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(hg):hg(r),o={done:!1,value:t[0]},a=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Bg(0,t,r);e.push(wg(n,1,i))}}(t,e.length-1),t}(t),e),s=Ug(a,t,{ease:Array.isArray(i)?i:Wg(t,i)});return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}function $g(e,t){return t?e*(1e3/t):0}function Gg(e,t,n){const r=Math.max(t-5,0);return $g(n-e(r),t-r)}const Yg=.001;const qg=12;function Xg(e,t){return e*Math.sqrt(1-t*t)}const Kg=["duration","bounce"],Zg=["stiffness","damping","mass"];function Jg(e,t){return t.some(t=>void 0!==e[t])}function Qg({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Jg(e,Zg)&&Jg(e,Kg)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o,a=1-t;a=kf(.05,1,a),e=kf(.01,10,Gp(e)),a<1?(i=t=>{const r=t*a,i=r*e,o=r-n,s=Xg(t,a),l=Math.exp(-i);return Yg-o/s*l},o=t=>{const r=t*a*e,o=r*n+n,s=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Xg(Math.pow(t,2),a);return(-i(t)+Yg>0?-1:1)*((o-s)*l)/c}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-Yg,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let i=1;i<qg;i++)r-=e(r)/t(r);return r}(i,o,5/e);if(e=$p(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*a*Math.sqrt(r*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-Gp(r.velocity||0)}),f=d||0,p=l/(2*Math.sqrt(s*c)),g=o-i,m=Gp(Math.sqrt(s/c)),v=Math.abs(g)<5;let y;if(n||(n=v?.01:2),t||(t=v?.005:.5),p<1){const e=Xg(m,p);y=t=>{const n=Math.exp(-p*m*t);return o-n*((f+p*m*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===p)y=e=>o-Math.exp(-m*e)*(g+(f+m*g)*e);else{const e=m*Math.sqrt(p*p-1);y=t=>{const n=Math.exp(-p*m*t),r=Math.min(e*t,300);return o-n*((f+p*m*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}return{calculatedDuration:h&&u||null,next:e=>{const r=y(e);if(h)a.done=e>=u;else{let i=f;0!==e&&(i=p<1?Gg(y,e,r):0);const s=Math.abs(i)<=n,l=Math.abs(o-r)<=t;a.done=s&&l}return a.value=a.done?o:r,a}}}function em({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],h={done:!1,value:d},f=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=n*t;const g=d+p,m=void 0===a?g:a(g);m!==g&&(p=m-d);const v=e=>-p*Math.exp(-e/r),y=e=>m+v(e),b=e=>{const t=v(e),n=y(e);h.done=Math.abs(t)<=c,h.value=h.done?m:n};let w,x;const C=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(h.value)&&(w=e,x=Qg({keyframes:[h.value,f(h.value)],velocity:Gg(y,e,h.value),damping:i,stiffness:o,restDelta:c,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!x&&void 0===w&&(t=!0,b(e),C(e)),void 0!==w&&e>w?x.next(e-w):(!t&&b(e),h)}}}const tm=e=>{const t=({timestamp:t})=>e(t);return{start:()=>yp.update(t,!0),stop:()=>bp(t),now:()=>wp.isProcessing?wp.timestamp:performance.now()}};function nm(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}const rm={decay:em,inertia:em,tween:Hg,keyframes:Hg,spring:Qg};function im({autoplay:e=!0,delay:t=0,driver:n=tm,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:c,onComplete:u,onUpdate:d,...h}){let f,p,g=1,m=!1;const v=()=>{p=new Promise(e=>{f=e})};let y;v();const b=rm[i]||Hg;let w;b!==Hg&&"number"!=typeof r[0]&&(w=Ug([0,100],r,{clamp:!1}),r=[0,100]);const x=b({...h,keyframes:r});let C;"mirror"===s&&(C=b({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let _="idle",S=null,k=null,A=null;null===x.calculatedDuration&&o&&(x.calculatedDuration=nm(x));const{calculatedDuration:j}=x;let E=1/0,I=1/0;null!==j&&(E=j+a,I=E*(o+1)-a);let T=0;const O=e=>{if(null===k)return;g>0&&(k=Math.min(k,e)),g<0&&(k=Math.min(e-I/g,k)),T=null!==S?S:Math.round(e-k)*g;const n=T-t*(g>=0?1:-1),i=g>=0?n<0:n>I;T=Math.max(n,0),"finished"===_&&null===S&&(T=I);let l=T,c=x;if(o){const e=Math.min(T,I)/E;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,o+1),!!(t%2)&&("reverse"===s?(n=1-n,a&&(n-=a/E)):"mirror"===s&&(c=C)),l=kf(0,1,n)*E}const u=i?{done:!1,value:r[0]}:c.next(l);w&&(u.value=w(u.value));let{done:h}=u;!i&&null!==j&&(h=g>=0?T>=I:T<=0);const f=null===S&&("finished"===_||"running"===_&&h);return d&&d(u.value),f&&M(),u},F=()=>{y&&y.stop(),y=void 0},P=()=>{_="idle",F(),f(),v(),k=A=null},M=()=>{_="finished",u&&u(),F(),f()},R=()=>{if(m)return;y||(y=n(O));const e=y.now();l&&l(),null!==S?k=e-S:(!k||"finished"===_)&&(k=e),"finished"===_&&v(),A=k,S=null,_="running",y.start()};e&&R();const L={then:(e,t)=>p.then(e,t),get time(){return Gp(T)},set time(e){e=$p(e),T=e,null===S&&y&&0!==g?k=y.now()-e/g:S=e},get duration(){const e=null===x.calculatedDuration?nm(x):x.calculatedDuration;return Gp(e)},get speed(){return g},set speed(e){e===g||!y||(g=e,L.time=Gp(T))},get state(){return _},play:R,pause:()=>{_="paused",S=T},stop:()=>{m=!0,"idle"!==_&&(_="idle",c&&c(),P())},cancel:()=>{null!==A&&O(A),P()},complete:()=>{_="finished"},sample:e=>(k=0,O(e))};return L}const om=function(){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),am=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const sm={type:"spring",stiffness:500,damping:25,restSpeed:10},lm={type:"keyframes",duration:.8},cm={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},um=(e,{keyframes:t})=>t.length>2?lm:mf.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):sm:cm,dm=(e,t)=>"zIndex"!==e&&!("number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!Mg.test(t)&&"0"!==t||t.startsWith("url("))),hm=new Set(["brightness","contrast","saturate","opacity"]);function fm(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Tf)||[];if(!r)return e;const i=n.replace(r,"");let o=hm.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const pm=/([a-z-]*)\(.*?\)/g,gm={...Mg,getAnimatableNone:e=>{const t=e.match(pm);return t?t.map(fm).join(" "):e}},mm={...Uf,color:bg,backgroundColor:bg,outlineColor:bg,fill:bg,stroke:bg,borderColor:bg,borderTopColor:bg,borderRightColor:bg,borderBottomColor:bg,borderLeftColor:bg,filter:gm,WebkitFilter:gm},vm=e=>mm[e];function ym(e,t){let n=vm(e);return n!==gm&&(n=Mg),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const bm=e=>/^0[^.\s]+$/.test(e);function wm(e){return"number"==typeof e?0===e:null!==e?"none"===e||"0"===e||bm(e):void 0}function xm(e,t){return e[t]||e.default||e}const Cm=(e,t,n,r={})=>i=>{const o=xm(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s-=$p(a);const l=function(e,t,n,r){const i=dm(t,n);let o;o=Array.isArray(n)?[...n]:[null,n];const a=void 0!==r.from?r.from:e.get();let s;const l=[];for(let c=0;c<o.length;c++)null===o[c]&&(o[c]=0===c?a:o[c-1]),wm(o[c])&&l.push(c),"string"==typeof o[c]&&"none"!==o[c]&&"0"!==o[c]&&(s=o[c]);if(i&&l.length&&s)for(let c=0;c<l.length;c++)o[l[c]]=ym(t,s);return o}(t,e,n,o),c=l[0],u=l[l.length-1],d=dm(e,c),h=dm(e,u);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:e=>{t.set(e),o.onUpdate&&o.onUpdate(e)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length}(o)||(f={...f,...um(e,f)}),f.duration&&(f.duration=$p(f.duration)),f.repeatDelay&&(f.repeatDelay=$p(f.repeatDelay)),!d||!h||!1===o.type)return function({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:gp,pause:gp,stop:gp,then:e=>(e(),Promise.resolve()),cancel:gp,complete:gp});return t?im({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}(f);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const n=function(e,t,{onUpdate:n,onComplete:r,...i}){if(!om()||!am.has(t)||i.repeatDelay||"mirror"===i.repeatType||0===i.damping||"inertia"===i.type)return!1;let o,a,s=!1,l=!1;const c=()=>{a=new Promise(e=>{o=e})};c();let{keyframes:u,duration:d=300,ease:h,times:f}=i;if(((e,t)=>"spring"===t.type||"backgroundColor"===e||!qp(t.ease))(t,i)){const e=im({...i,repeat:0,delay:0});let t={done:!1,value:u[0]};const n=[];let r=0;for(;!t.done&&r<2e4;)t=e.sample(r),n.push(t.value),r+=10;f=void 0,u=n,d=r-10,h="linear"}const p=function(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=Zp(s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===a?"alternate":"normal"})}(e.owner.current,t,u,{...i,duration:d,ease:h,times:f}),g=()=>{l=!1,p.cancel()},m=()=>{l=!0,yp.update(g),o(),c()};return p.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:n="loop"}){return e[t&&"loop"!==n&&t%2==1?0:e.length-1]}(u,i)),r&&r(),m())},{then:(e,t)=>a.then(e,t),attachTimeline:e=>(p.timeline=e,p.onfinish=null,gp),get time(){return Gp(p.currentTime||0)},set time(e){p.currentTime=$p(e)},get speed(){return p.playbackRate},set speed(e){p.playbackRate=e},get duration(){return Gp(d)},play:()=>{s||(p.play(),bp(g))},pause:()=>p.pause(),stop:()=>{if(s=!0,"idle"===p.playState)return;const{currentTime:t}=p;if(t){const n=im({...i,autoplay:!1});e.setWithVelocity(n.sample(t-10).value,n.sample(t).value,10)}m()},complete:()=>{l||p.finish()},cancel:m}}(t,e,f);if(n)return n}return im(f)};function _m(e){return!(!yf(e)||!e.add)}const Sm=e=>/^\-?\d*\.?\d+$/.test(e);class km{constructor(){this.subscriptions=[]}add(e){return function(e,t){-1===e.indexOf(t)&&e.push(t)}(this.subscriptions,e),()=>function(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){const r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class Am{constructor(e,t={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{this.prev=this.current,this.current=e;const{delta:n,timestamp:r}=wp;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,yp.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>yp.postRender(this.velocityCheck),this.velocityCheck=({timestamp:e})=>{e!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current),this.owner=t.owner}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new km);const n=this.events[e].add(t);return"change"===e?()=>{n(),yp.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=e,this.timeDelta=n}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?$g(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function jm(e,t){return new Am(e,t)}const Em=e=>t=>t.test(e),Im=[Af,Df,Lf,Rf,zf,Nf,{test:e=>"auto"===e,parse:e=>e}],Tm=e=>Im.find(Em(e)),Om=[...Im,bg,Mg],Fm=e=>Om.find(Em(e));function Pm(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,jm(n))}function Mm(e,t){return t?(t[e]||t.default||t).from:void 0}function Rm({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Lm(e,t){const n=e.get();if(!Array.isArray(t))return n!==t;for(let r=0;r<t.length;r++)if(t[r]!==n)return!0}function Dm(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const c=[],u=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const t=e.getValue(d),r=s[d];if(!t||void 0===r||u&&Rm(u,d))continue;const i={delay:n,elapsed:0,...xm(o||{},d)};if(window.HandoffAppearAnimations){const n=e.getProps()[qh];if(n){const e=window.HandoffAppearAnimations(n,d,t,yp);null!==e&&(i.elapsed=e,i.isHandoff=!0)}}let a=!i.isHandoff&&!Lm(t,r);if("spring"===i.type&&(t.getVelocity()||i.velocity)&&(a=!1),t.animation&&(a=!1),a)continue;t.start(Cm(d,t,r,e.shouldReduceMotion&&mf.has(d)?{type:!1}:i));const h=t.animation;_m(l)&&(l.add(d),h.then(()=>l.remove(d))),c.push(h)}return a&&Promise.all(c).then(()=>{a&&function(e,t){const n=Wp(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o)Pm(e,a,dp(o[a]))}(e,a)}),c}function Nm(e,t,n={}){const r=Wp(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(Dm(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=1===i?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(zm).forEach((e,r)=>{e.notify("AnimationStart",t),a.push(Nm(e,t,{...o,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,o+r,a,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[e,t]="beforeChildren"===s?[o,a]:[a,o];return e().then(()=>t())}return Promise.all([o(),a(n.delay)])}function zm(e,t){return e.sortNodePosition(t)}const Bm=[...Jh].reverse(),Vm=Jh.length;function Um(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map(t=>Nm(e,t,n));r=Promise.all(i)}else if("string"==typeof t)r=Nm(e,t,n);else{const i="function"==typeof t?Wp(e,t,n.custom):t;r=Promise.all(Dm(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}(e,t,n)))}(e);const n={animate:Hm(!0),whileInView:Hm(),whileHover:Hm(),whileTap:Hm(),whileDrag:Hm(),whileFocus:Hm(),exit:Hm()};let r=!0;const i=(t,n)=>{const r=Wp(e,n);if(r){const{transition:e,transitionEnd:n,...i}=r;t={...t,...i,...n}}return t};function o(o,a){const s=e.getProps(),l=e.getVariantContext(!0)||{},c=[],u=new Set;let d={},h=1/0;for(let t=0;t<Vm;t++){const f=Bm[t],p=n[f],g=void 0!==s[f]?s[f]:l[f],m=Kh(g),v=f===a?p.isActive:null;!1===v&&(h=t);let y=g===l[f]&&g!==s[f]&&m;if(y&&r&&e.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...d},!p.isActive&&null===v||!g&&!p.prevProp||Zh(g)||"boolean"==typeof g)continue;let b=Wm(p.prevProp,g)||f===a&&p.isActive&&!y&&m||t>h&&m,w=!1;const x=Array.isArray(g)?g:[g];let C=x.reduce(i,{});!1===v&&(C={});const{prevResolvedValues:_={}}=p,S={..._,...C},k=e=>{b=!0,u.has(e)&&(w=!0,u.delete(e)),p.needsAnimating[e]=!0};for(const e in S){const t=C[e],n=_[e];if(d.hasOwnProperty(e))continue;let r=!1;r=up(t)&&up(n)?!Up(t,n):t!==n,r?void 0!==t?k(e):u.add(e):void 0!==t&&u.has(e)?k(e):p.protectedKeys[e]=!0}p.prevProp=g,p.prevResolvedValues=C,p.isActive&&(d={...d,...C}),r&&e.blockInitialAnimation&&(b=!1),b&&(!y||w)&&c.push(...x.map(e=>({animation:e,options:{type:f,...o}})))}if(u.size){const t={};u.forEach(n=>{const r=e.getBaseTarget(n);void 0!==r&&(t[n]=r)}),c.push({animation:t})}let f=!!c.length;return r&&(!1===s.initial||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(f=!1),r=!1,f?t(c):Promise.resolve()}return{animateChanges:o,setActive:function(t,r,i){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;const s=o(i,t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Wm(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!Up(t,e)}function Hm(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let $m=0;const Gm={animation:{Feature:class extends Fp{constructor(e){super(e),e.animationState||(e.animationState=Um(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),Zh(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends Fp{constructor(){super(...arguments),this.id=$m++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const i=this.node.animationState.setActive("exit",!e,{custom:n??this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Ym=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function qm(e,t,n=1){const[r,i]=function(e){const t=Ym.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const e=o.trim();return Sm(e)?parseFloat(e):e}return _f(i)?qm(i,t,n+1):i}const Xm=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Km=e=>Xm.has(e),Zm=e=>e===Af||e===Df,Jm=(e,t)=>parseFloat(e.split(", ")[t]),Qm=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return Jm(i[1],t);{const t=r.match(/^matrix\((.+)\)$/);return t?Jm(t[1],e):0}},ev=new Set(["x","y","z"]),tv=gf.filter(e=>!ev.has(e)),nv={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Qm(4,13),y:Qm(5,14)};nv.translateX=nv.x,nv.translateY=nv.y;function rv(e,t,n,r){return(e=>Object.keys(e).some(Km))(t)?((e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(Km);let o=[],a=!1;const s=[];if(i.forEach(i=>{const l=e.getValue(i);if(!e.hasValue(i))return;let c=n[i],u=Tm(c);const d=t[i];let h;if(up(d)){const e=d.length,t=null===d[0]?1:0;c=d[t],u=Tm(c);for(let n=t;n<e&&null!==d[n];n++)h?Hp(Tm(d[n])===h):h=Tm(d[n])}else h=Tm(d);if(u!==h)if(Zm(u)&&Zm(h)){const e=l.get();"string"==typeof e&&l.set(parseFloat(e)),"string"==typeof d?t[i]=parseFloat(d):Array.isArray(d)&&h===Df&&(t[i]=d.map(parseFloat))}else null!=u&&u.transform&&null!=h&&h.transform&&(0===c||0===d)?0===c?l.set(h.transform(c)):t[i]=u.transform(d):(a||(o=function(e){const t=[];return tv.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),a=!0),s.push(i),r[i]=void 0!==r[i]?r[i]:t[i],l.jump(d))}),s.length){const n=s.indexOf("height")>=0?window.pageYOffset:null,i=((e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};"none"===a&&t.setStaticValue("display",e.display||"block"),n.forEach(e=>{s[e]=nv[e](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(n=>{const r=t.getValue(n);r&&r.jump(s[n]),e[n]=nv[n](l,o)}),e})(t,e,s);return o.length&&o.forEach(([t,n])=>{e.getValue(t).set(n)}),e.render(),Hh&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:r}}return{target:t,transitionEnd:r}})(e,t,n,r):{target:t,transitionEnd:r}}const iv={current:null},ov={current:!1},av=new WeakMap,sv=Object.keys(of),lv=sv.length,cv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],uv=Qh.length;class dv{constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>yp.render(this.render,!1,!0);const{latestValues:a,renderState:s}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=s,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.isControllingVariants=ef(t),this.isVariantNode=tf(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:l,...c}=this.scrapeMotionValuesFromProps(t,{});for(const u in c){const e=c[u];void 0!==a[u]&&yf(e)&&(e.set(a[u],!1),_m(l)&&l.add(u))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,av.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),ov.current||function(){if(ov.current=!0,Hh)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>iv.current=e.matches;e.addListener(t),t()}else iv.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||iv.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){av.delete(this.current),this.projection&&this.projection.unmount(),bp(this.notifyUpdate),bp(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){const n=mf.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&yp.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{r(),i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,r,i){let o,a;for(let s=0;s<lv;s++){const e=sv[s],{isEnabled:n,Feature:r,ProjectionNode:i,MeasureLayout:l}=of[e];i&&(o=i),n(t)&&(!this.features[e]&&r&&(this.features[e]=new r(this)),l&&(a=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&o){this.projection=new o(this.latestValues,this.parent&&this.parent.projection);const{layoutId:e,layout:n,drag:r,dragConstraints:a,layoutScroll:s,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:!!r||a&&Xh(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:i,layoutScroll:s,layoutRoot:l})}return a}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,this.props,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let n=0;n<cv.length;n++){const t=cv[n];this.propEventSubscriptions[t]&&(this.propEventSubscriptions[t](),delete this.propEventSubscriptions[t]);const r=e["on"+t];r&&(this.propEventSubscriptions[t]=this.on(t,r))}this.prevMotionValues=function(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(yf(o))e.addValue(i,o),_m(r)&&r.add(i);else if(yf(a))e.addValue(i,jm(o,{owner:e})),_m(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const t=e.getValue(i);!t.hasAnimated&&t.set(o)}else{const t=e.getStaticValue(i);e.addValue(i,jm(void 0!==t?t:o,{owner:e}))}}for(const i in n)void 0===t[i]&&e.removeValue(i);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const t={};for(let n=0;n<uv;n++){const e=Qh[n],r=this.props[e];(Kh(r)||!1===r)&&(t[e]=r)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=jm(t,{owner:this}),this.addValue(e,n)),n}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(t=lp(this.props,n))||void 0===t?void 0:t[e]:void 0;if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||yf(i)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new km),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class hv extends dv{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...n},{transformValues:r},i){let o=function(e,t,n){const r={};for(const i in e){const e=Mm(i,t);if(void 0!==e)r[i]=e;else{const e=n.getValue(i);e&&(r[i]=e.get())}}return r}(n,e||{},this);if(r&&(t&&(t=r(t)),n&&(n=r(n)),o&&(o=r(o))),i){!function(e,t,n){var r,i;const o=Object.keys(t).filter(t=>!e.hasValue(t)),a=o.length;if(a)for(let s=0;s<a;s++){const a=o[s],l=t[a];let c=null;Array.isArray(l)&&(c=l[0]),null===c&&(c=null!==(i=null!==(r=n[a])&&void 0!==r?r:e.readValue(a))&&void 0!==i?i:t[a]),null!=c&&("string"==typeof c&&(Sm(c)||bm(c))?c=parseFloat(c):!Fm(c)&&Mg.test(l)&&(c=ym(a,l)),e.addValue(a,jm(c,{owner:e})),void 0===n[a]&&(n[a]=c),null!==c&&e.setBaseTarget(a,c))}}(this,n,o);const e=((e,t,n,r)=>{const i=function(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(e=>{const t=e.get();if(!_f(t))return;const n=qm(t,r);n&&e.set(n)});for(const i in t){const e=t[i];if(!_f(e))continue;const o=qm(e,r);o&&(t[i]=o,n||(n={}),void 0===n[i]&&(n[i]=e))}return{target:t,transitionEnd:n}}(e,t,r);return rv(e,t=i.target,n,r=i.transitionEnd)})(this,n,o,t);t=e.transitionEnd,n=e.target}return{transition:e,transitionEnd:t,...n}}}class fv extends hv{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(mf.has(t)){const e=vm(t);return e&&e.default||0}{const n=function(e){return window.getComputedStyle(e)}(e),r=(Cf(t)?n.getPropertyValue(t):n[t])||0;return"string"==typeof r?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return function(e,t){return function({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}(e,t)}build(e,t,n,r){Wf(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t){return ap(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;yf(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,n,r){rp(e,t,n,r)}}class pv extends hv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mf.has(t)){const e=vm(t);return e&&e.default||0}return t=ip.has(t)?t:Yh(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t){return sp(e,t)}build(e,t,n,r){Qf(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){op(e,t,0,r)}mount(e){this.isSVGTag=ep(e.tagName),super.mount(e)}}const gv=function(){function e(e,t={}){return uf(function(e,{forwardMotionProps:t=!1},n,r){return{...ff(e)?xp:Cp,preloadedFeatures:n,useRender:np(t),createVisualElement:r,Component:e}}(e,t))}if(typeof Proxy>"u")return e;const t=new Map;return new Proxy(e,{get:(n,r)=>(t.has(r)||t.set(r,e(r)),t.get(r))})}();function mv(){const e=(0,o.useRef)(!1);return $h(()=>(e.current=!0,()=>{e.current=!1}),[]),e}class vv extends o.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function yv({children:e,isPresent:t}){const n=(0,o.useId)(),r=(0,o.useRef)(null),i=(0,o.useRef)({width:0,height:0,top:0,left:0});return(0,o.useInsertionEffect)(()=>{const{width:e,height:o,top:a,left:s}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${o}px !important;\n top: ${a}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(l)}},[t]),o.createElement(vv,{isPresent:t,childRef:r,sizeRef:i},o.cloneElement(e,{ref:r}))}const bv=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:s})=>{const l=cp(wv),c=(0,o.useId)(),u=(0,o.useMemo)(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:e=>{l.set(e,!0);for(const t of l.values())if(!t)return;r&&r()},register:e=>(l.set(e,!1),()=>l.delete(e))}),a?void 0:[n]);return(0,o.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),o.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),"popLayout"===s&&(e=o.createElement(yv,{isPresent:n},e)),o.createElement(Wh.Provider,{value:u},e)};function wv(){return new Map}const xv=e=>e.key||"",Cv=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:a=!0,mode:s="sync"})=>{const l=(0,o.useContext)(sf).forceRender||function(){const e=mv(),[t,n]=(0,o.useState)(0),r=(0,o.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,o.useCallback)(()=>yp.postRender(r),[r]),t]}()[0],c=mv(),u=function(e){const t=[];return o.Children.forEach(e,e=>{(0,o.isValidElement)(e)&&t.push(e)}),t}(e);let d=u;const h=(0,o.useRef)(new Map).current,f=(0,o.useRef)(d),p=(0,o.useRef)(new Map).current,g=(0,o.useRef)(!0);if($h(()=>{g.current=!1,function(e,t){e.forEach(e=>{const n=xv(e);t.set(n,e)})}(u,p),f.current=d}),(0,o.useEffect)(()=>()=>(g.current=!0,p.clear(),void h.clear()),[]),g.current)return o.createElement(o.Fragment,null,d.map(e=>o.createElement(bv,{key:xv(e),isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:a,mode:s},e)));d=[...d];const m=f.current.map(xv),v=u.map(xv),y=m.length;for(let o=0;o<y;o++){const e=m[o];-1===v.indexOf(e)&&!h.has(e)&&h.set(e,void 0)}return"wait"===s&&h.size&&(d=[]),h.forEach((e,n)=>{if(-1!==v.indexOf(n))return;const i=p.get(n);if(!i)return;const g=m.indexOf(n);let y=e;if(!y){const e=()=>{h.delete(n);const e=Array.from(p.keys()).filter(e=>!v.includes(e));if(e.forEach(e=>p.delete(e)),f.current=u.filter(t=>{const r=xv(t);return r===n||e.includes(r)}),!h.size){if(!1===c.current)return;l(),r&&r()}};y=o.createElement(bv,{key:xv(i),isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:a,mode:s},i),h.set(n,y)}d.splice(g,0,y)}),d=d.map(e=>{const t=e.key;return h.has(t)?e:o.createElement(bv,{key:xv(e),isPresent:!0,presenceAffectsLayout:a,mode:s},e)}),o.createElement(o.Fragment,null,h.size?d:d.map(e=>(0,o.cloneElement)(e)))};function _v({children:e,features:t,strict:n=!1}){const[,r]=(0,o.useState)(!Sv(t)),i=(0,o.useRef)(void 0);if(!Sv(t)){const{renderer:e,...n}=t;i.current=e,af(n)}return(0,o.useEffect)(()=>{Sv(t)&&t().then(({renderer:e,...t})=>{af(t),i.current=e,r(!0)})},[]),o.createElement(Gh.Provider,{value:{renderer:i.current,strict:n}},e)}function Sv(e){return"function"==typeof e}const kv={renderer:(e,t)=>ff(e)?new pv(t,{enableHardwareAcceleration:!1}):new fv(t,{enableHardwareAcceleration:!0}),...Gm,...Vp},Av=typeof document<"u"?o.useLayoutEffect:()=>{},jv=o.createContext(!1);function Ev(){return!1}function Iv(){return!0}function Tv(e){return()=>{}}function Ov(){return"function"==typeof o.useSyncExternalStore?o.useSyncExternalStore(Tv,Ev,Iv):(0,o.useContext)(jv)}o.useId;let Fv=new Map;function Pv(e,t){if(e===t)return e;let n=Fv.get(e);if(n)return n(t),t;let r=Fv.get(t);return r?(r(e),e):t}function Mv(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Rv=e=>{var t;return null!==(t=null==e?void 0:e.ownerDocument)&&void 0!==t?t:document},Lv=e=>e&&"window"in e&&e.window===e?e:Rv(e).defaultView||window;function Dv(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];"function"==typeof n&&"function"==typeof i&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Mv(n,i):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof n||"string"!=typeof i?"id"===e&&n&&i?t.id=Pv(n,i):t[e]=void 0!==i?i:n:t[e]=gc(n,i)}}return t}function Nv(e){if(function(){if(null==zv){zv=!1;try{document.createElement("div").focus({get preventScroll(){return zv=!0,!0}})}catch{}}return zv}())e.focus({preventScroll:!0});else{let t=function(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let zv=null;function Bv(){return function(){var e;return typeof window<"u"&&null!=window.navigator&&/^Mac/i.test((null===(e=window.navigator.userAgentData)||void 0===e?void 0:e.platform)||window.navigator.platform)}()}let Vv=new Map,Uv=new Set;function Wv(){if(typeof window>"u")return;function e(e){return"propertyName"in e}let t=n=>{if(!e(n)||!n.target)return;let r=Vv.get(n.target);if(r&&(r.delete(n.propertyName),0===r.size&&(n.target.removeEventListener("transitioncancel",t),Vv.delete(n.target)),0===Vv.size)){for(let e of Uv)e();Uv.clear()}};document.body.addEventListener("transitionrun",n=>{if(!e(n)||!n.target)return;let r=Vv.get(n.target);r||(r=new Set,Vv.set(n.target,r),n.target.addEventListener("transitioncancel",t,{once:!0})),r.add(n.propertyName)}),document.body.addEventListener("transitionend",t)}function Hv(){let e=(0,o.useRef)(new Map),t=(0,o.useCallback)((t,n,r,i)=>{let o=null!=i&&i.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:o,options:i}),t.addEventListener(n,r,i)},[]),n=(0,o.useCallback)((t,n,r,i)=>{var o;let a=(null===(o=e.current.get(r))||void 0===o?void 0:o.fn)||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=(0,o.useCallback)(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return(0,o.useEffect)(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function $v(e){const t=(0,o.useRef)(null);return(0,o.useMemo)(()=>({get current(){return t.current},set current(n){t.current=n,"function"==typeof e?e(n):e&&(e.current=n)}}),[e])}typeof document<"u"&&("loading"!==document.readyState?Wv():document.addEventListener("DOMContentLoaded",Wv));let Gv=typeof document<"u"&&window.visualViewport;function Yv(){return{width:Gv&&(null==Gv?void 0:Gv.width)||window.innerWidth,height:Gv&&(null==Gv?void 0:Gv.height)||window.innerHeight}}function qv(e,t,n){let[r,i]=(0,o.useState)(e||t),a=(0,o.useRef)(void 0!==e),s=void 0!==e;(0,o.useEffect)(()=>{a.current;a.current=s},[s]);let l=s?e:r,c=(0,o.useCallback)((e,...t)=>{let r=(e,...t)=>{n&&(Object.is(l,e)||n(e,...t)),s||(l=e)};"function"==typeof e?i((n,...i)=>{let o=e(s?l:n,...i);return r(o,...t),s?n:o}):(s||i(e),r(e,...t))},[s,l,n]);return[l,c]}function Xv(e,t=-1/0,n=1/0){return Math.min(Math.max(e,t),n)}function Kv(e,t){let n=e,r=t.toString(),i=r.indexOf("."),o=i>=0?r.length-i:0;if(o>0){let e=Math.pow(10,o);n=Math.round(n*e)/e}return n}function Zv(e,t,n=10){const r=Math.pow(n,t);return Math.round(e*r)/r}var Jv={};const Qv=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));!function(e){var t,n=n||{version:"5.3.0"};if(e.fabric=n,typeof document<"u"&&typeof window<"u")document instanceof(typeof HTMLDocument<"u"?HTMLDocument:Document)?n.document=document:n.document=document.implementation.createHTMLDocument(""),n.window=window;else{var r=new Qv.JSDOM(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;n.document=r.document,n.jsdomImplForWrapper=Qv.implForWrapper,n.nodeCanvas=Qv.Canvas,n.window=r,DOMParser=n.window.DOMParser}function i(e,t){var n=e.canvas,r=t.targetCanvas,i=r.getContext("2d");i.translate(0,r.height),i.scale(1,-1);var o=n.height-r.height;i.drawImage(n,0,o,r.width,r.height,0,0,r.width,r.height)}function o(e,t){var n=t.targetCanvas.getContext("2d"),r=t.destinationWidth,i=t.destinationHeight,o=r*i*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);var l=new ImageData(s,r,i);n.putImageData(l,0,0)}n.isTouchSupported="ontouchstart"in n.window||"ontouchstart"in n.document||n.window&&n.window.navigator&&n.window.navigator.maxTouchPoints>0,n.isLikelyNode=typeof re<"u"&&typeof window>"u",n.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],n.DPI=96,n.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",n.commaWsp="(?:\\s+,?\\s*|,\\s*)",n.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,n.reNonWord=/[ \n\.,;!\?\-]/,n.fontPaths={},n.iMatrix=[1,0,0,1,0,0],n.svgNS="http://www.w3.org/2000/svg",n.perfLimitSizeTotal=2097152,n.maxCacheSideLimit=4096,n.minCacheSideLimit=256,n.charWidthsCache={},n.textureSize=2048,n.disableStyleCopyPaste=!1,n.enableGLFiltering=!0,n.devicePixelRatio=n.window.devicePixelRatio||n.window.webkitDevicePixelRatio||n.window.mozDevicePixelRatio||1,n.browserShadowBlurConstant=1,n.arcToSegmentsCache={},n.boundsOfCurveCache={},n.cachesBoundsOfCurve=!0,n.forceGLPutImageData=!1,n.initFilterBackend=function(){return n.enableGLFiltering&&n.isWebglSupported&&n.isWebglSupported(n.textureSize)?new n.WebglFilterBackend({tileSize:n.textureSize}):n.Canvas2dFilterBackend?new n.Canvas2dFilterBackend:void 0},typeof document<"u"&&typeof window<"u"&&(window.fabric=n),function(){function e(e,t){if(this.__eventListeners[e]){var r=this.__eventListeners[e];t?r[r.indexOf(t)]=!1:n.util.array.fill(r,!1)}}function t(e,t){var n=function(){t.apply(this,arguments),this.off(e,n)}.bind(this);this.on(e,n)}n.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var r=0,i=n.length;r<i;r++)n[r]&&n[r].call(this,t||{});return this.__eventListeners[e]=n.filter(function(e){return!1!==e}),this},on:function(e,t){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var n in e)this.on(n,e[n]);else this.__eventListeners[e]||(this.__eventListeners[e]=[]),this.__eventListeners[e].push(t);return this},once:function(e,n){if(1===arguments.length)for(var r in e)t.call(this,r,e[r]);else t.call(this,e,n);return this},off:function(t,n){if(!this.__eventListeners)return this;if(0===arguments.length)for(t in this.__eventListeners)e.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var r in t)e.call(this,r,t[r]);else e.call(this,t,n);return this}}}(),n.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var e=0,t=arguments.length;e<t;e++)this._onObjectAdded(arguments[e]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(e,t,n){var r=this._objects;return n?r[t]=e:r.splice(t,0,e),this._onObjectAdded&&this._onObjectAdded(e),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var e,t=this._objects,n=!1,r=0,i=arguments.length;r<i;r++)-1!==(e=t.indexOf(arguments[r]))&&(n=!0,t.splice(e,1),this._onObjectRemoved&&this._onObjectRemoved(arguments[r]));return this.renderOnAddRemove&&n&&this.requestRenderAll(),this},forEachObject:function(e,t){for(var n=this.getObjects(),r=0,i=n.length;r<i;r++)e.call(t,n[r],r,n);return this},getObjects:function(e){return typeof e>"u"?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(e){return this._objects[e]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return this._objects.indexOf(e)>-1||!!t&&this._objects.some(function(t){return"function"==typeof t.contains&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(e,t){return e+(t.complexity?t.complexity():0)},0)}},n.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){e&&e.colorStops&&!(e instanceof n.Gradient)&&this.set(t,new n.Gradient(e))},_initPattern:function(e,t,r){!e||!e.source||e instanceof n.Pattern?r&&r():this.set(t,new n.Pattern(e,r))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"==typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"==typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},function(e){var t=Math.sqrt,r=Math.atan2,i=Math.pow,o=Math.PI/180,a=Math.PI/2;n.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/a){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/a){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return-1!==n&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*o},radiansToDegrees:function(e){return e/o},rotatePoint:function(e,t,r){var i=new n.Point(e.x-t.x,e.y-t.y),o=n.util.rotateVector(i,r);return new n.Point(o.x,o.y).addEquals(t)},rotateVector:function(e,t){var r=n.util.sin(t),i=n.util.cos(t);return{x:e.x*i-e.y*r,y:e.x*r+e.y*i}},createVector:function(e,t){return new n.Point(t.x-e.x,t.y-e.y)},calcAngleBetweenVectors:function(e,t){return Math.acos((e.x*t.x+e.y*t.y)/(Math.hypot(e.x,e.y)*Math.hypot(t.x,t.y)))},getHatVector:function(e){return new n.Point(e.x,e.y).multiply(1/Math.hypot(e.x,e.y))},getBisector:function(e,t,r){var i=n.util.createVector(e,t),o=n.util.createVector(e,r),a=n.util.calcAngleBetweenVectors(i,o),s=a*(0===n.util.calcAngleBetweenVectors(n.util.rotateVector(i,a),o)?1:-1)/2;return{vector:n.util.getHatVector(n.util.rotateVector(i,s)),angle:a}},projectStrokeOnPoints:function(e,t,r){var i=[],o=t.strokeWidth/2,a=t.strokeUniform?new n.Point(1/t.scaleX,1/t.scaleY):new n.Point(1,1),s=function(e){var t=o/Math.hypot(e.x,e.y);return new n.Point(e.x*t*a.x,e.y*t*a.y)};return e.length<=1||e.forEach(function(l,c){var u,d,h=new n.Point(l.x,l.y);0===c?(d=e[c+1],u=r?s(n.util.createVector(d,h)).addEquals(h):e[e.length-1]):c===e.length-1?(u=e[c-1],d=r?s(n.util.createVector(u,h)).addEquals(h):e[0]):(u=e[c-1],d=e[c+1]);var f,p,g=n.util.getBisector(h,u,d),m=g.vector,v=g.angle;if("miter"===t.strokeLineJoin&&(f=-o/Math.sin(v/2),p=new n.Point(m.x*f*a.x,m.y*f*a.y),Math.hypot(p.x,p.y)/o<=t.strokeMiterLimit))return i.push(h.add(p)),void i.push(h.subtract(p));f=-o*Math.SQRT2,p=new n.Point(m.x*f*a.x,m.y*f*a.y),i.push(h.add(p)),i.push(h.subtract(p))}),i},transformPoint:function(e,t,r){return r?new n.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new n.Point(t[0]*e.x+t[2]*e.y+t[4],t[1]*e.x+t[3]*e.y+t[5])},makeBoundingBoxFromPoints:function(e,t){if(t)for(var r=0;r<e.length;r++)e[r]=n.util.transformPoint(e[r],t);var i=[e[0].x,e[1].x,e[2].x,e[3].x],o=n.util.array.min(i),a=n.util.array.max(i)-o,s=[e[0].y,e[1].y,e[2].y,e[3].y],l=n.util.array.min(s);return{left:o,top:l,width:a,height:n.util.array.max(s)-l}},invertTransform:function(e){var t=1/(e[0]*e[3]-e[1]*e[2]),r=[t*e[3],-t*e[1],-t*e[2],t*e[0]],i=n.util.transformPoint({x:e[4],y:e[5]},r,!0);return r[4]=-i.x,r[5]=-i.y,r},toFixed:function(e,t){return parseFloat(Number(e).toFixed(t))},parseUnit:function(e,t){var r=/\D{0,2}$/.exec(e),i=parseFloat(e);switch(t||(t=n.Text.DEFAULT_SVG_FONT_SIZE),r[0]){case"mm":return i*n.DPI/25.4;case"cm":return i*n.DPI/2.54;case"in":return i*n.DPI;case"pt":return i*n.DPI/72;case"pc":return i*n.DPI/72*12;case"em":return i*t;default:return i}},falseFunction:function(){return!1},getKlass:function(e,t){return e=n.util.string.camelize(e.charAt(0).toUpperCase()+e.slice(1)),n.util.resolveNamespace(t)[e]},getSvgAttributes:function(e){var t=["instantiated_by_use","style","id","class"];switch(e){case"linearGradient":t=t.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":t=t.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":t=t.concat(["offset","stop-color","stop-opacity"])}return t},resolveNamespace:function(t){if(!t)return n;var r,i=t.split("."),o=i.length,a=e||n.window;for(r=0;r<o;++r)a=a[i[r]];return a},loadImage:function(e,t,r,i){if(e){var o=n.util.createImage(),a=function(){t&&t.call(r,o,!1),o=o.onload=o.onerror=null};o.onload=a,o.onerror=function(){n.log("Error loading "+o.src),t&&t.call(r,null,!0),o=o.onload=o.onerror=null},0!==e.indexOf("data")&&null!=i&&(o.crossOrigin=i),"data:image/svg"===e.substring(0,14)&&(o.onload=null,n.util.loadImageInDom(o,a)),o.src=e}else t&&t.call(r,e)},loadImageInDom:function(e,t){var r=n.document.createElement("div");r.style.width=r.style.height="1px",r.style.left=r.style.top="-100%",r.style.position="absolute",r.appendChild(e),n.document.querySelector("body").appendChild(r),e.onload=function(){t(),r.parentNode.removeChild(r),r=null}},enlivenObjects:function(e,t,r,i){var o=[],a=0,s=(e=e||[]).length;function l(){++a===s&&t&&t(o.filter(function(e){return e}))}s?e.forEach(function(e,t){e&&e.type?n.util.getKlass(e.type,r).fromObject(e,function(n,r){r||(o[t]=n),i&&i(e,n,r),l()}):l()}):t&&t(o)},enlivenObjectEnlivables:function(e,t,r){var i=n.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});n.util.enlivenObjects(i.map(function(t){return e[t]}),function(e){var n={};i.forEach(function(r,i){n[r]=e[i],t&&(t[r]=e[i])}),r&&r(n)})},enlivenPatterns:function(e,t){function r(){++o===a&&t&&t(i)}var i=[],o=0,a=(e=e||[]).length;a?e.forEach(function(e,t){e&&e.source?new n.Pattern(e,function(e){i[t]=e,r()}):(i[t]=e,r())}):t&&t(i)},groupSVGElements:function(e,t,r){var i;return e&&1===e.length?(typeof r<"u"&&(e[0].sourcePath=r),e[0]):(t&&(t.width&&t.height?t.centerPoint={x:t.width/2,y:t.height/2}:(delete t.width,delete t.height)),i=new n.Group(e,t),typeof r<"u"&&(i.sourcePath=r),i)},populateWithProperties:function(e,t,n){if(n&&Array.isArray(n))for(var r=0,i=n.length;r<i;r++)n[r]in e&&(t[n[r]]=e[n[r]])},createCanvasElement:function(){return n.document.createElement("canvas")},copyCanvasElement:function(e){var t=n.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,n){return e.toDataURL("image/"+t,n)},createImage:function(){return n.document.createElement("img")},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var n=r(e[1],e[0]),a=i(e[0],2)+i(e[1],2),s=t(a),l=(e[0]*e[3]-e[2]*e[1])/s,c=r(e[0]*e[2]+e[1]*e[3],a);return{angle:n/o,scaleX:s,scaleY:l,skewX:c/o,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return n.iMatrix.concat();var t=n.util.degreesToRadians(e.angle),r=n.util.cos(t),i=n.util.sin(t);return[r,i,-i,r,0,0]},calcDimensionsMatrix:function(e){var t=typeof e.scaleX>"u"?1:e.scaleX,r=typeof e.scaleY>"u"?1:e.scaleY,i=[e.flipX?-t:t,0,0,e.flipY?-r:r,0,0],o=n.util.multiplyTransformMatrices,a=n.util.degreesToRadians;return e.skewX&&(i=o(i,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(i=o(i,[1,Math.tan(a(e.skewY)),0,1],!0)),i},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],r=n.util.multiplyTransformMatrices;return e.angle&&(t=r(t,n.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=r(t,n.util.calcDimensionsMatrix(e))),t},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,r){r>0&&(t>r?t-=r:t=0,n>r?n-=r:n=0);var i,o=!0,a=e.getImageData(t,n,2*r||1,2*r||1),s=a.data.length;for(i=3;i<s&&!1!==(o=a.data[i]<=0);i+=4);return a=null,o},parsePreserveAspectRatioAttribute:function(e){var t,n="meet",r=e.split(" ");return r&&r.length&&("meet"!==(n=r.pop())&&"slice"!==n?(t=n,n="meet"):r.length&&(t=r.pop())),{meetOrSlice:n,alignX:"none"!==t?t.slice(1,4):"none",alignY:"none"!==t?t.slice(5,8):"none"}},clearFabricFontCache:function(e){(e=(e||"").toLowerCase())?n.charWidthsCache[e]&&delete n.charWidthsCache[e]:n.charWidthsCache={}},limitDimsByArea:function(e,t){var n=Math.sqrt(t*e),r=Math.floor(t/n);return{x:Math.floor(n),y:r}},capValue:function(e,t,n){return Math.max(e,Math.min(t,n))},findScaleToFit:function(e,t){return Math.min(t.width/e.width,t.height/e.height)},findScaleToCover:function(e,t){return Math.max(t.width/e.width,t.height/e.height)},matrixToSVG:function(e){return"matrix("+e.map(function(e){return n.util.toFixed(e,n.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(e,t){var r=n.util.invertTransform(t),i=n.util.multiplyTransformMatrices(r,e.calcOwnMatrix());n.util.applyTransformToObject(e,i)},addTransformToObject:function(e,t){n.util.applyTransformToObject(e,n.util.multiplyTransformMatrices(t,e.calcOwnMatrix()))},applyTransformToObject:function(e,t){var r=n.util.qrDecompose(t),i=new n.Point(r.translateX,r.translateY);e.flipX=!1,e.flipY=!1,e.set("scaleX",r.scaleX),e.set("scaleY",r.scaleY),e.skewX=r.skewX,e.skewY=r.skewY,e.angle=r.angle,e.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(e,t,r){var i=e/2,o=t/2,a=[{x:-i,y:-o},{x:i,y:-o},{x:-i,y:o},{x:i,y:o}],s=n.util.calcDimensionsMatrix(r),l=n.util.makeBoundingBoxFromPoints(a,s);return{x:l.width,y:l.height}},mergeClipPaths:function(e,t){var r=e,i=t;r.inverted&&!i.inverted&&(r=t,i=e),n.util.applyTransformToObject(i,n.util.multiplyTransformMatrices(n.util.invertTransform(r.calcTransformMatrix()),i.calcTransformMatrix()));var o=r.inverted&&i.inverted;return o&&(r.inverted=i.inverted=!1),new n.Group([r],{clipPath:i,inverted:o})},hasStyleChanged:function(e,t,n){return n=n||!1,e.fill!==t.fill||e.stroke!==t.stroke||e.strokeWidth!==t.strokeWidth||e.fontSize!==t.fontSize||e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight||e.fontStyle!==t.fontStyle||e.textBackgroundColor!==t.textBackgroundColor||e.deltaY!==t.deltaY||n&&(e.overline!==t.overline||e.underline!==t.underline||e.linethrough!==t.linethrough)},stylesToArray:function(e,t){e=n.util.object.clone(e,!0);for(var r=t.split("\n"),i=-1,o={},a=[],s=0;s<r.length;s++)if(e[s])for(var l=0;l<r[s].length;l++){i++;var c=e[s][l];c&&Object.keys(c).length>0&&(n.util.hasStyleChanged(o,c,!0)?a.push({start:i,end:i+1,style:c}):a[a.length-1].end++),o=c||{}}else i+=r[s].length;return a},stylesFromArray:function(e,t){if(!Array.isArray(e))return e;for(var n=t.split("\n"),r=-1,i=0,o={},a=0;a<n.length;a++)for(var s=0;s<n[a].length;s++)r++,e[i]&&e[i].start<=r&&r<e[i].end&&(o[a]=o[a]||{},o[a][s]=Object.assign({},e[i].style),r===e[i].end-1&&i++);return o}}}(e),function(){var e=Array.prototype.join,t={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},r={m:"l",M:"L"};function i(e,t,r,i,o,a,s,l,c,u,d){var h=n.util.cos(e),f=n.util.sin(e),p=n.util.cos(t),g=n.util.sin(t),m=r*o*p-i*a*g+s,v=i*o*p+r*a*g+l;return["C",u+c*(-r*o*f-i*a*h),d+c*(-i*o*f+r*a*h),m+c*(r*o*g+i*a*p),v+c*(i*o*g-r*a*p),m,v]}function o(e,t,n,r){var i=Math.atan2(t,e),o=Math.atan2(r,n);return o>=i?o-i:2*Math.PI-(i-o)}function a(e,t,r){for(var a=r[1],s=r[2],l=r[3],c=r[4],u=r[5],d=function(e,t,r,a,s,l,c){var u=Math.PI,d=c*u/180,h=n.util.sin(d),f=n.util.cos(d),p=0,g=0,m=-f*e*.5-h*t*.5,v=-f*t*.5+h*e*.5,y=(r=Math.abs(r))*r,b=(a=Math.abs(a))*a,w=v*v,x=m*m,C=y*b-y*w-b*x,_=0;if(C<0){var S=Math.sqrt(1-C/(y*b));r*=S,a*=S}else _=(s===l?-1:1)*Math.sqrt(C/(y*w+b*x));var k=_*r*v/a,A=-_*a*m/r,j=f*k-h*A+.5*e,E=h*k+f*A+.5*t,I=o(1,0,(m-k)/r,(v-A)/a),T=o((m-k)/r,(v-A)/a,(-m-k)/r,(-v-A)/a);0===l&&T>0?T-=2*u:1===l&&T<0&&(T+=2*u);for(var O=Math.ceil(Math.abs(T/u*2)),F=[],P=T/O,M=8/3*Math.sin(P/4)*Math.sin(P/4)/Math.sin(P/2),R=I+P,L=0;L<O;L++)F[L]=i(I,R,f,h,r,a,j,E,M,p,g),p=F[L][5],g=F[L][6],I=R,R+=P;return F}(r[6]-e,r[7]-t,a,s,c,u,l),h=0,f=d.length;h<f;h++)d[h][1]+=e,d[h][2]+=t,d[h][3]+=e,d[h][4]+=t,d[h][5]+=e,d[h][6]+=t;return d}function s(e,t,n,r){return Math.sqrt((n-e)*(n-e)+(r-t)*(r-t))}function l(e,t,n,r,i,o,a,s){return function(l){var c=function(e){return e*e*e}(l),u=function(e){return 3*e*e*(1-e)}(l),d=function(e){return 3*e*(1-e)*(1-e)}(l),h=function(e){return(1-e)*(1-e)*(1-e)}(l);return{x:a*c+i*u+n*d+e*h,y:s*c+o*u+r*d+t*h}}}function c(e,t,n,r,i,o,a,s){return function(l){var c=1-l,u=3*c*c*(n-e)+6*c*l*(i-n)+3*l*l*(a-i),d=3*c*c*(r-t)+6*c*l*(o-r)+3*l*l*(s-o);return Math.atan2(d,u)}}function u(e,t,n,r,i,o){return function(a){var s=function(e){return e*e}(a),l=function(e){return 2*e*(1-e)}(a),c=function(e){return(1-e)*(1-e)}(a);return{x:i*s+n*l+e*c,y:o*s+r*l+t*c}}}function d(e,t,n,r,i,o){return function(a){var s=1-a,l=2*s*(n-e)+2*a*(i-n),c=2*s*(r-t)+2*a*(o-r);return Math.atan2(c,l)}}function h(e,t,n){var r,i,o={x:t,y:n},a=0;for(i=1;i<=100;i+=1)r=e(i/100),a+=s(o.x,o.y,r.x,r.y),o=r;return a}function f(e,t){for(var n,r,i,o=0,a=0,l=e.iterator,c={x:e.x,y:e.y},u=.01,d=e.angleFinder;a<t&&u>1e-4;)n=l(o),i=o,(r=s(c.x,c.y,n.x,n.y))+a>t?(o-=u,u/=2):(c=n,o+=u,a+=r);return n.angle=d(i),n}function p(e){for(var t,n,r,i,o=0,a=e.length,f=0,p=0,g=0,m=0,v=[],y=0;y<a;y++){switch(r={x:f,y:p,command:(t=e[y])[0]},t[0]){case"M":r.length=0,g=f=t[1],m=p=t[2];break;case"L":r.length=s(f,p,t[1],t[2]),f=t[1],p=t[2];break;case"C":n=l(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),i=c(f,p,t[1],t[2],t[3],t[4],t[5],t[6]),r.iterator=n,r.angleFinder=i,r.length=h(n,f,p),f=t[5],p=t[6];break;case"Q":n=u(f,p,t[1],t[2],t[3],t[4]),i=d(f,p,t[1],t[2],t[3],t[4]),r.iterator=n,r.angleFinder=i,r.length=h(n,f,p),f=t[3],p=t[4];break;case"Z":case"z":r.destX=g,r.destY=m,r.length=s(f,p,g,m),f=g,p=m}o+=r.length,v.push(r)}return v.push({length:o,x:f,y:p}),v}n.util.joinPath=function(e){return e.map(function(e){return e.join(" ")}).join(" ")},n.util.parsePath=function(e){var i,o,a,s,l,c=[],u=[],d=n.rePathCommand,h="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",f="("+h+")"+n.commaWsp,p="([01])"+n.commaWsp+"?",g=new RegExp(f+"?"+f+"?"+f+p+p+f+"?("+h+")","g");if(!e||!e.match)return c;for(var m,v=0,y=(l=e.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;v<y;v++){s=(i=l[v]).slice(1).trim(),u.length=0;var b=i.charAt(0);if(m=[b],"a"===b.toLowerCase())for(var w;w=g.exec(s);)for(var x=1;x<w.length;x++)u.push(w[x]);else for(;a=d.exec(s);)u.push(a[0]);x=0;for(var C=u.length;x<C;x++)o=parseFloat(u[x]),isNaN(o)||m.push(o);var _=t[b.toLowerCase()],S=r[b]||b;if(m.length-1>_)for(var k=1,A=m.length;k<A;k+=_)c.push([b].concat(m.slice(k,k+_))),b=S;else c.push(m)}return c},n.util.makePathSimpler=function(e){var t,n,r,i,o,s,l=0,c=0,u=e.length,d=0,h=0,f=[];for(n=0;n<u;++n){switch(r=!1,(t=e[n].slice(0))[0]){case"l":t[0]="L",t[1]+=l,t[2]+=c;case"L":l=t[1],c=t[2];break;case"h":t[1]+=l;case"H":t[0]="L",t[2]=c,l=t[1];break;case"v":t[1]+=c;case"V":t[0]="L",c=t[1],t[1]=l,t[2]=c;break;case"m":t[0]="M",t[1]+=l,t[2]+=c;case"M":l=t[1],c=t[2],d=t[1],h=t[2];break;case"c":t[0]="C",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c,t[5]+=l,t[6]+=c;case"C":o=t[3],s=t[4],l=t[5],c=t[6];break;case"s":t[0]="S",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"S":"C"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),l=t[3],c=t[4],t[0]="C",t[5]=t[3],t[6]=t[4],t[3]=t[1],t[4]=t[2],t[1]=o,t[2]=s,o=t[3],s=t[4];break;case"q":t[0]="Q",t[1]+=l,t[2]+=c,t[3]+=l,t[4]+=c;case"Q":o=t[1],s=t[2],l=t[3],c=t[4];break;case"t":t[0]="T",t[1]+=l,t[2]+=c;case"T":"Q"===i?(o=2*l-o,s=2*c-s):(o=l,s=c),t[0]="Q",l=t[1],c=t[2],t[1]=o,t[2]=s,t[3]=l,t[4]=c;break;case"a":t[0]="A",t[6]+=l,t[7]+=c;case"A":r=!0,f=f.concat(a(l,c,t)),l=t[6],c=t[7];break;case"z":case"Z":l=d,c=h}r||f.push(t),i=t[0]}return f},n.util.getSmoothPathFromPoints=function(e,t){var r,i=[],o=new n.Point(e[0].x,e[0].y),a=new n.Point(e[1].x,e[1].y),s=e.length,l=1,c=0,u=s>2;for(t=t||0,u&&(l=e[2].x<a.x?-1:e[2].x===a.x?0:1,c=e[2].y<a.y?-1:e[2].y===a.y?0:1),i.push(["M",o.x-l*t,o.y-c*t]),r=1;r<s;r++){if(!o.eq(a)){var d=o.midPointFrom(a);i.push(["Q",o.x,o.y,d.x,d.y])}o=e[r],r+1<e.length&&(a=e[r+1])}return u&&(l=o.x>e[r-2].x?1:o.x===e[r-2].x?0:-1,c=o.y>e[r-2].y?1:o.y===e[r-2].y?0:-1),i.push(["L",o.x+l*t,o.y+c*t]),i},n.util.getPathSegmentsInfo=p,n.util.getBoundsOfCurve=function(t,r,i,o,a,s,l,c){var u;if(n.cachesBoundsOfCurve&&(u=e.call(arguments),n.boundsOfCurveCache[u]))return n.boundsOfCurveCache[u];var d,h,f,p,g,m,v,y,b=Math.sqrt,w=Math.min,x=Math.max,C=Math.abs,_=[],S=[[],[]];h=6*t-12*i+6*a,d=-3*t+9*i-9*a+3*l,f=3*i-3*t;for(var k=0;k<2;++k)if(k>0&&(h=6*r-12*o+6*s,d=-3*r+9*o-9*s+3*c,f=3*o-3*r),C(d)<1e-12){if(C(h)<1e-12)continue;0<(p=-f/h)&&p<1&&_.push(p)}else!((v=h*h-4*f*d)<0)&&(0<(g=(-h+(y=b(v)))/(2*d))&&g<1&&_.push(g),0<(m=(-h-y)/(2*d))&&m<1&&_.push(m));for(var A,j,E,I=_.length,T=I;I--;)A=(E=1-(p=_[I]))*E*E*t+3*E*E*p*i+3*E*p*p*a+p*p*p*l,S[0][I]=A,j=E*E*E*r+3*E*E*p*o+3*E*p*p*s+p*p*p*c,S[1][I]=j;S[0][T]=t,S[1][T]=r,S[0][T+1]=l,S[1][T+1]=c;var O=[{x:w.apply(null,S[0]),y:w.apply(null,S[1])},{x:x.apply(null,S[0]),y:x.apply(null,S[1])}];return n.cachesBoundsOfCurve&&(n.boundsOfCurveCache[u]=O),O},n.util.getPointOnPath=function(e,t,r){r||(r=p(e));for(var i=0;t-r[i].length>0&&i<r.length-2;)t-=r[i].length,i++;var o,a=r[i],s=t/a.length,l=a.command,c=e[i];switch(l){case"M":return{x:a.x,y:a.y,angle:0};case"Z":case"z":return(o=new n.Point(a.x,a.y).lerp(new n.Point(a.destX,a.destY),s)).angle=Math.atan2(a.destY-a.y,a.destX-a.x),o;case"L":return(o=new n.Point(a.x,a.y).lerp(new n.Point(c[1],c[2]),s)).angle=Math.atan2(c[2]-a.y,c[1]-a.x),o;case"C":case"Q":return f(a,t)}},n.util.transformPath=function(e,t,r){return r&&(t=n.util.multiplyTransformMatrices(t,[1,0,0,1,-r.x,-r.y])),e.map(function(e){for(var r=e.slice(0),i={},o=1;o<e.length-1;o+=2)i.x=e[o],i.y=e[o+1],i=n.util.transformPoint(i,t),r[o]=i.x,r[o+1]=i.y;return r})}}(),function(){var e=Array.prototype.slice;function t(e,t,n){if(e&&0!==e.length){var r=e.length-1,i=t?e[r][t]:e[r];if(t)for(;r--;)n(e[r][t],i)&&(i=e[r][t]);else for(;r--;)n(e[r],i)&&(i=e[r]);return i}}n.util.array={fill:function(e,t){for(var n=e.length;n--;)e[n]=t;return e},invoke:function(t,n){for(var r=e.call(arguments,2),i=[],o=0,a=t.length;o<a;o++)i[o]=r.length?t[o][n].apply(t[o],r):t[o][n].call(t[o]);return i},min:function(e,n){return t(e,n,function(e,t){return e<t})},max:function(e,n){return t(e,n,function(e,t){return e>=t})}}}(),function(){function e(t,r,i){if(i)if(!n.isLikelyNode&&r instanceof Element)t=r;else if(r instanceof Array){t=[];for(var o=0,a=r.length;o<a;o++)t[o]=e({},r[o],i)}else if(r&&"object"==typeof r)for(var s in r)"canvas"===s||"group"===s?t[s]=null:r.hasOwnProperty(s)&&(t[s]=e({},r[s],i));else t=r;else for(var s in r)t[s]=r[s];return t}n.util.object={extend:e,clone:function(t,n){return e({},t,n)}},n.util.object.extend(n.util,n.Observable)}(),function(){function e(e,t){var n=e.charCodeAt(t);if(isNaN(n))return"";if(n<55296||n>57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var r=e.charCodeAt(t+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}n.util.string={camelize:function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},graphemeSplit:function(t){var n,r=0,i=[];for(r=0;r<t.length;r++)!1!==(n=e(t,r))&&i.push(n);return i}}}(),function(){var e=Array.prototype.slice,t=function(){},r=function(){for(var e in{toString:1})if("toString"===e)return!1;return!0}(),i=function(e,t,n){for(var i in t)i in e.prototype&&"function"==typeof e.prototype[i]&&(t[i]+"").indexOf("callSuper")>-1?e.prototype[i]=function(e){return function(){var r=this.constructor.superclass;this.constructor.superclass=n;var i=t[e].apply(this,arguments);if(this.constructor.superclass=r,"initialize"!==e)return i}}(i):e.prototype[i]=t[i],r&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function o(){}function a(t){for(var n=null,r=this;r.constructor.superclass;){var i=r.constructor.superclass.prototype[t];if(r[t]!==i){n=i;break}r=r.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):void 0}n.util.createClass=function(){var n=null,r=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"==typeof r[0]&&(n=r.shift()),s.superclass=n,s.subclasses=[],n&&(o.prototype=n.prototype,s.prototype=new o,n.subclasses.push(s));for(var l=0,c=r.length;l<c;l++)i(s,r[l],n);return s.prototype.initialize||(s.prototype.initialize=t),s.prototype.constructor=s,s.prototype.callSuper=a,s}}(),function(){var e=!!n.document.createElement("div").attachEvent,t=["touchstart","touchmove","touchend"];n.util.addListener=function(t,n,r,i){t&&t.addEventListener(n,r,!e&&i)},n.util.removeListener=function(t,n,r,i){t&&t.removeEventListener(n,r,!e&&i)},n.util.getPointer=function(e){var t=e.target,r=n.util.getScrollLeftTop(t),i=function(e){var t=e.changedTouches;return t&&t[0]?t[0]:e}(e);return{x:i.clientX+r.left,y:i.clientY+r.top}},n.util.isTouchEvent=function(e){return t.indexOf(e.type)>-1||"touch"===e.pointerType}}(),function(){var e=n.document.createElement("div"),t="string"==typeof e.style.opacity,r="string"==typeof e.style.filter,i=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(e){return e};t?o=function(e,t){return e.style.opacity=t,e}:r&&(o=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),i.test(n.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",n.filter=n.filter.replace(i,t)):n.filter+=" alpha(opacity="+100*t+")",e}),n.util.setStyle=function(e,t){var n=e.style;if(!n)return e;if("string"==typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?o(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t)if("opacity"===r)o(e,t[r]);else{var i="float"===r||"cssFloat"===r?typeof n.styleFloat>"u"?"cssFloat":"styleFloat":r;n.setProperty(i,t[r])}return e}}(),function(){var e,t,r,i,o=Array.prototype.slice,a=function(e){return o.call(e,0)};try{e=a(n.document.childNodes)instanceof Array}catch{}function s(e,t){var r=n.document.createElement(e);for(var i in t)"class"===i?r.className=t[i]:"for"===i?r.htmlFor=t[i]:r.setAttribute(i,t[i]);return r}function l(e){for(var t=0,r=0,i=n.document.documentElement,o=n.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===n.document?(t=o.scrollLeft||i.scrollLeft||0,r=o.scrollTop||i.scrollTop||0):(t+=e.scrollLeft||0,r+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:r}}e||(a=function(e){for(var t=new Array(e.length),n=e.length;n--;)t[n]=e[n];return t}),t=n.document.defaultView&&n.document.defaultView.getComputedStyle?function(e,t){var r=n.document.defaultView.getComputedStyle(e,null);return r?r[t]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n},r=n.document.documentElement.style,i="userSelect"in r?"userSelect":"MozUserSelect"in r?"MozUserSelect":"WebkitUserSelect"in r?"WebkitUserSelect":"KhtmlUserSelect"in r?"KhtmlUserSelect":"",n.util.makeElementUnselectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=n.util.falseFunction),i?e.style[i]="none":"string"==typeof e.unselectable&&(e.unselectable="on"),e},n.util.makeElementSelectable=function(e){return typeof e.onselectstart<"u"&&(e.onselectstart=null),i?e.style[i]="":"string"==typeof e.unselectable&&(e.unselectable=""),e},n.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},n.util.getById=function(e){return"string"==typeof e?n.document.getElementById(e):e},n.util.toArray=a,n.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},n.util.makeElement=s,n.util.wrapElement=function(e,t,n){return"string"==typeof t&&(t=s(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},n.util.getScrollLeftTop=l,n.util.getElementOffset=function(e){var n,r,i=e&&e.ownerDocument,o={left:0,top:0},a={left:0,top:0},s={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return a;for(var c in s)a[s[c]]+=parseInt(t(e,c),10)||0;return n=i.documentElement,typeof e.getBoundingClientRect<"u"&&(o=e.getBoundingClientRect()),r=l(e),{left:o.left+r.left-(n.clientLeft||0)+a.left,top:o.top+r.top-(n.clientTop||0)+a.top}},n.util.getNodeCanvas=function(e){var t=n.jsdomImplForWrapper(e);return t._canvas||t._image},n.util.cleanUpJsdomNode=function(e){if(n.isLikelyNode){var t=n.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}n.util.request=function(t,r){r||(r={});var i=r.method?r.method.toUpperCase():"GET",o=r.onComplete||function(){},a=new n.window.XMLHttpRequest,s=r.body||r.parameters;return a.onreadystatechange=function(){4===a.readyState&&(o(a),a.onreadystatechange=e)},"GET"===i&&(s=null,"string"==typeof r.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,r.parameters))),a.open(i,t,!0),("POST"===i||"PUT"===i)&&a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(s),a}}(),n.log=console.log,n.warn=console.warn,function(){var e=n.util.object.extend,t=n.util.object.clone,r=[];function i(){return!1}function o(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}n.util.object.extend(r,{cancelAll:function(){var e=this.splice(0);return e.forEach(function(e){e.cancel()}),e},cancelByCanvas:function(e){if(!e)return[];var t=this.filter(function(t){return"object"==typeof t.target&&t.target.canvas===e});return t.forEach(function(e){e.cancel()}),t},cancelByTarget:function(e){var t=this.findAnimationsByTarget(e);return t.forEach(function(e){e.cancel()}),t},findAnimationIndex:function(e){return this.indexOf(this.findAnimation(e))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}});var a=n.window.requestAnimationFrame||n.window.webkitRequestAnimationFrame||n.window.mozRequestAnimationFrame||n.window.oRequestAnimationFrame||n.window.msRequestAnimationFrame||function(e){return n.window.setTimeout(e,1e3/60)},s=n.window.cancelAnimationFrame||n.window.clearTimeout;function l(){return a.apply(n.window,arguments)}n.util.animate=function(r){r||(r={});var a,s=!1,c=function(){var e=n.runningAnimations.indexOf(a);return e>-1&&n.runningAnimations.splice(e,1)[0]};return a=e(t(r),{cancel:function(){return s=!0,c()},currentValue:"startValue"in r?r.startValue:0,completionRate:0,durationRate:0}),n.runningAnimations.push(a),l(function(e){var t,n=e||+new Date,u=r.duration||500,d=n+u,h=r.onChange||i,f=r.abort||i,p=r.onComplete||i,g=r.easing||o,m="startValue"in r&&r.startValue.length>0,v="startValue"in r?r.startValue:0,y="endValue"in r?r.endValue:100,b=r.byValue||(m?v.map(function(e,t){return y[t]-v[t]}):y-v);r.onStart&&r.onStart(),function e(r){var i=(t=r||+new Date)>d?u:t-n,o=i/u,w=m?v.map(function(e,t){return g(i,v[t],b[t],u)}):g(i,v,b,u),x=Math.abs(m?(w[0]-v[0])/b[0]:(w-v)/b);if(a.currentValue=m?w.slice():w,a.completionRate=x,a.durationRate=o,!s){if(f(w,x,o))return void c();if(t>d)return a.currentValue=m?y.slice():y,a.completionRate=1,a.durationRate=1,h(m?y.slice():y,1,1),p(y,1,1),void c();h(w,x,o),l(e)}}(n)}),a.cancel},n.util.requestAnimFrame=l,n.util.cancelAnimFrame=function(){return s.apply(n.window,arguments)},n.runningAnimations=r}(),function(){function e(e,t,n){var r="rgba("+parseInt(e[0]+n*(t[0]-e[0]),10)+","+parseInt(e[1]+n*(t[1]-e[1]),10)+","+parseInt(e[2]+n*(t[2]-e[2]),10);return(r+=","+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1))+")"}n.util.animateColor=function(t,r,i,o){var a=new n.Color(t).getSource(),s=new n.Color(r).getSource(),l=o.onComplete,c=o.onChange;return o=o||{},n.util.animate(n.util.object.extend(o,{duration:i||500,startValue:a,endValue:s,byValue:s,easing:function(t,n,r,i){return e(n,r,o.colorEasing?o.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,n,r){if(l)return l(e(s,s,0),n,r)},onChange:function(t,n,r){if(c){if(Array.isArray(t))return c(e(t,t,0),n,r);c(t,n,r)}}}))}}(),function(){function e(e,t,n,r){return e<Math.abs(t)?(e=t,r=n/4):r=0===t&&0===e?n/(2*Math.PI)*Math.asin(1):n/(2*Math.PI)*Math.asin(t/e),{a:e,c:t,p:n,s:r}}function t(e,t,n){return e.a*Math.pow(2,10*(t-=1))*Math.sin((t*n-e.s)*(2*Math.PI)/e.p)}function r(e,t,n,r){return n-i(r-e,0,n,r)+t}function i(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}n.util.ease={easeInQuad:function(e,t,n,r){return n*(e/=r)*e+t},easeOutQuad:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeInOutQuad:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,r){return n*(e/=r)*e*e+t},easeOutCubic:function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutQuart:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,r){return n*(e/=r)*e*e*e*e+t},easeOutQuint:function(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t},easeOutSine:function(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t},easeInOutSine:function(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t},easeInExpo:function(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t},easeOutExpo:function(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t},easeInOutExpo:function(e,t,n,r){return 0===e?t:e===r?t+n:(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t},easeInCirc:function(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t},easeOutCirc:function(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t},easeInOutCirc:function(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(n,r,i,o){var a=0;return 0===n?r:1===(n/=o)?r+i:(a||(a=.3*o),-t(e(i,i,a,1.70158),n,o)+r)},easeOutElastic:function(t,n,r,i){var o=0;if(0===t)return n;if(1===(t/=i))return n+r;o||(o=.3*i);var a=e(r,r,o,1.70158);return a.a*Math.pow(2,-10*t)*Math.sin((t*i-a.s)*(2*Math.PI)/a.p)+a.c+n},easeInOutElastic:function(n,r,i,o){var a=0;if(0===n)return r;if(2===(n/=o/2))return r+i;a||(a=o*(.3*1.5));var s=e(i,i,a,1.70158);return n<1?-.5*t(s,n,o)+r:s.a*Math.pow(2,-10*(n-=1))*Math.sin((n*o-s.s)*(2*Math.PI)/s.p)*.5+s.c+r},easeInBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),n*(e/=r)*e*((i+1)*e-i)+t},easeOutBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},easeInOutBack:function(e,t,n,r,i){return void 0===i&&(i=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(i*=1.525))*e-i))+t:n/2*((e-=2)*e*((1+(i*=1.525))*e+i)+2)+t},easeInBounce:r,easeOutBounce:i,easeInOutBounce:function(e,t,n,o){return e<o/2?.5*r(2*e,0,n,o)+t:.5*i(2*e-o,0,n,o)+.5*n+t}}}(),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,o=t.util.parseUnit,a=t.util.multiplyTransformMatrices,s={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},l={stroke:"strokeOpacity",fill:"fillOpacity"},c="font-size",u="clip-path";function d(e){return e in s?s[e]:e}function h(e,n,r,i){var s,l=Array.isArray(n);if("fill"!==e&&"stroke"!==e||"none"!==n){if("strokeUniform"===e)return"non-scaling-stroke"===n;if("strokeDashArray"===e)n="none"===n?null:n.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===e)n=r&&r.transformMatrix?a(r.transformMatrix,t.parseTransformAttribute(n)):t.parseTransformAttribute(n);else if("visible"===e)n="none"!==n&&"hidden"!==n,r&&!1===r.visible&&(n=!1);else if("opacity"===e)n=parseFloat(n),r&&typeof r.opacity<"u"&&(n*=r.opacity);else if("textAnchor"===e)n="start"===n?"left":"end"===n?"right":"center";else if("charSpacing"===e)s=o(n,i)/i*1e3;else if("paintFirst"===e){var c=n.indexOf("fill"),u=n.indexOf("stroke");n="fill",(c>-1&&u>-1&&u<c||-1===c&&u>-1)&&(n="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return n;if("imageSmoothing"===e)return"optimizeQuality"===n;s=l?n.map(o):o(n,i)}}else n="";return!l&&isNaN(s)?n:s}function f(e){return new RegExp("^("+e.join("|")+")\\b","i")}function p(e,t){var n,r,i,o,a=[];for(i=0,o=t.length;i<o;i++)n=t[i],r=e.getElementsByTagName(n),a=a.concat(Array.prototype.slice.call(r));return a}function g(e,t){var n,r=!0;return(n=m(e,t.pop()))&&t.length&&(r=function(e,t){for(var n,r=!0;e.parentNode&&1===e.parentNode.nodeType&&t.length;)r&&(n=t.pop()),r=m(e=e.parentNode,n);return 0===t.length}(e,t)),n&&r&&0===t.length}function m(e,t){var n,r,i=e.nodeName,o=e.getAttribute("class"),a=e.getAttribute("id");if(n=new RegExp("^"+i,"i"),t=t.replace(n,""),a&&t.length&&(n=new RegExp("#"+a+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"")),o&&t.length)for(r=(o=o.split(" ")).length;r--;)n=new RegExp("\\."+o[r]+"(?![a-zA-Z\\-]+)","i"),t=t.replace(n,"");return 0===t.length}function v(e,t){var n;if(e.getElementById&&(n=e.getElementById(t)),n)return n;var r,i,o,a=e.getElementsByTagName("*");for(i=0,o=a.length;i<o;i++)if(t===(r=a[i]).getAttribute("id"))return r}t.svgValidTagNamesRegEx=f(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),t.svgViewBoxElementsRegEx=f(["symbol","image","marker","pattern","view","svg"]),t.svgInvalidAncestorsRegEx=f(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),t.svgValidParentsRegEx=f(["symbol","g","a","svg","clipPath","defs"]),t.cssRules={},t.gradientDefs={},t.clipPaths={},t.parseTransformAttribute=function(){function e(e,n,r){e[r]=Math.tan(t.util.degreesToRadians(n[0]))}var n=t.iMatrix,r=t.reNum,i=t.commaWsp,o="(?:(?:(matrix)\\s*\\(\\s*("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")"+i+"("+r+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+r+")(?:"+i+"("+r+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+r+")(?:"+i+"("+r+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+r+")(?:"+i+"("+r+")"+i+"("+r+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+r+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+r+")\\s*\\)))",a=new RegExp("^\\s*(?:(?:"+o+"(?:"+i+"*"+o+")*)?)\\s*$"),s=new RegExp(o,"g");return function(r){var i=n.concat(),l=[];if(!r||r&&!a.test(r))return i;r.replace(s,function(r){var a=new RegExp(o).exec(r).filter(function(e){return!!e}),s=a[1],c=a.slice(2).map(parseFloat);switch(s){case"translate":!function(e,t){e[4]=t[0],2===t.length&&(e[5]=t[1])}(i,c);break;case"rotate":c[0]=t.util.degreesToRadians(c[0]),function(e,n){var r=t.util.cos(n[0]),i=t.util.sin(n[0]),o=0,a=0;3===n.length&&(o=n[1],a=n[2]),e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=o-(r*o-i*a),e[5]=a-(i*o+r*a)}(i,c);break;case"scale":!function(e,t){var n=t[0],r=2===t.length?t[1]:t[0];e[0]=n,e[3]=r}(i,c);break;case"skewX":e(i,c,2);break;case"skewY":e(i,c,1);break;case"matrix":i=c}l.push(i.concat()),i=n.concat()});for(var c=l[0];l.length>1;)l.shift(),c=t.util.multiplyTransformMatrices(c,l[0]);return c}}();var y=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function b(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var n,r,i,a,s,l,c=e.getAttribute("viewBox"),u=1,d=1,h=e.getAttribute("width"),f=e.getAttribute("height"),p=e.getAttribute("x")||0,g=e.getAttribute("y")||0,m=e.getAttribute("preserveAspectRatio")||"",v=!c||!(c=c.match(y)),b=!h||!f||"100%"===h||"100%"===f,w=v&&b,x={},C="",_=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=w,v&&(p||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") ",s=(e.getAttribute("transform")||"")+C,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(v)return x.width=o(h),x.height=o(f),x;if(n=-parseFloat(c[1]),r=-parseFloat(c[2]),i=parseFloat(c[3]),a=parseFloat(c[4]),x.minX=n,x.minY=r,x.viewBoxWidth=i,x.viewBoxHeight=a,b?(x.width=i,x.height=a):(x.width=o(h),x.height=o(f),u=x.width/i,d=x.height/a),"none"!==(m=t.util.parsePreserveAspectRatioAttribute(m)).alignX&&("meet"===m.meetOrSlice&&(d=u=u>d?d:u),"slice"===m.meetOrSlice&&(d=u=u>d?u:d),_=x.width-i*u,S=x.height-a*u,"Mid"===m.alignX&&(_/=2),"Mid"===m.alignY&&(S/=2),"Min"===m.alignX&&(_=0),"Min"===m.alignY&&(S=0)),1===u&&1===d&&0===n&&0===r&&0===p&&0===g)return x;if((p||g)&&"#document"!==e.parentNode.nodeName&&(C=" translate("+o(p)+" "+o(g)+") "),s=C+" matrix("+u+" 0 0 "+d+" "+(n*u+_)+" "+(r*d+S)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function w(e,t){var n="xlink:href",r=v(e,t.getAttribute(n).slice(1));if(r&&r.getAttribute(n)&&w(e,r),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(e){r&&!t.hasAttribute(e)&&r.hasAttribute(e)&&t.setAttribute(e,r.getAttribute(e))}),!t.children.length)for(var i=r.cloneNode(!0);i.firstChild;)t.appendChild(i.firstChild);t.removeAttribute(n)}t.parseSVGDocument=function(e,n,i,o){if(e){!function(e){for(var n=p(e,["use","svg:use"]),r=0;n.length&&r<n.length;){var i=n[r],o=i.getAttribute("xlink:href")||i.getAttribute("href");if(null===o)return;var a,s,l,c,u=o.slice(1),d=i.getAttribute("x")||0,h=i.getAttribute("y")||0,f=v(e,u).cloneNode(!0),g=(f.getAttribute("transform")||"")+" translate("+d+", "+h+")",m=n.length,y=t.svgNS;if(b(f),/^svg$/i.test(f.nodeName)){var w=f.ownerDocument.createElementNS(y,"g");for(s=0,c=(l=f.attributes).length;s<c;s++)a=l.item(s),w.setAttributeNS(y,a.nodeName,a.nodeValue);for(;f.firstChild;)w.appendChild(f.firstChild);f=w}for(s=0,c=(l=i.attributes).length;s<c;s++)"x"!==(a=l.item(s)).nodeName&&"y"!==a.nodeName&&"xlink:href"!==a.nodeName&&"href"!==a.nodeName&&("transform"===a.nodeName?g=a.nodeValue+" "+g:f.setAttribute(a.nodeName,a.nodeValue));f.setAttribute("transform",g),f.setAttribute("instantiated_by_use","1"),f.removeAttribute("id"),i.parentNode.replaceChild(f,i),n.length===m&&r++}}(e);var a,s,l=t.Object.__uid++,c=b(e),u=t.util.toArray(e.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===u.length&&t.isLikelyNode){var d=[];for(a=0,s=(u=e.selectNodes('//*[name(.)!="svg"]')).length;a<s;a++)d[a]=u[a];u=d}var h=u.filter(function(e){return b(e),t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))&&!function(e,t){for(;e&&(e=e.parentNode);)if(e.nodeName&&t.test(e.nodeName.replace("svg:",""))&&!e.getAttribute("instantiated_by_use"))return!0;return!1}(e,t.svgInvalidAncestorsRegEx)});if(!h||h&&!h.length)return void(n&&n([],{}));var f={};u.filter(function(e){return"clipPath"===e.nodeName.replace("svg:","")}).forEach(function(e){var n=e.getAttribute("id");f[n]=t.util.toArray(e.getElementsByTagName("*")).filter(function(e){return t.svgValidTagNamesRegEx.test(e.nodeName.replace("svg:",""))})}),t.gradientDefs[l]=t.getGradientDefs(e),t.cssRules[l]=t.getCSSRules(e),t.clipPaths[l]=f,t.parseElements(h,function(e,r){n&&(n(e,c,r,u),delete t.gradientDefs[l],delete t.cssRules[l],delete t.clipPaths[l])},r(c),i,o)}};var x=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+t.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+t.reNum+"))?\\s+(.*)");n(t,{parseFontDeclaration:function(e,t){var n=e.match(x);if(n){var r=n[1],i=n[3],a=n[4],s=n[5],l=n[6];r&&(t.fontStyle=r),i&&(t.fontWeight=isNaN(parseFloat(i))?i:parseFloat(i)),a&&(t.fontSize=o(a)),l&&(t.fontFamily=l),s&&(t.lineHeight="normal"===s?1:s)}},getGradientDefs:function(e){var t,n=p(e,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),r=0,i={};for(r=n.length;r--;)(t=n[r]).getAttribute("xlink:href")&&w(e,t),i[t.getAttribute("id")]=t;return i},parseAttributes:function(e,r,a){if(e){var s,f,p,m={};typeof a>"u"&&(a=e.getAttribute("svgUid")),e.parentNode&&t.svgValidParentsRegEx.test(e.parentNode.nodeName)&&(m=t.parseAttributes(e.parentNode,r,a));var v=r.reduce(function(t,n){return(s=e.getAttribute(n))&&(t[n]=s),t},{}),y=n(function(e,n){var r={};for(var i in t.cssRules[n])if(g(e,i.split(" ")))for(var o in t.cssRules[n][i])r[o]=t.cssRules[n][i][o];return r}(e,a),t.parseStyleAttribute(e));v=n(v,y),y[u]&&e.setAttribute(u,y[u]),f=p=m.fontSize||t.Text.DEFAULT_SVG_FONT_SIZE,v[c]&&(v[c]=f=o(v[c],p));var b,w,x={};for(var C in v)w=h(b=d(C),v[C],m,f),x[b]=w;x&&x.font&&t.parseFontDeclaration(x.font,x);var _=n(m,x);return t.svgValidParentsRegEx.test(e.nodeName)?_:function(e){for(var n in l)if(!(typeof e[l[n]]>"u"||""===e[n])){if(typeof e[n]>"u"){if(!t.Object.prototype[n])continue;e[n]=t.Object.prototype[n]}if(0!==e[n].indexOf("url(")){var r=new t.Color(e[n]);e[n]=r.setAlpha(i(r.getAlpha()*e[l[n]],2)).toRgba()}}return e}(_)}},parseElements:function(e,n,r,i,o){new t.ElementsParser(e,n,r,i,o).parse()},parseStyleAttribute:function(e){var t={},n=e.getAttribute("style");return n&&("string"==typeof n?function(e,t){var n,r;e.replace(/;\s*$/,"").split(";").forEach(function(e){var i=e.split(":");n=i[0].trim().toLowerCase(),r=i[1].trim(),t[n]=r})}(n,t):function(e,t){var n,r;for(var i in e)typeof e[i]>"u"||(n=i.toLowerCase(),r=e[i],t[n]=r)}(n,t)),t},parsePointsAttribute:function(e){if(!e)return null;var t,n,r=[];for(t=0,n=(e=(e=e.replace(/,/g," ").trim()).split(/\s+/)).length;t<n;t+=2)r.push({x:parseFloat(e[t]),y:parseFloat(e[t+1])});return r},getCSSRules:function(e){var n,r,i=e.getElementsByTagName("style"),o={};for(n=0,r=i.length;n<r;n++){var a=i[n].textContent;""!==(a=a.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&a.split("}").filter(function(e){return e.trim()}).forEach(function(e){var i=e.split("{"),a={},s=i[1].trim().split(";").filter(function(e){return e.trim()});for(n=0,r=s.length;n<r;n++){var l=s[n].split(":"),c=l[0].trim(),u=l[1].trim();a[c]=u}(e=i[0].trim()).split(",").forEach(function(e){""!==(e=e.replace(/^svg/i,"").trim())&&(o[e]?t.util.object.extend(o[e],a):o[e]=t.util.object.clone(a))})})}return o},loadSVGFromURL:function(e,n,r,i){e=e.replace(/^\n\s*/,"").trim(),new t.util.request(e,{method:"get",onComplete:function(e){var o=e.responseXML;if(!o||!o.documentElement)return n&&n(null),!1;t.parseSVGDocument(o.documentElement,function(e,t,r,i){n&&n(e,t,r,i)},r,i)}})},loadSVGFromString:function(e,n,r,i){var o=(new t.window.DOMParser).parseFromString(e.trim(),"text/xml");t.parseSVGDocument(o.documentElement,function(e,t,r,i){n(e,t,r,i)},r,i)}})}(e),n.ElementsParser=function(e,t,n,r,i,o){this.elements=e,this.callback=t,this.options=n,this.reviver=r,this.svgUid=n&&n.svgUid||0,this.parsingOptions=i,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=o},(t=n.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},t.createObjects=function(){var e=this;this.elements.forEach(function(t,n){t.setAttribute("svgUid",e.svgUid),e.createObject(t,n)})},t.findTag=function(e){return n[n.util.string.capitalize(e.tagName.replace("svg:",""))]},t.createObject=function(e,t){var r=this.findTag(e);if(r&&r.fromElement)try{r.fromElement(e,this.createCallback(t,e),this.options)}catch(e){n.log(e)}else this.checkIfDone()},t.createCallback=function(e,t){var r=this;return function(i){var o;r.resolveGradient(i,t,"fill"),r.resolveGradient(i,t,"stroke"),i instanceof n.Image&&i._originalElement&&(o=i.parsePreserveAspectRatioAttribute(t)),i._removeTransformMatrix(o),r.resolveClipPath(i,t),r.reviver&&r.reviver(t,i),r.instances[e]=i,r.checkIfDone()}},t.extractPropertyDefinition=function(e,t,r){var i=e[t],o=this.regexUrl;if(o.test(i)){o.lastIndex=0;var a=o.exec(i)[1];return o.lastIndex=0,n[r][this.svgUid][a]}},t.resolveGradient=function(e,t,r){var i=this.extractPropertyDefinition(e,r,"gradientDefs");if(i){var o=t.getAttribute(r+"-opacity"),a=n.Gradient.fromElement(i,e,o,this.options);e.set(r,a)}},t.createClipPathCallback=function(e,t){return function(e){e._removeTransformMatrix(),e.fillRule=e.clipRule,t.push(e)}},t.resolveClipPath=function(e,t){var r,i,o,a,s=this.extractPropertyDefinition(e,"clipPath","clipPaths");if(s){o=[],i=n.util.invertTransform(e.calcTransformMatrix());for(var l=s[0].parentNode,c=t;c.parentNode&&c.getAttribute("clip-path")!==e.clipPath;)c=c.parentNode;c.parentNode.appendChild(l);for(var u=0;u<s.length;u++)r=s[u],this.findTag(r).fromElement(r,this.createClipPathCallback(e,o),this.options);s=1===o.length?o[0]:new n.Group(o),a=n.util.multiplyTransformMatrices(i,s.calcTransformMatrix()),s.clipPath&&this.resolveClipPath(s,c);var d=n.util.qrDecompose(a);s.flipX=!1,s.flipY=!1,s.set("scaleX",d.scaleX),s.set("scaleY",d.scaleY),s.angle=d.angle,s.skewX=d.skewX,s.skewY=0,s.setPositionByOrigin({x:d.translateX,y:d.translateY},"center","center"),e.clipPath=s}else delete e.clipPath},t.checkIfDone=function(){0===--this.numElements&&(this.instances=this.instances.filter(function(e){return null!=e}),this.callback(this.instances,this.elements))},function(e){var t=e.fabric||(e.fabric={});function n(e,t){this.x=e,this.y=t}t.Point?t.warn("fabric.Point is already defined"):(t.Point=n,n.prototype={type:"point",constructor:n,add:function(e){return new n(this.x+e.x,this.y+e.y)},addEquals:function(e){return this.x+=e.x,this.y+=e.y,this},scalarAdd:function(e){return new n(this.x+e,this.y+e)},scalarAddEquals:function(e){return this.x+=e,this.y+=e,this},subtract:function(e){return new n(this.x-e.x,this.y-e.y)},subtractEquals:function(e){return this.x-=e.x,this.y-=e.y,this},scalarSubtract:function(e){return new n(this.x-e,this.y-e)},scalarSubtractEquals:function(e){return this.x-=e,this.y-=e,this},multiply:function(e){return new n(this.x*e,this.y*e)},multiplyEquals:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return new n(this.x/e,this.y/e)},divideEquals:function(e){return this.x/=e,this.y/=e,this},eq:function(e){return this.x===e.x&&this.y===e.y},lt:function(e){return this.x<e.x&&this.y<e.y},lte:function(e){return this.x<=e.x&&this.y<=e.y},gt:function(e){return this.x>e.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return typeof t>"u"&&(t=.5),t=Math.max(Math.min(1,t),0),new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n},clone:function(){return new n(this.x,this.y)}})}(e),function(e){var t=e.fabric||(e.fabric={});function n(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=n,t.Intersection.prototype={constructor:n,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,r,i,o){var a,s=(o.x-i.x)*(e.y-i.y)-(o.y-i.y)*(e.x-i.x),l=(r.x-e.x)*(e.y-i.y)-(r.y-e.y)*(e.x-i.x),c=(o.y-i.y)*(r.x-e.x)-(o.x-i.x)*(r.y-e.y);if(0!==c){var u=s/c,d=l/c;0<=u&&u<=1&&0<=d&&d<=1?(a=new n("Intersection")).appendPoint(new t.Point(e.x+u*(r.x-e.x),e.y+u*(r.y-e.y))):a=new n}else a=new n(0===s||0===l?"Coincident":"Parallel");return a},t.Intersection.intersectLinePolygon=function(e,t,r){var i,o,a,s,l=new n,c=r.length;for(s=0;s<c;s++)i=r[s],o=r[(s+1)%c],a=n.intersectLineLine(e,t,i,o),l.appendPoints(a.points);return l.points.length>0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var r,i=new n,o=e.length;for(r=0;r<o;r++){var a=e[r],s=e[(r+1)%o],l=n.intersectLinePolygon(a,s,t);i.appendPoints(l.points)}return i.points.length>0&&(i.status="Intersection"),i},t.Intersection.intersectPolygonRectangle=function(e,r,i){var o=r.min(i),a=r.max(i),s=new t.Point(a.x,o.y),l=new t.Point(o.x,a.y),c=n.intersectLinePolygon(o,s,e),u=n.intersectLinePolygon(s,a,e),d=n.intersectLinePolygon(a,l,e),h=n.intersectLinePolygon(l,o,e),f=new n;return f.appendPoints(c.points),f.appendPoints(u.points),f.appendPoints(d.points),f.appendPoints(h.points),f.points.length>0&&(f.status="Intersection"),f})}(e),function(e){var t=e.fabric||(e.fabric={});function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function r(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t;e in n.colorNameMap&&(e=n.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=n.sourceFromHex(e)),t||(t=n.sourceFromRgb(e)),t||(t=n.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,n,r){e/=255,n/=255,r/=255;var i,o,a,s=t.util.array.max([e,n,r]),l=t.util.array.min([e,n,r]);if(a=(s+l)/2,s===l)i=o=0;else{var c=s-l;switch(o=a>.5?c/(2-s-l):c/(s+l),s){case e:i=(n-r)/c+(n<r?6:0);break;case n:i=(r-e)/c+2;break;case r:i=(e-n)/c+4}i/=6}return[Math.round(360*i),Math.round(100*o),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(e){this._source=e},toRgb:function(){var e=this.getSource();return"rgb("+e[0]+","+e[1]+","+e[2]+")"},toRgba:function(){var e=this.getSource();return"rgba("+e[0]+","+e[1]+","+e[2]+","+e[3]+")"},toHsl:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var e=this.getSource(),t=this._rgbToHsl(e[0],e[1],e[2]);return"hsla("+t[0]+","+t[1]+"%,"+t[2]+"%,"+e[3]+")"},toHex:function(){var e,t,n,r=this.getSource();return e=1===(e=r[0].toString(16)).length?"0"+e:e,t=1===(t=r[1].toString(16)).length?"0"+t:t,n=1===(n=r[2].toString(16)).length?"0"+n:n,e.toUpperCase()+t.toUpperCase()+n.toUpperCase()},toHexa:function(){var e,t=this.getSource();return e=1===(e=(e=Math.round(255*t[3])).toString(16)).length?"0"+e:e,this.toHex()+e.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(e){var t=this.getSource();return t[3]=e,this.setSource(t),this},toGrayscale:function(){var e=this.getSource(),t=parseInt((.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),10),n=e[3];return this.setSource([t,t,t,n]),this},toBlackWhite:function(e){var t=this.getSource(),n=(.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),r=t[3];return e=e||127,n=Number(n)<Number(e)?0:255,this.setSource([n,n,n,r]),this},overlayWith:function(e){e instanceof n||(e=new n(e));var t,r=[],i=this.getAlpha(),o=this.getSource(),a=e.getSource();for(t=0;t<3;t++)r.push(Math.round(.5*o[t]+.5*a[t]));return r[3]=i,this.setSource(r),this}},t.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,t.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,t.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,t.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},t.Color.fromRgb=function(e){return n.fromSource(n.sourceFromRgb(e))},t.Color.sourceFromRgb=function(e){var t=e.match(n.reRGBa);if(t){var r=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),o=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1);return[parseInt(r,10),parseInt(i,10),parseInt(o,10),t[4]?parseFloat(t[4]):1]}},t.Color.fromRgba=n.fromRgb,t.Color.fromHsl=function(e){return n.fromSource(n.sourceFromHsl(e))},t.Color.sourceFromHsl=function(e){var t=e.match(n.reHSLa);if(t){var i,o,a,s=(parseFloat(t[1])%360+360)%360/360,l=parseFloat(t[2])/(/%$/.test(t[2])?100:1),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(0===l)i=o=a=c;else{var u=c<=.5?c*(l+1):c+l-c*l,d=2*c-u;i=r(d,u,s+1/3),o=r(d,u,s),a=r(d,u,s-1/3)}return[Math.round(255*i),Math.round(255*o),Math.round(255*a),t[4]?parseFloat(t[4]):1]}},t.Color.fromHsla=n.fromHsl,t.Color.fromHex=function(e){return n.fromSource(n.sourceFromHex(e))},t.Color.sourceFromHex=function(e){if(e.match(n.reHex)){var t=e.slice(e.indexOf("#")+1),r=3===t.length||4===t.length,i=8===t.length||4===t.length,o=r?t.charAt(0)+t.charAt(0):t.substring(0,2),a=r?t.charAt(1)+t.charAt(1):t.substring(2,4),s=r?t.charAt(2)+t.charAt(2):t.substring(4,6),l=i?r?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF";return[parseInt(o,16),parseInt(a,16),parseInt(s,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},t.Color.fromSource=function(e){var t=new n;return t.setSource(e),t})}(e),function(e){var t=e.fabric||(e.fabric={}),n=["e","se","s","sw","w","nw","n","ne","e"],r=["ns","nesw","ew","nwse"],i={},o="left",a="top",s="right",l="bottom",c="center",u={top:l,bottom:a,left:s,right:o,center:c},d=t.util.radiansToDegrees,h=Math.sign||function(e){return(e>0)-(e<0)||+e};function f(e,t){var n=e.angle+d(Math.atan2(t.y,t.x))+360;return Math.round(n%360/45)}function p(e,n){var r=n.transform.target,i=r.canvas,o=t.util.object.clone(n);o.target=r,i&&i.fire("object:"+e,o),r.fire(e,n)}function g(e,t){var n=t.canvas,r=e[n.uniScaleKey];return n.uniformScaling&&!r||!n.uniformScaling&&r}function m(e){return e.originX===c&&e.originY===c}function v(e,t,n){var r=e.lockScalingX,i=e.lockScalingY;return!!(r&&i||!t&&(r||i)&&n||r&&"x"===t||i&&"y"===t)}function y(e,t,n,r){return{e:e,transform:t,pointer:{x:n,y:r}}}function b(e){return function(t,n,r,i){var o=n.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,n.originX,n.originY),l=e(t,n,r,i);return o.setPositionByOrigin(s,n.originX,n.originY),l}}function w(e,t){return function(n,r,i,o){var a=t(n,r,i,o);return a&&p(e,y(n,r,i,o)),a}}function x(e,n,r,i,o){var a=e.target,s=a.controls[e.corner],l=a.canvas.getZoom(),c=a.padding/l,u=a.toLocalPoint(new t.Point(i,o),n,r);return u.x>=c&&(u.x-=c),u.x<=-c&&(u.x+=c),u.y>=c&&(u.y-=c),u.y<=c&&(u.y+=c),u.x-=s.offsetX,u.y-=s.offsetY,u}function C(e){return e.flipX!==e.flipY}function _(e,t,n,r,i){if(0!==e[t]){var o=i/e._getTransformedDimensions()[r]*e[n];e.set(n,o)}}function S(e,t,n,r){var i,c=t.target,u=c._getTransformedDimensions(0,c.skewY),h=x(t,t.originX,t.originY,n,r),f=Math.abs(2*h.x)-u.x,p=c.skewX;f<2?i=0:(i=d(Math.atan2(f/c.scaleX,u.y/c.scaleY)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().y;c.set("skewX",i),_(c,"skewY","scaleY","y",m)}return g}function k(e,t,n,r){var i,c=t.target,u=c._getTransformedDimensions(c.skewX,0),h=x(t,t.originX,t.originY,n,r),f=Math.abs(2*h.y)-u.y,p=c.skewY;f<2?i=0:(i=d(Math.atan2(f/c.scaleY,u.x/c.scaleX)),t.originX===o&&t.originY===l&&(i=-i),t.originX===s&&t.originY===a&&(i=-i),C(c)&&(i=-i));var g=p!==i;if(g){var m=c._getTransformedDimensions().x;c.set("skewY",i),_(c,"skewX","scaleX","x",m)}return g}function A(e,t,n,r,i){i=i||{};var o,a,s,l,c,d,f=t.target,p=f.lockScalingX,y=f.lockScalingY,b=i.by,w=g(e,f),C=v(f,b,w),_=t.gestureScale;if(C)return!1;if(_)a=t.scaleX*_,s=t.scaleY*_;else{if(o=x(t,t.originX,t.originY,n,r),c="y"!==b?h(o.x):1,d="x"!==b?h(o.y):1,t.signX||(t.signX=c),t.signY||(t.signY=d),f.lockScalingFlip&&(t.signX!==c||t.signY!==d))return!1;if(l=f._getTransformedDimensions(),w&&!b){var S=Math.abs(o.x)+Math.abs(o.y),k=t.original,A=S/(Math.abs(l.x*k.scaleX/f.scaleX)+Math.abs(l.y*k.scaleY/f.scaleY));a=k.scaleX*A,s=k.scaleY*A}else a=Math.abs(o.x*f.scaleX/l.x),s=Math.abs(o.y*f.scaleY/l.y);m(t)&&(a*=2,s*=2),t.signX!==c&&"y"!==b&&(t.originX=u[t.originX],a*=-1,t.signX=c),t.signY!==d&&"x"!==b&&(t.originY=u[t.originY],s*=-1,t.signY=d)}var j=f.scaleX,E=f.scaleY;return b?("x"===b&&f.set("scaleX",a),"y"===b&&f.set("scaleY",s)):(!p&&f.set("scaleX",a),!y&&f.set("scaleY",s)),j!==f.scaleX||E!==f.scaleY}i.scaleCursorStyleHandler=function(e,t,r){var i=g(e,r),o="";if(0!==t.x&&0===t.y?o="x":0===t.x&&0!==t.y&&(o="y"),v(r,o,i))return"not-allowed";var a=f(r,t);return n[a]+"-resize"},i.skewCursorStyleHandler=function(e,t,n){if(0!==t.x&&n.lockSkewingY||0!==t.y&&n.lockSkewingX)return"not-allowed";var i=f(n,t)%4;return r[i]+"-resize"},i.scaleSkewCursorStyleHandler=function(e,t,n){return e[n.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,n):i.scaleCursorStyleHandler(e,t,n)},i.rotationWithSnapping=w("rotating",b(function(e,t,n,r){var i=t,o=i.target,a=o.translateToOriginPoint(o.getCenterPoint(),i.originX,i.originY);if(o.lockRotation)return!1;var s,l=Math.atan2(i.ey-a.y,i.ex-a.x),c=Math.atan2(r-a.y,n-a.x),u=d(c-l+i.theta);if(o.snapAngle>0){var h=o.snapAngle,f=o.snapThreshold||h,p=Math.ceil(u/h)*h,g=Math.floor(u/h)*h;Math.abs(u-g)<f?u=g:Math.abs(u-p)<f&&(u=p)}return u<0&&(u=360+u),u%=360,s=o.angle!==u,o.angle=u,s})),i.scalingEqually=w("scaling",b(function(e,t,n,r){return A(e,t,n,r)})),i.scalingX=w("scaling",b(function(e,t,n,r){return A(e,t,n,r,{by:"x"})})),i.scalingY=w("scaling",b(function(e,t,n,r){return A(e,t,n,r,{by:"y"})})),i.scalingYOrSkewingX=function(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerX(e,t,n,r):i.scalingY(e,t,n,r)},i.scalingXOrSkewingY=function(e,t,n,r){return e[t.target.canvas.altActionKey]?i.skewHandlerY(e,t,n,r):i.scalingX(e,t,n,r)},i.changeWidth=w("resizing",b(function(e,t,n,r){var i=t.target,o=x(t,t.originX,t.originY,n,r),a=i.strokeWidth/(i.strokeUniform?i.scaleX:1),s=m(t)?2:1,l=i.width,c=Math.abs(o.x*s/i.scaleX)-a;return i.set("width",Math.max(c,0)),l!==c})),i.skewHandlerX=function(e,t,n,r){var i,l=t.target,u=l.skewX,d=t.originY;return!l.lockSkewingX&&(0===u?i=x(t,c,c,n,r).x>0?o:s:(u>0&&(i=d===a?o:s),u<0&&(i=d===a?s:o),C(l)&&(i=i===o?s:o)),t.originX=i,w("skewing",b(S))(e,t,n,r))},i.skewHandlerY=function(e,t,n,r){var i,s=t.target,u=s.skewY,d=t.originX;return!s.lockSkewingY&&(0===u?i=x(t,c,c,n,r).y>0?a:l:(u>0&&(i=d===o?a:l),u<0&&(i=d===o?l:a),C(s)&&(i=i===a?l:a)),t.originY=i,w("skewing",b(k))(e,t,n,r))},i.dragHandler=function(e,t,n,r){var i=t.target,o=n-t.offsetX,a=r-t.offsetY,s=!i.get("lockMovementX")&&i.left!==o,l=!i.get("lockMovementY")&&i.top!==a;return s&&i.set("left",o),l&&i.set("top",a),(s||l)&&p("moving",y(e,t,n,r)),s||l},i.scaleOrSkewActionName=function(e,t,n){var r=e[n.canvas.altActionKey];return 0===t.x?r?"skewX":"scaleY":0===t.y?r?"skewY":"scaleX":void 0},i.rotationStyleHandler=function(e,t,n){return n.lockRotation?"not-allowed":t.cursorStyle},i.fireEvent=p,i.wrapWithFixedAnchor=b,i.wrapWithFireEvent=w,i.getLocalPoint=x,t.controlsUtils=i}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.degreesToRadians,r=t.controlsUtils;r.renderCircleControl=function(e,t,n,r,i){r=r||{};var o,a=this.sizeX||r.cornerSize||i.cornerSize,s=this.sizeY||r.cornerSize||i.cornerSize,l=typeof r.transparentCorners<"u"?r.transparentCorners:i.transparentCorners,c=l?"stroke":"fill",u=!l&&(r.cornerStrokeColor||i.cornerStrokeColor),d=t,h=n;e.save(),e.fillStyle=r.cornerColor||i.cornerColor,e.strokeStyle=r.cornerStrokeColor||i.cornerStrokeColor,a>s?(o=a,e.scale(1,s/a),h=n*a/s):s>a?(o=s,e.scale(a/s,1),d=t*s/a):o=a,e.lineWidth=1,e.beginPath(),e.arc(d,h,o/2,0,2*Math.PI,!1),e[c](),u&&e.stroke(),e.restore()},r.renderSquareControl=function(e,t,r,i,o){i=i||{};var a=this.sizeX||i.cornerSize||o.cornerSize,s=this.sizeY||i.cornerSize||o.cornerSize,l=typeof i.transparentCorners<"u"?i.transparentCorners:o.transparentCorners,c=l?"stroke":"fill",u=!l&&(i.cornerStrokeColor||o.cornerStrokeColor),d=a/2,h=s/2;e.save(),e.fillStyle=i.cornerColor||o.cornerColor,e.strokeStyle=i.cornerStrokeColor||o.cornerStrokeColor,e.lineWidth=1,e.translate(t,r),e.rotate(n(o.angle)),e[c+"Rect"](-d,-h,a,s),u&&e.strokeRect(-d,-h,a,s),e.restore()}}(e),function(e){var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var n=e._controlsVisibility;return n&&typeof n[t]<"u"?n[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,n){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},n)},calcCornerCoords:function(e,n,r,i,o){var a,s,l,c,u=o?this.touchSizeX:this.sizeX,d=o?this.touchSizeY:this.sizeY;if(u&&d&&u!==d){var h=Math.atan2(d,u),f=Math.sqrt(u*u+d*d)/2,p=h-t.util.degreesToRadians(e),g=Math.PI/2-h-t.util.degreesToRadians(e);a=f*t.util.cos(p),s=f*t.util.sin(p),l=f*t.util.cos(g),c=f*t.util.sin(g)}else f=.7071067812*(u&&d?u:n),p=t.util.degreesToRadians(45-e),a=l=f*t.util.cos(p),s=c=f*t.util.sin(p);return{tl:{x:r-c,y:i-l},tr:{x:r+a,y:i-s},bl:{x:r-a,y:i+s},br:{x:r+c,y:i+l}}},render:function(e,n,r,i,o){"circle"===((i=i||{}).cornerStyle||o.cornerStyle)?t.controlsUtils.renderCircleControl.call(this,e,n,r,i,o):t.controlsUtils.renderSquareControl.call(this,e,n,r,i,o)}}}(e),function(){function e(e,t){var r,i,o,a,s=e.getAttribute("style"),l=e.getAttribute("offset")||0;if(l=(l=parseFloat(l)/(/%$/.test(l)?100:1))<0?0:l>1?1:l,s){var c=s.split(/\s*;\s*/);for(""===c[c.length-1]&&c.pop(),a=c.length;a--;){var u=c[a].split(/\s*:\s*/),d=u[0].trim(),h=u[1].trim();"stop-color"===d?r=h:"stop-opacity"===d&&(o=h)}}return r||(r=e.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=e.getAttribute("stop-opacity")),i=(r=new n.Color(r)).getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=i*t,{offset:l,color:r.toRgb(),opacity:o}}var t=n.util.object.clone;n.Gradient=n.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,r=this;Object.keys(e).forEach(function(t){r[t]=e[t]}),this.id?this.id+="_"+n.Object.__uid++:this.id=n.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var t in e){var r=new n.Color(e[t]);this.colorStops.push({offset:parseFloat(t),color:r.toRgb(),opacity:r.getAlpha()})}return this},toObject:function(e){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return n.util.populateWithProperties(this,t,e),t},toSVG:function(e,r){var i,o,a,s,l=t(this.coords,!0),c=(r=r||{},t(this.colorStops,!0)),u=l.r1>l.r2,d=this.gradientTransform?this.gradientTransform.concat():n.iMatrix.concat(),h=-this.offsetX,f=-this.offsetY,p=!!r.additionalTransform,g="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(c.sort(function(e,t){return e.offset-t.offset}),"objectBoundingBox"===g?(h/=e.width,f/=e.height):(h+=e.width/2,f+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(h-=e.pathOffset.x,f-=e.pathOffset.y),d[4]-=h,d[5]-=f,s='id="SVGID_'+this.id+'" gradientUnits="'+g+'"',s+=' gradientTransform="'+(p?r.additionalTransform+" ":"")+n.util.matrixToSVG(d)+'" ',"linear"===this.type?a=["<linearGradient ",s,' x1="',l.x1,'" y1="',l.y1,'" x2="',l.x2,'" y2="',l.y2,'">\n']:"radial"===this.type&&(a=["<radialGradient ",s,' cx="',u?l.x1:l.x2,'" cy="',u?l.y1:l.y2,'" r="',u?l.r1:l.r2,'" fx="',u?l.x2:l.x1,'" fy="',u?l.y2:l.y1,'">\n']),"radial"===this.type){if(u)for((c=c.concat()).reverse(),i=0,o=c.length;i<o;i++)c[i].offset=1-c[i].offset;var m=Math.min(l.r1,l.r2);if(m>0){var v=m/Math.max(l.r1,l.r2);for(i=0,o=c.length;i<o;i++)c[i].offset+=v*(1-c[i].offset)}}for(i=0,o=c.length;i<o;i++){var y=c[i];a.push("<stop ",'offset="',100*y.offset+"%",'" style="stop-color:',y.color,typeof y.opacity<"u"?";stop-opacity: "+y.opacity:";",'"/>\n')}return a.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),a.join("")},toLive:function(e){var t,r,i,o=n.util.object.clone(this.coords);if(this.type){for("linear"===this.type?t=e.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(t=e.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),r=0,i=this.colorStops.length;r<i;r++){var a=this.colorStops[r].color,s=this.colorStops[r].opacity,l=this.colorStops[r].offset;typeof s<"u"&&(a=new n.Color(a).setAlpha(s).toRgba()),t.addColorStop(l,a)}return t}}}),n.util.object.extend(n.Gradient,{fromElement:function(t,r,i,o){var a=parseFloat(i)/(/%$/.test(i)?100:1);a=a<0?0:a>1?1:a,isNaN(a)&&(a=1);var s,l,c,u,d=t.getElementsByTagName("stop"),h="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",f=t.getAttribute("gradientTransform")||"",p=[],g=0,m=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(s="linear",l=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(t)):(s="radial",l=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(t)),c=d.length;c--;)p.push(e(d[c],a));return u=n.parseTransformAttribute(f),function(e,t,n,r){var i,o;Object.keys(t).forEach(function(e){"Infinity"===(i=t[e])?o=1:"-Infinity"===i?o=0:(o=parseFloat(t[e],10),"string"==typeof i&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(o*=.01,"pixels"===r&&(("x1"===e||"x2"===e||"r2"===e)&&(o*=n.viewBoxWidth||n.width),("y1"===e||"y2"===e)&&(o*=n.viewBoxHeight||n.height)))),t[e]=o})}(0,l,o,h),"pixels"===h&&(g=-r.left,m=-r.top),new n.Gradient({id:t.getAttribute("id"),type:s,coords:l,colorStops:p,gradientUnits:h,gradientTransform:u,offsetX:g,offsetY:m})}})}(),function(){var e=n.util.toFixed;n.Pattern=n.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,t){if(e||(e={}),this.id=n.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!=typeof e.source)t&&t(this);else{var r=this;this.source=n.util.createImage(),n.util.loadImage(e.source,function(e,n){r.source=e,t&&t(r,n)},null,this.crossOrigin)}},toObject:function(t){var r,i,o=n.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?r=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(r=this.source.toDataURL()),i={type:"pattern",source:r,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,o),offsetY:e(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},n.util.populateWithProperties(this,i,t),i},toSVG:function(e){var t="function"==typeof this.source?this.source():this.source,n=t.width/e.width,r=t.height/e.height,i=this.offsetX/e.width,o=this.offsetY/e.height,a="";return("repeat-x"===this.repeat||"no-repeat"===this.repeat)&&(r=1,o&&(r+=Math.abs(o))),("repeat-y"===this.repeat||"no-repeat"===this.repeat)&&(n=1,i&&(n+=Math.abs(i))),t.src?a=t.src:t.toDataURL&&(a=t.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+i+'" y="'+o+'" width="'+n+'" height="'+r+'">\n<image x="0" y="0" width="'+t.width+'" height="'+t.height+'" xlink:href="'+a+'"></image>\n</pattern>\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;return!t||typeof t.src<"u"&&(!t.complete||0===t.naturalWidth||0===t.naturalHeight)?"":e.createPattern(t,this.repeat)}})}(),function(e){var t=e.fabric||(e.fabric={}),n=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var n in"string"==typeof e&&(e=this._parseShadow(e)),e)this[n]=e[n];this.id=t.Object.__uid++},_parseShadow:function(e){var n=e.trim(),r=t.Shadow.reOffsetsAndBlur.exec(n)||[];return{color:(n.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var r=40,i=40,o=t.Object.NUM_FRACTION_DIGITS,a=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(r=100*n((Math.abs(a.x)+this.blur)/e.width,o)+20,i=100*n((Math.abs(a.y)+this.blur)/e.height,o)+20),e.flipX&&(a.x*=-1),e.flipY&&(a.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+i+'%" height="'+(100+2*i)+'%" x="-'+r+'%" width="'+(100+2*r)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+n(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+n(a.x,o)+'" dy="'+n(a.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+s.toRgb()+'" flood-opacity="'+s.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},n=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==n[t]&&(e[t]=this[t])},this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){if(n.StaticCanvas)n.warn("fabric.StaticCanvas is already defined.");else{var e=n.util.object.extend,t=n.util.getElementOffset,r=n.util.removeFromArray,i=n.util.toFixed,o=n.util.transformPoint,a=n.util.invertTransform,s=n.util.getNodeCanvas,l=n.util.createCanvasElement,c=new Error("Could not initialize `canvas` element");n.StaticCanvas=n.util.createClass(n.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:n.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var n=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,n),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,n),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,n),t.overlayColor&&this.setOverlayColor(t.overlayColor,n),this.calcOffset()},_isRetinaScaling:function(){return n.devicePixelRatio>1&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,n.devicePixelRatio):1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=n.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,n){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),n.scale(e,e)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(e,t,n){return this.__setBgOverlayImage("overlayImage",e,t,n)},setBackgroundImage:function(e,t,n){return this.__setBgOverlayImage("backgroundImage",e,t,n)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,t,r,i){return"string"==typeof t?n.util.loadImage(t,function(t,o){if(t){var a=new n.Image(t,i);this[e]=a,a.canvas=this}r&&r(t,o)},this,i&&i.crossOrigin):(i&&t.setOptions(i),this[e]=t,t&&(t.canvas=this),r&&r(t,!1)),this},__setBgOverlayColor:function(e,t,n){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,n),this},_createCanvasElement:function(){var e=l();if(!e||(e.style||(e.style={}),typeof e.getContext>"u"))throw c;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=n.util.getById(e)||this._createCanvasElement(),n.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var n;for(var r in t=t||{},e)n=e[r],t.cssOnly||(this._setBackstoreDimension(r,e[r]),n+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(r,n);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,n,r,i=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=e,n=0,r=this._objects.length;n<r;n++)(t=this._objects[n]).group||t.setCoords(!0);return i&&i.setCoords(),o&&o.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(e,t){var n=e,r=this.viewportTransform.slice(0);e=o(e,a(this.viewportTransform)),r[0]=t,r[3]=t;var i=o(e,r);return r[4]+=n.x-i.x,r[5]+=n.y-i.y,this.setViewportTransform(r)},setZoom:function(e){return this.zoomToPoint(new n.Point(0,0),e),this},absolutePan:function(e){var t=this.viewportTransform.slice(0);return t[4]=-e.x,t[5]=-e.y,this.setViewportTransform(t)},relativePan:function(e){return this.absolutePan(new n.Point(-e.x-this.viewportTransform[4],-e.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(e){this.stateful&&e.setupState(),e._set("canvas",this),e.setCoords(),this.fire("object:added",{target:e}),e.fire("added")},_onObjectRemoved:function(e){this.fire("object:removed",{target:e}),e.fire("removed"),delete e.canvas},clearContext:function(e){return e.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var e=this.contextContainer;return this.renderCanvas(e,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=n.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var e={},t=this.width,r=this.height,i=a(this.viewportTransform);return e.tl=o({x:0,y:0},i),e.br=o({x:t,y:r},i),e.tr=new n.Point(e.br.x,e.tl.y),e.bl=new n.Point(e.tl.x,e.br.y),this.vptCoords=e,e},cancelRequestedRender:function(){this.isRendering&&(n.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(e,t){var r=this.viewportTransform,i=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(e),n.util.setImageSmoothing(e,this.imageSmoothingEnabled),this.fire("before:render",{ctx:e}),this._renderBackground(e),e.save(),e.transform(r[0],r[1],r[2],r[3],r[4],r[5]),this._renderObjects(e,t),e.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),i&&(i.canvas=this,i.shouldCache(),i._transformDone=!0,i.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(e)),this._renderOverlay(e),this.controlsAboveOverlay&&this.interactive&&this.drawControls(e),this.fire("after:render",{ctx:e})},drawClipPathOnCanvas:function(e){var t=this.viewportTransform,n=this.clipPath;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.globalCompositeOperation="destination-in",n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},_renderObjects:function(e,t){var n,r;for(n=0,r=t.length;n<r;++n)t[n]&&t[n].render(e)},_renderBackgroundOrOverlay:function(e,t){var n=this[t+"Color"],r=this[t+"Image"],i=this.viewportTransform,o=this[t+"Vpt"];if(n||r){if(n){e.save(),e.beginPath(),e.moveTo(0,0),e.lineTo(this.width,0),e.lineTo(this.width,this.height),e.lineTo(0,this.height),e.closePath(),e.fillStyle=n.toLive?n.toLive(e,this):n,o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.transform(1,0,0,1,n.offsetX||0,n.offsetY||0);var a=n.gradientTransform||n.patternTransform;a&&e.transform(a[0],a[1],a[2],a[3],a[4],a[5]),e.fill(),e.restore()}r&&(e.save(),o&&e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),r.render(e),e.restore())}},_renderBackground:function(e){this._renderBackgroundOrOverlay(e,"background")},_renderOverlay:function(e){this._renderBackgroundOrOverlay(e,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new n.Point(this.width/2,this.height/2)},centerObjectH:function(e){return this._centerObject(e,new n.Point(this.getCenterPoint().x,e.getCenterPoint().y))},centerObjectV:function(e){return this._centerObject(e,new n.Point(e.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(e){var t=this.getCenterPoint();return this._centerObject(e,t)},viewportCenterObject:function(e){var t=this.getVpCenter();return this._centerObject(e,t)},viewportCenterObjectH:function(e){var t=this.getVpCenter();return this._centerObject(e,new n.Point(t.x,e.getCenterPoint().y)),this},viewportCenterObjectV:function(e){var t=this.getVpCenter();return this._centerObject(e,new n.Point(e.getCenterPoint().x,t.y))},getVpCenter:function(){var e=this.getCenterPoint(),t=a(this.viewportTransform);return o(e,t)},_centerObject:function(e,t){return e.setPositionByOrigin(t,"center","center"),e.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(e){return this.toDatalessObject(e)},toObject:function(e){return this._toObjectMethod("toObject",e)},toDatalessObject:function(e){return this._toObjectMethod("toDatalessObject",e)},_toObjectMethod:function(t,r){var i=this.clipPath,o={version:n.version,objects:this._toObjects(t,r)};return i&&!i.excludeFromExport&&(o.clipPath=this._toObject(this.clipPath,t,r)),e(o,this.__serializeBgOverlay(t,r)),n.util.populateWithProperties(this,o,r),o},_toObjects:function(e,t){return this._objects.filter(function(e){return!e.excludeFromExport}).map(function(n){return this._toObject(n,e,t)},this)},_toObject:function(e,t,n){var r;this.includeDefaultValues||(r=e.includeDefaultValues,e.includeDefaultValues=!1);var i=e[t](n);return this.includeDefaultValues||(e.includeDefaultValues=r),i},__serializeBgOverlay:function(e,t){var n={},r=this.backgroundImage,i=this.overlayImage,o=this.backgroundColor,a=this.overlayColor;return o&&o.toObject?o.excludeFromExport||(n.background=o.toObject(t)):o&&(n.background=o),a&&a.toObject?a.excludeFromExport||(n.overlay=a.toObject(t)):a&&(n.overlay=a),r&&!r.excludeFromExport&&(n.backgroundImage=this._toObject(r,e,t)),i&&!i.excludeFromExport&&(n.overlayImage=this._toObject(i,e,t)),n},svgViewportTransformation:!0,toSVG:function(e,t){e||(e={}),e.reviver=t;var n=[];return this._setSVGPreamble(n,e),this._setSVGHeader(n,e),this.clipPath&&n.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(n,"background"),this._setSVGBgOverlayImage(n,"backgroundImage",t),this._setSVGObjects(n,t),this.clipPath&&n.push("</g>\n"),this._setSVGBgOverlayColor(n,"overlay"),this._setSVGBgOverlayImage(n,"overlayImage",t),n.push("</svg>"),n.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('<?xml version="1.0" encoding="',t.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(e,t){var r,o=t.width||this.width,a=t.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',l=n.Object.NUM_FRACTION_DIGITS;t.viewBox?s='viewBox="'+t.viewBox.x+" "+t.viewBox.y+" "+t.viewBox.width+" "+t.viewBox.height+'" ':this.svgViewportTransformation&&(r=this.viewportTransform,s='viewBox="'+i(-r[4]/r[0],l)+" "+i(-r[5]/r[3],l)+" "+i(this.width/r[0],l)+" "+i(this.height/r[3],l)+'" '),e.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',o,'" ','height="',a,'" ',s,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",n.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(t),"</defs>\n")},createSVGClipPathMarkup:function(e){var t=this.clipPath;return t?(t.clipPathId="CLIPPATH_"+n.Object.__uid++,'<clipPath id="'+t.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(e.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map(function(t){var r=e[t+"Color"];if(r&&r.toLive){var i=e[t+"Vpt"],o=e.viewportTransform,a={width:e.width/(i?o[0]:1),height:e.height/(i?o[3]:1)};return r.toSVG(a,{additionalTransform:i?n.util.matrixToSVG(o):""})}}).join("")},createSVGFontFacesMarkup:function(){var e,t,r,i,o,a,s,l,c="",u={},d=n.fontPaths,h=[];for(this._objects.forEach(function e(t){h.push(t),t._objects&&t._objects.forEach(e)}),s=0,l=h.length;s<l;s++)if(t=(e=h[s]).fontFamily,-1!==e.type.indexOf("text")&&!u[t]&&d[t]&&(u[t]=!0,e.styles))for(o in r=e.styles)for(a in i=r[o])!u[t=i[a].fontFamily]&&d[t]&&(u[t]=!0);for(var f in u)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",d[f],"');\n","\t\t}\n"].join("");return c&&(c=['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")),c},_setSVGObjects:function(e,t){var n,r,i,o=this._objects;for(r=0,i=o.length;r<i;r++)!(n=o[r]).excludeFromExport&&this._setSVGObject(e,n,t)},_setSVGObject:function(e,t,n){e.push(t.toSVG(n))},_setSVGBgOverlayImage:function(e,t,n){this[t]&&!this[t].excludeFromExport&&this[t].toSVG&&e.push(this[t].toSVG(n))},_setSVGBgOverlayColor:function(e,t){var r=this[t+"Color"],i=this.viewportTransform,o=this.width,a=this.height;if(r)if(r.toLive){var s=r.repeat,l=n.util.invertTransform(i),c=this[t+"Vpt"]?n.util.matrixToSVG(l):"";e.push('<rect transform="'+c+" translate(",o/2,",",a/2,')"',' x="',r.offsetX-o/2,'" y="',r.offsetY-a/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?r.source.width:o,'" height="',"repeat-x"===s||"no-repeat"===s?r.source.height:a,'" fill="url(#SVGID_'+r.id+')"',"></rect>\n")}else e.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',r,'"',"></rect>\n")},sendToBack:function(e){if(!e)return this;var t,n,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(t=(i=o._objects).length;t--;)n=i[t],r(this._objects,n),this._objects.unshift(n);else r(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,n,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(i=o._objects,t=0;t<i.length;t++)n=i[t],r(this._objects,n),this._objects.push(n);else r(this._objects,e),this._objects.push(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(e,t){if(!e)return this;var n,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(s=l._objects,n=0;n<s.length;n++)i=s[n],(o=this._objects.indexOf(i))>0+c&&(a=o-1,r(this._objects,i),this._objects.splice(a,0,i)),c++;else 0!==(o=this._objects.indexOf(e))&&(a=this._findNewLowerIndex(e,o,t),r(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,n){var r,i;if(n){for(r=t,i=t-1;i>=0;--i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t-1;return r},bringForward:function(e,t){if(!e)return this;var n,i,o,a,s,l=this._activeObject,c=0;if(e===l&&"activeSelection"===e.type)for(n=(s=l._objects).length;n--;)i=s[n],(o=this._objects.indexOf(i))<this._objects.length-1-c&&(a=o+1,r(this._objects,i),this._objects.splice(a,0,i)),c++;else(o=this._objects.indexOf(e))!==this._objects.length-1&&(a=this._findNewUpperIndex(e,o,t),r(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(e,t,n){var r,i,o;if(n){for(r=t,i=t+1,o=this._objects.length;i<o;++i)if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t+1;return r},moveTo:function(e,t){return r(this._objects,e),this._objects.splice(t,0,e),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(n.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),n.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),n.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),e(n.StaticCanvas.prototype,n.Observable),e(n.StaticCanvas.prototype,n.Collection),e(n.StaticCanvas.prototype,n.DataURLExporter),e(n.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=l();if(!t||!t.getContext)return null;var n=t.getContext("2d");return n&&"setLineDash"===e?typeof n.setLineDash<"u":null}}),n.StaticCanvas.prototype.toJSON=n.StaticCanvas.prototype.toObject,n.isLikelyNode&&(n.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},n.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),n.BaseBrush=n.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(e){e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,t=this.shadow,r=e.contextTop,i=e.getZoom();e&&e._isRetinaScaling()&&(i*=n.devicePixelRatio),r.shadowColor=t.color,r.shadowBlur=t.blur*i,r.shadowOffsetX=t.offsetX*i,r.shadowOffsetY=t.offsetY*i}},needsFullRender:function(){return new n.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),n.PencilBrush=n.util.createClass(n.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(e){this.canvas=e,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(e,t,n){var r=t.midPointFrom(n);return e.quadraticCurveTo(t.x,t.y,r.x,r.y),r},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(this.drawStraightLine=t.e[this.straightLineKey],(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1))if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var n=this._points,r=n.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,n[r-2],n[r-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var t=new n.Point(e.x,e.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1])||(this.drawStraightLine&&this._points.length>1&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(e),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(e){var t=new n.Point(e.x,e.y);return this._addPoint(t)},_render:function(e){var t,r,i=this._points[0],o=this._points[1];if(e=e||this.canvas.contextTop,this._saveAndTransform(e),e.beginPath(),2===this._points.length&&i.x===o.x&&i.y===o.y){var a=this.width/1e3;i=new n.Point(i.x,i.y),o=new n.Point(o.x,o.y),i.x-=a,o.x+=a}for(e.moveTo(i.x,i.y),t=1,r=this._points.length;t<r;t++)this._drawSegment(e,i,o),i=this._points[t],o=this._points[t+1];e.lineTo(i.x,i.y),e.stroke(),e.restore()},convertPointsToSVGPath:function(e){var t=this.width/1e3;return n.util.getSmoothPathFromPoints(e,t)},_isEmptySVGPath:function(e){return"M 0 0 Q 0 0 0 0 L 0 0"===n.util.joinPath(e)},createPath:function(e){var t=new n.Path(e,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,t.shadow=new n.Shadow(this.shadow)),t},decimatePoints:function(e,t){if(e.length<=2)return e;var n,r=this.canvas.getZoom(),i=Math.pow(t/r,2),o=e.length-1,a=e[0],s=[a];for(n=1;n<o-1;n++)Math.pow(a.x-e[n].x,2)+Math.pow(a.y-e[n].y,2)>=i&&(a=e[n],s.push(a));return s.push(e[o]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),n.CircleBrush=n.util.createClass(n.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),n=this.canvas.contextTop;this._saveAndTransform(n),this.dot(n,t),n.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,n=this.canvas.contextTop,r=this.points;for(this._saveAndTransform(n),e=0,t=r.length;e<t;e++)this.dot(n,r[e]);n.restore()},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(e),this._render()):this.drawDot(e))},onMouseUp:function(){var e,t,r=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var i=[];for(e=0,t=this.points.length;e<t;e++){var o=this.points[e],a=new n.Circle({radius:o.radius,left:o.x,top:o.y,originX:"center",originY:"center",fill:o.fill});this.shadow&&(a.shadow=new n.Shadow(this.shadow)),i.push(a)}var s=new n.Group(i);s.canvas=this.canvas,this.canvas.fire("before:path:created",{path:s}),this.canvas.add(s),this.canvas.fire("path:created",{path:s}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=r,this.canvas.requestRenderAll()},addPoint:function(e){var t=new n.Point(e.x,e.y),r=n.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new n.Color(this.color).setAlpha(n.util.getRandomInt(0,100)/100).toRgba();return t.radius=r,t.fill=i,this.points.push(t),t}}),n.SprayBrush=n.util.createClass(n.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(e){this.canvas=e,this.sprayChunks=[]},onMouseDown:function(e){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(e),this.render(this.sprayChunkPoints)},onMouseMove:function(e){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(e)||(this.addSprayChunk(e),this.render(this.sprayChunkPoints))},onMouseUp:function(){var e=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var t=[],r=0,i=this.sprayChunks.length;r<i;r++)for(var o=this.sprayChunks[r],a=0,s=o.length;a<s;a++){var l=new n.Rect({width:o[a].width,height:o[a].width,left:o[a].x+1,top:o[a].y+1,originX:"center",originY:"center",fill:this.color});t.push(l)}this.optimizeOverlapping&&(t=this._getOptimizedRects(t));var c=new n.Group(t);this.shadow&&c.set("shadow",new n.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:c}),this.canvas.add(c),this.canvas.fire("path:created",{path:c}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=e,this.canvas.requestRenderAll()},_getOptimizedRects:function(e){var t,n,r,i={};for(n=0,r=e.length;n<r;n++)i[t=e[n].left+""+e[n].top]||(i[t]=e[n]);var o=[];for(t in i)o.push(i[t]);return o},render:function(e){var t,n,r=this.canvas.contextTop;for(r.fillStyle=this.color,this._saveAndTransform(r),t=0,n=e.length;t<n;t++){var i=e[t];typeof i.opacity<"u"&&(r.globalAlpha=i.opacity),r.fillRect(i.x,i.y,i.width,i.width)}r.restore()},_render:function(){var e,t,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,t=this.sprayChunks.length;e<t;e++)this.render(this.sprayChunks[e]);n.restore()},addSprayChunk:function(e){this.sprayChunkPoints=[];var t,r,i,o,a=this.width/2;for(o=0;o<this.density;o++){t=n.util.getRandomInt(e.x-a,e.x+a),r=n.util.getRandomInt(e.y-a,e.y+a),i=this.dotWidthVariance?n.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var s=new n.Point(t,r);s.width=i,this.randomOpacity&&(s.opacity=n.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(s)}this.sprayChunks.push(this.sprayChunkPoints)}}),n.PatternBrush=n.util.createClass(n.PencilBrush,{getPatternSrc:function(){var e=n.util.createCanvasElement(),t=e.getContext("2d");return e.width=e.height=25,t.fillStyle=this.color,t.beginPath(),t.arc(10,10,10,0,2*Math.PI,!1),t.closePath(),t.fill(),e},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(e){return e.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle=this.getPattern(e)},createPath:function(e){var t=this.callSuper("createPath",e),r=t._getLeftTopCoords().scalarAdd(t.strokeWidth/2);return t.stroke=new n.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-r.x,offsetY:-r.y}),t}}),function(){var e=n.util.getPointer,t=n.util.degreesToRadians,r=n.util.isTouchEvent;for(var i in n.Canvas=n.util.createClass(n.StaticCanvas,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=n.PencilBrush&&new n.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var e,t,n,r=this.getActiveObjects();if(r.length>0&&!this.preserveObjectStacking){t=[],n=[];for(var i=0,o=this._objects.length;i<o;i++)e=this._objects[i],-1===r.indexOf(e)?t.push(e):n.push(e);r.length>1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){this.contextTopDirty&&!this._groupSelector&&!this.isDrawingMode&&(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,t){var r=e.calcTransformMatrix(),i=n.util.invertTransform(r),o=this.restorePointerVpt(t);return n.util.transformPoint(o,i)},isTargetTransparent:function(e,t,r){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var i=this._normalizePointer(e,{x:t,y:r}),o=Math.max(e.cacheTranslationX+i.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+i.y*e.zoomY,0);return n.util.isTransparent(e._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance)}var s=this.contextCache,l=e.selectionBackgroundColor,c=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(c[0],c[1],c[2],c[3],c[4],c[5]),e.render(s),s.restore(),e.selectionBackgroundColor=l,n.util.isTransparent(s,t,r,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey]},_shouldClearSelection:function(e,t){var n=this.getActiveObjects(),r=this._activeObject;return!t||t&&r&&n.length>1&&-1===n.indexOf(t)&&r!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&r&&r!==t},_shouldCenterTransform:function(e,t,n){var r;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?r=this.centeredScaling||e.centeredScaling:"rotate"===t&&(r=this.centeredRotation||e.centeredRotation),r?!n:n},_getOriginFromCorner:function(e,t){var n={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?n.x="right":("mr"===t||"tr"===t||"br"===t)&&(n.x="left"),"tl"===t||"mt"===t||"tr"===t?n.y="bottom":("bl"===t||"mb"===t||"br"===t)&&(n.y="top"),n},_getActionFromCorner:function(e,t,n,r){if(!t||!e)return"drag";var i=r.controls[t];return i.getActionName(n,i,r)},_setupCurrentTransform:function(e,r,i){if(r){var o=this.getPointer(e),a=r.__corner,s=r.controls[a],l=i&&a?s.getActionHandler(e,r,s):n.controlsUtils.dragHandler,c=this._getActionFromCorner(i,a,e,r),u=this._getOriginFromCorner(r,a),d=e[this.centeredKey],h={target:r,action:c,actionHandler:l,corner:a,scaleX:r.scaleX,scaleY:r.scaleY,skewX:r.skewX,skewY:r.skewY,offsetX:o.x-r.left,offsetY:o.y-r.top,originX:u.x,originY:u.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:t(r.angle),width:r.width*r.scaleX,shiftKey:e.shiftKey,altKey:d,original:n.util.saveObjectTransform(r)};this._shouldCenterTransform(r,c,d)&&(h.originX="center",h.originY="center"),h.original.originX=u.x,h.original.originY=u.y,this._currentTransform=h,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var t=this._groupSelector,r=new n.Point(t.ex,t.ey),i=n.util.transformPoint(r,this.viewportTransform),o=new n.Point(t.ex+t.left,t.ey+t.top),a=n.util.transformPoint(o,this.viewportTransform),s=Math.min(i.x,a.x),l=Math.min(i.y,a.y),c=Math.max(i.x,a.x),u=Math.max(i.y,a.y),d=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,l,c-s,u-l)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=d,l+=d,c-=d,u-=d,n.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,l,c-s,u-l))},findTarget:function(e,t){if(!this.skipTargetFind){var n,i,o=this.getPointer(e,!0),a=this._activeObject,s=this.getActiveObjects(),l=r(e),c=s.length>1&&!t||1===s.length;if(this.targets=[],c&&a._findTargetCorner(o,l)||s.length>1&&!t&&a===this._searchPossibleTargets([a],o))return a;if(1===s.length&&a===this._searchPossibleTargets([a],o)){if(!this.preserveObjectStacking)return a;n=a,i=this.targets,this.targets=[]}var u=this._searchPossibleTargets(this._objects,o);return e[this.altSelectionKey]&&u&&n&&u!==n&&(u=n,this.targets=i),u}},_checkTarget:function(e,t,n){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,n.x,n.y))return!0}},_searchPossibleTargets:function(e,t){for(var r,i,o=e.length;o--;){var a=e[o],s=a.group?this._normalizePointer(a.group,t):t;if(this._checkTarget(s,a,t)){(r=e[o]).subTargetCheck&&r instanceof n.Group&&(i=this._searchPossibleTargets(r._objects,t))&&this.targets.push(i);break}}return r},restorePointerVpt:function(e){return n.util.transformPoint(e,n.util.invertTransform(this.viewportTransform))},getPointer:function(t,n){if(this._absolutePointer&&!n)return this._absolutePointer;if(this._pointer&&n)return this._pointer;var r,i=e(t),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,l=a.height||0;(!s||!l)&&("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),i.x=i.x-this._offset.left,i.y=i.y-this._offset.top,n||(i=this.restorePointerVpt(i));var c=this.getRetinaScaling();return 1!==c&&(i.x/=c,i.y/=c),r=0===s||0===l?{width:1,height:1}:{width:o.width/s,height:o.height/l},{x:i.x*r.width,y:i.y*r.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),t=this.lowerCanvasEl,r=this.upperCanvasEl;r?r.className="":(r=this._createCanvasElement(),this.upperCanvasEl=r),n.util.addClass(r,"upper-canvas "+e),this.wrapperEl.appendChild(r),this._copyCanvasStyle(t,r),this._applyCanvasStyle(r),this.contextTop=r.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=n.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),n.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),n.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var t=this.width||e.width,r=this.height||e.height;n.util.setStyle(e,{position:"absolute",width:t+"px",height:r+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=t,e.height=r,n.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var n=!1,r=this.getActiveObjects(),i=[],o=[];e.forEach(function(e){-1===r.indexOf(e)&&(n=!0,e.fire("deselected",{e:t,target:e}),o.push(e))}),r.forEach(function(r){-1===e.indexOf(r)&&(n=!0,r.fire("selected",{e:t,target:r}),i.push(r))}),e.length>0&&r.length>0?n&&this.fire("selection:updated",{e:t,selected:i,deselected:o}):r.length>0?this.fire("selection:created",{e:t,selected:i}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:o})},setActiveObject:function(e,t){var n=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(n,t),this},_setActiveObject:function(e,t){return!(this._activeObject===e||!this._discardActiveObject(t,e)||e.onSelect({e:t}))&&(this._activeObject=e,!0)},_discardActiveObject:function(e,t){var n=this._activeObject;if(n){if(n.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),n=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:n,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){n.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,n.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(e),i=this.callSuper("_toObject",e,t,n);return this._unwindGroupTransformOnObject(e,r),i},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var t={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(n){t[n]=e[n]}),n.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,n),this._unwindGroupTransformOnObject(t,r)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),n.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),n.StaticCanvas)"prototype"!==i&&(n.Canvas[i]=n.StaticCanvas[i])}(),function(){var e=n.util.addListener,t=n.util.removeListener,r={passive:!1};function i(e,t){return e.button&&e.button===t-1}n.util.object.extend(n.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,t){var i=this.upperCanvasEl,o=this._getEventPrefix();e(n.window,"resize",this._onResize),e(i,o+"down",this._onMouseDown),e(i,o+"move",this._onMouseMove,r),e(i,o+"out",this._onMouseOut),e(i,o+"enter",this._onMouseEnter),e(i,"wheel",this._onMouseWheel),e(i,"contextmenu",this._onContextMenu),e(i,"dblclick",this._onDoubleClick),e(i,"dragover",this._onDragOver),e(i,"dragenter",this._onDragEnter),e(i,"dragleave",this._onDragLeave),e(i,"drop",this._onDrop),this.enablePointerEvents||e(i,"touchstart",this._onTouchStart,r),typeof eventjs<"u"&&t in eventjs&&(eventjs[t](i,"gesture",this._onGesture),eventjs[t](i,"drag",this._onDrag),eventjs[t](i,"orientation",this._onOrientationChange),eventjs[t](i,"shake",this._onShake),eventjs[t](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(t,"remove");var e=this._getEventPrefix();t(n.document,e+"up",this._onMouseUp),t(n.document,"touchend",this._onTouchEnd,r),t(n.document,e+"move",this._onMouseMove,r),t(n.document,"touchmove",this._onMouseMove,r)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var n=this;this._hoveredTargets.forEach(function(r){n.fire("mouse:out",{target:t,e:e}),r&&t.fire("mouseout",{e:e})}),this._hoveredTargets=[]},_onMouseEnter:function(e){!this._currentTransform&&!this.findTarget(e)&&(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onDrop:function(e){return this._simpleEventHandler("drop:before",e),this._simpleEventHandler("drop",e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(i){i.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(i)),this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();e(n.document,"touchend",this._onTouchEnd,r),e(n.document,"touchmove",this._onMouseMove,r),t(o,a+"down",this._onMouseDown)},_onMouseDown:function(i){this.__onMouseDown(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();t(o,a+"move",this._onMouseMove,r),e(n.document,a+"up",this._onMouseUp),e(n.document,a+"move",this._onMouseMove,r)},_onTouchEnd:function(i){if(!(i.touches.length>0)){this.__onMouseUp(i),this._resetTransformEventData(),this.mainTouchId=null;var o=this._getEventPrefix();t(n.document,"touchend",this._onTouchEnd,r),t(n.document,"touchmove",this._onMouseMove,r);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){e(a.upperCanvasEl,o+"down",a._onMouseDown),a._willAddMouseDown=0},400)}},_onMouseUp:function(i){this.__onMouseUp(i),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(i)&&(t(n.document,a+"up",this._onMouseUp),t(n.document,a+"move",this._onMouseMove,r),e(o,a+"move",this._onMouseMove,r))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!=!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var t,r=this._currentTransform,o=this._groupSelector,a=!1,s=!o||0===o.left&&0===o.top;if(this._cacheTransformEventData(e),t=this._target,this._handleEvent(e,"up:before"),i(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,s);else{if(i(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(r&&(this._finalizeCurrentTransform(e),a=r.actionPerformed),!s){var l=t===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(t)||!l&&t===this._activeObject)}var c,u;if(t){if(c=t._findTargetCorner(this.getPointer(e,!0),n.util.isTouchEvent(e)),t.selectable&&t!==this._activeObject&&"up"===t.activeOn)this.setActiveObject(t,e),a=!0;else{var d=t.controls[c],h=d&&d.getMouseUpHandler(e,t,d);h&&h(e,r,(u=this.getPointer(e)).x,u.y)}t.isMoving=!1}if(r&&(r.target!==t||r.corner!==c)){var f=r.target&&r.target.controls[r.corner],p=f&&f.getMouseUpHandler(e,t,d);u=u||this.getPointer(e),p&&p(e,r,u.x,u.y)}this._setCursorFromEvent(e,t),this._handleEvent(e,"up",1,s),this._groupSelector=null,this._currentTransform=null,t&&(t.__corner=0),a?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var n=this.findTarget(t),r=this.targets,i={e:t,target:n,subTargets:r};if(this.fire(e,i),n&&n.fire(e,i),!r)return n;for(var o=0;o<r.length;o++)r[o].fire(e,i);return n},_handleEvent:function(e,t,n,r){var i=this._target,o=this.targets||[],a={e:e,target:i,subTargets:o,button:n||1,isClick:r||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===t&&(a.currentTarget=this.findTarget(e),a.currentSubTargets=this.targets),this.fire("mouse:"+t,a),i&&i.fire("mouse"+t,a);for(var s=0;s<o.length;s++)o[s].fire("mouse"+t,a)},_finalizeCurrentTransform:function(e){var t=this._currentTransform,n=t.target,r={e:e,target:n,transform:t,action:t.action};n._scaling&&(n._scaling=!1),n.setCoords(),(t.actionPerformed||this.stateful&&n.hasStateChanged())&&this._fire("modified",r)},_onMouseDownInDrawingMode:function(e){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(e).requestRenderAll();var t=this.getPointer(e);this.freeDrawingBrush.onMouseDown(t,{e:e,pointer:t}),this._handleEvent(e,"down")},_onMouseMoveInDrawingMode:function(e){if(this._isCurrentlyDrawing){var t=this.getPointer(e);this.freeDrawingBrush.onMouseMove(t,{e:e,pointer:t})}this.setCursor(this.freeDrawingCursor),this._handleEvent(e,"move")},_onMouseUpInDrawingMode:function(e){var t=this.getPointer(e);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:e,pointer:t}),this._handleEvent(e,"up")},__onMouseDown:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"down:before");var t=this._target;if(i(e,3))this.fireRightClick&&this._handleEvent(e,"down",3);else if(i(e,2))this.fireMiddleClick&&this._handleEvent(e,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(e);else if(this._isMainEvent(e)&&!this._currentTransform){var r=this._pointer;this._previousPointer=r;var o=this._shouldRender(t),a=this._shouldGroup(e,t);if(this._shouldClearSelection(e,t)?this.discardActiveObject(e):a&&(this._handleGrouping(e,t),t=this._activeObject),this.selection&&(!t||!t.selectable&&!t.isEditing&&t!==this._activeObject)&&(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),t){var s=t===this._activeObject;t.selectable&&"down"===t.activeOn&&this.setActiveObject(t,e);var l=t._findTargetCorner(this.getPointer(e,!0),n.util.isTouchEvent(e));if(t.__corner=l,t===this._activeObject&&(l||!a)){this._setupCurrentTransform(e,t,s);var c=t.controls[l],u=(r=this.getPointer(e),c&&c.getMouseDownHandler(e,t,c));u&&u(e,this._currentTransform,r.x,r.y)}}this._handleEvent(e,"down"),(o||a)&&this.requestRenderAll()}},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(e){this._resetTransformEventData(),this._pointer=this.getPointer(e,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(e)||null},_beforeTransform:function(e){var t=this._currentTransform;this.stateful&&t.target.saveState(),this.fire("before:transform",{e:e,transform:t})},__onMouseMove:function(e){var t,n;if(this._handleEvent(e,"move:before"),this._cacheTransformEventData(e),this.isDrawingMode)this._onMouseMoveInDrawingMode(e);else if(this._isMainEvent(e)){var r=this._groupSelector;r?(n=this._absolutePointer,r.left=n.x-r.ex,r.top=n.y-r.ey,this.renderTop()):this._currentTransform?this._transformObject(e):(t=this.findTarget(e)||null,this._setCursorFromEvent(e,t),this._fireOverOutEvents(t,e)),this._handleEvent(e,"move"),this._resetTransformEventData()}},_fireOverOutEvents:function(e,t){var n=this._hoveredTarget,r=this._hoveredTargets,i=this.targets,o=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:r[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=e,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(e,t){var n=this._draggedoverTarget,r=this._hoveredTargets,i=this.targets,o=Math.max(r.length,i.length);this.fireSyntheticInOutEvents(e,t,{oldTarget:n,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<o;a++)this.fireSyntheticInOutEvents(i[a],t,{oldTarget:r[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=e},fireSyntheticInOutEvents:function(e,t,n){var r,i,o,a=n.oldTarget,s=a!==e,l=n.canvasEvtIn,c=n.canvasEvtOut;s&&(r={e:t,target:e,previousTarget:a},i={e:t,target:a,nextTarget:e}),o=e&&s,a&&s&&(c&&this.fire(c,i),a.fire(n.evtOut,i)),o&&(l&&this.fire(l,r),e.fire(n.evtIn,r))},__onMouseWheel:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"wheel"),this._resetTransformEventData()},_transformObject:function(e){var t=this.getPointer(e),n=this._currentTransform;n.reset=!1,n.shiftKey=e.shiftKey,n.altKey=e[this.centeredKey],this._performTransformAction(e,n,t),n.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(e,t,n){var r=n.x,i=n.y,o=t.action,a=!1,s=t.actionHandler;s&&(a=s(e,t,r,i)),"drag"===o&&a&&(t.target.isMoving=!0,this.setCursor(t.target.moveCursor||this.moveCursor)),t.actionPerformed=t.actionPerformed||a},_fire:n.controlsUtils.fireEvent,_setCursorFromEvent:function(e,t){if(!t)return this.setCursor(this.defaultCursor),!1;var n=t.hoverCursor||this.hoverCursor,r=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,i=(!r||!r.contains(t))&&t._findTargetCorner(this.getPointer(e,!0));i?this.setCursor(this.getCornerCursor(i,t,e)):(t.subTargetCheck&&this.targets.concat().reverse().map(function(e){n=e.hoverCursor||n}),this.setCursor(n))},getCornerCursor:function(e,t,n){var r=t.controls[e];return r.cursorStyleHandler(n,r,t)}})}(),function(){var e=Math.min,t=Math.max;n.util.object.extend(n.Canvas.prototype,{_shouldGroup:function(e,t){var n=this._activeObject;return n&&this._isSelectionKeyPressed(e)&&t&&t.selectable&&this.selection&&(n!==t||"activeSelection"===n.type)&&!t.onSelect({e:e})},_handleGrouping:function(e,t){var n=this._activeObject;n.__corner||t===n&&(!(t=this.findTarget(e,!0))||!t.selectable)||(n&&"activeSelection"===n.type?this._updateActiveSelection(t,e):this._createActiveSelection(t,e))},_updateActiveSelection:function(e,t){var n=this._activeObject,r=n._objects.slice(0);n.contains(e)?(n.removeWithUpdate(e),this._hoveredTarget=e,this._hoveredTargets=this.targets.concat(),1===n.size()&&this._setActiveObject(n.item(0),t)):(n.addWithUpdate(e),this._hoveredTarget=n,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(r,t)},_createActiveSelection:function(e,t){var n=this.getActiveObjects(),r=this._createGroup(e);this._hoveredTarget=r,this._setActiveObject(r,t),this._fireSelectionEvents(n,t)},_createGroup:function(e){var t=this._objects,r=t.indexOf(this._activeObject)<t.indexOf(e)?[this._activeObject,e]:[e,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new n.ActiveSelection(r,{canvas:this})},_groupSelectedObjects:function(e){var t,r=this._collectObjects(e);1===r.length?this.setActiveObject(r[0],e):r.length>1&&(t=new n.ActiveSelection(r.reverse(),{canvas:this}),this.setActiveObject(t,e))},_collectObjects:function(r){for(var i,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,l=a+this._groupSelector.left,c=s+this._groupSelector.top,u=new n.Point(e(a,l),e(s,c)),d=new n.Point(t(a,l),t(s,c)),h=!this.selectionFullyContained,f=a===l&&s===c,p=this._objects.length;p--&&!((i=this._objects[p])&&i.selectable&&i.visible&&(h&&i.intersectsWithRect(u,d,!0)||i.isContainedWithinRect(u,d,!0)||h&&i.containsPoint(u,null,!0)||h&&i.containsPoint(d,null,!0))&&(o.push(i),f)););return o.length>1&&(o=o.filter(function(e){return!e.onSelect({e:r})})),o},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),n.util.object.extend(n.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var t=e.format||"png",r=e.quality||1,i=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(i,e);return n.util.toDataURL(o,t,r)},toCanvasElement:function(e,t){e=e||1;var r=((t=t||{}).width||this.width)*e,i=(t.height||this.height)*e,o=this.getZoom(),a=this.width,s=this.height,l=o*e,c=this.viewportTransform,u=(c[4]-(t.left||0))*e,d=(c[5]-(t.top||0))*e,h=this.interactive,f=[l,0,0,l,u,d],p=this.enableRetinaScaling,g=n.util.createCanvasElement(),m=this.contextTop;return g.width=r,g.height=i,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=f,this.width=r,this.height=i,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=c,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=h,this.enableRetinaScaling=p,this.contextTop=m,g}}),n.util.object.extend(n.StaticCanvas.prototype,{loadFromJSON:function(e,t,r){if(e){var i="string"==typeof e?JSON.parse(e):n.util.object.clone(e),o=this,a=i.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete i.clipPath,this._enlivenObjects(i.objects,function(e){o.clear(),o._setBgOverlay(i,function(){a?o._enlivenObjects([a],function(n){o.clipPath=n[0],o.__setupCanvas.call(o,i,e,s,t)}):o.__setupCanvas.call(o,i,e,s,t)})},r),this}},__setupCanvas:function(e,t,n,r){var i=this;t.forEach(function(e,t){i.insertAt(e,t)}),this.renderOnAddRemove=n,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),r&&r()},_setBgOverlay:function(e,t){var n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var r=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,n,r),this.__setBgOverlay("overlayImage",e.overlayImage,n,r),this.__setBgOverlay("backgroundColor",e.background,n,r),this.__setBgOverlay("overlayColor",e.overlay,n,r)}else t&&t()},__setBgOverlay:function(e,t,r,i){var o=this;if(!t)return r[e]=!0,void(i&&i());"backgroundImage"===e||"overlayImage"===e?n.util.enlivenObjects([t],function(t){o[e]=t[0],r[e]=!0,i&&i()}):this["set"+n.util.string.capitalize(e,!0)](t,function(){r[e]=!0,i&&i()})},_enlivenObjects:function(e,t,r){e&&0!==e.length?n.util.enlivenObjects(e,function(e){t&&t(e)},null,r):t&&t([])},_toDataURL:function(e,t){this.clone(function(n){t(n.toDataURL(e))})},_toDataURLWithMultiplier:function(e,t,n){this.clone(function(r){n(r.toDataURLWithMultiplier(e,t))})},clone:function(e,t){var n=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(n,function(){e&&e(t)})})},cloneWithoutData:function(e){var t=n.util.createCanvasElement();t.width=this.width,t.height=this.height;var r=new n.Canvas(t);this.backgroundImage?(r.setBackgroundImage(this.backgroundImage.src,function(){r.renderAll(),e&&e(r)}),r.backgroundImageOpacity=this.backgroundImageOpacity,r.backgroundImageStretch=this.backgroundImageStretch):e&&e(r)}}),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,o=t.util.string.capitalize,a=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var n=t.perfLimitSizeTotal,r=e.width,i=e.height,o=t.maxCacheSideLimit,a=t.minCacheSideLimit;if(r<=o&&i<=o&&r*i<=n)return r<a&&(e.width=a),i<a&&(e.height=a),e;var s=r/i,l=t.util.limitDimsByArea(s,n),c=t.util.capValue,u=c(a,l.x,o),d=c(a,l.y,o);return r>u&&(e.zoomX/=r/u,e.width=u,e.capped=!0),i>d&&(e.zoomY/=i/d,e.height=d,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),n=t.x*e.scaleX/this.scaleX,r=t.y*e.scaleY/this.scaleY;return{width:n+2,height:r+2,zoomX:e.scaleX,zoomY:e.scaleY,x:n,y:r}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var n=e._currentTransform.target,r=e._currentTransform.action;if(this===n&&r.slice&&"scale"===r.slice(0,5))return!1}var i,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,c=s.width,u=s.height,d=s.zoomX,h=s.zoomY,f=c!==this.cacheWidth||u!==this.cacheHeight,p=this.zoomX!==d||this.zoomY!==h,g=f||p,m=0,v=0,y=!1;if(f){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=c>b||u>w;y=x||(c<.9*b||u<.9*w)&&b>l&&w>l,x&&!s.capped&&(c>l||u>l)&&(m=.1*c,v=.1*u)}return this instanceof t.Text&&this.path&&(g=!0,y=!0,m+=this.getHeightOfLine(0)*this.zoomX,v+=this.getHeightOfLine(0)*this.zoomY),!!g&&(y?(a.width=Math.ceil(c+m),a.height=Math.ceil(u+v)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),i=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-i)+i,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=c,this.cacheHeight=u,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(d,h),this.zoomX=d,this.zoomY=h,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,n=this.calcTransformMatrix(!t);e.transform(n[0],n[1],n[2],n[3],n[4],n[5])},toObject:function(e){var n=t.Object.NUM_FRACTION_DIGITS,r={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,n),top:i(this.top,n),width:i(this.width,n),height:i(this.height,n),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,n),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,n),scaleX:i(this.scaleX,n),scaleY:i(this.scaleY,n),angle:i(this.angle,n),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,n),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,n),skewY:i(this.skewY,n)};return this.clipPath&&!this.clipPath.excludeFromExport&&(r.clipPath=this.clipPath.toObject(e),r.clipPath.inverted=this.clipPath.inverted,r.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,r,e),this.includeDefaultValues||(r=this._removeDefaultValues(r)),r},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var n=t.util.getKlass(e.type).prototype;return n.stateProperties.forEach(function(t){"left"===t||"top"===t||(e[t]===n[t]&&delete e[t],Array.isArray(e[t])&&Array.isArray(n[t])&&0===e[t].length&&0===n[t].length&&delete e[t])}),e},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,n=e.scaleY;if(this.canvas){var r=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=r*i,n*=r*i}return{scaleX:t,scaleY:n}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,n){var r="scaleX"===e||"scaleY"===e,i=this[e]!==n,o=!1;return r&&(n=this._constrainScale(n)),"scaleX"===e&&n<0?(this.flipX=!this.flipX,n*=-1):"scaleY"===e&&n<0?(this.flipY=!this.flipY,n*=-1):"shadow"!==e||!n||n instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",n):n=new t.Shadow(n),this[e]=n,i&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},(!this._cacheCanvas||!this._cacheContext)&&this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!!("stroke"===this.paintFirst&&this.hasFill()&&this.hasStroke()&&"object"==typeof this.shadow||this.clipPath)},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e,n){if(e.save(),n.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",n.absolutePositioned){var r=t.util.invertTransform(this.calcTransformMatrix());e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},drawObject:function(e,t){var n=this.fill,r=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e,this.clipPath),this.fill=n,this.stroke=r},_drawClipPath:function(e,t){t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e,t))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&this._cacheContext&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&this._cacheContext&&!e){var t=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-n/2,t,n)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var n=t.stroke;n&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(e,n):(e.strokeStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var n=t.fill;n&&(n.toLive?(e.fillStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=n)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){!t||0===t.length||(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,n){var r,i,o,s=this.getViewportTransform(),l=this.calcTransformMatrix();i=typeof(n=n||{}).hasBorders<"u"?n.hasBorders:this.hasBorders,o=typeof n.hasControls<"u"?n.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),r=t.util.qrDecompose(l),e.save(),e.translate(r.translateX,r.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(r.angle-=180),e.rotate(a(this.group?r.angle:this.angle)),n.forActiveSelection||this.group?i&&this.drawBordersInGroup(e,r,n):i&&this.drawBorders(e,n),o&&this.drawControls(e,n),e.restore()},_setShadow:function(e){if(this.shadow){var n,r=this.shadow,i=this.canvas,o=i&&i.viewportTransform[0]||1,a=i&&i.viewportTransform[3]||1;n=r.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(o*=t.devicePixelRatio,a*=t.devicePixelRatio),e.shadowColor=r.color,e.shadowBlur=r.blur*t.browserShadowBlurConstant*(o+a)*(n.scaleX+n.scaleY)/4,e.shadowOffsetX=r.offsetX*o*n.scaleX,e.shadowOffsetY=r.offsetY*a*n.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var n=t.gradientTransform||t.patternTransform,r=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,r,i):e.transform(1,0,0,1,r,i),n&&e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:r,offsetY:i}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,n){var r,i=this._limitCacheSize(this._getCacheCanvasDimensions()),o=t.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=i.x/this.scaleX/a,l=i.y/this.scaleY/a;o.width=s,o.height=l,(r=o.getContext("2d")).beginPath(),r.moveTo(0,0),r.lineTo(s,0),r.lineTo(s,l),r.lineTo(0,l),r.closePath(),r.translate(s/2,l/2),r.scale(i.zoomX/this.scaleX/a,i.zoomY/this.scaleY/a),this._applyPatternGradientTransform(r,n),r.fillStyle=n.toLive(e),r.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(a*this.scaleX/i.zoomX,a*this.scaleY/i.zoomY),e.strokeStyle=r.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var n=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),n=t.util.transformPoint(n,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,n.x+=e.offsetLeft,n.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(n,"center","center")},clone:function(e,n){var r=this.toObject(n);this.constructor.fromObject?this.constructor.fromObject(r,e):t.Object._fromObject("Object",r,e)},cloneAsImage:function(e,n){var r=this.toCanvasElement(n);return e&&e(new t.Image(r)),this},toCanvasElement:function(e){e||(e={});var n=t.util,r=n.saveObjectTransform(this),i=this.group,o=this.shadow,a=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&n.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,c,u,d,h=t.util.createCanvasElement(),f=this.getBoundingRect(!0,!0),p=this.shadow,g={x:0,y:0};p&&(c=p.blur,l=p.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(a(p.offsetX)+c)*a(l.scaleX),g.y=2*Math.round(a(p.offsetY)+c)*a(l.scaleY)),u=f.width+g.x,d=f.height+g.y,h.width=Math.ceil(u),h.height=Math.ceil(d);var m=new t.StaticCanvas(h,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(m.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(m.width/2,m.height/2),"center","center");var v=this.canvas;m.add(this);var y=m.toCanvasElement(s||1,e);return this.shadow=o,this.set("canvas",v),i&&(this.group=i),this.set(r).setCoords(),m._objects=[],m.dispose(),m=null,y},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return arguments.length>1?Array.from(arguments).includes(this.type):this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,n){n=n||this.canvas.getPointer(e);var r=new t.Point(n.x,n.y),i=this._getLeftTopCoords();return this.angle&&(r=t.util.rotatePoint(r,i,a(-this.angle))),{x:r.x-i.x,y:r.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){t.runningAnimations&&t.runningAnimations.cancelByTarget(this)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),n(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object.ENLIVEN_PROPS=["clipPath"],t.Object._fromObject=function(e,n,i,o){var a=t[e];n=r(n,!0),t.util.enlivenPatterns([n.fill,n.stroke],function(e){typeof e[0]<"u"&&(n.fill=e[0]),typeof e[1]<"u"&&(n.stroke=e[1]),t.util.enlivenObjectEnlivables(n,n,function(){var e=o?new a(n[o],n):new a(n);i&&i(e)})})},t.Object.__uid=0)}(e),function(){var e=n.util.degreesToRadians,t={left:-.5,center:0,right:.5},r={top:-.5,center:0,bottom:.5};n.util.object.extend(n.Object.prototype,{translateToGivenOrigin:function(e,i,o,a,s){var l,c,u,d=e.x,h=e.y;return"string"==typeof i?i=t[i]:i-=.5,"string"==typeof a?a=t[a]:a-=.5,"string"==typeof o?o=r[o]:o-=.5,"string"==typeof s?s=r[s]:s-=.5,c=s-o,((l=a-i)||c)&&(u=this._getTransformedDimensions(),d=e.x+l*u.x,h=e.y+c*u.y),new n.Point(d,h)},translateToCenterPoint:function(t,r,i){var o=this.translateToGivenOrigin(t,r,i,"center","center");return this.angle?n.util.rotatePoint(o,t,e(this.angle)):o},translateToOriginPoint:function(t,r,i){var o=this.translateToGivenOrigin(t,"center","center",r,i);return this.angle?n.util.rotatePoint(o,t,e(this.angle)):o},getCenterPoint:function(){var e=new n.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var n=this.getCenterPoint();return this.translateToOriginPoint(n,e,t)},toLocalPoint:function(t,r,i){var o,a,s=this.getCenterPoint();return o=typeof r<"u"&&typeof i<"u"?this.translateToGivenOrigin(s,"center","center",r,i):new n.Point(this.left,this.top),a=new n.Point(t.x,t.y),this.angle&&(a=n.util.rotatePoint(a,s,-e(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(e,t,n){var r=this.translateToCenterPoint(e,t,n),i=this.translateToOriginPoint(r,this.originX,this.originY);this.set("left",i.x),this.set("top",i.y)},adjustPosition:function(r){var i,o,a=e(this.angle),s=this.getScaledWidth(),l=n.util.cos(a)*s,c=n.util.sin(a)*s;i="string"==typeof this.originX?t[this.originX]:this.originX-.5,o="string"==typeof r?t[r]:r-.5,this.left+=l*(o-i),this.top+=c*(o-i),this.setCoords(),this.originX=r},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var e=n.util,t=e.degreesToRadians,r=e.multiplyTransformMatrices,i=e.transformPoint;e.object.extend(n.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():((!this.aCoords||!this.lineCoords)&&this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,t){return function(e){return[new n.Point(e.tl.x,e.tl.y),new n.Point(e.tr.x,e.tr.y),new n.Point(e.br.x,e.br.y),new n.Point(e.bl.x,e.bl.y)]}(this._getCoords(e,t))},intersectsWithRect:function(e,t,r,i){var o=this.getCoords(r,i);return"Intersection"===n.Intersection.intersectPolygonRectangle(o,e,t).status},intersectsWithObject:function(e,t,r){return"Intersection"===n.Intersection.intersectPolygonPolygon(this.getCoords(t,r),e.getCoords(t,r)).status||e.isContainedWithinObject(this,t,r)||this.isContainedWithinObject(e,t,r)},isContainedWithinObject:function(e,t,n){for(var r=this.getCoords(t,n),i=t?e.aCoords:e.lineCoords,o=0,a=e._getImageLines(i);o<4;o++)if(!e.containsPoint(r[o],a))return!1;return!0},isContainedWithinRect:function(e,t,n,r){var i=this.getBoundingRect(n,r);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,n,r){var i=this._getCoords(n,r),o=(t=t||this._getImageLines(i),this._findCrossPoints(e,t));return 0!==o&&o%2==1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!(!this.getCoords(!0,e).some(function(e){return e.x<=n.x&&e.x>=t.x&&e.y<=n.y&&e.y>=t.y})&&!this.intersectsWithRect(t,n,!0,e))||this._containsCenterOfCanvas(t,n,e)},_containsCenterOfCanvas:function(e,t,n){var r={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(r,null,!0,n)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,n,!0,e)||this.getCoords(!0,e).every(function(e){return(e.x>=n.x||e.x<=t.x)&&(e.y>=n.y||e.y<=t.y)})&&this._containsCenterOfCanvas(t,n,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var n,r,i,o,a,s=0;for(var l in t)if(!((a=t[l]).o.y<e.y&&a.d.y<e.y||a.o.y>=e.y&&a.d.y>=e.y||(a.o.x===a.d.x&&a.o.x>=e.x?o=a.o.x:(n=(a.d.y-a.o.y)/(a.d.x-a.o.x),r=e.y-0*e.x,i=a.o.y-n*a.o.x,o=-(r-i)/(0-n)),o>=e.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,n){var r=this.getCoords(t,n);return e.makeBoundingBoxFromPoints(r)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)<this.minScaleLimit?e<0?-this.minScaleLimit:this.minScaleLimit:0===e?1e-4:e},scale:function(e){return this._set("scaleX",e),this._set("scaleY",e),this.setCoords()},scaleToWidth:function(e,t){var n=this.getBoundingRect(t).width/this.getScaledWidth();return this.scale(e/this.width/n)},scaleToHeight:function(e,t){var n=this.getBoundingRect(t).height/this.getScaledHeight();return this.scale(e/this.height/n)},calcLineCoords:function(){var n=this.getViewportTransform(),r=this.padding,o=t(this.angle),a=e.cos(o)*r,s=e.sin(o)*r,l=a+s,c=a-s,u=this.calcACoords(),d={tl:i(u.tl,n),tr:i(u.tr,n),bl:i(u.bl,n),br:i(u.br,n)};return r&&(d.tl.x-=c,d.tl.y-=l,d.tr.x+=l,d.tr.y-=c,d.bl.x-=l,d.bl.y+=c,d.br.x+=c,d.br.y+=l),d},calcOCoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=this.getViewportTransform(),i=r(n,t),o=r(i,e),a=(o=r(o,[1/n[0],0,0,1/n[3],0,0]),this._calculateCurrentDimensions()),s={};return this.forEachControl(function(e,t,n){s[t]=e.positionHandler(a,o,n)}),s},calcACoords:function(){var e=this._calcRotateMatrix(),t=this._calcTranslateMatrix(),n=r(t,e),o=this._getTransformedDimensions(),a=o.x/2,s=o.y/2;return{tl:i({x:-a,y:-s},n),tr:i({x:a,y:-s},n),bl:i({x:-a,y:s},n),br:i({x:a,y:s},n)}},setCoords:function(e){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),e||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return e.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var e=this.getCenterPoint();return[1,0,0,1,e.x,e.y]},transformMatrixKey:function(e){var t="_",n="";return!e&&this.group&&(n=this.group.transformMatrixKey(e)+t),n+this.top+t+this.left+t+this.scaleX+t+this.scaleY+t+this.skewX+t+this.skewY+t+this.angle+t+this.originX+t+this.originY+t+this.width+t+this.height+t+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(e){var t=this.calcOwnMatrix();if(e||!this.group)return t;var n=this.transformMatrixKey(e),i=this.matrixCache||(this.matrixCache={});return i.key===n?i.value:(this.group&&(t=r(this.group.calcTransformMatrix(!1),t)),i.key=n,i.value=t,t)},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),n=this.ownMatrixCache||(this.ownMatrixCache={});if(n.key===t)return n.value;var r=this._calcTranslateMatrix(),i={angle:this.angle,translateX:r[4],translateY:r[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY};return n.key=t,n.value=e.composeMatrix(i),n.value},_getNonTransformedDimensions:function(){var e=this.strokeWidth;return{x:this.width+e,y:this.height+e}},_getTransformedDimensions:function(t,n){typeof t>"u"&&(t=this.skewX),typeof n>"u"&&(n=this.skewY);var r,i,o,a=0===t&&0===n;if(this.strokeUniform?(i=this.width,o=this.height):(i=(r=this._getNonTransformedDimensions()).x,o=r.y),a)return this._finalizeDimensions(i*this.scaleX,o*this.scaleY);var s=e.sizeAfterTransform(i,o,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:n});return this._finalizeDimensions(s.x,s.y)},_finalizeDimensions:function(e,t){return this.strokeUniform?{x:e+this.strokeWidth,y:t+this.strokeWidth}:{x:e,y:t}},_calculateCurrentDimensions:function(){var e=this.getViewportTransform(),t=this._getTransformedDimensions();return i(t,e,!0).scalarAdd(2*this.padding)}})}(),n.util.object.extend(n.Object.prototype,{sendToBack:function(){return this.group?n.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?n.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(e){return this.group?n.StaticCanvas.prototype.sendBackwards.call(this.group,this,e):this.canvas&&this.canvas.sendBackwards(this,e),this},bringForward:function(e){return this.group?n.StaticCanvas.prototype.bringForward.call(this.group,this,e):this.canvas&&this.canvas.bringForward(this,e),this},moveTo:function(e){return this.group&&"activeSelection"!==this.group.type?n.StaticCanvas.prototype.moveTo.call(this.group,this,e):this.canvas&&this.canvas.moveTo(this,e),this}}),function(){function e(e,t){if(t){if(t.toLive)return e+": url(#SVGID_"+t.id+"); ";var r=new n.Color(t),i=e+": "+r.toRgb()+"; ",o=r.getAlpha();return 1!==o&&(i+=e+"-opacity: "+o.toString()+"; "),i}return e+": none; "}var t=n.util.toFixed;n.util.object.extend(n.Object.prototype,{getSvgStyles:function(t){var n=this.fillRule?this.fillRule:"nonzero",r=this.strokeWidth?this.strokeWidth:"0",i=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeDashOffset?this.strokeDashOffset:"0",a=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",l=this.strokeMiterLimit?this.strokeMiterLimit:"4",c=typeof this.opacity<"u"?this.opacity:"1",u=this.visible?"":" visibility: hidden;",d=t?"":this.getSvgFilter(),h=e("fill",this.fill);return[e("stroke",this.stroke),"stroke-width: ",r,"; ","stroke-dasharray: ",i,"; ","stroke-linecap: ",a,"; ","stroke-dashoffset: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",l,"; ",h,"fill-rule: ",n,"; ","opacity: ",c,";",d,u].join("")},getSvgSpanStyles:function(t,n){var r="; ",i=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+r:"",o=t.strokeWidth?"stroke-width: "+t.strokeWidth+r:"",a=t.fontSize?"font-size: "+t.fontSize+"px"+r:"",s=t.fontStyle?"font-style: "+t.fontStyle+r:"",l=t.fontWeight?"font-weight: "+t.fontWeight+r:"",c=t.fill?e("fill",t.fill):"",u=t.stroke?e("stroke",t.stroke):"",d=this.getSvgTextDecoration(t);return d&&(d="text-decoration: "+d+r),[u,o,i,a,s,l,d,c,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",n?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter(function(t){return e[t.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(e,t){var r=e?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+n.util.matrixToSVG(r)+(t||"")+'" '},_setSVGBg:function(e){if(this.backgroundColor){var r=n.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',t(-this.width/2,r),'" y="',t(-this.height/2,r),'" width="',t(this.width,r),'" height="',t(this.height,r),'"></rect>\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var n=(t=t||{}).reviver,r=t.additionalTransform||"",i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),o=e.indexOf("COMMON_PARTS");return e[o]=i,n?n(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,t){var r,i,o=(t=t||{}).noStyle,a=t.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',l=t.withShadow?'style="'+this.getSvgFilter()+'" ':"",c=this.clipPath,u=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",d=c&&c.absolutePositioned,h=this.stroke,f=this.fill,p=this.shadow,g=[],m=e.indexOf("COMMON_PARTS"),v=t.additionalTransform;return c&&(c.clipPathId="CLIPPATH_"+n.Object.__uid++,i='<clipPath id="'+c.clipPathId+'" >\n'+c.toClipPathSVG(a)+"</clipPath>\n"),d&&g.push("<g ",l,this.getSvgCommons()," >\n"),g.push("<g ",this.getSvgTransform(!1),d?"":l+this.getSvgCommons()," >\n"),r=[s,u,o?"":this.addPaintOrder()," ",v?'transform="'+v+'" ':""].join(""),e[m]=r,f&&f.toLive&&g.push(f.toSVG(this)),h&&h.toLive&&g.push(h.toSVG(this)),p&&g.push(p.toSVG(this)),c&&g.push(i),g.push(e.join("")),g.push("</g>\n"),d&&g.push("</g>\n"),a?a(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=n.util.object.extend,t="stateProperties";function r(t,n,r){var i={};r.forEach(function(e){i[e]=t[e]}),e(t[n],i,!0)}function i(e,t,n){if(e===t)return!0;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0,o=e.length;r<o;r++)if(!i(e[r],t[r]))return!1;return!0}if(e&&"object"==typeof e){var a,s=Object.keys(e);if(!t||"object"!=typeof t||!n&&s.length!==Object.keys(t).length)return!1;for(r=0,o=s.length;r<o;r++)if("canvas"!==(a=s[r])&&"group"!==a&&!i(e[a],t[a]))return!1;return!0}}n.util.object.extend(n.Object.prototype,{hasStateChanged:function(e){var n="_"+(e=e||t);return Object.keys(this[n]).length<this[e].length||!i(this[n],this,!0)},saveState:function(e){var n=e&&e.propertySet||t,i="_"+n;return this[i]?(r(this,i,this[n]),e&&e.stateProperties&&r(this,i,e.stateProperties),this):this.setupState(e)},setupState:function(e){var n=(e=e||{}).propertySet||t;return e.propertySet=n,this["_"+n]={},this.saveState(e),this}})}(),function(){var e=n.util.degreesToRadians;n.util.object.extend(n.Object.prototype,{_findTargetCorner:function(e,t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var n,r,i,o=e.x,a=e.y,s=Object.keys(this.oCoords),l=s.length-1;for(this.__corner=0;l>=0;l--)if(i=s[l],this.isControlVisible(i)&&(r=this._getImageLines(t?this.oCoords[i].touchCorner:this.oCoords[i].corner),0!==(n=this._findCrossPoints({x:o,y:a},r))&&n%2==1))return this.__corner=i,i;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var n=this.controls[t];e[t].corner=n.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=n.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var n=this.getCenterPoint(),r=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(n.x,n.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var n=this._calculateCurrentDimensions(),r=this.borderScaleFactor,i=n.x+r,o=n.y+r,a=typeof t.hasControls<"u"?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-o/2,i,o),a&&(e.beginPath(),this.forEachControl(function(t,n,r){t.withConnection&&t.getVisibility(r,n)&&(s=!0,e.moveTo(t.x*i,t.y*o),e.lineTo(t.x*i+t.offsetX,t.y*o+t.offsetY))}),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,t,r){r=r||{};var i=n.util.sizeAfterTransform(this.width,this.height,t),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,l=i.x+o*(a?this.canvas.getZoom():t.scaleX)+s,c=i.y+o*(a?this.canvas.getZoom():t.scaleY)+s;return e.save(),this._setLineDash(e,r.borderDashArray||this.borderDashArray),e.strokeStyle=r.borderColor||this.borderColor,e.strokeRect(-l/2,-c/2,l,c),e.restore(),this},drawControls:function(e,t){t=t||{},e.save();var r,i,o=this.canvas.getRetinaScaling();return e.setTransform(o,0,0,o,0,0),e.strokeStyle=e.fillStyle=t.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=t.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,t.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(r=this.group.calcTransformMatrix()),this.forEachControl(function(o,a,s){i=s.oCoords[a],o.getVisibility(s,a)&&(r&&(i=n.util.transformPoint(i,r)),o.render(e,i.x,i.y,t,s))}),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),n.util.object.extend(n.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var r=function(){},i=(t=t||{}).onComplete||r,o=t.onChange||r,a=this;return n.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxCenterObjectV:function(e,t){var r=function(){},i=(t=t||{}).onComplete||r,o=t.onChange||r,a=this;return n.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),i()}})},fxRemove:function(e,t){var r=function(){},i=(t=t||{}).onComplete||r,o=t.onChange||r,a=this;return n.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),o()},onComplete:function(){a.remove(e),i()}})}}),n.util.object.extend(n.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var e,t,n=[],r=[];for(e in arguments[0])n.push(e);for(var i=0,o=n.length;i<o;i++)e=n[i],t=i!==o-1,r.push(this._animate(e,arguments[0][e],arguments[1],t));return r}return this._animate.apply(this,arguments)},_animate:function(e,t,r,i){var o,a=this;t=t.toString(),r=r?n.util.object.clone(r):{},~e.indexOf(".")&&(o=e.split("."));var s=a.colorProperties.indexOf(e)>-1||o&&a.colorProperties.indexOf(o[1])>-1,l=o?this.get(o[0])[o[1]]:this.get(e);"from"in r||(r.from=l),s||(t=~t.indexOf("=")?l+parseFloat(t.replace("=","")):parseFloat(t));var c={target:this,startValue:r.from,endValue:t,byValue:r.by,easing:r.easing,duration:r.duration,abort:r.abort&&function(e,t,n){return r.abort.call(a,e,t,n)},onChange:function(t,n,s){o?a[o[0]][o[1]]=t:a.set(e,t),!i&&r.onChange&&r.onChange(t,n,s)},onComplete:function(e,t,n){i||(a.setCoords(),r.onComplete&&r.onComplete(e,t,n))}};return s?n.util.animateColor(c.startValue,c.endValue,c.duration,c):n.util.animate(c)}}),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function o(e,t){var n=e.origin,r=e.axis1,i=e.axis2,o=e.dimension,a=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(n)){case a:return Math.min(this.get(r),this.get(i));case s:return Math.min(this.get(r),this.get(i))+.5*this.get(o);case l:return Math.max(this.get(r),this.get(i))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),typeof i[e]<"u"&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var n=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=n},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return n(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,n=e*this.width*.5,r=t*this.height*.5;return{x1:n,x2:e*this.width*-.5,y1:r,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',e.x1,'" y1="',e.y1,'" x2="',e.x2,'" y2="',e.y2,'" />\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,r,i){i=i||{};var o=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];r(new t.Line(a,n(o,i)))},t.Line.fromObject=function(e,n){var i=r(e,!0);i.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",i,function(e){delete e.points,n&&n(e)},"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.degreesToRadians;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=(this.endAngle-this.startAngle)%360;if(0===r)e=["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n'];else{var i=n(this.startAngle),o=n(this.endAngle),a=this.radius;e=['<path d="M '+t.util.cos(i)*a+" "+t.util.sin(i)*a," A "+a+" "+a," 0 ",+(r>180?"1":"0")+" 1"," "+t.util.cos(o)*a+" "+t.util.sin(o)*a,'" ',"COMMON_PARTS"," />\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,n(this.startAngle),n(this.endAngle),!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,n){var r=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!function(e){return"radius"in e&&e.radius>=0}(r))throw new Error("value of `r` attribute is required and can not be negative");r.left=(r.left||0)-r.radius,r.top=(r.top||0)-r.radius,n(new t.Circle(r))},t.Circle.fromObject=function(e,n){t.Object._fromObject("Circle",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-e+" "+t,"0 "+-t,e+" "+t].join(","),'" />']}}),t.Triangle.fromObject=function(e,n){return t.Object._fromObject("Triangle",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={}),n=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,n,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,n){var r=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,n(new t.Ellipse(r))},t.Ellipse.fromObject=function(e,n){t.Object._fromObject("Ellipse",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,n=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,i=this.height,o=-this.width/2,a=-this.height/2,s=0!==t||0!==n,l=.4477152502;e.beginPath(),e.moveTo(o+t,a),e.lineTo(o+r-t,a),s&&e.bezierCurveTo(o+r-l*t,a,o+r,a+l*n,o+r,a+n),e.lineTo(o+r,a+i-n),s&&e.bezierCurveTo(o+r,a+i-l*n,o+r-l*t,a+i,o+r-t,a+i),e.lineTo(o+t,a+i),s&&e.bezierCurveTo(o+l*t,a+i,o,a+i-l*n,o,a+i-n),e.lineTo(o,a+n),s&&e.bezierCurveTo(o,a+l*n,o+l*t,a,o+t,a),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,r,i){if(!e)return r(null);i=i||{};var o=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new t.Rect(n(i?t.util.object.clone(i):{},o));a.visible=a.visible&&a.width>0&&a.height>0,r(a)},t.Rect.fromObject=function(e,n){return t.Object._fromObject("Rect",e,n)})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,o=t.util.toFixed,a=t.util.projectStrokeOnPoints;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_projectStrokeOnPoints:function(){return a(this.points,this,!0)},_setPositionDimensions:function(e){var t,n=this._calcDimensions(e),r=this.exactBoundingBox?this.strokeWidth:0;this.width=n.width-r,this.height=n.height-r,e.fromSVG||(t=this.translateToGivenOrigin({x:n.left-this.strokeWidth/2+r/2,y:n.top-this.strokeWidth/2+r/2},"left","top",this.originX,this.originY)),typeof e.left>"u"&&(this.left=e.fromSVG?n.left:t.x),typeof e.top>"u"&&(this.top=e.fromSVG?n.top:t.y),this.pathOffset={x:n.left+this.width/2+r/2,y:n.top+this.height/2+r/2}},_calcDimensions:function(){var e=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,t=r(e,"x")||0,n=r(e,"y")||0;return{left:t,top:n,width:(i(e,"x")||0)-t,height:(i(e,"y")||0)-n}},toObject:function(e){return n(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],n=this.pathOffset.x,r=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a<s;a++)e.push(o(this.points[a].x-n,i),",",o(this.points[a].y-r,i)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',e.join(""),'" />\n']},commonRender:function(e){var t,n=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(!n||isNaN(this.points[n-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-r,this.points[0].y-i);for(var o=0;o<n;o++)t=this.points[o],e.lineTo(t.x-r,t.y-i);return!0},_render:function(e){this.commonRender(e)&&this._renderPaintInOrder(e)},complexity:function(){return this.get("points").length}}),t.Polyline.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polyline.fromElementGenerator=function(e){return function(r,i,o){if(!r)return i(null);o||(o={});var a=t.parsePointsAttribute(r.getAttribute("points")),s=t.parseAttributes(r,t[e].ATTRIBUTE_NAMES);s.fromSVG=!0,i(new t[e](a,n(s,o)))}},t.Polyline.fromElement=t.Polyline.fromElementGenerator("Polyline"),t.Polyline.fromObject=function(e,n){return t.Object._fromObject("Polyline",e,n,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.projectStrokeOnPoints;t.Polygon?t.warn("fabric.Polygon is already defined"):(t.Polygon=t.util.createClass(t.Polyline,{type:"polygon",_projectStrokeOnPoints:function(){return n(this.points,this)},_render:function(e){this.commonRender(e)&&(e.closePath(),this._renderPaintInOrder(e))}}),t.Polygon.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(),t.Polygon.fromElement=t.Polyline.fromElementGenerator("Polygon"),t.Polygon.fromObject=function(e,n){t.Object._fromObject("Polygon",e,n,"points")})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.array.min,r=t.util.array.max,i=t.util.object.extend,o=t.util.object.clone,a=t.util.toFixed;t.Path?t.warn("fabric.Path is already defined"):(t.Path=t.util.createClass(t.Object,{type:"path",path:null,cacheProperties:t.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:t.Object.prototype.stateProperties.concat("path"),initialize:function(e,t){delete(t=o(t||{})).path,this.callSuper("initialize",t),this._setPath(e||[],t)},_setPath:function(e,n){this.path=t.util.makePathSimpler(Array.isArray(e)?e:t.util.parsePath(e)),t.Polyline.prototype._setPositionDimensions.call(this,n||{})},_renderPathCommands:function(e){var t,n=0,r=0,i=0,o=0,a=0,s=0,l=-this.pathOffset.x,c=-this.pathOffset.y;e.beginPath();for(var u=0,d=this.path.length;u<d;++u)switch(t=this.path[u],t[0]){case"L":i=t[1],o=t[2],e.lineTo(i+l,o+c);break;case"M":n=i=t[1],r=o=t[2],e.moveTo(i+l,o+c);break;case"C":i=t[5],o=t[6],a=t[3],s=t[4],e.bezierCurveTo(t[1]+l,t[2]+c,a+l,s+c,i+l,o+c);break;case"Q":e.quadraticCurveTo(t[1]+l,t[2]+c,t[3]+l,t[4]+c),i=t[3],o=t[4],a=t[1],s=t[2];break;case"z":case"Z":i=n,o=r,e.closePath()}},_render:function(e){this._renderPathCommands(e),this._renderPaintInOrder(e)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(e){return i(this.callSuper("toObject",e),{path:this.path.map(function(e){return e.slice()})})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',t.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,e)+", "+a(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,i,o=[],a=[],s=0,l=0,c=0,u=0,d=0,h=this.path.length;d<h;++d){switch((e=this.path[d])[0]){case"L":c=e[1],u=e[2],i=[];break;case"M":s=c=e[1],l=u=e[2],i=[];break;case"C":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[3],e[4],e[5],e[6]),c=e[5],u=e[6];break;case"Q":i=t.util.getBoundsOfCurve(c,u,e[1],e[2],e[1],e[2],e[3],e[4]),c=e[3],u=e[4];break;case"z":case"Z":c=s,u=l}i.forEach(function(e){o.push(e.x),a.push(e.y)}),o.push(c),a.push(u)}var f=n(o)||0,p=n(a)||0;return{left:f,top:p,width:(r(o)||0)-f,height:(r(a)||0)-p}}}),t.Path.fromObject=function(e,n){if("string"==typeof e.sourcePath){var r=e.sourcePath;t.loadSVGFromURL(r,function(r){var i=r[0];i.setOptions(e),e.clipPath?t.util.enlivenObjects([e.clipPath],function(e){i.clipPath=e[0],n&&n(i)}):n&&n(i)})}else t.Object._fromObject("Path",e,n,"path")},t.Path.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat(["d"]),t.Path.fromElement=function(e,n,r){var o=t.parseAttributes(e,t.Path.ATTRIBUTE_NAMES);o.fromSVG=!0,n(new t.Path(o.d,i(o,r)))})}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.array.min,r=t.util.array.max;t.Group||(t.Group=t.util.createClass(t.Object,t.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(e,t,n){t=t||{},this._objects=[],n&&this.callSuper("initialize",t),this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;if(n)this._updateObjectsACoords();else{var i=t&&t.centerPoint;void 0!==t.originX&&(this.originX=t.originX),void 0!==t.originY&&(this.originY=t.originY),i||this._calcBounds(),this._updateObjectsCoords(i),delete t.centerPoint,this.callSuper("initialize",t)}this.setCoords()},_updateObjectsACoords:function(){for(var e=this._objects.length;e--;)this._objects[e].setCoords(!0)},_updateObjectsCoords:function(e){e=e||this.getCenterPoint();for(var t=this._objects.length;t--;)this._updateObjectCoords(this._objects[t],e)},_updateObjectCoords:function(e,t){var n=e.left,r=e.top;e.set({left:n-t.x,top:r-t.y}),e.group=this,e.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(e){var n=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(n&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,n?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,n){var r=this._objects.length;if(this.useSetOnGroup)for(;r--;)this._objects[r].setOnGroup(e,n);if("canvas"===e)for(;r--;)this._objects[r]._set(e,n);t.Object.prototype._set.call(this,e,n)},toObject:function(e){var n=this.includeDefaultValues,r=this._objects.filter(function(e){return!e.excludeFromExport}).map(function(t){var r=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(e);return t.includeDefaultValues=r,i}),i=t.Object.prototype.toObject.call(this,e);return i.objects=r,i},toDatalessObject:function(e){var n,r=this.sourcePath;if(r)n=r;else{var i=this.includeDefaultValues;n=this._objects.map(function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toDatalessObject(e);return t.includeDefaultValues=n,r})}var o=t.Object.prototype.toDatalessObject.call(this,e);return o.objects=n,o},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var n=0,r=this._objects.length;n<r;n++)if(this._objects[n].willDrawShadow())return this.ownCaching=!1,!1;return e},willDrawShadow:function(){if(t.Object.prototype.willDrawShadow.call(this))return!0;for(var e=0,n=this._objects.length;e<n;e++)if(this._objects[e].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(e){for(var t=0,n=this._objects.length;t<n;t++)this._objects[t].render(e);this._drawClipPath(e,this.clipPath)},isCacheDirty:function(e){if(this.callSuper("isCacheDirty",e))return!0;if(!this.statefullCache)return!1;for(var t=0,n=this._objects.length;t<n;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var r=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-r/2,-i/2,r,i)}return!0}return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(n){t.util.addTransformToObject(n,e),delete n.group,n.setCoords()}),this},destroy:function(){return this._objects.forEach(function(e){e.set("dirty",!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper("dispose"),this.forEachObject(function(e){e.dispose&&e.dispose()}),this._objects=[]},toActiveSelection:function(){if(this.canvas){var e=this._objects,n=this.canvas;this._objects=[];var r=this.toObject();delete r.objects;var i=new t.ActiveSelection([]);return i.set(r),i.type="activeSelection",n.remove(this),e.forEach(function(e){e.group=i,e.dirty=!0,n.add(e)}),i.canvas=n,i._objects=e,n._activeObject=i,i.setCoords(),i}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(e){e.setCoords(!0)}),this},_calcBounds:function(e){for(var t,n,r,i,o=[],a=[],s=["tr","br","bl","tl"],l=0,c=this._objects.length,u=s.length;l<c;++l){for(r=(t=this._objects[l]).calcACoords(),i=0;i<u;i++)n=s[i],o.push(r[n].x),a.push(r[n].y);t.aCoords=r}this._getBounds(o,a,e)},_getBounds:function(e,i,o){var a=new t.Point(n(e),n(i)),s=new t.Point(r(e),r(i)),l=a.y||0,c=a.x||0,u=s.x-a.x||0,d=s.y-a.y||0;this.width=u,this.height=d,o||this.setPositionByOrigin({x:c,y:l},"left","top")},_toSVG:function(e){for(var t=["<g ","COMMON_PARTS"," >\n"],n=0,r=this._objects.length;n<r;n++)t.push("\t\t",this._objects[n].toSVG(e));return t.push("</g>\n"),t},getSvgStyles:function(){var e=typeof this.opacity<"u"&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],n=0,r=this._objects.length;n<r;n++)t.push("\t",this._objects[n].toClipPathSVG(e));return this._createBaseClipPathSVGMarkup(t,{reviver:e})}}),t.Group.fromObject=function(e,n){var r=e.objects,i=t.util.object.clone(e,!0);delete i.objects,"string"!=typeof r?t.util.enlivenObjects(r,function(r){t.util.enlivenObjectEnlivables(e,i,function(){n&&n(new t.Group(r,i,!0))})}):t.loadSVGFromURL(r,function(o){var a=t.util.groupSVGElements(o,e,r),s=i.clipPath;delete i.clipPath,a.set(i),s?t.util.enlivenObjects([s],function(e){a.clipPath=e[0],n&&n(a)}):n&&n(a)})})}(e),function(e){var t=e.fabric||(e.fabric={});t.ActiveSelection||(t.ActiveSelection=t.util.createClass(t.Group,{type:"activeSelection",initialize:function(e,n){n=n||{},this._objects=e||[];for(var r=this._objects.length;r--;)this._objects[r].group=this;n.originX&&(this.originX=n.originX),n.originY&&(this.originY=n.originY),this._calcBounds(),this._updateObjectsCoords(),t.Object.prototype.initialize.call(this,n),this.setCoords()},toGroup:function(){var e=this._objects.concat();this._objects=[];var n=t.Object.prototype.toObject.call(this),r=new t.Group([]);if(delete n.type,r.set(n),e.forEach(function(e){e.canvas.remove(e),e.group=r}),r._objects=e,!this.canvas)return r;var i=this.canvas;return i.add(r),i._activeObject=r,r.setCoords(),r},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,n){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),typeof(n=n||{}).hasControls>"u"&&(n.hasControls=!1),n.forActiveSelection=!0;for(var r=0,i=this._objects.length;r<i;r++)this._objects[r]._renderControls(e,n);e.restore()}}),t.ActiveSelection.fromObject=function(e,n){t.util.enlivenObjects(e.objects,function(r){delete e.objects,n&&n(new t.ActiveSelection(r,e,!0))})})}(e),function(e){var t=n.util.object.extend;e.fabric||(e.fabric={}),e.fabric.Image?n.warn("fabric.Image is already defined."):(n.Image=n.util.createClass(n.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:n.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:n.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(e,t){t||(t={}),this.filters=[],this.cacheKey="texture"+n.Object.__uid++,this.callSuper("initialize",t),this._initElement(e,t)},getElement:function(){return this._element||{}},setElement:function(e,t){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=e,this._originalElement=e,this._initConfig(t),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(e){var t=n.filterBackend;t&&t.evictCachesForKey&&t.evictCachesForKey(e)},dispose:function(){this.callSuper("dispose"),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(e){n.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var e=this.getElement();return{width:e.naturalWidth||e.width,height:e.naturalHeight||e.height}},_stroke:function(e){if(this.stroke&&0!==this.strokeWidth){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,-n),e.lineTo(t,-n),e.lineTo(t,n),e.lineTo(-t,n),e.lineTo(-t,-n),e.closePath()}},toObject:function(e){var n=[];this.filters.forEach(function(e){e&&n.push(e.toObject())});var r=t(this.callSuper("toObject",["cropX","cropY"].concat(e)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:n});return this.resizeFilter&&(r.resizeFilter=this.resizeFilter.toObject()),r},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var e,t=[],r=[],i=this._element,o=-this.width/2,a=-this.height/2,s="",l="";if(!i)return[];if(this.hasCrop()){var c=n.Object.__uid++;t.push('<clipPath id="imageCrop_'+c+'">\n','\t<rect x="'+o+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),s=' clip-path="url(#imageCrop_'+c+')" '}if(this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),r.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',o-this.cropX,'" y="',a-this.cropY,'" width="',i.width||i.naturalWidth,'" height="',i.height||i.height,l,'"',s,"></image>\n"),this.stroke||this.strokeDashArray){var u=this.fill;this.fill=null,e=["\t<rect ",'x="',o,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=u}return"fill"!==this.paintFirst?t.concat(e,r):t.concat(r,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,t,r){return n.util.loadImage(e,function(e,n){this.setElement(e,r),this._setWidthHeight(),t&&t(this,n)},this,r&&r.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var e=this.resizeFilter,t=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),i=r.scaleX,o=r.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||i>t&&o>t)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=i,void(this._lastScaleY=o);n.filterBackend||(n.filterBackend=n.initFilterBackend());var s=n.util.createCanvasElement(),l=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,c=a.width,u=a.height;s.width=c,s.height=u,this._element=s,this._lastScaleX=e.scaleX=i,this._lastScaleY=e.scaleY=o,n.filterBackend.applyFilters([e],a,c,u,this._element,l),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter(function(e){return e&&!e.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var t=this._originalElement,r=t.naturalWidth||t.width,i=t.naturalHeight||t.height;if(this._element===this._originalElement){var o=n.util.createCanvasElement();o.width=r,o.height=i,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,r,i),this._lastScaleX=1,this._lastScaleY=1;return n.filterBackend||(n.filterBackend=n.initFilterBackend()),n.filterBackend.applyFilters(e,this._originalElement,r,i,this._element,this.cacheKey),(this._originalElement.width!==this._element.width||this._originalElement.height!==this._element.height)&&(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){n.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){n.util.setImageSmoothing(e,this.imageSmoothing),n.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var n=this._filterScalingX,r=this._filterScalingY,i=this.width,o=this.height,a=Math.min,s=Math.max,l=s(this.cropX,0),c=s(this.cropY,0),u=t.naturalWidth||t.width,d=t.naturalHeight||t.height,h=l*n,f=c*r,p=a(i*n,u-h),g=a(o*r,d-f),m=-i/2,v=-o/2,y=a(i,u/n-l),b=a(o,d/r-c);t&&e.drawImage(t,h,f,p,g,m,v,y,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,t){this.setElement(n.util.getById(e),t),n.util.addClass(this.getElement(),n.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,t){e&&e.length?n.util.enlivenObjects(e,function(e){t&&t(e)},"fabric.Image.filters"):t&&t()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,t=n.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),r=this._element.width,i=this._element.height,o=1,a=1,s=0,l=0,c=0,u=0,d=this.width,h=this.height,f={width:d,height:h};return!t||"none"===t.alignX&&"none"===t.alignY?(o=d/r,a=h/i):("meet"===t.meetOrSlice&&(e=(d-r*(o=a=n.util.findScaleToFit(this._element,f)))/2,"Min"===t.alignX&&(s=-e),"Max"===t.alignX&&(s=e),e=(h-i*a)/2,"Min"===t.alignY&&(l=-e),"Max"===t.alignY&&(l=e)),"slice"===t.meetOrSlice&&(e=r-d/(o=a=n.util.findScaleToCover(this._element,f)),"Mid"===t.alignX&&(c=e/2),"Max"===t.alignX&&(c=e),e=i-h/a,"Mid"===t.alignY&&(u=e/2),"Max"===t.alignY&&(u=e),r=d/o,i=h/a)),{width:r,height:i,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:l,cropX:c,cropY:u}}}),n.Image.CSS_CANVAS="canvas-img",n.Image.prototype.getSvgSrc=n.Image.prototype.getSrc,n.Image.fromObject=function(e,t){var r=n.util.object.clone(e);n.util.loadImage(r.src,function(e,i){i?t&&t(null,!0):n.Image.prototype._initFilters.call(r,r.filters,function(i){r.filters=i||[],n.Image.prototype._initFilters.call(r,[r.resizeFilter],function(i){r.resizeFilter=i[0],n.util.enlivenObjectEnlivables(r,r,function(){var i=new n.Image(e,r);t(i,!1)})})})},null,r.crossOrigin)},n.Image.fromURL=function(e,t,r){n.util.loadImage(e,function(e,i){t&&t(new n.Image(e,r),i)},null,r&&r.crossOrigin)},n.Image.ATTRIBUTE_NAMES=n.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),n.Image.fromElement=function(e,r,i){var o=n.parseAttributes(e,n.Image.ATTRIBUTE_NAMES);n.Image.fromURL(o["xlink:href"],r,t(i?n.util.object.clone(i):{},o))})}(e),n.util.object.extend(n.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(e){var t=function(){},r=(e=e||{}).onComplete||t,i=e.onChange||t,o=this;return n.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){o.rotate(e),i()},onComplete:function(){o.setCoords(),r()}})}}),n.util.object.extend(n.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){function e(e,t){var n="precision "+t+" float;\nvoid main(){}",r=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,n),e.compileShader(r),!!e.getShaderParameter(r,e.COMPILE_STATUS)}function t(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}n.isWebglSupported=function(t){if(n.isLikelyNode)return!1;t=t||n.WebglFilterBackend.prototype.tileSize;var r=document.createElement("canvas"),i=r.getContext("webgl")||r.getContext("experimental-webgl"),o=!1;if(i){n.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE),o=n.maxTextureSize>=t;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(e(i,a[s])){n.webGlPrecision=a[s];break}}return this.isSupported=o,o},n.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,t){var r,a=typeof window.performance<"u";try{new ImageData(1,1),r=!0}catch{r=!1}var s=typeof ArrayBuffer<"u",l=typeof Uint8ClampedArray<"u";if(a&&r&&s&&l){var c=n.util.createCanvasElement(),u=new ArrayBuffer(e*t*4);if(n.forceGLPutImageData)return this.imageBuffer=u,void(this.copyGLTo2D=o);var d,h,f={imageBuffer:u,destinationWidth:e,destinationHeight:t,targetCanvas:c};c.width=e,c.height=t,d=window.performance.now(),i.call(f,this.gl,f),h=window.performance.now()-d,d=window.performance.now(),o.call(f,this.gl,f),h>window.performance.now()-d?(this.imageBuffer=u,this.copyGLTo2D=o):this.copyGLTo2D=i}},createWebGLCanvas:function(e,t){var r=n.util.createCanvasElement();r.width=e,r.height=t;var i={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=r.getContext("webgl",i);o||(o=r.getContext("experimental-webgl",i)),o&&(o.clearColor(0,0,0,0),this.canvas=r,this.gl=o)},applyFilters:function(e,t,n,r,i,o){var a,s=this.gl;o&&(a=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:n,sourceHeight:r,destinationWidth:n,destinationHeight:r,context:s,sourceTexture:this.createTexture(s,n,r,!a&&t),targetTexture:this.createTexture(s,n,r),originalTexture:a||this.createTexture(s,n,r,!a&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},c=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,c),e.forEach(function(e){e&&e.applyTo(l)}),function(e){var t=e.targetCanvas,n=t.width,r=t.height,i=e.destinationWidth,o=e.destinationHeight;(n!==i||r!==o)&&(t.width=i,t.height=o)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(c),i.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,n,r,i){var o=e.createTexture();return e.bindTexture(e.TEXTURE_2D,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i||e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),o},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var n=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=n,n},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:i,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var n=e.getExtension("WEBGL_debug_renderer_info");if(n){var r=e.getParameter(n.UNMASKED_RENDERER_WEBGL),i=e.getParameter(n.UNMASKED_VENDOR_WEBGL);r&&(t.renderer=r.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){var e=function(){};function t(){}n.Canvas2dFilterBackend=t,t.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,n,r,i){var o=i.getContext("2d");o.drawImage(t,0,0,n,r);var a={sourceWidth:n,sourceHeight:r,imageData:o.getImageData(0,0,n,r),originalEl:t,originalImageData:o.getImageData(0,0,n,r),canvasEl:i,ctx:o,filterBackend:this};return e.forEach(function(e){e.applyTo(a)}),(a.imageData.width!==n||a.imageData.height!==r)&&(i.width=a.imageData.width,i.height=a.imageData.height),o.putImageData(a.imageData,0,0),a}}}(),n.Image=n.Image||{},n.Image.filters=n.Image.filters||{},n.Image.filters.BaseFilter=n.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,t,r){t=t||this.fragmentSource,r=r||this.vertexSource,"highp"!==n.webGlPrecision&&(t=t.replace(/precision highp float/g,"precision "+n.webGlPrecision+" float"));var i=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(i));var o=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(o,t),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(o));var a=e.createProgram();if(e.attachShader(a,i),e.attachShader(a,o),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var s=this.getAttributeLocations(e,a),l=this.getUniformLocations(e,a)||{};return l.uStepW=e.getUniformLocation(a,"uStepW"),l.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:l}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,n){var r=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,n,r=e.context;e.passes>1?(t=e.destinationWidth,n=e.destinationHeight,(e.sourceWidth!==t||e.sourceHeight!==n)&&(r.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(r,t,n)),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.targetTexture,0)):(r.bindFramebuffer(r.FRAMEBUFFER,null),r.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,t=n.Image.filters[this.type].prototype;if(e){if(Array.isArray(t[e])){for(var r=t[e].length;r--;)if(this[e][r]!==t[e][r])return!1;return!0}return t[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,n=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(n.program),this.sendAttributeData(t,n.attributeLocations,e.aPosition),t.uniform1f(n.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(n.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,n.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,n){e.activeTexture(n),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),n.Image.filters.BaseFilter.fromObject=function(e,t){var r=new n.Image.filters[e.type](e);return t&&t(r),r},function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.ColorMatrix=r(n.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,n,r,i,o,a=e.imageData.data,s=a.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<s;o+=4)t=a[o],n=a[o+1],r=a[o+2],c?(a[o]=t*l[0]+n*l[1]+r*l[2]+255*l[4],a[o+1]=t*l[5]+n*l[6]+r*l[7]+255*l[9],a[o+2]=t*l[10]+n*l[11]+r*l[12]+255*l[14]):(i=a[o+3],a[o]=t*l[0]+n*l[1]+r*l[2]+i*l[3]+255*l[4],a[o+1]=t*l[5]+n*l[6]+r*l[7]+i*l[8]+255*l[9],a[o+2]=t*l[10]+n*l[11]+r*l[12]+i*l[13]+255*l[14],a[o+3]=t*l[15]+n*l[16]+r*l[17]+i*l[18]+255*l[19])},getUniformLocations:function(e,t){return{uColorMatrix:e.getUniformLocation(t,"uColorMatrix"),uConstants:e.getUniformLocation(t,"uConstants")}},sendUniformData:function(e,t){var n=this.matrix,r=[n[0],n[1],n[2],n[3],n[5],n[6],n[7],n[8],n[10],n[11],n[12],n[13],n[15],n[16],n[17],n[18]],i=[n[4],n[9],n[14],n[19]];e.uniformMatrix4fv(t.uColorMatrix,!1,r),e.uniform4fv(t.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Brightness=r(n.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += uBrightness;\ngl_FragColor = color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(e){if(0!==this.brightness){var t,n=e.imageData.data,r=n.length,i=Math.round(255*this.brightness);for(t=0;t<r;t+=4)n[t]=n[t]+i,n[t+1]=n[t+1]+i,n[t+2]=n[t+2]+i}},getUniformLocations:function(e,t){return{uBrightness:e.getUniformLocation(t,"uBrightness")}},sendUniformData:function(e,t){e.uniform1f(t.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Convolute=i(r.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 3.0; h+=1.0) {\nfor (float w = 0.0; w < 3.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 5.0; h+=1.0) {\nfor (float w = 0.0; w < 5.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 7.0; h+=1.0) {\nfor (float w = 0.0; w < 7.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 0);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor += texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor = color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = vec4(0, 0, 0, 1);\nfor (float h = 0.0; h < 9.0; h+=1.0) {\nfor (float w = 0.0; w < 9.0; w+=1.0) {\nvec2 matrixPos = vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb += texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha = texture2D(uTexture, vTexCoord).a;\ngl_FragColor = color;\ngl_FragColor.a = alpha;\n}"},retrieveShader:function(e){var t=Math.sqrt(this.matrix.length),n=this.type+"_"+t+"_"+(this.opaque?1:0),r=this.fragmentSource[n];return e.programCache.hasOwnProperty(n)||(e.programCache[n]=this.createProgram(e.context,r)),e.programCache[n]},applyTo2d:function(e){var t,n,r,i,o,a,s,l,c,u,d,h,f,p=e.imageData,g=p.data,m=this.matrix,v=Math.round(Math.sqrt(m.length)),y=Math.floor(v/2),b=p.width,w=p.height,x=e.ctx.createImageData(b,w),C=x.data,_=this.opaque?1:0;for(d=0;d<w;d++)for(u=0;u<b;u++){for(o=4*(d*b+u),t=0,n=0,r=0,i=0,f=0;f<v;f++)for(h=0;h<v;h++)a=u+h-y,!((s=d+f-y)<0||s>=w||a<0||a>=b)&&(l=4*(s*b+a),c=m[f*v+h],t+=g[l]*c,n+=g[l+1]*c,r+=g[l+2]*c,_||(i+=g[l+3]*c));C[o]=t,C[o+1]=n,C[o+2]=r,C[o+3]=_?g[o+3]:i}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return n(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Grayscale=r(n.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,n,r=e.imageData.data,i=r.length,o=this.mode;for(t=0;t<i;t+=4)"average"===o?n=(r[t]+r[t+1]+r[t+2])/3:"lightness"===o?n=(Math.min(r[t],r[t+1],r[t+2])+Math.max(r[t],r[t+1],r[t+2]))/2:"luminosity"===o&&(n=.21*r[t]+.72*r[t+1]+.07*r[t+2]),r[t]=n,r[t+1]=n,r[t+2]=n},retrieveShader:function(e){var t=this.type+"_"+this.mode;if(!e.programCache.hasOwnProperty(t)){var n=this.fragmentSource[this.mode];e.programCache[t]=this.createProgram(e.context,n)}return e.programCache[t]},getUniformLocations:function(e,t){return{uMode:e.getUniformLocation(t,"uMode")}},sendUniformData:function(e,t){e.uniform1i(t.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Invert=r(n.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nif (uInvert == 1) {\ngl_FragColor = vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n} else {\ngl_FragColor = color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(e){var t,n=e.imageData.data,r=n.length;for(t=0;t<r;t+=4)n[t]=255-n[t],n[t+1]=255-n[t+1],n[t+2]=255-n[t+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(e,t){return{uInvert:e.getUniformLocation(t,"uInvert")}},sendUniformData:function(e,t){e.uniform1i(t.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.Noise=i(r.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand(vec2 co, float seed, float vScale) {\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor.rgb += (0.5 - rand(vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor = color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(e){if(0!==this.noise){var t,n,r=e.imageData.data,i=r.length,o=this.noise;for(t=0,i=r.length;t<i;t+=4)n=(.5-Math.random())*o,r[t]+=n,r[t+1]+=n,r[t+2]+=n}},getUniformLocations:function(e,t){return{uNoise:e.getUniformLocation(t,"uNoise"),uSeed:e.getUniformLocation(t,"uSeed")}},sendUniformData:function(e,t){e.uniform1f(t.uNoise,this.noise/255),e.uniform1f(t.uSeed,Math.random())},toObject:function(){return n(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Pixelate=r(n.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main() {\nfloat blockW = uBlocksize * uStepW;\nfloat blockH = uBlocksize * uStepW;\nint posX = int(vTexCoord.x / blockW);\nint posY = int(vTexCoord.y / blockH);\nfloat fposX = float(posX);\nfloat fposY = float(posY);\nvec2 squareCoords = vec2(fposX * blockW, fposY * blockH);\nvec4 color = texture2D(uTexture, squareCoords);\ngl_FragColor = color;\n}",applyTo2d:function(e){var t,n,r,i,o,a,s,l,c,u,d,h=e.imageData,f=h.data,p=h.height,g=h.width;for(n=0;n<p;n+=this.blocksize)for(r=0;r<g;r+=this.blocksize)for(i=f[t=4*n*g+4*r],o=f[t+1],a=f[t+2],s=f[t+3],u=Math.min(n+this.blocksize,p),d=Math.min(r+this.blocksize,g),l=n;l<u;l++)for(c=r;c<d;c++)f[t=4*l*g+4*c]=i,f[t+1]=o,f[t+2]=a,f[t+3]=s},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(e,t){return{uBlocksize:e.getUniformLocation(t,"uBlocksize"),uStepW:e.getUniformLocation(t,"uStepW"),uStepH:e.getUniformLocation(t,"uStepH")}},sendUniformData:function(e,t){e.uniform1f(t.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.Image.filters,i=t.util.createClass;r.RemoveColor=i(r.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb)) && all(greaterThan(uHigh.rgb,gl_FragColor.rgb))) {\ngl_FragColor.a = 0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(e){var n,r,i,o,a=e.imageData.data,s=255*this.distance,l=new t.Color(this.color).getSource(),c=[l[0]-s,l[1]-s,l[2]-s],u=[l[0]+s,l[1]+s,l[2]+s];for(n=0;n<a.length;n+=4)r=a[n],i=a[n+1],o=a[n+2],r>c[0]&&i>c[1]&&o>c[2]&&r<u[0]&&i<u[1]&&o<u[2]&&(a[n+3]=0)},getUniformLocations:function(e,t){return{uLow:e.getUniformLocation(t,"uLow"),uHigh:e.getUniformLocation(t,"uHigh")}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource(),i=parseFloat(this.distance),o=[0+r[0]/255-i,0+r[1]/255-i,0+r[2]/255-i,1],a=[r[0]/255+i,r[1]/255+i,r[2]/255+i,1];e.uniform4fv(n.uLow,o),e.uniform4fv(n.uHigh,a)},toObject:function(){return n(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),t.Image.filters.RemoveColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass,i={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(var o in i)n[o]=r(n.ColorMatrix,{type:o,matrix:i[o],mainParameter:!1,colorsOnly:!0}),t.Image.filters[o].fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendColor=r(n.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *= uColor.rgb;\n",screen:"gl_FragColor.rgb = 1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb += uColor.rgb;\n",diff:"gl_FragColor.rgb = abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -= uColor.rgb;\n",lighten:"gl_FragColor.rgb = max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb = min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb += uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if (uColor.r < 0.5) {\ngl_FragColor.r *= 2.0 * uColor.r;\n} else {\ngl_FragColor.r = 1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif (uColor.g < 0.5) {\ngl_FragColor.g *= 2.0 * uColor.g;\n} else {\ngl_FragColor.g = 1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif (uColor.b < 0.5) {\ngl_FragColor.b *= 2.0 * uColor.b;\n} else {\ngl_FragColor.b = 1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *= (1.0 - uColor.a);\ngl_FragColor.rgb += uColor.rgb;\n"},buildSource:function(e){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ngl_FragColor = color;\nif (color.a > 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,n=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(n)||(t=this.buildSource(this.mode),e.programCache[n]=this.createProgram(e.context,t)),e.programCache[n]},applyTo2d:function(e){var n,r,i,o,a,s,l,c=e.imageData.data,u=c.length,d=1-this.alpha;n=(l=new t.Color(this.color).getSource())[0]*this.alpha,r=l[1]*this.alpha,i=l[2]*this.alpha;for(var h=0;h<u;h+=4)switch(o=c[h],a=c[h+1],s=c[h+2],this.mode){case"multiply":c[h]=o*n/255,c[h+1]=a*r/255,c[h+2]=s*i/255;break;case"screen":c[h]=255-(255-o)*(255-n)/255,c[h+1]=255-(255-a)*(255-r)/255,c[h+2]=255-(255-s)*(255-i)/255;break;case"add":c[h]=o+n,c[h+1]=a+r,c[h+2]=s+i;break;case"diff":case"difference":c[h]=Math.abs(o-n),c[h+1]=Math.abs(a-r),c[h+2]=Math.abs(s-i);break;case"subtract":c[h]=o-n,c[h+1]=a-r,c[h+2]=s-i;break;case"darken":c[h]=Math.min(o,n),c[h+1]=Math.min(a,r),c[h+2]=Math.min(s,i);break;case"lighten":c[h]=Math.max(o,n),c[h+1]=Math.max(a,r),c[h+2]=Math.max(s,i);break;case"overlay":c[h]=n<128?2*o*n/255:255-2*(255-o)*(255-n)/255,c[h+1]=r<128?2*a*r/255:255-2*(255-a)*(255-r)/255,c[h+2]=i<128?2*s*i/255:255-2*(255-s)*(255-i)/255;break;case"exclusion":c[h]=n+o-2*n*o/255,c[h+1]=r+a-2*r*a/255,c[h+2]=i+s-2*i*s/255;break;case"tint":c[h]=n+o*d,c[h+1]=r+a*d,c[h+2]=i+s*d}},getUniformLocations:function(e,t){return{uColor:e.getUniformLocation(t,"uColor")}},sendUniformData:function(e,n){var r=new t.Color(this.color).getSource();r[0]=this.alpha*r[0]/255,r[1]=this.alpha*r[1]/255,r[2]=this.alpha*r[2]/255,r[3]=this.alpha,e.uniform4fv(n.uColor,r)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendColor.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric,n=t.Image.filters,r=t.util.createClass;n.BlendImage=r(n.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main() {\nvTexCoord = aPosition;\nvTexCoord2 = (uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.rgba *= color2.rgba;\ngl_FragColor = color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec4 color2 = texture2D(uImage, vTexCoord2);\ncolor.a = color2.a;\ngl_FragColor = color;\n}"},retrieveShader:function(e){var t=this.type+"_"+this.mode,n=this.fragmentSource[this.mode];return e.programCache.hasOwnProperty(t)||(e.programCache[t]=this.createProgram(e.context,n)),e.programCache[t]},applyToWebGL:function(e){var t=e.context,n=this.createTexture(e.filterBackend,this.image);this.bindAdditionalTexture(t,n,t.TEXTURE1),this.callSuper("applyToWebGL",e),this.unbindAdditionalTexture(t,t.TEXTURE1)},createTexture:function(e,t){return e.getCachedTexture(t.cacheKey,t._element)},calculateMatrix:function(){var e=this.image,t=e._element.width,n=e._element.height;return[1/e.scaleX,0,0,0,1/e.scaleY,0,-e.left/t,-e.top/n,1]},applyTo2d:function(e){var n,r,i,o,a,s,l,c,u,d,h,f=e.imageData,p=e.filterBackend.resources,g=f.data,m=g.length,v=f.width,y=f.height,b=this.image;p.blendImage||(p.blendImage=t.util.createCanvasElement()),d=(u=p.blendImage).getContext("2d"),u.width!==v||u.height!==y?(u.width=v,u.height=y):d.clearRect(0,0,v,y),d.setTransform(b.scaleX,0,0,b.scaleY,b.left,b.top),d.drawImage(b._element,0,0,v,y),h=d.getImageData(0,0,v,y).data;for(var w=0;w<m;w+=4)switch(a=g[w],s=g[w+1],l=g[w+2],c=g[w+3],n=h[w],r=h[w+1],i=h[w+2],o=h[w+3],this.mode){case"multiply":g[w]=a*n/255,g[w+1]=s*r/255,g[w+2]=l*i/255,g[w+3]=c*o/255;break;case"mask":g[w+3]=o}},getUniformLocations:function(e,t){return{uTransformMatrix:e.getUniformLocation(t,"uTransformMatrix"),uImage:e.getUniformLocation(t,"uImage")}},sendUniformData:function(e,t){var n=this.calculateMatrix();e.uniform1i(t.uImage,1),e.uniformMatrix3fv(t.uTransformMatrix,!1,n)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),t.Image.filters.BlendImage.fromObject=function(e,n){t.Image.fromObject(e.image,function(r){var i=t.util.object.clone(e);i.image=r,n(new t.Image.filters.BlendImage(i))})}}(e),function(e){var t=e.fabric||(e.fabric={}),n=Math.pow,r=Math.floor,i=Math.sqrt,o=Math.abs,a=Math.round,s=Math.sin,l=Math.ceil,c=t.Image.filters,u=t.util.createClass;c.Resize=u(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(e,t){return{uDelta:e.getUniformLocation(t,"uDelta"),uTaps:e.getUniformLocation(t,"uTaps")}},sendUniformData:function(e,t){e.uniform2fv(t.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),e.uniform1fv(t.uTaps,this.taps)},retrieveShader:function(e){var t=this.getFilterWindow(),n=this.type+"_"+t;if(!e.programCache.hasOwnProperty(n)){var r=this.generateShader(t);e.programCache[n]=this.createProgram(e.context,r)}return e.programCache[n]},getFilterWindow:function(){var e=this.tempScale;return Math.ceil(this.lanczosLobes/e)},getTaps:function(){for(var e=this.lanczosCreate(this.lanczosLobes),t=this.tempScale,n=this.getFilterWindow(),r=new Array(n),i=1;i<=n;i++)r[i-1]=e(i*t);return r},generateShader:function(e){for(var t=new Array(e),n=this.fragmentSourceTOP,r=1;r<=e;r++)t[r-1]=r+".0 * uDelta";return n+="uniform float uTaps["+e+"];\n",n+="void main() {\n",n+=" vec4 color = texture2D(uTexture, vTexCoord);\n",n+=" float sum = 1.0;\n",t.forEach(function(e,t){n+=" color += texture2D(uTexture, vTexCoord + "+e+") * uTaps["+t+"];\n",n+=" color += texture2D(uTexture, vTexCoord - "+e+") * uTaps["+t+"];\n",n+=" sum += 2.0 * uTaps["+t+"];\n"}),n+=" gl_FragColor = color / sum;\n",n+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(e){e.webgl?(e.passes++,this.width=e.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=e.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),e.destinationWidth=this.dW,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceWidth=e.destinationWidth,this.height=e.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),e.destinationHeight=this.dH,this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e),e.sourceHeight=e.destinationHeight):this.applyTo2d(e)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(e){return function(t){if(t>=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var n=(t*=Math.PI)/e;return s(t)/t*s(n)/n}},applyTo2d:function(e){var t=e.imageData,n=this.scaleX,r=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/r;var i,o=t.width,s=t.height,l=a(o*n),c=a(s*r);"sliceHack"===this.resizeType?i=this.sliceByTwo(e,o,s,l,c):"hermite"===this.resizeType?i=this.hermiteFastResize(e,o,s,l,c):"bilinear"===this.resizeType?i=this.bilinearFiltering(e,o,s,l,c):"lanczos"===this.resizeType&&(i=this.lanczosResize(e,o,s,l,c)),e.imageData=i},sliceByTwo:function(e,n,i,o,a){var s,l,c=e.imageData,u=.5,d=!1,h=!1,f=n*u,p=i*u,g=t.filterBackend.resources,m=0,v=0,y=n,b=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((s=g.sliceByTwo).width<1.5*n||s.height<i)&&(s.width=1.5*n,s.height=i),(l=s.getContext("2d")).clearRect(0,0,1.5*n,i),l.putImageData(c,0,0),o=r(o),a=r(a);!d||!h;)n=f,i=p,o<r(f*u)?f=r(f*u):(f=o,d=!0),a<r(p*u)?p=r(p*u):(p=a,h=!0),l.drawImage(s,m,v,n,i,y,b,f,p),m=y,v=b,b+=p;return l.getImageData(m,v,o,a)},lanczosResize:function(e,t,a,s,c){var u=e.imageData.data,d=e.ctx.createImageData(s,c),h=d.data,f=this.lanczosCreate(this.lanczosLobes),p=this.rcpScaleX,g=this.rcpScaleY,m=2/this.rcpScaleX,v=2/this.rcpScaleY,y=l(p*this.lanczosLobes/2),b=l(g*this.lanczosLobes/2),w={},x={},C={};return function e(l){var _,S,k,A,j,E,I,T,O,F,P;for(x.x=(l+.5)*p,C.x=r(x.x),_=0;_<c;_++){for(x.y=(_+.5)*g,C.y=r(x.y),j=0,E=0,I=0,T=0,O=0,S=C.x-y;S<=C.x+y;S++)if(!(S<0||S>=t)){F=r(1e3*o(S-x.x)),w[F]||(w[F]={});for(var M=C.y-b;M<=C.y+b;M++)M<0||M>=a||(P=r(1e3*o(M-x.y)),w[F][P]||(w[F][P]=f(i(n(F*m,2)+n(P*v,2))/1e3)),(k=w[F][P])>0&&(j+=k,E+=k*u[A=4*(M*t+S)],I+=k*u[A+1],T+=k*u[A+2],O+=k*u[A+3]))}h[A=4*(_*s+l)]=E/j,h[A+1]=I/j,h[A+2]=T/j,h[A+3]=O/j}return++l<s?e(l):d}(0)},bilinearFiltering:function(e,t,n,i,o){var a,s,l,c,u,d,h,f,p,g=0,m=this.rcpScaleX,v=this.rcpScaleY,y=4*(t-1),b=e.imageData.data,w=e.ctx.createImageData(i,o),x=w.data;for(l=0;l<o;l++)for(c=0;c<i;c++)for(u=m*c-(a=r(m*c)),d=v*l-(s=r(v*l)),p=4*(s*t+a),h=0;h<4;h++)f=b[p+h]*(1-u)*(1-d)+b[p+4+h]*u*(1-d)+b[p+y+h]*d*(1-u)+b[p+y+4+h]*u*d,x[g++]=f;return w},hermiteFastResize:function(e,t,n,a,s){for(var c=this.rcpScaleX,u=this.rcpScaleY,d=l(c/2),h=l(u/2),f=e.imageData.data,p=e.ctx.createImageData(a,s),g=p.data,m=0;m<s;m++)for(var v=0;v<a;v++){for(var y=4*(v+m*a),b=0,w=0,x=0,C=0,_=0,S=0,k=0,A=(m+.5)*u,j=r(m*u);j<(m+1)*u;j++)for(var E=o(A-(j+.5))/h,I=(v+.5)*c,T=E*E,O=r(v*c);O<(v+1)*c;O++){var F=o(I-(O+.5))/d,P=i(T+F*F);P>1&&P<-1||(b=2*P*P*P-3*P*P+1)>0&&(k+=b*f[3+(F=4*(O+j*t))],x+=b,f[F+3]<255&&(b=b*f[F+3]/250),C+=b*f[F],_+=b*f[F+1],S+=b*f[F+2],w+=b)}g[y]=C/w,g[y+1]=_/w,g[y+2]=S/w,g[y+3]=k/x}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Contrast=r(n.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,n=e.imageData.data,r=n.length,i=Math.floor(255*this.contrast),o=259*(i+255)/(255*(259-i));for(t=0;t<r;t+=4)n[t]=o*(n[t]-128)+128,n[t+1]=o*(n[t+1]-128)+128,n[t+2]=o*(n[t+2]-128)+128}},getUniformLocations:function(e,t){return{uContrast:e.getUniformLocation(t,"uContrast")}},sendUniformData:function(e,t){e.uniform1f(t.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Saturation=r(n.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat rgMax = max(color.r, color.g);\nfloat rgbMax = max(rgMax, color.b);\ncolor.r += rgbMax != color.r ? (rgbMax - color.r) * uSaturation : 0.00;\ncolor.g += rgbMax != color.g ? (rgbMax - color.g) * uSaturation : 0.00;\ncolor.b += rgbMax != color.b ? (rgbMax - color.b) * uSaturation : 0.00;\ngl_FragColor = color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(e){if(0!==this.saturation){var t,n,r=e.imageData.data,i=r.length,o=-this.saturation;for(t=0;t<i;t+=4)n=Math.max(r[t],r[t+1],r[t+2]),r[t]+=n!==r[t]?(n-r[t])*o:0,r[t+1]+=n!==r[t+1]?(n-r[t+1])*o:0,r[t+2]+=n!==r[t+2]?(n-r[t+2])*o:0}},getUniformLocations:function(e,t){return{uSaturation:e.getUniformLocation(t,"uSaturation")}},sendUniformData:function(e,t){e.uniform1f(t.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Vibrance=r(n.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat max = max(color.r, max(color.g, color.b));\nfloat avg = (color.r + color.g + color.b) / 3.0;\nfloat amt = (abs(max - avg) * 2.0) * uVibrance;\ncolor.r += max != color.r ? (max - color.r) * amt : 0.00;\ncolor.g += max != color.g ? (max - color.g) * amt : 0.00;\ncolor.b += max != color.b ? (max - color.b) * amt : 0.00;\ngl_FragColor = color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(e){if(0!==this.vibrance){var t,n,r,i,o=e.imageData.data,a=o.length,s=-this.vibrance;for(t=0;t<a;t+=4)n=Math.max(o[t],o[t+1],o[t+2]),r=(o[t]+o[t+1]+o[t+2])/3,i=2*Math.abs(n-r)/255*s,o[t]+=n!==o[t]?(n-o[t])*i:0,o[t+1]+=n!==o[t+1]?(n-o[t+1])*i:0,o[t+2]+=n!==o[t+2]?(n-o[t+2])*i:0}},getUniformLocations:function(e,t){return{uVibrance:e.getUniformLocation(t,"uVibrance")}},sendUniformData:function(e,t){e.uniform1f(t.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Blur=r(n.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples = 15.0;\nvec3 v3offset = vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale) {\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main() {\nvec4 color = vec4(0.0);\nfloat total = 0.0;\nfloat offset = random(v3offset);\nfor (float t = -nSamples; t <= nSamples; t++) {\nfloat percent = (t + offset - 0.5) / nSamples;\nfloat weight = 1.0 - abs(percent);\ncolor += texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal += weight;\n}\ngl_FragColor = color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(e){e.webgl?(this.aspectRatio=e.sourceWidth/e.sourceHeight,e.passes++,this._setupFrameBuffer(e),this.horizontal=!0,this.applyToWebGL(e),this._swapTextures(e),this._setupFrameBuffer(e),this.horizontal=!1,this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},applyTo2d:function(e){e.imageData=this.simpleBlur(e)},simpleBlur:function(e){var n,r,i=e.filterBackend.resources,o=e.imageData.width,a=e.imageData.height;i.blurLayer1||(i.blurLayer1=t.util.createCanvasElement(),i.blurLayer2=t.util.createCanvasElement()),n=i.blurLayer1,r=i.blurLayer2,(n.width!==o||n.height!==a)&&(r.width=n.width=o,r.height=n.height=a);var s,l,c,u,d=n.getContext("2d"),h=r.getContext("2d"),f=15,p=.06*this.blur*.5;for(d.putImageData(e.imageData,0,0),h.clearRect(0,0,o,a),u=-f;u<=f;u++)c=p*(l=u/f)*o+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(n,c,s),d.drawImage(r,0,0),h.globalAlpha=1,h.clearRect(0,0,r.width,r.height);for(u=-f;u<=f;u++)c=p*(l=u/f)*a+(s=(Math.random()-.5)/4),h.globalAlpha=1-Math.abs(l),h.drawImage(n,s,c),d.drawImage(r,0,0),h.globalAlpha=1,h.clearRect(0,0,r.width,r.height);e.ctx.drawImage(n,0,0);var g=e.ctx.getImageData(0,0,n.width,n.height);return d.globalAlpha=1,d.clearRect(0,0,n.width,n.height),g},getUniformLocations:function(e,t){return{delta:e.getUniformLocation(t,"uDelta")}},sendUniformData:function(e,t){var n=this.chooseRightDelta();e.uniform2fv(t.delta,n)},chooseRightDelta:function(){var e,t=1,n=[0,0];return this.horizontal?this.aspectRatio>1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?n[0]=e:n[1]=e,n}}),n.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Gamma=r(n.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],n.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,n=e.imageData.data,r=this.gamma,i=n.length,o=1/r[0],a=1/r[1],s=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,i=256;t<i;t++)this.rVals[t]=255*Math.pow(t/255,o),this.gVals[t]=255*Math.pow(t/255,a),this.bVals[t]=255*Math.pow(t/255,s);for(t=0,i=n.length;t<i;t+=4)n[t]=this.rVals[n[t]],n[t+1]=this.gVals[n[t+1]],n[t+2]=this.bVals[n[t+2]]},getUniformLocations:function(e,t){return{uGamma:e.getUniformLocation(t,"uGamma")}},sendUniformData:function(e,t){e.uniform3fv(t.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Composed=r(n.BaseFilter,{type:"Composed",subFilters:[],initialize:function(e){this.callSuper("initialize",e),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return t.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(e){return e.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(e){return!e.isNeutralState()})}}),t.Image.filters.Composed.fromObject=function(e,n){var r=(e.subFilters||[]).map(function(e){return new t.Image.filters[e.type](e)}),i=new t.Image.filters.Composed({subFilters:r});return n&&n(i),i}}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.HueRotation=r(n.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var e=this.rotation*Math.PI,n=t.util.cos(e),r=t.util.sin(e),i=1/3,o=Math.sqrt(i)*r,a=1-n;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=n+a/3,this.matrix[1]=i*a-o,this.matrix[2]=i*a+o,this.matrix[5]=i*a+o,this.matrix[6]=n+i*a,this.matrix[7]=i*a-o,this.matrix[10]=i*a-o,this.matrix[11]=i*a+o,this.matrix[12]=n+i*a},isNeutralState:function(e){return this.calculateMatrix(),n.BaseFilter.prototype.isNeutralState.call(this,e)},applyTo:function(e){this.calculateMatrix(),n.BaseFilter.prototype.applyTo.call(this,e)}}),t.Image.filters.HueRotation.fromObject=t.Image.filters.BaseFilter.fromObject}(e),function(e){var t=e.fabric||(e.fabric={}),n=t.util.object.clone;if(t.Text)t.warn("fabric.Text is already defined");else{var r="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign".split(" ");t.Text=t.util.createClass(t.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:t.Object.prototype.stateProperties.concat(r),cacheProperties:t.Object.prototype.cacheProperties.concat(r),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(e,t){this.styles=t&&t.styles||{},this.text=e,this.__skipDimension=!0,this.callSuper("initialize",t),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var e=this.path;e&&(e.segmentsInfo=t.util.getPathSegmentsInfo(e.path))},getMeasuringContext:function(){return t._measuringContext||(t._measuringContext=this.canvas&&this.canvas.contextCache||t.util.createCanvasElement().getContext("2d")),t._measuringContext},_splitText:function(){var e=this._splitTextIntoLines(this.text);return this.textLines=e.lines,this._textLines=e.graphemeLines,this._unwrappedTextLines=e._unwrappedLines,this._text=e.graphemeText,e},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var e,t,n,r,i,o,a,s=0,l=this._textLines.length;s<l;s++)if(("justify"===this.textAlign||s!==l-1&&!this.isEndOfWrapping(s))&&(r=0,i=this._textLines[s],(t=this.getLineWidth(s))<this.width&&(a=this.textLines[s].match(this._reSpacesAndTabs)))){n=a.length,e=(this.width-t)/n;for(var c=0,u=i.length;c<=u;c++)o=this.__charBounds[s][c],this._reSpaceAndTab.test(i[c])?(o.width+=e,o.kernedWidth+=e,o.left+=r,r+=e):o.left+=r}},isEndOfWrapping:function(e){return e===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,n){if(e.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":e.textBaseline="middle";break;case"ascender":e.textBaseline="top";break;case"descender":e.textBaseline="bottom"}e.font=this._getFontDeclaration(t,n)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,n=this._textLines.length;t<n;t++){var r=this.getLineWidth(t);r>e&&(e=r)}return e},_renderTextLine:function(e,t,n,r,i,o){this._renderChars(e,t,n,r,i,o)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,n,r,i,o,a,s,l=e.fillStyle,c=this._getLeftOffset(),u=this._getTopOffset(),d=0,h=0,f=this.path,p=0,g=this._textLines.length;p<g;p++)if(t=this.getHeightOfLine(p),this.textBackgroundColor||this.styleHas("textBackgroundColor",p)){r=this._textLines[p],n=this._getLineLeftOffset(p),h=0,d=0,i=this.getValueOfPropertyAt(p,0,"textBackgroundColor");for(var m=0,v=r.length;m<v;m++)o=this.__charBounds[p][m],a=this.getValueOfPropertyAt(p,m,"textBackgroundColor"),f?(e.save(),e.translate(o.renderLeft,o.renderTop),e.rotate(o.angle),e.fillStyle=a,a&&e.fillRect(-o.width/2,-t/this.lineHeight*(1-this._fontSizeFraction),o.width,t/this.lineHeight),e.restore()):a!==i?(s=c+n+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=i,i&&e.fillRect(s,u,h,t/this.lineHeight),d=o.left,h=o.width,i=a):h+=o.kernedWidth;a&&!f&&(s=c+n+d,"rtl"===this.direction&&(s=this.width-s-h),e.fillStyle=a,e.fillRect(s,u,h,t/this.lineHeight)),u+=t}else u+=t;e.fillStyle=l,this._removeShadow(e)}},getFontCache:function(e){var n=e.fontFamily.toLowerCase();t.charWidthsCache[n]||(t.charWidthsCache[n]={});var r=t.charWidthsCache[n],i=e.fontStyle.toLowerCase()+"_"+(e.fontWeight+"").toLowerCase();return r[i]||(r[i]={}),r[i]},_measureChar:function(e,t,n,r){var i,o,a,s,l=this.getFontCache(t),c=n+e,u=this._getFontDeclaration(t)===this._getFontDeclaration(r),d=t.fontSize/this.CACHE_FONT_SIZE;if(n&&void 0!==l[n]&&(a=l[n]),void 0!==l[e]&&(s=i=l[e]),u&&void 0!==l[c]&&(s=(o=l[c])-a),void 0===i||void 0===a||void 0===o){var h=this.getMeasuringContext();this._setTextStyles(h,t,!0)}return void 0===i&&(s=i=h.measureText(e).width,l[e]=i),void 0===a&&u&&n&&(a=h.measureText(n).width,l[n]=a),u&&void 0===o&&(o=h.measureText(c).width,l[c]=o,s=o-a),{width:i*d,kernedWidth:s*d}},getHeightOfChar:function(e,t){return this.getValueOfPropertyAt(e,t,"fontSize")},measureLine:function(e){var t=this._measureLine(e);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(e){var n,r,i,o,a,s,l=0,c=this._textLines[e],u=new Array(c.length),d=0,h=this.path,f="right"===this.pathSide;for(this.__charBounds[e]=u,n=0;n<c.length;n++)r=c[n],o=this._getGraphemeBox(r,e,n,i),u[n]=o,l+=o.kernedWidth,i=r;if(u[n]={left:o?o.left+o.width:0,width:0,kernedWidth:0,height:this.fontSize},h){switch(s=h.segmentsInfo[h.segmentsInfo.length-1].length,(a=t.util.getPointOnPath(h.path,0,h.segmentsInfo)).x+=h.pathOffset.x,a.y+=h.pathOffset.y,this.textAlign){case"left":d=f?s-l:0;break;case"center":d=(s-l)/2;break;case"right":d=f?0:s-l}for(d+=this.pathStartOffset*(f?-1:1),n=f?c.length-1:0;f?n>=0:n<c.length;f?n--:n++)o=u[n],d>s?d%=s:d<0&&(d+=s),this._setGraphemeOnPath(d,o,a),d+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,n,r){var i=e+n.kernedWidth/2,o=this.path,a=t.util.getPointOnPath(o.path,i,o.segmentsInfo);n.renderLeft=a.x-r.x,n.renderTop=a.y-r.y,n.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,n,r,i){var o,a=this.getCompleteStyleDeclaration(t,n),s=r?this.getCompleteStyleDeclaration(t,n-1):{},l=this._measureChar(e,a,r,s),c=l.kernedWidth,u=l.width;0!==this.charSpacing&&(u+=o=this._getWidthOfCharSpacing(),c+=o);var d={width:u,left:0,height:a.fontSize,kernedWidth:c,deltaY:a.deltaY};if(n>0&&!i){var h=this.__charBounds[t][n-1];d.left=h.left+h.width+l.kernedWidth-l.width}return d},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],n=this.getHeightOfChar(e,0),r=1,i=t.length;r<i;r++)n=Math.max(this.getHeightOfChar(e,r),n);return this.__lineHeights[e]=n*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var e,t=0,n=0,r=this._textLines.length;n<r;n++)e=this.getHeightOfLine(n),t+=n===r-1?e/this.lineHeight:e;return t},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(e,t){e.save();for(var n=0,r=this._getLeftOffset(),i=this._getTopOffset(),o=0,a=this._textLines.length;o<a;o++){var s=this.getHeightOfLine(o),l=s/this.lineHeight,c=this._getLineLeftOffset(o);this._renderTextLine(t,e,this._textLines[o],r+c,i+n+l,o),n+=s}e.restore()},_renderTextFill:function(e){!this.fill&&!this.styleHas("fill")||this._renderTextCommon(e,"fillText")},_renderTextStroke:function(e){(!this.stroke||0===this.strokeWidth)&&this.isEmptyStyles()||(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this._setLineDash(e,this.strokeDashArray),e.beginPath(),this._renderTextCommon(e,"strokeText"),e.closePath(),e.restore())},_renderChars:function(e,n,r,i,o,a){var s,l,c,u,d,h=this.getHeightOfLine(a),f=-1!==this.textAlign.indexOf("justify"),p="",g=0,m=this.path,v=!f&&0===this.charSpacing&&this.isEmptyStyles(a)&&!m,y="ltr"===this.direction,b="ltr"===this.direction?1:-1,w=n.canvas.getAttribute("dir");if(n.save(),w!==this.direction&&(n.canvas.setAttribute("dir",y?"ltr":"rtl"),n.direction=y?"ltr":"rtl",n.textAlign=y?"left":"right"),o-=h*this._fontSizeFraction/this.lineHeight,v)return this._renderChar(e,n,a,0,r.join(""),i,o,h),void n.restore();for(var x=0,C=r.length-1;x<=C;x++)u=x===C||this.charSpacing||m,p+=r[x],c=this.__charBounds[a][x],0===g?(i+=b*(c.kernedWidth-c.width),g+=c.width):g+=c.kernedWidth,f&&!u&&this._reSpaceAndTab.test(r[x])&&(u=!0),u||(s=s||this.getCompleteStyleDeclaration(a,x),l=this.getCompleteStyleDeclaration(a,x+1),u=t.util.hasStyleChanged(s,l,!1)),u&&(m?(n.save(),n.translate(c.renderLeft,c.renderTop),n.rotate(c.angle),this._renderChar(e,n,a,x,p,-g/2,0,h),n.restore()):(d=i,this._renderChar(e,n,a,x,p,d,o,h)),p="",s=l,i+=b*g,g=0);n.restore()},_applyPatternGradientTransformText:function(e){var n,r=t.util.createCanvasElement(),i=this.width+this.strokeWidth,o=this.height+this.strokeWidth;return r.width=i,r.height=o,(n=r.getContext("2d")).beginPath(),n.moveTo(0,0),n.lineTo(i,0),n.lineTo(i,o),n.lineTo(0,o),n.closePath(),n.translate(i/2,o/2),n.fillStyle=e.toLive(n),this._applyPatternGradientTransform(n,e),n.fill(),n.createPattern(r,"no-repeat")},handleFiller:function(e,t,n){var r,i;return n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?(r=-this.width/2,i=-this.height/2,e.translate(r,i),e[t]=this._applyPatternGradientTransformText(n),{offsetX:r,offsetY:i}):(e[t]=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):(e[t]=n,{offsetX:0,offsetY:0})},_setStrokeStyles:function(e,t){return e.lineWidth=t.strokeWidth,e.lineCap=this.strokeLineCap,e.lineDashOffset=this.strokeDashOffset,e.lineJoin=this.strokeLineJoin,e.miterLimit=this.strokeMiterLimit,this.handleFiller(e,"strokeStyle",t.stroke)},_setFillStyles:function(e,t){return this.handleFiller(e,"fillStyle",t.fill)},_renderChar:function(e,t,n,r,i,o,a){var s,l,c=this._getStyleDeclaration(n,r),u=this.getCompleteStyleDeclaration(n,r),d="fillText"===e&&u.fill,h="strokeText"===e&&u.stroke&&u.strokeWidth;!h&&!d||(t.save(),d&&(s=this._setFillStyles(t,u)),h&&(l=this._setStrokeStyles(t,u)),t.font=this._getFontDeclaration(u),c&&c.textBackgroundColor&&this._removeShadow(t),c&&c.deltaY&&(a+=c.deltaY),d&&t.fillText(i,o-s.offsetX,a-s.offsetY),h&&t.strokeText(i,o-l.offsetX,a-l.offsetY),t.restore())},setSuperscript:function(e,t){return this._setScript(e,t,this.superscript)},setSubscript:function(e,t){return this._setScript(e,t,this.subscript)},_setScript:function(e,t,n){var r=this.get2DCursorLocation(e,!0),i=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,"fontSize"),o=this.getValueOfPropertyAt(r.lineIndex,r.charIndex,"deltaY"),a={fontSize:i*n.size,deltaY:o+i*n.baseline};return this.setSelectionStyles(a,e,t),this},_getLineLeftOffset:function(e){var t=this.getLineWidth(e),n=this.width-t,r=this.textAlign,i=this.direction,o=0,a=this.isEndOfWrapping(e);return"justify"===r||"justify-center"===r&&!a||"justify-right"===r&&!a||"justify-left"===r&&!a?0:("center"===r&&(o=n/2),"right"===r&&(o=n),"justify-center"===r&&(o=n/2),"justify-right"===r&&(o=n),"rtl"===i&&(o-=n),o)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var e=this._forceClearCache;return e||(e=this.hasStateChanged("_dimensionAffectingProps")),e&&(this.dirty=!0,this._forceClearCache=!1),e},getLineWidth:function(e){if(void 0!==this.__lineWidths[e])return this.__lineWidths[e];var t=this.measureLine(e).width;return this.__lineWidths[e]=t,t},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(e,t,n){var r=this._getStyleDeclaration(e,t);return r&&typeof r[n]<"u"?r[n]:this[n]},_renderTextDecoration:function(e,t){if(this[t]||this.styleHas(t)){for(var n,r,i,o,a,s,l,c,u,d,h,f,p,g,m,v,y=this._getLeftOffset(),b=this._getTopOffset(),w=this.path,x=this._getWidthOfCharSpacing(),C=this.offsets[t],_=0,S=this._textLines.length;_<S;_++)if(n=this.getHeightOfLine(_),this[t]||this.styleHas(t,_)){l=this._textLines[_],g=n/this.lineHeight,o=this._getLineLeftOffset(_),d=0,h=0,c=this.getValueOfPropertyAt(_,0,t),v=this.getValueOfPropertyAt(_,0,"fill"),u=b+g*(1-this._fontSizeFraction),r=this.getHeightOfChar(_,0),a=this.getValueOfPropertyAt(_,0,"deltaY");for(var k=0,A=l.length;k<A;k++)if(f=this.__charBounds[_][k],p=this.getValueOfPropertyAt(_,k,t),m=this.getValueOfPropertyAt(_,k,"fill"),i=this.getHeightOfChar(_,k),s=this.getValueOfPropertyAt(_,k,"deltaY"),w&&p&&m)e.save(),e.fillStyle=v,e.translate(f.renderLeft,f.renderTop),e.rotate(f.angle),e.fillRect(-f.kernedWidth/2,C*i+s,f.kernedWidth,this.fontSize/15),e.restore();else if((p!==c||m!==v||i!==r||s!==a)&&h>0){var j=y+o+d;"rtl"===this.direction&&(j=this.width-j-h),c&&v&&(e.fillStyle=v,e.fillRect(j,u+C*r+a,h,this.fontSize/15)),d=f.left,h=f.width,c=p,v=m,r=i,a=s}else h+=f.kernedWidth;j=y+o+d,"rtl"===this.direction&&(j=this.width-j-h),e.fillStyle=m,p&&m&&e.fillRect(j,u+C*r+a,h-x,this.fontSize/15),b+=n}else b+=n;this._removeShadow(e)}},_getFontDeclaration:function(e,n){var r=e||this,i=this.fontFamily,o=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,a=void 0===i||i.indexOf("'")>-1||i.indexOf(",")>-1||i.indexOf('"')>-1||o?r.fontFamily:'"'+r.fontFamily+'"';return[t.isLikelyNode?r.fontWeight:r.fontStyle,t.isLikelyNode?r.fontStyle:r.fontWeight,n?this.CACHE_FONT_SIZE+"px":r.fontSize+"px",a].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var n=e.split(this._reNewline),r=new Array(n.length),i=["\n"],o=[],a=0;a<n.length;a++)r[a]=t.util.string.graphemeSplit(n[a]),o=o.concat(r[a],i);return o.pop(),{_unwrappedLines:r,lines:n,graphemeText:o,graphemeLines:r}},toObject:function(e){var n=r.concat(e),i=this.callSuper("toObject",n);return i.styles=t.util.stylesToArray(this.styles,this.text),i.path&&(i.path=this.path.toObject()),i},set:function(e,t){this.callSuper("set",e,t);var n=!1,r=!1;if("object"==typeof e)for(var i in e)"path"===i&&this.setPathInfo(),n=n||-1!==this._dimensionAffectingProps.indexOf(i),r=r||"path"===i;else n=-1!==this._dimensionAffectingProps.indexOf(e),r="path"===e;return r&&this.setPathInfo(),n&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),t.Text.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),t.Text.DEFAULT_SVG_FONT_SIZE=16,t.Text.fromElement=function(e,r,i){if(!e)return r(null);var o=t.parseAttributes(e,t.Text.ATTRIBUTE_NAMES),a=o.textAnchor||"left";if((i=t.util.object.extend(i?n(i):{},o)).top=i.top||0,i.left=i.left||0,o.textDecoration){var s=o.textDecoration;-1!==s.indexOf("underline")&&(i.underline=!0),-1!==s.indexOf("overline")&&(i.overline=!0),-1!==s.indexOf("line-through")&&(i.linethrough=!0),delete i.textDecoration}"dx"in o&&(i.left+=o.dx),"dy"in o&&(i.top+=o.dy),"fontSize"in i||(i.fontSize=t.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in e?l=e.textContent:"firstChild"in e&&null!==e.firstChild&&"data"in e.firstChild&&null!==e.firstChild.data&&(l=e.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=i.strokeWidth;i.strokeWidth=0;var u=new t.Text(l,i),d=u.getScaledHeight()/u.height,h=((u.height+u.strokeWidth)*u.lineHeight-u.height)*d,f=u.getScaledHeight()+h,p=0;"center"===a&&(p=u.getScaledWidth()/2),"right"===a&&(p=u.getScaledWidth()),u.set({left:u.left-p,top:u.top-(f-u.fontSize*(.07+u._fontSizeFraction))/u.lineHeight,strokeWidth:typeof c<"u"?c:1}),r(u)},t.Text.fromObject=function(e,r){var i=n(e),o=e.path;return delete i.path,t.Object._fromObject("Text",i,function(n){n.styles=t.util.stylesFromArray(e.styles,e.text),o?t.Object._fromObject("Path",o,function(e){n.set("path",e),r(n)},"path"):r(n)},"text")},t.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],t.util.createAccessors&&t.util.createAccessors(t.Text)}}(e),n.util.object.extend(n.Text.prototype,{isEmptyStyles:function(e){if(!this.styles||typeof e<"u"&&!this.styles[e])return!0;var t=typeof e>"u"?this.styles:{line:this.styles[e]};for(var n in t)for(var r in t[n])for(var i in t[n][r])return!1;return!0},styleHas:function(e,t){if(!this.styles||!e||""===e||typeof t<"u"&&!this.styles[t])return!1;var n=typeof t>"u"?this.styles:{0:this.styles[t]};for(var r in n)for(var i in n[r])if(typeof n[r][i][e]<"u")return!0;return!1},cleanStyle:function(e){if(!this.styles||!e||""===e)return!1;var t,n,r=this.styles,i=0,o=!0,a=0;for(var s in r){for(var l in t=0,r[s]){var c;i++,(c=r[s][l]).hasOwnProperty(e)?(n?c[e]!==n&&(o=!1):n=c[e],c[e]===this[e]&&delete c[e]):o=!1,0!==Object.keys(c).length?t++:delete r[s][l]}0===t&&delete r[s]}for(var u=0;u<this._textLines.length;u++)a+=this._textLines[u].length;o&&i===a&&(this[e]=n,this.removeStyle(e))},removeStyle:function(e){if(this.styles&&e&&""!==e){var t,n,r,i=this.styles;for(n in i){for(r in t=i[n])delete t[r][e],0===Object.keys(t[r]).length&&delete t[r];0===Object.keys(t).length&&delete i[n]}}},_extendStyles:function(e,t){var r=this.get2DCursorLocation(e);this._getLineStyle(r.lineIndex)||this._setLineStyle(r.lineIndex),this._getStyleDeclaration(r.lineIndex,r.charIndex)||this._setStyleDeclaration(r.lineIndex,r.charIndex,{}),n.util.object.extend(this._getStyleDeclaration(r.lineIndex,r.charIndex),t)},get2DCursorLocation:function(e,t){typeof e>"u"&&(e=this.selectionStart);for(var n=t?this._unwrappedTextLines:this._textLines,r=n.length,i=0;i<r;i++){if(e<=n[i].length)return{lineIndex:i,charIndex:e};e-=n[i].length+this.missingNewlineOffset(i)}return{lineIndex:i-1,charIndex:n[i-1].length<e?n[i-1].length:e}},getSelectionStyles:function(e,t,n){typeof e>"u"&&(e=this.selectionStart||0),typeof t>"u"&&(t=this.selectionEnd||e);for(var r=[],i=e;i<t;i++)r.push(this.getStyleAtPosition(i,n));return r},getStyleAtPosition:function(e,t){var n=this.get2DCursorLocation(e);return(t?this.getCompleteStyleDeclaration(n.lineIndex,n.charIndex):this._getStyleDeclaration(n.lineIndex,n.charIndex))||{}},setSelectionStyles:function(e,t,n){typeof t>"u"&&(t=this.selectionStart||0),typeof n>"u"&&(n=this.selectionEnd||t);for(var r=t;r<n;r++)this._extendStyles(r,e);return this._forceClearCache=!0,this},_getStyleDeclaration:function(e,t){var n=this.styles&&this.styles[e];return n?n[t]:null},getCompleteStyleDeclaration:function(e,t){for(var n,r=this._getStyleDeclaration(e,t)||{},i={},o=0;o<this._styleProperties.length;o++)i[n=this._styleProperties[o]]=typeof r[n]>"u"?this[n]:r[n];return i},_setStyleDeclaration:function(e,t,n){this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){delete this.styles[e][t]},_getLineStyle:function(e){return!!this.styles[e]},_setLineStyle:function(e){this.styles[e]={}},_deleteLineStyle:function(e){delete this.styles[e]}}),function(){function e(e){e.textDecoration&&(e.textDecoration.indexOf("underline")>-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}n.IText=n.util.createClass(n.Text,n.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,n=this.canvas.viewportTransform;t.save(),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,n=this.height+4;e.clearRect(-t/2,-n/2,t,n)},_getCursorBoundaries:function(e){typeof e>"u"&&(e=this.selectionStart);var t=this._getLeftOffset(),n=this._getTopOffset(),r=this._getCursorBoundariesOffsets(e);return{left:t,top:n,leftOffset:r.left,topOffset:r.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,n,r,i,o=0,a=0,s=this.get2DCursorLocation(e);r=s.charIndex,n=s.lineIndex;for(var l=0;l<n;l++)o+=this.getHeightOfLine(l);t=this._getLineLeftOffset(n);var c=this.__charBounds[n][r];return c&&(a=c.left),0!==this.charSpacing&&r===this._textLines[n].length&&(a-=this._getWidthOfCharSpacing()),i={top:o,left:t+(a>0?a:0)},"rtl"===this.direction&&(i.left*=-1),this.cursorOffsetCache=i,this.cursorOffsetCache},renderCursor:function(e,t){var n=this.get2DCursorLocation(),r=n.lineIndex,i=n.charIndex>0?n.charIndex-1:0,o=this.getValueOfPropertyAt(r,i,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,l=e.topOffset,c=this.getValueOfPropertyAt(r,i,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(r)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(r,i,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+c,s,o)},renderSelection:function(e,t){for(var n=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,r=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(n),a=this.get2DCursorLocation(r),s=o.lineIndex,l=a.lineIndex,c=o.charIndex<0?0:o.charIndex,u=a.charIndex<0?0:a.charIndex,d=s;d<=l;d++){var h,f=this._getLineLeftOffset(d)||0,p=this.getHeightOfLine(d),g=0,m=0;if(d===s&&(g=this.__charBounds[s][c].left),d>=s&&d<l)m=i&&!this.isEndOfWrapping(d)?this.width:this.getLineWidth(d)||5;else if(d===l)if(0===u)m=this.__charBounds[l][u].left;else{var v=this._getWidthOfCharSpacing();m=this.__charBounds[l][u-1].left+this.__charBounds[l][u-1].width-v}h=p,(this.lineHeight<1||d===l&&this.lineHeight>1)&&(p/=this.lineHeight);var y=e.left+f+g,b=m-g,w=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=p):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(y=this.width-y-b),t.fillRect(y,e.top+e.topOffset+x,b,w),e.topOffset+=h}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),n.IText.fromObject=function(t,r){var i=n.util.stylesFromArray(t.styles,t.text),o=Object.assign({},t,{styles:i});if(e(o),o.styles)for(var a in o.styles)for(var s in o.styles[a])e(o.styles[a][s]);n.Object._fromObject("IText",o,r,"text")}}(),function(){var e=n.util.object.clone;n.util.object.extend(n.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on("removed",function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],n.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))})},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.__isMousedown=!1})},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,n,r){var i;return i={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:n,onComplete:function(){i.isAborted||e[r]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(e){var t=this,n=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){t._tick()},n)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,n=e-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n--;for(;/\S/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findWordBoundaryRight:function(e){var t=0,n=e;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n++;for(;/\S/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},findLineBoundaryLeft:function(e){for(var t=0,n=e-1;!/\n/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findLineBoundaryRight:function(e){for(var t=0,n=e;!/\n/.test(this._text[n])&&n<this._text.length;)t++,n++;return e+t},searchWordBoundary:function(e,t){for(var r=this._text,i=this._reSpace.test(r[e])?e-1:e,o=r[i],a=n.reNonWord;!a.test(o)&&i>0&&i<r.length;)o=r[i+=t];return a.test(o)&&(i+=1===t?0:1),i},selectWord:function(e){e=e||this.selectionStart;var t=this.searchWordBoundary(e,-1),n=this.searchWordBoundary(e,1);this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(e){e=e||this.selectionStart;var t=this.findLineBoundaryLeft(e),n=this.findLineBoundaryRight(e);return this.selectionStart=t,this.selectionEnd=n,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(e){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(e),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas?(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll(),this):this},exitEditingOnOthers:function(e){e._iTextInstances&&e._iTextInstances.forEach(function(e){e.selected=!1,e.isEditing&&e.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(e){if(this.__isMousedown&&this.isEditing){document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus();var t=this.getSelectionStartFromPointer(e.e),n=this.selectionStart,r=this.selectionEnd;(t!==this.__selectionStartOnMouseDown||n===r)&&(n===t||r===t)||(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),(this.selectionStart!==n||this.selectionEnd!==r)&&(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,t,r){var i=r.slice(0,e),o=n.util.string.graphemeSplit(i).length;if(e===t)return{selectionStart:o,selectionEnd:o};var a=r.slice(e,t);return{selectionStart:o,selectionEnd:o+n.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,n){var r=n.slice(0,e).join("").length;return e===t?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+n.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,t=this._getCursorBoundaries(e),r=this.get2DCursorLocation(e),i=r.lineIndex,o=r.charIndex,a=this.getValueOfPropertyAt(i,o,"fontSize")*this.lineHeight,s=t.leftOffset,l=this.calcTransformMatrix(),c={x:t.left+s,y:t.top+t.topOffset+a},u=this.canvas.getRetinaScaling(),d=this.canvas.upperCanvasEl,h=d.width/u,f=d.height/u,p=h-a,g=f-a,m=d.clientWidth/h,v=d.clientHeight/f;return c=n.util.transformPoint(c,l),(c=n.util.transformPoint(c,this.canvas.viewportTransform)).x*=m,c.y*=v,c.x<0&&(c.x=0),c.x>p&&(c.x=p),c.y<0&&(c.y=0),c.y>g&&(c.y=g),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var n,r,i=this.get2DCursorLocation(e,!0),o=this.get2DCursorLocation(t,!0),a=i.lineIndex,s=i.charIndex,l=o.lineIndex,c=o.charIndex;if(a!==l){if(this.styles[a])for(n=s;n<this._unwrappedTextLines[a].length;n++)delete this.styles[a][n];if(this.styles[l])for(n=c;n<this._unwrappedTextLines[l].length;n++)(r=this.styles[l][n])&&(this.styles[a]||(this.styles[a]={}),this.styles[a][s+n-c]=r);for(n=a+1;n<=l;n++)delete this.styles[n];this.shiftLineStyles(l,a-l)}else if(this.styles[a]){r=this.styles[a];var u,d,h=c-s;for(n=s;n<c;n++)delete r[n];for(d in this.styles[a])(u=parseInt(d,10))>=c&&(r[u-h]=r[d],delete r[d])}},shiftLineStyles:function(t,n){var r=e(this.styles);for(var i in this.styles){var o=parseInt(i,10);o>t&&(this.styles[o+n]=r[o],r[o-n]||delete this.styles[o])}},restartCursorIfNeeded:function(){(!this._currentTickState||this._currentTickState.isAborted||!this._currentTickCompleteState||this._currentTickCompleteState.isAborted)&&this.initDelayedCursor()},insertNewlineStyleObject:function(t,n,r,i){var o,a={},s=!1,l=this._unwrappedTextLines[t].length===n;for(var c in r||(r=1),this.shiftLineStyles(t,r),this.styles[t]&&(o=this.styles[t][0===n?n:n-1]),this.styles[t]){var u=parseInt(c,10);u>=n&&(s=!0,a[u-n]=this.styles[t][c],l&&0===n||delete this.styles[t][c])}var d=!1;for(s&&!l&&(this.styles[t+r]=a,d=!0),d&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:e(i[r-1])}:o?this.styles[t+r]={0:e(o)}:delete this.styles[t+r],r--;this._forceClearCache=!0},insertCharStyleObject:function(t,n,r,i){this.styles||(this.styles={});var o=this.styles[t],a=o?e(o):{};for(var s in r||(r=1),a){var l=parseInt(s,10);l>=n&&(o[l+r]=a[l],a[l-r]||delete o[l])}if(this._forceClearCache=!0,i)for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][n+r]=e(i[r]));else if(o)for(var c=o[n?n-1:1];c&&r--;)this.styles[t][n+r]=e(c)},insertNewStyleBlock:function(e,t,n){for(var r=this.get2DCursorLocation(t,!0),i=[0],o=0,a=0;a<e.length;a++)"\n"===e[a]?i[++o]=0:i[o]++;for(i[0]>0&&(this.insertCharStyleObject(r.lineIndex,r.charIndex,i[0],n),n=n&&n.slice(i[0]+1)),o&&this.insertNewlineStyleObject(r.lineIndex,r.charIndex+i[0],o),a=1;a<o;a++)i[a]>0?this.insertCharStyleObject(r.lineIndex+a,0,i[a],n):n&&this.styles[r.lineIndex+a]&&n[0]&&(this.styles[r.lineIndex+a][0]=n[0]),n=n&&n.slice(i[a]+1);i[a]>0&&this.insertCharStyleObject(r.lineIndex+a,0,i[a],n)},setSelectionStartEndWithShift:function(e,t,n){n<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=n):n>e&&n<t?"right"===this._selectionDirection?this.selectionEnd=n:this.selectionStart=n:(t===e?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=t),this.selectionEnd=n)},setSelectionInBoundaries:function(){var e=this.text.length;this.selectionStart>e?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),n.util.object.extend(n.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),n=this.selectionStart,r=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(n,r,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,n=this.getLocalPointer(e),r=0,i=0,o=0,a=0,s=0,l=0,c=this._textLines.length;l<c&&o<=n.y;l++)o+=this.getHeightOfLine(l)*this.scaleY,s=l,l>0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));i=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(n.x=this.width*this.scaleX-n.x+i);for(var u=0,d=t.length;u<d&&(r=i,(i+=this.__charBounds[s][u].kernedWidth*this.scaleX)<=n.x);u++)a++;return this._getNewSelectionStartFromOffset(n,r,i,a,d)},_getNewSelectionStartFromOffset:function(e,t,n,r,i){var o=e.x-t,a=n-e.x,s=r+(a>o||a<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),n.util.object.extend(n.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=n.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):n.document.body.appendChild(this.hiddenTextarea),n.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),n.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),n.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),n.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),n.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),n.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),n.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),n.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),n.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(n.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var t=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var r,i,o,a,s,l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,c=this._text.length,u=l.length,d=u-c,h=this.selectionStart,f=this.selectionEnd,p=h!==f;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),m=h>g.selectionStart;p?(r=this._text.slice(h,f),d+=f-h):u<c&&(r=m?this._text.slice(f+d,f):this._text.slice(h,h-d)),i=l.slice(g.selectionEnd-d,g.selectionEnd),r&&r.length&&(i.length&&(o=this.getSelectionStyles(h,h+1,!1),o=i.map(function(){return o[0]})),p?(a=h,s=f):m?(a=f-r.length,s=f):(a=f,s=f+r.length),this.removeStyleFromTo(a,s)),i.length&&(t&&i.join("")===n.copiedText&&!n.disableStyleCopyPaste&&(o=n.copiedTextStyle),this.insertNewStyleBlock(i,h,o)),this.updateFromTextArea(),this.fire("changed"),this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())}},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(e){this.compositionStart=e.target.selectionStart,this.compositionEnd=e.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(n.copiedText=this.getSelectedText(),n.disableStyleCopyPaste?n.copiedTextStyle=null:n.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(e){return e&&e.clipboardData||n.window.clipboardData},_getWidthBeforeCursor:function(e,t){var n,r=this._getLineLeftOffset(e);return t>0&&(r+=(n=this.__charBounds[e][t-1]).left+n.width),r},getDownCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-n;var o=r.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i+1,a);return this._textLines[i].slice(o).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(0===i||e.metaKey||33===e.keyCode)return-n;var o=r.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i-1,a),l=this._textLines[i].slice(0,o),c=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-l.length+(1-c)},_getIndexOnLine:function(e,t){for(var n,r,i=this._textLines[e],o=this._getLineLeftOffset(e),a=0,s=0,l=i.length;s<l;s++)if((o+=n=this.__charBounds[e][s].width)>t){r=!0;var c=o-n,u=o,d=Math.abs(c-t);a=Math.abs(u-t)<d?s:s-1;break}return r||(a=i.length-1),a},moveCursorDown:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var n=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),0!==n&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,n){var r;if(e.altKey)r=this["findWordBoundary"+n](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===n?-1:1,!0;r=this["findLineBoundary"+n](this[t])}if(typeof r<"u"&&this[t]!==r)return this[t]=r,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var n="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?n+="Shift":n+="outShift",this[n](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){typeof t>"u"&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,t,r,i){typeof i>"u"&&(i=r),i>r&&this.removeStyleFromTo(r,i);var o=n.util.string.graphemeSplit(e);this.insertNewStyleBlock(o,r,t),this._text=[].concat(this._text.slice(0,r),o,this._text.slice(i)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var e=n.util.toFixed,t=/ +/g;n.util.object.extend(n.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",t?'text-decoration="'+t+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(e,t){var n,r=[],i=[],o=e;this._setSVGBg(i);for(var a=0,s=this._textLines.length;a<s;a++)n=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(i,a,t+n,o),this._setSVGTextLineText(r,a,t+n,o),o+=this.getHeightOfLine(a);return{textSpans:r,textBgRects:i}},_createTextCharSpan:function(r,i,o,a){var s=r!==r.trim()||r.match(t),l=this.getSvgSpanStyles(i,s),c=l?'style="'+l+'"':"",u=i.deltaY,d="",h=n.Object.NUM_FRACTION_DIGITS;return u&&(d=' dy="'+e(u,h)+'" '),['<tspan x="',e(o,h),'" y="',e(a,h),'" ',d,c,">",n.util.string.escapeXml(r),"</tspan>"].join("")},_setSVGTextLineText:function(e,t,r,i){var o,a,s,l,c,u=this.getHeightOfLine(t),d=-1!==this.textAlign.indexOf("justify"),h="",f=0,p=this._textLines[t];i+=u*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,m=p.length-1;g<=m;g++)c=g===m||this.charSpacing,h+=p[g],s=this.__charBounds[t][g],0===f?(r+=s.kernedWidth-s.width,f+=s.width):f+=s.kernedWidth,d&&!c&&this._reSpaceAndTab.test(p[g])&&(c=!0),c||(o=o||this.getCompleteStyleDeclaration(t,g),a=this.getCompleteStyleDeclaration(t,g+1),c=n.util.hasStyleChanged(o,a,!0)),c&&(l=this._getStyleDeclaration(t,g)||{},e.push(this._createTextCharSpan(h,l,r,i)),h="",o=a,r+=f,f=0)},_pushTextBgRect:function(t,r,i,o,a,s){var l=n.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(r),' x="',e(i,l),'" y="',e(o,l),'" width="',e(a,l),'" height="',e(s,l),'"></rect>\n')},_setSVGTextLineBg:function(e,t,n,r){for(var i,o,a=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,c=0,u=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),d=0,h=a.length;d<h;d++)i=this.__charBounds[t][d],(o=this.getValueOfPropertyAt(t,d,"textBackgroundColor"))!==u?(u&&this._pushTextBgRect(e,u,n+c,r,l,s),c=i.left,l=i.width,u=o):l+=i.kernedWidth;o&&this._pushTextBgRect(e,o,n+c,r,l,s)},_getFillAttributes:function(e){var t=e&&"string"==typeof e?new n.Color(e):"";return t&&t.getSource()&&1!==t.getAlpha()?'opacity="'+t.getAlpha()+'" fill="'+t.setAlpha(1).toRgb()+'"':'fill="'+e+'"'},_getSVGLineTopOffset:function(e){for(var t,n=0,r=0;r<e;r++)n+=this.getHeightOfLine(r);return t=this.getHeightOfLine(r),{lineTop:n,offset:(this._fontSizeMult-this._fontSizeFraction)*t/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(e){return n.Object.prototype.getSvgStyles.call(this,e)+" white-space: pre;"}})}(),function(e){var t=e.fabric||(e.fabric={});t.Textbox=t.util.createClass(t.IText,t.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:t.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,n=0,r=0,i={},o=0;o<e.graphemeLines.length;o++)"\n"===e.graphemeText[r]&&o>0?(n=0,r++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[r])&&o>0&&(n++,r++),i[o]={line:t,offset:n},r+=e.graphemeLines[o].length,n+=e.graphemeLines[o].length;return i},styleHas:function(e,n){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[n];r&&(n=r.line)}return t.Text.prototype.styleHas.call(this,e,n)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,n,r=0,i=!1,o=this._styleMap[e],a=this._styleMap[e+1];for(var s in o&&(e=o.line,r=o.offset),a&&(i=a.line===e,t=a.offset),n=typeof e>"u"?this.styles:{line:this.styles[e]})for(var l in n[s])if(l>=r&&(!i||l<t))for(var c in n[s][l])return!1;return!0},_getStyleDeclaration:function(e,t){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[e];if(!n)return null;e=n.line,t=n.offset+t}return this.callSuper("_getStyleDeclaration",e,t)},_setStyleDeclaration:function(e,t,n){var r=this._styleMap[e];e=r.line,t=r.offset+t,this.styles[e][t]=n},_deleteStyleDeclaration:function(e,t){var n=this._styleMap[e];e=n.line,t=n.offset+t,delete this.styles[e][t]},_getLineStyle:function(e){var t=this._styleMap[e];return!!this.styles[t.line]},_setLineStyle:function(e){var t=this._styleMap[e];this.styles[t.line]={}},_wrapText:function(e,t){var n,r=[];for(this.isWrapping=!0,n=0;n<e.length;n++)r=r.concat(this._wrapLine(e[n],n,t));return this.isWrapping=!1,r},_measureWord:function(e,t,n){var r,i=0;n=n||0;for(var o=0,a=e.length;o<a;o++)i+=this._getGraphemeBox(e[o],t,o+n,r,!0).kernedWidth,r=e[o];return i},_wrapLine:function(e,n,r,i){var o=0,a=this.splitByGrapheme,s=[],l=[],c=a?t.util.string.graphemeSplit(e):e.split(this._wordJoiners),u="",d=0,h=a?"":" ",f=0,p=0,g=0,m=!0,v=this._getWidthOfCharSpacing();i=i||0,0===c.length&&c.push([]),r-=i;for(var y=0;y<c.length;y++)u=a?c[y]:t.util.string.graphemeSplit(c[y]),f=this._measureWord(u,n,d),d+=u.length,(o+=p+f-v)>r&&!m?(s.push(l),l=[],o=f,m=!0):o+=v,!m&&!a&&l.push(h),l=l.concat(u),p=a?0:this._measureWord([h],n,d),d++,m=!1,f>g&&(g=f);return y&&s.push(l),g+i>this.dynamicMinWidth&&(this.dynamicMinWidth=g-v+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var n=t.Text.prototype._splitTextIntoLines.call(this,e),r=this._wrapText(n.lines,this.width),i=new Array(r.length),o=0;o<r.length;o++)i[o]=r[o].join("");return n.lines=i,n.graphemeLines=r,n},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var e={};for(var t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(var t in this.styles)e[t]||delete this.styles[t]},toObject:function(e){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(e))}}),t.Textbox.fromObject=function(e,n){var r=t.util.stylesFromArray(e.styles,e.text),i=Object.assign({},e,{styles:r});return t.Object._fromObject("Textbox",i,n,"text")}}(e),function(){var e=n.controlsUtils,t=e.scaleSkewCursorStyleHandler,r=e.scaleCursorStyleHandler,i=e.scalingEqually,o=e.scalingYOrSkewingX,a=e.scalingXOrSkewingY,s=e.scaleOrSkewActionName,l=n.Object.prototype.controls;if(l.ml=new n.Control({x:-.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:s}),l.mr=new n.Control({x:.5,y:0,cursorStyleHandler:t,actionHandler:a,getActionName:s}),l.mb=new n.Control({x:0,y:.5,cursorStyleHandler:t,actionHandler:o,getActionName:s}),l.mt=new n.Control({x:0,y:-.5,cursorStyleHandler:t,actionHandler:o,getActionName:s}),l.tl=new n.Control({x:-.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),l.tr=new n.Control({x:.5,y:-.5,cursorStyleHandler:r,actionHandler:i}),l.bl=new n.Control({x:-.5,y:.5,cursorStyleHandler:r,actionHandler:i}),l.br=new n.Control({x:.5,y:.5,cursorStyleHandler:r,actionHandler:i}),l.mtr=new n.Control({x:0,y:-.5,actionHandler:e.rotationWithSnapping,cursorStyleHandler:e.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),n.Textbox){var c=n.Textbox.prototype.controls={};c.mtr=l.mtr,c.tr=l.tr,c.br=l.br,c.tl=l.tl,c.bl=l.bl,c.mt=l.mt,c.mb=l.mb,c.mr=new n.Control({x:.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"}),c.ml=new n.Control({x:-.5,y:0,actionHandler:e.changeWidth,cursorStyleHandler:t,actionName:"resizing"})}}()}(Jv);const ey={lockScalingFlip:!0,originY:"center",originX:"center",lockMovementX:!0,lockMovementY:!0,borderColor:"transparent"};function ty(e=36){let t="";for(let n=0;n<e;n+=1)t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(Math.floor(62*Math.random()));return t}let ny=null;function ry(e){ny=e}class iy{constructor(){Ni(this,"maxZoom",2),Ni(this,"minZoom",1),Ni(this,"step",.05),this.allowUserZoom&&this.bindMouseWheel(),Ah.subscribe(e=>e.stageSize,()=>{setTimeout(()=>{this.fitToScreen()},1)})}get allowUserZoom(){var e,t,n;return(null==(n=null==(t=null==(e=jh().config)?void 0:e.tools)?void 0:t.zoom)?void 0:n.allowUserZoom)??!0}get currentZoom(){return jh().zoom}zoomIn(e=this.step){this.set(this.currentZoom+e)}canZoomIn(e=this.step){return this.currentZoom+e<=this.maxZoom}canZoomOut(e=this.step){return this.currentZoom-e>=this.minZoom}zoomOut(e=this.step){this.set(this.currentZoom-e)}set(e,t=!0){if(e<this.minZoom||e>this.maxZoom)return;const n=Yi(jh().original.width*e,0),r=Yi(jh().original.height*e,0);Ih().setZoom(e),t&&Ih().setDimensions({width:n,height:r}),jh().setZoom(e)}fitToScreen(){var e,t;if(null==(t=null==(e=jh().config.tools)?void 0:e.zoom)||!t.fitImageToScreen)return;const{width:n,height:r}=jh().stageSize,i=Math.max(r,1),o=Math.max(n,1);if(jh().original.height>i||jh().original.width>o){const e=Math.min(i/jh().original.height,o/jh().original.width);this.minZoom=Math.min(e,1)}else this.minZoom=1;this.set(this.minZoom)}bindMouseWheel(){Ih().on("mouse:wheel",e=>{e.e.preventDefault(),e.e.stopPropagation(),null==ny&&(e.e.deltaY<0?this.zoomIn():this.zoomOut())})}}function oy(e){return new Promise(t=>{Jv.fabric.util.loadImage(e,e=>t(new Jv.fabric.Image(e)),null,jh().config.crossOrigin?"anonymous":void 0)})}function ay(){return!(jh().config.image||jh().config.blankCanvasSize||Ih()&&0!==Ih().getObjects().length)}class sy{constructor(){Ni(this,"minWidth",50),Ni(this,"minHeight",50)}resize(e,t,{applyZoom:n=!1,resizeHelper:r=!0}={}){const i=jh().zoom;Ih().setWidth(e*(n?i:1)),Ih().setHeight(t*(n?i:1)),jh().setOriginal(e,t),r&&Eh().transform.resetStraightenAnchor()}async addMainImage(e,t="mainImage"){var n,r;jh().toggleLoading(t);const i=await oy(e);if(i)return this.clear(),i.set(Fh),i.name=Cd.MainImage,Ih().add(i),this.resize(i.width,i.height),i.center(),i.setCoords(),Eh().zoom.fitToScreen(),jh().toggleLoading(!1),null==(r=(n=jh().config).onMainImageLoaded)||r.call(n,i),i}openNew(e,t,n){return e=Math.max(this.minWidth,e),t=Math.max(this.minHeight,t),this.clear(),this.resize(e,t),Ih().backgroundColor=n,Eh().zoom.fitToScreen(),jh().toggleLoading("newCanvas"),requestAnimationFrame(()=>{jh().toggleLoading(!1)}),Promise.resolve({width:e,height:t})}getMainImage(){return Ih().getObjects().find(e=>e.name===Cd.MainImage)}render(){Ih().requestRenderAll()}async loadInitialContent(){var e,t;const n=jh().config.image,r=jh().config.blankCanvasSize,i=jh().config.state;if(n&&n.endsWith("json")){const e=await Oh(n);await Eh().import.loadState(e)}else n&&n.startsWith('{"canvas')?await Eh().import.loadState(n):n?await this.addMainImage(n):i?await Eh().import.loadState(i):r&&await this.openNew(r.width,r.height);return ay()&&null!=(t=null==(e=jh().config.ui)?void 0:e.openImageDialog)&&t.show&&jh().togglePanel("newImage",!0),new Promise(e=>{setTimeout(()=>{Eh().history.addInitial(),e()},10)})}clear(){Ih().clear(),Eh().frame.remove(),Eh().transform.resetStraightenAnchor()}}const ly=["fontSize","fontFamily","left","top","width","height","scaleX","scaleY","flipX","flipY","angle","src","strokeWidth"];function cy(e={}){Ih().fire("object:modified",function(e){return{values:e,sizeOrPositionChanged:uy(e)}}(e))}function uy(e){return Object.keys(e).some(e=>ly.includes(e))}function dy(e){var t,n;const[r]=Rh(null==(t=e.selected)?void 0:t[0]),i=r===jh().activeTool;return!(!jh().dirty||null!=(n=e.selected)&&n[0]&&i)&&(e.deselected&&Eh().objects.select(e.deselected[0]),!0)}function hy(e){(null==e?void 0:e.data.id)!==jh().objects.active.id&&(jh().objects.setActive(e??null),jh().activeTool!==fc.DRAW&&Mh())}class fy{constructor(){this.syncObjects(),jh().fabric.on("selection:created",e=>{var t;null!=(t=e.selected)&&t[0]&&!dy(e)&&hy(e.selected[0])}),jh().fabric.on("selection:updated",e=>{var t;dy(e)||hy(null==(t=e.selected)?void 0:t[0])}),jh().fabric.on("selection:cleared",()=>{hy()}),jh().fabric.on("text:editing:entered",()=>{jh().objects.setIsEditingText(!0)}),jh().fabric.on("text:editing:exited",()=>{jh().objects.setIsEditingText(!1)}),jh().fabric.on("object:added",()=>{this.syncObjects()}),jh().fabric.on("object:removed",()=>{this.syncObjects()})}getAll(){return Ih().getObjects().filter(e=>{var t;return!(null!=(t=null==e?void 0:e.data)&&t.pixieInternal)})}get(e){return this.getAll().find(t=>t.name===e)}getById(e){return this.getAll().find(t=>t.data.id===e)}isActive(e){var t;const n="string"==typeof e?e:e.data.id;return(null==(t=jh().objects.active)?void 0:t.id)===n}getActive(){return Ih().getActiveObject()}has(e){return this.getAll().findIndex(t=>t.name===e)>-1}select(e){const t="string"==typeof e?this.getById(e):e;t&&(Ih().setActiveObject(t),Ih().requestRenderAll())}deselectActive(){Ih().discardActiveObject(),Ih().requestRenderAll()}setValues(e,t){if(!(t=t||this.getActive()))return;let n=!1;(function(e){return e.name===Cd.Sticker&&"forEachObject"in e})(t)&&e.fill&&e.fill!==t.fill&&t.forEachObject(t=>t.set("fill",e.fill)),xd(t)?((e.fontFamily!==t.fontFamily||e.fontSize!==t.fontSize)&&(n=!0),t.selectionStart!==t.selectionEnd?t.setSelectionStyles(e):t.set(e)):t.set(e),n?setTimeout(()=>{Ih().requestRenderAll()},50):Ih().requestRenderAll(),jh().objects.setActive(t),cy(e)}move(e,t=1,n){(n=n||this.getActive())&&("up"===e?this.setValues({top:n.top-t}):"down"===e?this.setValues({top:n.top+t}):"left"===e?this.setValues({left:n.left-t}):"right"===e&&this.setValues({left:n.left+t}),Eh().canvas.render())}bringToFront(e){(e=e||this.getActive())&&(e.bringToFront(),Eh().canvas.render())}sendToBack(e){(e=e||this.getActive())&&(e.sendToBack(),Eh().canvas.render())}flipHorizontally(e){(e=e||this.getActive())&&(this.setValues({flipX:!e.flipX}),Eh().canvas.render())}duplicate(e){const t=e||this.getActive();t&&(this.deselectActive(),t.clone(e=>{e.set({left:t.left+40,top:t.top+40,data:{...t.data,id:ty(10)},name:t.name}),Ih().add(e),this.select(e),Eh().canvas.render()}))}delete(e){(e=e||this.getActive())&&(this.deselectActive(),Ih().remove(e),Ih().requestRenderAll(),Eh().history.addHistoryItem({name:"deletedObject"}))}syncObjects(){const e=this.getAll().map(e=>({name:e.name,selectable:e.selectable??!1,id:e.data.id}));Ah.setState({objects:{...jh().objects,all:e}})}}const py={frame:null,fonts:[]};function gy(e){return e.state||(e.state=Ph()),{...e.state||Ph(),name:e.name,id:ty(15)}}function my(e){return!!e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e)}function vy(e){return e?my(e)?e:`${jh().config.baseUrl?`${jh().config.baseUrl}/`:""}${e}`:""}function yy(e,t){return t||btoa(e.split("/").pop())}const by=new class{constructor(){Ni(this,"loadedAssets",{})}loadAsset(e,t={type:"js"}){var n;e=e.startsWith("//")?`${window.location.protocol}${e}`:e;const r=null==(n=this.loadedAssets[e])?void 0:n.state;return"loaded"!==r||t.force?!r||this.loadedAssets[e].doc!==t.document||t.force&&"loaded"===r?(this.loadedAssets[e]={state:new Promise(n=>{const r={url:my(e)?e:`assets/${e}`,id:yy(e,t.id),resolve:n,parentEl:t.parentEl,document:t.document};"css"===t.type?this.loadStyleAsset(r):this.loadScriptAsset(r)}),doc:t.document},this.loadedAssets[e].state):this.loadedAssets[e].state:new Promise(e=>e())}isLoadingOrLoaded(e){return null!=this.loadedAssets[e]}loadStyleAsset(e){var t;const n=e.document||document,r=e.parentEl||n.head,i=n.createElement("link"),o=yy(e.url,e.id);i.rel="stylesheet",i.id=o,i.href=e.url;try{r.querySelector(`#${o}`)&&(null==(t=r.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},r.appendChild(i)}loadScriptAsset(e){var t;const n=e.document||document,r=e.parentEl||n.body,i=n.createElement("script"),o=yy(e.url,e.id);i.async=!0,i.id=o,i.src=e.url;try{r.querySelector(`#${o}`)&&(null==(t=r.querySelector(`#${o}`))||t.remove())}catch{}i.onload=()=>{this.loadedAssets[e.url].state="loaded",e.resolve()},(r||r).appendChild(i)}};function wy(e){return`be-fonts-${e}`}function xy(e,t){const n=t.document||document,r=[],i=[];let o=[];if(e.forEach(e=>{"google"in e&&e.google?r.push(e):"src"in e&&i.push(e)}),null!=r&&r.length){const r=t.weights||[400],i=e.map(e=>`${e.family}:${r.join(",")}`).join("|"),a=by.loadAsset(`https://fonts.googleapis.com/css?family=${i}&display=swap`,{type:"css",id:wy(t.id),force:t.forceAssetLoad,document:n});o.push(a)}if(null!=i&&i.length){const e=i.map(async e=>{const r=Array.from(n.fonts.values()).find(t=>t.family===e.family);if(r)return r.loaded;const i=new FontFace(e.family,`url(${null!=t&&t.prefixSrc?t.prefixSrc(e.src):e.src})`,e.descriptors);return n.fonts.add(i),i.load()});o=o.concat(e)}return Promise.all(o)}class Cy{async undo(){if(this.canUndo()){const e=jh().history.items[jh().history.pointer-1];await this.load(e)}}async redo(){if(this.canRedo()){const e=jh().history.items[jh().history.pointer+1];await this.load(e)}}canUndo(){return jh().history.canUndo}canRedo(){return jh().history.canRedo}reload(){return this.load(jh().history.items[jh().history.pointer])}replaceCurrent(){const e=jh().history.items[jh().history.pointer];[...jh().history.items][jh().history.pointer]=gy({name:e.name,state:e})}addHistoryItem(e){const t=gy(e),n=[...jh().history.items.slice(0,jh().history.pointer+1),t];jh().history.update(n.length-1,n)}load(e){return e={...e,editor:e.editor||py},new Promise(t=>{xy(function(e){const t=[];return e.forEach(e=>{var n,r,i;if(!xd(e))return;const o=null==(i=null==(r=null==(n=jh().config.tools)?void 0:n.text)?void 0:r.items)?void 0:i.find(t=>t.family===e.fontFamily);o&&t.push(o)}),t}(e.canvas.objects),{prefixSrc:vy,id:"pixie-fonts"}).finally(()=>{Ih().loadFromJSON(e.canvas,()=>{Eh().zoom.set(1),e.canvasWidth&&e.canvasHeight&&Eh().canvas.resize(e.canvasWidth,e.canvasHeight,{resizeHelper:!1,applyZoom:!1}),Eh().frame.remove(),e.editor.frame&&Eh().frame.add(e.editor.frame.name,e.editor.frame.sizePercent),Eh().objects.syncObjects(),Eh().objects.getAll().forEach(e=>{var t,n;if(!e.data.pixieInternal&&"left"===e.originX&&"top"===e.originY){const t=e.getPointByOrigin("center","center");e.set("left",t.x),e.set("top",t.y)}e.set({...ey}),"i-text"===e.type&&(e.padding=null==(n=null==(t=jh().config.tools)?void 0:t.text)?void 0:n.controlsPadding)}),Eh().canvas.render(),Ih().calcOffset(),Eh().zoom.fitToScreen(),jh().history.updatePointerById(e.id),Eh().transform.resetStraightenAnchor(),t()})})})}addInitial(e){!jh().history.items.find(e=>"initial"===e.name)&&(e||!ay())&&this.addHistoryItem({name:"initial",state:e})}}class _y{canMerge(){return Eh().objects.getAll().filter(e=>e.name!==Cd.MainImage).length>0}async apply(){jh().toggleLoading("merge");const e=Eh().export.getDataUrl();e&&await Eh().canvas.addMainImage(e,"merge")}}const Sy=[{name:"grayscale"},{name:"blackWhite",fabricType:"blackwhite"},{name:"sharpen",uses:"Convolute",matrix:[0,-1,0,-1,5,-1,0,-1,0]},{name:"invert"},{name:"vintage"},{name:"polaroid"},{name:"kodachrome"},{name:"technicolor"},{name:"brownie"},{name:"sepia"},{name:"removeColor",fabricType:"removecolor",options:{distance:{type:"slider",current:.1,min:0,max:1,step:.01},color:{current:"#fff",type:"colorPicker"}}},{name:"brightness",options:{brightness:{type:"slider",current:.1,min:-1,max:1,step:.1}}},{name:"gamma",options:{red:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},green:{type:"slider",current:.1,min:.2,max:2.2,step:.003921},blue:{type:"slider",current:.1,min:.2,max:2.2,step:.003921}},apply:e=>{e.gamma=[e.red,e.green,e.blue]}},{name:"noise",options:{noise:{type:"slider",current:40,min:1,max:600}}},{name:"pixelate",options:{blocksize:{type:"slider",min:1,max:40,current:6}}},{name:"blur",uses:"Convolute",matrix:[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]},{name:"emboss",uses:"Convolute",matrix:[1,1,1,1,.7,-1,-1,-1,-1]},{name:"blendColor",fabricType:"blendcolor",options:{alpha:{type:"slider",current:.5,min:.1,max:1,step:.1},mode:{current:"add",type:"select",available:[{key:"add"},{key:"multiply"},{key:"subtract"},{key:"diff"},{key:"screen"},{key:"lighten"},{key:"darken"}]},color:{type:"colorPicker",current:"#FF4081"}}}],ky={grayscale:sc("grayscale"),blackWhite:sc("Black & White"),sharpen:sc("Sharpen"),invert:sc("Invert"),vintage:sc("Vintage"),polaroid:sc("Polaroid"),kodachrome:sc("Kodachrome"),technicolor:sc("Technicolor"),brownie:sc("Brownie"),sepia:sc("Sepia"),removeColor:sc("Remove Color"),brightness:sc("Brightness"),gamma:sc("Gamma"),noise:sc("Noise"),pixelate:sc("Pixelate"),blur:sc("Blur"),emboss:sc("Emboss"),blendColor:sc("Blend Color")},Ay={distance:sc("distance"),color:sc("color"),brightness:sc("brightness"),red:sc("red"),green:sc("green"),blue:sc("blue"),noise:sc("noise"),blocksize:sc("blocksize"),mode:sc("mode"),alpha:sc("alpha")};function jy(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}class Ey{constructor(){Ah.subscribe(e=>e.history.pointer,()=>{this.syncState()})}apply(e){jh().filter.select(e,this.hasOptions(e));const t=this.getByName(e);if(this.isApplied(t.name))return void this.remove(t.name);const n=this.create(t);this.getImages().forEach(e=>{var t;null==(t=e.filters)||t.push(n),e.applyFilters()}),this.syncState(),Eh().canvas.render()}remove(e){jh().filter.deselect(e);const t=this.getByName(e);this.getImages().forEach(e=>{var n;const r=this.findFilterIndex(t.name,e.filters);null==(n=e.filters)||n.splice(r,1),e.applyFilters()}),this.syncState(),Eh().canvas.render()}getAll(){return Sy}getByName(e){return Sy.find(t=>t.name===e)}isApplied(e){const t=Eh().canvas.getMainImage();return!!t&&this.findFilterIndex(e,t.filters)>-1}applyValue(e,t,n){const r=this.getByName(e);this.getImages().forEach(e=>{const i=(e.filters||[]).find(e=>e.type.toLowerCase()===r.name.toLowerCase());i&&(i[t]=n,r.apply&&r.apply(i,t,n),e.applyFilters())}),Eh().canvas.render()}addCustom(e,t,n,r){const i=Jv.fabric.Image.filters;i[jy(e)]=Jv.fabric.util.createClass(i.BaseFilter,t),i[jy(e)].fromObject=i.BaseFilter.fromObject,Sy.push({name:e,options:n,initialConfig:r})}create(e){const t=e.initialConfig||{};let n;return e.uses?(t.matrix=e.matrix,n=new(Jv.fabric.Image.filters[jy(e.uses)])(t)):(Object.entries(e.options||{}).forEach(([e,n])=>{t[e]=n.current}),n=new(Jv.fabric.Image.filters[jy(e.name)])(t)),n.name=e.name,n}hasOptions(e){return!!this.getByName(e).options}findFilterIndex(e,t){if(null==t||!t.length)return-1;const n=this.getByName(e);return t.findIndex(e=>this.configMatchesFabricFilter(n,e))}syncState(){var e;const t=[];((null==(e=this.getImages()[0])?void 0:e.filters)||[]).forEach(e=>{const n=this.getByFabricFilter(e);n&&t.push(n.name)}),Ah.setState({filter:{...jh().filter,applied:t}})}getByFabricFilter(e){return Sy.find(t=>this.configMatchesFabricFilter(t,e))}configMatchesFabricFilter(e,t){const n=t.type.toLowerCase().replace(" ","");return n===e.fabricType||n===e.name||"convolute"===n&&this.matrixAreEqual(e.matrix,t.matrix)}matrixAreEqual(e,t){if(!e||!t||e.length!==t.length)return!1;for(let n=e.length;n--;)if(e[n]!==t[n])return!1;return!0}getImages(){return Eh().objects.getAll().filter(e=>e.name===Cd.Image||e.name===Cd.MainImage)}}function Iy(e){var t,n;const r=(null==(n=null==(t=jh().config.tools)?void 0:t.resize)?void 0:n.minWidth)||50;return e?Math.ceil(100*r/jh().original.width):r}function Ty(e){var t,n;const r=(null==(n=null==(t=jh().config.tools)?void 0:t.resize)?void 0:n.maxWidth)||2400;return e?Math.ceil(100*r/jh().original.width):r}function Oy(e){var t,n;const r=(null==(n=null==(t=jh().config.tools)?void 0:t.resize)?void 0:n.minHeight)||50;return e?Math.ceil(100*r/jh().original.height):r}function Fy(e){var t,n;const r=(null==(n=null==(t=jh().config.tools)?void 0:t.resize)?void 0:n.maxHeight)||2400;return e?Math.ceil(100*r/jh().original.height):r}function Py(e,t){if(t)return e;const n=jh().original.height/e;return Math.floor(jh().original.width/n)}function My(e,t){if(t)return e;const n=jh().original.width/e;return Math.floor(jh().original.height/n)}class Ry{apply(e){const{width:t,height:n,usePercentages:r}=function(e){return e.width<Iy(e.usePercentages)&&(e.width=Iy(e.usePercentages),e.maintainAspect&&(e.height=My(e.width,e.usePercentages))),e.width>Ty(e.usePercentages)&&(e.width=Ty(e.usePercentages),e.maintainAspect&&(e.height=My(e.width,e.usePercentages))),e.height<Oy(e.usePercentages)&&(e.height=Oy(e.usePercentages),e.maintainAspect&&(e.width=Py(e.height,e.usePercentages))),e.height>Fy(e.usePercentages)&&(e.height=Fy(e.usePercentages),e.maintainAspect&&(e.width=Py(e.height,e.usePercentages))),e}(e),i=Math.ceil(jh().original.width),o=Math.ceil(jh().original.height),a=Math.ceil(t),s=Math.ceil(n);let l,c;r?(l=t/100,c=n/100):(l=t/jh().original.width,c=n/jh().original.height),(i!==a||o!==s)&&this.resize(l,c)}resize(e,t){Eh().zoom.set(1,!1);const n=Math.round(jh().original.height*t),r=Math.round(jh().original.width*e);Eh().canvas.resize(r,n,{applyZoom:!1,resizeHelper:!0}),Eh().objects.getAll().forEach(n=>{const r=n.scaleX||1,i=n.scaleY||1,o=n.left||0,a=n.top||0,s=r*e,l=i*t,c=o*e,u=a*t;n.scaleX=s,n.scaleY=l,n.left=c,n.top=u,n.setCoords()}),Eh().zoom.fitToScreen(),Ih().requestRenderAll()}}function Ly(e,t,n){let r=t,i=n;return e&&(n*e>t?i=t/e:r=n*e),{width:Math.floor(r),height:Math.floor(i)}}function Dy(e){if(!e)return null;const t=e.split(":");return parseInt(t[0])/parseInt(t[1])}class Ny{constructor(){Ni(this,"refs",null)}apply(e){var t;const n=null==(t=Eh().frame.active.config)?void 0:t.name,r=Eh().frame.active.currentSizeInPercent;return Eh().frame.active.hide(),Eh().merge.apply().then(()=>{Eh().canvas.resize(Math.round(e.width),Math.round(e.height),{applyZoom:!0,resizeHelper:!0});const t=Eh().canvas.getMainImage();t.cropX=Math.round(e.left),t.cropY=Math.round(e.top),t.width=Math.round(e.width),t.height=Math.round(e.height),t.viewportCenter(),n&&Eh().frame.add(n,r),Eh().zoom.fitToScreen(),Eh().canvas.render()})}drawZone(e){var t;null!=(t=this.refs)&&t.current&&(jh().crop.setCropzoneRect(e),function(e,t){null!==t.innerZone&&(function(e,t){t.innerZone.style.width=`${e.width}px`,t.innerZone.style.height=`${e.height}px`,t.innerZone.style.transform=`translate(${e.left}px, ${e.top}px)`}(e,t),function(e,t){const n=jh().canvasSize.width,r=jh().canvasSize.height;t.maskTop.style.height=`${e.top}px`,t.maskTop.style.width=`${n}px`,t.maskLeft.style.top=`${e.top}px`,t.maskLeft.style.height=`${e.height}px`,t.maskLeft.style.width=`${e.left}px`;const i=e.left+e.width;t.maskRight.style.left=`${i}px`,t.maskRight.style.top=`${e.top}px`,t.maskRight.style.height=`${e.height}px`,t.maskRight.style.width=n-i+"px",t.maskBottom.style.height=r-(e.top+e.height)+"px",t.maskBottom.style.width=`${n}px`}(e,t),function(e,t){const n=(e.width-2)/3;t.lineVer1.style.height=`${e.height}px`,t.lineVer1.style.transform=`translate(${n}px, 0)`,t.lineVer2.style.height=`${e.height}px`,t.lineVer2.style.transform=`translate(${2*n}px, 0)`;const r=(e.height-2)/3;t.lineHor1.style.width=`${e.width}px`,t.lineHor1.style.transform=`translate(0, ${r}px)`,t.lineHor2.style.width=`${e.width}px`,t.lineHor2.style.transform=`translate(0, ${2*r}px)`}(e,t))}(e,this.refs.current))}resetCropzone(e){const t=jh().canvasSize,n=Dy(e);if(!t)return;jh().crop.setAspectRatio(e);const r=function(e,t=null){const n={width:e.width,height:e.height,top:0,left:0,angle:0};if(t){const e=Ly(t,n.width,n.height);n.width=e.width,n.height=e.height}return n.left=(e.width-n.width)/2,n.top=(e.height-n.height)/2,n}(t,n);this.drawZone(r)}registerRefs(e){this.refs=e}}class zy{getShapeByName(e){var t,n;const r=null==(n=null==(t=jh().config.tools)?void 0:t.shapes)?void 0:n.items;return(null==r?void 0:r.find(t=>t.name===e))||null}addBasicShape(e){var t;const n=this.getShapeByName(e);if(!n)return null;const{width:r,height:i,...o}=(null==(t=jh().config.objectDefaults)?void 0:t.shape)||{},a={...o,...n.options};let s;if("circle"===n.name)s=new Jv.fabric.Circle({...a,radius:100});else if("ellipse"===n.name)s=new Jv.fabric.Ellipse({...a,rx:100,ry:50});else if("Path"===n.type)s=new Jv.fabric.Path(a.path,{displayName:n.name,...a});else{const e=n.type;s=new Jv.fabric[e]({...a,width:150,height:150})}return this.addAndPositionShape(s,Cd.Shape,{width:r,height:i}),s}addSticker(e,t){var n,r,i;const o=null==(i=null==(r=null==(n=jh().config.tools)?void 0:n.stickers)?void 0:r.items)?void 0:i.find(t=>t.name===e);if(!o)return Promise.resolve();if("svg"===o.type){const e=By(o,t);return this.addSvgSticker(e)}return this.addRegularSticker(o,t)}addRegularSticker(e,t){return new Promise(n=>{Jv.fabric.util.loadImage(By(e,t),e=>{var t;const{width:r,height:i,...o}=(null==(t=jh().config.objectDefaults)?void 0:t.sticker)||{},a=new Jv.fabric.Image(e,o);this.addAndPositionShape(a,Cd.Sticker,{width:r,height:i}),n()})})}addSvgSticker(e,t=Cd.Sticker){return new Promise(n=>{Jv.fabric.loadSVGFromURL(e,(e,r)=>{var i;const{width:o,height:a,...s}=(null==(i=jh().config.objectDefaults)?void 0:i.sticker)||{},l=Jv.fabric.util.groupSVGElements(e,r);l.set(s),this.addAndPositionShape(l,t,{width:o,height:a}),n()})})}addAndPositionShape(e,t,{width:n}){e.name=t,e.scaleX=1,e.scaleY=1,Ih().add(e);const r=n||jh().original.width*jh().zoom/4;e.scaleToWidth(Math.min(150,r)),e.viewportCenter(),e.setCoords(),Eh().canvas.render(),Ih().setActiveObject(e)}}function By(e,t){return vy(`images/stickers/${e.name}/${t}.${e.type}`)}class Vy{constructor(e){Ni(this,"patternCache",[]),this.activeFrame=e}fillParts(e){this.patternCache.forEach(t=>{this.fillPartWithPattern(t,e)})}fillPartWithPattern(e,t){if(!this.activeFrame.parts)return;e.canvas=new Jv.fabric.StaticCanvas(null),e.canvas.add(e.img);const n=new Jv.fabric.Pattern({source:e.canvas.getElement(),repeat:"repeat"===t?"repeat":"no-repeat"});this.activeFrame.parts[e.name]&&this.activeFrame.parts[e.name].set("fill",n)}scale(e){if(!this.activeFrame.config||!this.patternCache)return;const t=this.activeFrame.config.mode;e/=Ih().getRetinaScaling(),this.patternCache.forEach(n=>{this.activeFrame.parts&&("top"===n.name||"bottom"===n.name?"stretch"===t?(this.scalePatternToWidth(n.img,this.activeFrame.parts.top.getScaledWidth()),this.scalePatternToHeight(n.img,e)):n.img.scaleToHeight(e):"left"===n.name||"right"===n.name?"stretch"===t?(this.scalePatternToWidth(n.img,e),this.scalePatternToHeight(n.img,this.activeFrame.parts.left.getScaledHeight())):n.img.scaleToWidth(e):"stretch"===t?(this.scalePatternToWidth(n.img,e),this.scalePatternToHeight(n.img,e)):n.img.scaleToWidth(e),n.canvas.setDimensions({width:n.img.getScaledWidth(),height:n.img.getScaledHeight()}))}),Eh().canvas.render()}scalePatternToWidth(e,t){if(!e.width)return;const n=e.getBoundingRect().width/e.getScaledWidth();e.set("scaleX",t/e.width/n),e.setCoords()}scalePatternToHeight(e,t){if(!e.height)return;const n=e.getBoundingRect().height/e.getScaledHeight();e.set("scaleY",t/e.height/n),e.setCoords()}load(e){const t=this.activeFrame.getPartNames().map(t=>new Promise(n=>{const r={...Fh,originX:"left",originY:"top"};jh().config.crossOrigin&&(r.crossOrigin="anonymous"),Jv.fabric.Image.fromURL(this.getPartUrl(e,t),e=>{n({name:t,img:e})},r)}));return Promise.all(t).then(t=>{this.patternCache=t,this.fillParts(e.mode)})}getPartUrl(e,t){return vy(`images/frames/${e.name}/${t}.png`)}}class Uy{constructor(e,t){this.activeFrame=e,this.patterns=t}get defaultColor(){var e,t;return null==(t=null==(e=jh().config.objectDefaults)?void 0:e.global)?void 0:t.fill}build(e,t){this.createParts(e),this.resize(t),this.activeFrame.config=e,"basic"!==e.mode?this.patterns.load(e).then(()=>{this.patterns.scale(t),Eh().canvas.render()}):Eh().canvas.render()}createParts(e){const t={};this.activeFrame.getPartNames().forEach(n=>{const r="basic"===e.mode?this.defaultColor:void 0;t[n]=new Jv.fabric.Rect({...Fh,fill:r,originX:"left",originY:"top",name:`frame.rect.${n}`,objectCaching:!1,data:{pixieInternal:!0}}),Ih().add(t[n])}),this.activeFrame.parts=t}resize(e){const t=jh().original.width,n=jh().original.height,r=this.activeFrame,i=e;r.parts&&(r.parts.topLeft.set({width:i,height:i}),r.parts.topRight.set({left:t-r.parts.topLeft.getScaledWidth(),width:i,height:i}),r.parts.top.set({left:r.parts.topLeft.getScaledWidth()-1,width:t-r.parts.topLeft.getScaledWidth()-r.parts.topRight.getScaledWidth()+3,height:i}),r.parts.bottomLeft.set({top:n-r.parts.topLeft.getScaledHeight(),width:i,height:i}),r.parts.left.set({top:r.parts.topLeft.getScaledHeight()-1,width:i,height:n-r.parts.topLeft.getScaledHeight()-r.parts.bottomLeft.getScaledHeight()+3}),r.parts.bottomRight.set({left:t-r.parts.bottomLeft.getScaledWidth(),top:n-r.parts.topRight.getScaledWidth(),width:i,height:i}),r.parts.bottom.set({left:r.parts.top.left,top:n-r.parts.top.getScaledHeight(),width:r.parts.top.getScaledWidth(),height:i}),r.parts.right.set({left:t-r.parts.left.getScaledWidth(),top:r.parts.left.top,width:r.parts.left.width,height:r.parts.left.getScaledHeight()}))}}class Wy{constructor(){Ni(this,"corners",["topLeft","topRight","bottomLeft","bottomRight"]),Ni(this,"sides",["top","right","bottom","left"]),Ni(this,"parts",null),Ni(this,"config",null),Ni(this,"currentSizeInPercent",100)}getPartNames(){return[...this.corners,...this.sides]}hide(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!1})),Eh().canvas.render())}show(){this.parts&&(Object.values(this.parts).forEach(e=>e.set({visible:!0})),Eh().canvas.render())}remove(){this.parts&&(this.config=null,Object.values(this.parts).forEach(e=>{Ih().remove(e)}),this.parts=null,Eh().canvas.render())}is(e){return!!this.config&&this.config.name===e.name}changeColor(e){var t;"basic"!==(null==(t=this.config)?void 0:t.mode)||!this.parts||(Object.values(this.parts).forEach(t=>{t.set("fill",e)}),Eh().canvas.render())}getMinSize(){var e;return(null==(e=this.config)?void 0:e.size.min)??1}getMaxSize(){var e;return(null==(e=this.config)?void 0:e.size.max)??35}}class Hy{constructor(){Ni(this,"patterns"),Ni(this,"builder"),Ni(this,"active"),this.active=new Wy,this.patterns=new Vy(this.active),this.builder=new Uy(this.active,this.patterns),Ih().on("object:added",()=>{Object.values(this.active.parts||[]).forEach(e=>e.moveTo(98))})}add(e,t){const n=this.getByName(e);if(!n||this.active.is(n))return;this.active.remove(),this.active.currentSizeInPercent=t??n.size.default;const r=this.calcFrameSizeInPixels(this.active.currentSizeInPercent);this.builder.build(n,r),jh().frame.select(n)}resize(e){if(!this.active.parts||!this.active.config)return;e?this.active.currentSizeInPercent=e:e=this.active.currentSizeInPercent;const t=this.calcFrameSizeInPixels(e);this.builder.resize(t),this.patterns.scale(t),Eh().canvas.render()}changeColor(e){this.active.changeColor(e)}remove(){this.active.remove(),jh().frame.deselect()}getByName(e){var t,n;const r=null==(n=null==(t=jh().config.tools)?void 0:t.frame)?void 0:n.items;if(r)return r.find(t=>t.name===e)}getActiveFrameConfig(){return this.active.config}calcFrameSizeInPixels(e){const t=Math.min(jh().original.width,jh().original.height);return Math.ceil(e/100*t)}}class $y{constructor(){Ni(this,"minWidth",250)}add(e,t={}){var n,r,i,o,a;if(!(e=e||(null==(r=null==(n=jh().config.tools)?void 0:n.text)?void 0:r.defaultText)))return;const s={...null==(i=jh().config.objectDefaults)?void 0:i.text,...t,name:Cd.Text,padding:null==(a=null==(o=jh().config.tools)?void 0:o.text)?void 0:a.controlsPadding,editingBorderColor:cc.fill},l=new Jv.fabric.IText(e,s);Ih().add(l),null==t.left&&null==t.top&&this.autoPositionText(l),Eh().objects.select(l)}autoPositionText(e){const t=Ih().getWidth(),n=Ih().getHeight(),r=Math.min(Ih().getWidth(),this.minWidth);e.scaleToWidth(Math.max(t/3,r)),e.getScaledHeight()>n&&e.scaleToHeight(n-e.getScaledHeight()-20),e.viewportCenter(),Ih().getObjects("i-text").forEach(t=>{if(t!==e&&t.intersectsWithObject(e)){const n=t.top-e.top+t.getScaledHeight();let r=e.top+n;r>jh().original.height-t.getScaledHeight()&&(r=0),e.set("top",r),e.setCoords()}})}selectOrAddText(e,t={}){if(jh().objects.active.isText)return!1;const n=Eh().objects.getAll().find(e=>xd(e));return n?(Eh().objects.select(n),!1):(this.add(e,t),!0)}}const Gy=e=>{const t=new Jv.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=Jv.fabric.document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(0,5),t.lineTo(10,5),t.closePath(),t.stroke(),e},t},Yy=e=>{const t=new Jv.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=10,e.height=10;const t=e.getContext("2d");return t.strokeStyle=this.color,t.lineWidth=5,t.beginPath(),t.moveTo(5,0),t.lineTo(5,10),t.closePath(),t.stroke(),e},t},qy=e=>{const t=new Jv.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=this.width/2,t=document.createElement("canvas"),n=new Jv.fabric.Rect({width:e,height:e,angle:45,fill:this.color}),r=n.getBoundingRect().width;t.width=r+5,t.height=r+5,n.set({left:r/2,top:r/2});const i=t.getContext("2d");return n.render(i),t},t},Xy=e=>{const t=new Jv.fabric.PatternBrush(e);return t.getPatternSrc=function(){const e=document.createElement("canvas");e.width=12,e.height=12;const t=e.getContext("2d");return t.fillStyle=this.color,t.fillRect(0,0,10,10),e},t};var Ky,Zy;class Jy{constructor(){Ni(this,"customBrushes",{VLineBrush:Gy,HLineBrush:Yy,DiamondBrush:qy,SquareBrush:Xy}),Ni(this,"currentBrush",{type:"PencilBrush",color:null==(Zy=null==(Ky=jh().config.objectDefaults)?void 0:Ky.global)?void 0:Zy.fill,width:uc[1]}),Ni(this,"onPathCreated",e=>{e.path.name=Cd.Drawing,e.path.set(function(){const e={...Fh};return delete e.strokeWidth,e}()),jh().setDirty(!0)})}enable(){Ih().on("path:created",this.onPathCreated),Ih().isDrawingMode=!0,this.setBrushType(this.currentBrush.type),this.setBrushSize(this.currentBrush.width)}disable(){Ih().off("path:created",this.onPathCreated),Ih().isDrawingMode=!1}getBrushType(){return this.currentBrush.type}setBrushType(e){this.currentBrush.type=e,Ih().freeDrawingBrush=e in Jv.fabric?new Jv.fabric[e](Ih()):this.customBrushes[e](Ih()),this.applyBrushStyles()}applyBrushStyles(){Object.keys(this.currentBrush).forEach(e=>{Ih().freeDrawingBrush[e]=this.currentBrush[e]});const e=Ih().freeDrawingBrush;e.getPatternSrc&&(e.source=e.getPatternSrc.call(e))}setBrushSize(e){this.currentBrush.width=e,this.applyBrushStyles()}getBrushSize(){return this.currentBrush.width}setBrushColor(e){this.currentBrush.color=e,this.applyBrushStyles()}getBrushColor(){return this.currentBrush.color}}async function Qy(e,t=!0,n=!0){const r=await oy(e);if(r)return new Promise(e=>{r.name=Cd.Image,r.opacity=0;const i=jh().original.width,o=jh().original.height;if(t&&(r.width>=i||r.height>=o)){const e=i-.1*i,t=o-.1*o,n=1/Math.min(t/r.getScaledHeight(),e/r.getScaledWidth());r.scaleX*=1/n,r.scaleY*=1/n}jh().fabric.add(r),n&&jh().fabric.setActiveObject(r),r.viewportCenter(),r.setCoords(),jh().fabric.requestRenderAll(),Eh().zoom.fitToScreen(),r.animate("opacity","1",{duration:425,onChange:()=>{jh().fabric.requestRenderAll()},onComplete:()=>{e(r)}})})}function eb(e){var t;return(null==(t=/(?:\.([^.]+))?$/.exec(e))?void 0:t[1])||""}class tb{constructor(e,t){Ni(this,"id"),Ni(this,"fingerprint"),Ni(this,"name"),Ni(this,"relativePath",""),Ni(this,"size"),Ni(this,"mime",""),Ni(this,"extension",""),Ni(this,"native"),Ni(this,"lastModified"),Ni(this,"cachedData"),this.id=Lh(),this.name=e.name,this.size=e.size,this.mime=function(e){const t={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",yaml:"text/yaml",yml:"text/yaml",log:"text/plain"},n=e.name?eb(e.name):null;return e.type?e.type:n&&n in t?t[n]:"application/octet-stream"}(e),this.lastModified=e.lastModified,this.extension=eb(e.name)||"bin",this.native=e,(t=(t=t||e.webkitRelativePath||"").replace(/^\/+/g,""))&&t.split("/").length>1&&(this.relativePath=t),this.fingerprint=function({name:e,mime:t,size:n,relativePath:r,lastModified:i}){let o="be";return"string"==typeof e&&(o+=`-${nb(e.toLowerCase())}`),t&&(o+=`-${t}`),"string"==typeof r&&(o+=`-${nb(r.toLowerCase())}`),void 0!==n&&(o+=`-${n}`),void 0!==i&&(o+=`-${i}`),o}({name:this.name,size:this.size,mime:this.mime,lastModified:this.lastModified})}get data(){return new Promise(e=>{this.cachedData&&e(this.cachedData);const t=new FileReader;t.addEventListener("load",()=>{this.cachedData=t.result,e(this.cachedData)}),"json"===this.extension?t.readAsText(this.native):t.readAsDataURL(this.native)})}}function nb(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}var rb=(e=>(e.image="image/*",e.audio="audio/*",e.text="text/*",e.json="application/json",e.video="video/mp4,video/mpeg,video/x-m4v,video/*",e))(rb||{});function ib(e,t=1){if(null==e||Number.isNaN(e))return"";const n=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(n&&(e=-e),e<1)return(n?"-":"")+e+" B";const i=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,i));const o=r[i];return e>=10||e%1==0?`${(n?"-":"")+e.toFixed(0)} ${o}`:`${(n?"-":"")+e.toFixed(t)} ${o}`}function ob(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}ob.prototype.match=function(e){var t,n,r=!0,i=this.parts,o=i.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<o;t++)"*"!==i[t]&&(r=t<n.length&&i[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var a in r={},e)this.match(a)&&(r[a]=e[a]);return r};var ab=/[\/\+\.]/;const sb=ic(function(e,t){function n(t){var n=function(e,t,n){var r=new ob(e,n||/[\/\.]/);return typeof t<"u"?r.match(t):r}(t,e,ab);return n&&n.length>=2}return t?n(t.split(";")[0]):n});function lb(e,t){return t.map(e=>e.split(",")).flat().some(t=>{if(t.includes("/"))return!!e.mime&&sb(e.mime.replace(/;.*?$/,""),t);const n=t.replace(".","").toLowerCase();return!(!n||!e.extension)&&e.extension.toLowerCase()===n})}class cb{async uploadAndAddImage(e=!0){const t=await this.openUploadWindow();await this.openUploadedFile(t,e)}async uploadAndReplaceMainImage(){const e=await this.openUploadWindow();e&&await this.openBackgroundImage(e)}async uploadAndOpenStateFile(){const e=await this.openUploadWindow(ub);e&&await this.loadState(await e.data)}async addImageFromUrl(e,t=!0){var n,r;await Qy(e,(null==(r=null==(n=jh().config.tools)?void 0:n.import)?void 0:r.fitOverlayToScreen)??!0,t),Eh().history.addHistoryItem({name:"overlayImage"})}async addImageFromData(e,t=!0){var n,r;await Qy(e,(null==(r=null==(n=jh().config.tools)?void 0:n.import)?void 0:r.fitOverlayToScreen)??!0,t),Eh().history.addHistoryItem({name:"overlayImage"})}async openUploadedFile(e,t=!0){if(!e)return;const n=await e.data;switch(e.extension){case"json":await this.loadState(n);break;case"svg":await Eh().shape.addSvgSticker(n,Cd.Image),Eh().history.addHistoryItem({name:"overlayImage"});break;default:await this.addImageFromData(n,t)}}async loadState(e){let t;jh().toggleLoading("state"),await Th(),t="string"==typeof e?e.endsWith(".json")?await Oh(e):JSON.parse(e):e,t.history?jh().history.reset(t.history):await Eh().history.addInitial(t),await Eh().history.reload(),jh().toggleLoading(!1)}async openUploadWindow(e){var t,n;e=e||function(){var e,t;const n=null==(t=null==(e=jh().config.tools)?void 0:e.import)?void 0:t.validImgExtensions;return n?{extensions:n}:{types:[rb.image]}}();const r=(await function(e={}){return new Promise(t=>{const n=function(e={}){const t=document.querySelector("#hidden-file-upload-input");t&&t.remove();const n=document.createElement("input");return n.type="file",n.multiple=e.multiple??!1,n.classList.add("hidden"),n.style.display="none",n.style.visibility="hidden",n.id="hidden-file-upload-input",n.accept=function({extensions:e=[],types:t=[]}){const n=[];return null!=e&&e.length&&(e=e.map(e=>e.startsWith(".")?e:`.${e}`),n.push(e.join(","))),null!=t&&t.length&&n.push(t.join(",")),n.join(",")}(e),e.directory&&(n.webkitdirectory=!0),document.body.appendChild(n),n}(e);n.onchange=e=>{const r=e.target.files;if(!r)return t([]);const i=Array.from(r).filter(e=>".DS_Store"!==e.name).map(e=>new tb(e));t(i),n.remove()},document.body.appendChild(n),n.click()})}(e))[0];return this.fileIsValid(r)?(null==(n=(t=jh().config).onFileOpen)||n.call(t,r),r):null}async openBackgroundImage(e){let t;await Th(),t=e instanceof HTMLImageElement?e.src:e instanceof tb?await e.data:e;const n=await Eh().canvas.addMainImage(t);return await Eh().history.addInitial(),n}fileIsValid(e){var t,n,r,i;const o=function(e,t){if(!t)return;const{maxFileSize:n,allowedFileTypes:r,blockedFileTypes:i}=t;return n&&null!=e.size&&e.size>n?sc("`:file` exceeds maximum allowed size of :size",{values:{file:e.name,size:ib(n)}}):null!=r&&r.length&&!lb(e,r)||null!=i&&i.length&&lb(e,i)?sc("This file type is not allowed"):void 0}(e,{maxFileSize:(null==(n=null==(t=jh().config.tools)?void 0:t.import)?void 0:n.maxFileSize)??10485760,allowedFileTypes:[...(null==(i=null==(r=jh().config.tools)?void 0:r.import)?void 0:i.validImgExtensions)??[],"json"]});return!o||(Bh.danger(o),!1)}}const ub={types:[".json",rb.json]};class db{constructor(){Ni(this,"watermark",null),Ni(this,"lineStyle",{stroke:"rgba(255,255,255,0.3)",strokeWidth:5,strokeLineCap:"round",strokeLineJoin:"round"})}add(e){this.createGroup(),this.addText(e),this.addLines(),Ih().add(this.watermark),Eh().canvas.render()}remove(){this.watermark&&(Ih().remove(this.watermark),this.watermark=null,Eh().canvas.render())}createGroup(){this.watermark=new Jv.fabric.Group(void 0,{...Fh,width:jh().original.width,height:jh().original.height,excludeFromExport:!0,top:0,left:0,originX:"left",originY:"top"})}addText(e){var t;const n=new Jv.fabric.Text(e,{fill:"rgba(255,255,255,0.3)",strokeWidth:2,stroke:"rgba(255,255,255,0.4)",originX:"center",originY:"center",fontWeight:600,fontSize:150,fontFamily:"Courier New"});n.scaleToWidth(jh().original.width/2),null==(t=this.watermark)||t.add(n)}addLines(){var e;if(!this.watermark)return;const t=null==(e=this.watermark)?void 0:e.getObjects("text")[0],n=jh().original.width/2,r=jh().original.height/2,i=100,o=t.width/4,a=new Jv.fabric.Line(void 0,this.lineStyle),s=new Jv.fabric.Line(void 0,this.lineStyle),l=new Jv.fabric.Line(void 0,this.lineStyle),c=new Jv.fabric.Line(void 0,this.lineStyle);this.watermark.add(a,s,l,c),a.set({x1:o,y1:-i,x2:n,y2:-r}),s.set({x1:o,y1:i,x2:n,y2:r}),l.set({x1:-o,y1:-i,x2:-n,y2:-r}),c.set({x1:-o,y1:i,x2:-n,y2:r})}}var hb={exports:{}};!function(e){!function(){function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){a(r.response,t,n)},r.onerror=function(){},r.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function r(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof rc&&rc.global===rc?rc:void 0,o=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),a=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(e,o,a){var s=i.URL||i.webkitURL,l=document.createElement("a");o=o||e.name||"download",l.download=o,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?r(l):n(l.href)?t(e,o,a):r(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){r(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,i,o){if(i=i||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return typeof t>"u"?t={autoBom:!1}:"object"!=typeof t&&(t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,o),i);else if(n(e))t(e,i,o);else{var a=document.createElement("a");a.href=e,a.target="_blank",setTimeout(function(){r(a)})}}:function(e,n,r,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var s="application/octet-stream"===e.type,l=/constructor/i.test(i.HTMLElement)||i.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&l||o)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var d=i.URL||i.webkitURL,h=d.createObjectURL(e);a?a.location=h:location.href=h,a=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});i.saveAs=a.saveAs=a,e.exports=a}()}(hb);var fb=hb.exports;class pb{save(e,t,n){var r,i,o;const a=null==(r=jh().config.tools)?void 0:r.export;e=e||(null==a?void 0:a.defaultName),t=this.getFormat(t),n=this.getQuality(n);const s=`${e}.${t}`;this.applyWaterMark();const l="json"===t?this.getJsonState():this.getDataUrl(t,n);if(Eh().watermark.remove(),l)if(jh().config.saveUrl)fetch(jh().config.saveUrl,{method:"POST",body:JSON.stringify({data:l,filename:s,format:t})});else if(jh().config.onSave)null==(o=(i=jh().config).onSave)||o.call(i,l,s,t);else{const e=this.getCanvasBlob(t,l);fb.saveAs(e,s)}}getDataUrl(e,t){try{return"svg"===e?Ih().toSVG():Ih().toDataURL({format:this.getFormat(e),quality:this.getQuality(t),multiplier:Math.max(jh().original.width/Ih().width,jh().original.height/Ih().height)})}catch(e){e.message.toLowerCase().includes("tainted")&&Bh.danger(sc("Could not export canvas with external image."))}return null}getCanvasBlob(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const n=`image/${e}`;return function(e,t,n){t=t||"",n=n||512;const r=atob(e),i=[];for(let o=0;o<r.length;o+=n){const e=r.slice(o,o+n),t=new Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);const a=new Uint8Array(t);i.push(a)}return new Blob(i,{type:t})}(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),n)}getJsonState(){return JSON.stringify({...Ph(),history:jh().history})}applyWaterMark(){const e=jh().config.watermarkText;e&&Eh().watermark.add(e)}getFormat(e){var t;const n=null==(t=jh().config.tools)?void 0:t.export;return"jpg"===(e=e||(null==n?void 0:n.defaultFormat)||"png")&&(e="jpeg"),e}getQuality(e){var t;const n=null==(t=jh().config.tools)?void 0:t.export;return e||(null==n?void 0:n.defaultQuality)||.8}}class gb{constructor(){Ni(this,"previewRect",null)}async apply(e){this.previewRect||this.showPreview(),this.updatePreview(e),Ih().remove(this.previewRect),Ih().clipPath=this.previewRect;const t=Eh().export.getDataUrl();t&&Eh().canvas.clear(),this.hidePreview(),t&&await Eh().canvas.addMainImage(t),Ih().clipPath=void 0}getPreviewRadius(){var e;return(null==(e=this.previewRect)?void 0:e.rx)||0}updatePreview(e){this.previewRect&&(this.previewRect.set({rx:e,ry:e}),Eh().canvas.render())}showPreview(){const e=.04*jh().original.width;this.previewRect=new Jv.fabric.Rect({width:jh().original.width,height:jh().original.height,rx:e,ry:e,objectCaching:!1,fill:"transparent",name:"round.rect",data:{pixieInternal:!0},stroke:"rgba(255,255,255,0.8)",strokeWidth:3,strokeDashArray:[4,4],selectable:!1,evented:!1}),Ih().add(this.previewRect),this.previewRect.moveTo(99),this.previewRect.viewportCenter(),Eh().canvas.render()}hidePreview(){this.previewRect&&(Ih().remove(this.previewRect),Eh().canvas.render(),this.previewRect=null)}}class mb{get straightenAnchor(){return Ih().getObjects().find(e=>e.name===Cd.StraightenAnchor)}rotateLeft(){this.rotateFixed(-90)}rotateRight(){this.rotateFixed(90)}straighten(e){this.storeObjectsRelationToHelper(),Eh().objects.deselectActive();const t=(this.straightenAnchor.data.rotateAngle||0)+e,n=this.getImageScale(t,this.straightenAnchor);this.straightenAnchor.angle=t,this.straightenAnchor.scaleX=n,this.straightenAnchor.scaleY=n,this.straightenAnchor.data.straightenAngle=e,this.transformObjectsBasedOnHelper()}flip(e){const t="horizontal"===e?"flipY":"flipX";Eh().objects.getAll().forEach(e=>{e[t]=!e[t]}),Eh().canvas.render()}rotateFixed(e){Eh().zoom.set(1,!1),Eh().objects.deselectActive();const t=this.straightenAnchor.data.rotateAngle||0;e=90*Math.round(e/90);const n=t+(this.straightenAnchor.data.straightenAngle||0)+e;Eh().canvas.resize(jh().original.height,jh().original.width,{applyZoom:!1,resizeHelper:!1}),this.storeObjectsRelationToHelper(),this.straightenAnchor.rotate(n),this.straightenAnchor.data.rotateAngle=t+e,this.straightenAnchor.center(),this.transformObjectsBasedOnHelper(),Eh().frame.resize(Eh().frame.active.currentSizeInPercent),requestAnimationFrame(()=>{Eh().zoom.fitToScreen()})}getImageScale(e,t){e=Jv.fabric.util.degreesToRadians(e);const n=jh().original.width/2,r=jh().original.height/2,i=t.width/2,o=t.height/2,a=Math.sqrt(n**2+r**2),s=Math.asin(r/a);let l=(e%(2*Math.PI)+4*Math.PI)%(2*Math.PI);l>Math.PI&&(l-=Math.PI),l>Math.PI/2&&l<=Math.PI&&(l=Math.PI/2-(l-Math.PI/2));const c=Math.PI/2-s-Math.abs(l),u=Math.abs(s-Math.abs(l)),d=Math.cos(c)*a,h=Math.cos(u)*a;return Math.max(h/i,d/o)}storeObjectsRelationToHelper(){Eh().objects.getAll().forEach(e=>{if(e!==this.straightenAnchor){const t=Jv.fabric.util.multiplyTransformMatrices(Jv.fabric.util.invertTransform(this.straightenAnchor.calcTransformMatrix()),e.calcTransformMatrix());e.data={...e.data,relationToCanvas:t}}})}transformObjectsBasedOnHelper(){Eh().objects.getAll().forEach(e=>{if(e.data.relationToCanvas){const t=Jv.fabric.util.multiplyTransformMatrices(this.straightenAnchor.calcTransformMatrix(),e.data.relationToCanvas),n=Jv.fabric.util.qrDecompose(t);e.set({flipX:!1,flipY:!1}),e.setPositionByOrigin({x:n.translateX,y:n.translateY},"center","center"),e.set(n),e.setCoords(),e.data.relationToCanvas=null}})}resetStraightenAnchor(){const e=this.straightenAnchor;e&&Ih().remove(e);const t=new Jv.fabric.Rect({...Fh,name:Cd.StraightenAnchor,visible:!1,width:jh().original.width,height:jh().original.height,data:{pixieInternal:!0,straightenAngle:0,rotateAngle:0}});Ih().add(t),t.viewportCenter()}}function vb(e,t){const n=new ResizeObserver(e=>{const n=e[0].contentRect;t({width:n.width,height:n.height})});return e.current&&n.observe(e.current),()=>{e.current&&n.unobserve(e.current)}}function yb(e){const t=e.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height}}const bb="flex flex-shrink-0 items-center justify-between px-12 py-[9px] w-full h-[54px]",wb={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute"},transition:{type:"tween",duration:.15}};function xb(e,{padding:t,equalWidth:n,variant:r}={}){switch(e){case"2xs":return"link"===r?"text-xs":`text-xs h-24 ${n?"w-24":t||"px-10"}`;case"xs":return"link"===r?"text-xs":`text-xs h-30 ${n?"w-30":t||"px-14"}`;case"sm":return"link"===r?"text-sm":`text-sm h-36 ${n?"w-36":t||"px-18"}`;case"md":return"link"===r?"text-base":`text-base h-42 ${n?"w-42":t||"px-22"}`;case"lg":return"link"===r?"text-lg":`text-base h-50 ${n?"w-50":t||"px-26"}`;case"xl":return"link"===r?"text-xl":`text-lg h-60 ${n?"w-60":t||"px-32"}`;default:return e||""}}function Cb(e){const{variant:t,shadow:n,whitespace:r="whitespace-nowrap",display:i="inline-flex"}=e,o={...e,border:e.border||"border"};let a=[];return"outline"===t?a=function({color:e,border:t}){const n="disabled:text-disabled disabled:bg-transparent disabled:border-disabled-bg";switch(e){case"primary":return[`text-primary bg-transparent ${t} border-primary/50`,"hover:bg-primary/hover hover:border-primary",n];case"danger":return[`text-danger bg-transparent ${t} border-danger/50`,"hover:bg-danger/4 hover:border-danger",n];case"positive":return[`text-positive bg-transparent ${t} border-positive/50`,"hover:bg-positive/4 hover:border-positive",n];case"paper":return[`text bg-paper ${t}`,"hover:bg-hover",n];case"white":return["text-white bg-transparent border border-white","hover:bg-white/20","disabled:text-white/70 disabled:border-white/70 disabled:bg-transparent"];default:return[`bg-transparent ${t}`,"hover:bg-hover",n]}}(o):"text"===t?a=function({color:e}){const t="disabled:text-disabled disabled:bg-transparent";switch(e){case"primary":return["text-primary bg-transparent border-transparent","hover:bg-primary/4",t];case"danger":return["text-danger bg-transparent border-transparent","hover:bg-danger/4",t];case"positive":return["text-positive bg-transparent border-transparent","hover:bg-positive/4",t];case"white":return["text-white bg-transparent border-transparent","hover:bg-white/20","disabled:text-white/70 disabled:bg-transparent"];default:return["bg-transparent border-transparent","hover:bg-hover",t]}}(o):"flat"===t||"raised"===t?a=function({color:e,border:t}){const n="disabled:text-disabled disabled:bg-disabled disabled:border-transparent disabled:shadow-none";switch(e){case"primary":return[`text-on-primary bg-primary ${t} border-primary`,"hover:bg-primary-dark hover:border-primary-dark",n];case"danger":return[`text-white bg-danger ${t} border-danger`,"hover:bg-danger/90 hover:border-danger/90",n];case"chip":return[`text-main bg-chip ${t} border-chip`,"hover:bg-chip/90 hover:border-chip/90",n];case"paper":return[`text-main bg-paper ${t} border-paper`,"hover:bg-paper/90 hover:border-paper/90",n];case"white":return[`text-black bg-white ${t} border-white`,"hover:bg-white",n];default:return[`bg ${t} border-background`,"hover:bg-hover",n]}}(o):"link"===t&&(a=function({color:e}){switch(e){case"primary":return["text-primary","hover:underline","disabled:text-disabled"];case"danger":return["text-danger","hover:underline","disabled:text-disabled"];default:return["text-main","hover:underline","disabled:text-disabled"]}}(o)),[...a,n||"raised"===t&&"shadow-md",r,i,t&&"align-middle flex-shrink-0 items-center transition-button duration-200","select-none appearance-none no-underline outline-none disabled:pointer-events-none disabled:cursor-default"]}function _b(e){return e&&(t=>{t.currentTarget.contains(t.target)&&e(t)})}const Sb=(0,o.forwardRef)((e,t)=>{const{children:n,color:r=null,variant:o,radius:a,shadow:s,whitespace:l,justify:c="justify-center",className:u,href:d,form:h,border:f,elementType:p,to:g,relative:m,replace:v,end:y,display:b,type:w="button",onClick:x,onPointerDown:C,onPointerUp:_,onKeyDown:S,...k}=e,A=p||(d?"a":"button"),j="a"===A;return(0,i.jsx)(A,{ref:t,form:j?void 0:h,href:d,to:g,relative:m,type:j?void 0:w,replace:v,end:y,onPointerDown:_b(C),onPointerUp:_b(_),onClick:_b(x),onKeyDown:_b(S),className:gc("focus-visible:ring",Cb({variant:o,color:r,border:f,whitespace:l,display:b}),a,c,u),...k,children:n})}),kb=o.forwardRef(({children:e,startIcon:t,endIcon:n,size:r="sm",sizeClassName:o,className:a,equalWidth:s=!1,radius:l="rounded-button",variant:c="text",disabled:u,elementType:d,to:h,replace:f,href:p,download:g,...m},v)=>{const y=gc("font-semibold",o||xb(r,{equalWidth:s,variant:c}),a);return(0,i.jsxs)(Sb,{className:y,ref:v,radius:l,variant:c,disabled:u,to:u?void 0:h,href:u?void 0:p,download:u?void 0:g,elementType:u?void 0:d,replace:u?void 0:f,...m,children:[t&&(0,i.jsx)(Ab,{position:"start",icon:t,size:r}),e,n&&(0,i.jsx)(Ab,{position:"end",icon:n,size:r})]})});function Ab({icon:e,position:t,size:n}){const r=gc("m-auto",{"-ml-4 mr-8":"start"===t,"-mr-4 ml-8":"end"===t},e.props.className);return o.cloneElement(e,{className:r,size:n})}const jb=(0,o.createContext)(null);function Eb(){return(0,o.useContext)(jb)}const Ib=yc((0,i.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"}),"CheckOutlined"),Tb=o.forwardRef((e,t)=>{let{startIcon:n,capitalizeFirst:r,children:o,description:a,endIcon:s,endSection:l,isDisabled:c,isActive:u,isSelected:d,showCheckmark:h,elementType:f="div",radius:p,padding:g,...m}=e;!n&&h&&(n=(0,i.jsx)(Ib,{size:"sm",className:gc("text-primary",!d&&"invisible")}));const v=gc("icon-sm rounded overflow-hidden flex-shrink-0",!c&&"text-muted"),y=gc(!c&&"text-muted");return(0,i.jsxs)(f,{...m,"aria-disabled":c,className:Ob(e),ref:t,children:[n&&(0,i.jsx)("div",{className:v,children:n}),(0,i.jsxs)("div",{className:gc("min-w-auto mr-auto w-full overflow-hidden overflow-ellipsis",r&&"first-letter:capitalize"),children:[o,a&&(0,i.jsx)("div",{className:gc("mt-4 whitespace-normal text-xs",c?"text-disabled":"text-muted"),children:a})]}),(s||l)&&(0,i.jsx)("div",{className:s?v:y,children:s||l})]})});function Ob({className:e,isSelected:t,isActive:n,isDisabled:r,showCheckmark:i,endIcon:o,endSection:a,radius:s,padding:l}){let c,u="";return u=r?"text-disabled pointer-events-none":t?n?"bg-primary/focus":"bg-primary/selected hover:bg-primary/focus":n?"hover:bg-fg-base/15 bg-focus":"hover:bg-hover",c=l||(i?o||a?"pl-8 pr-8 py-8":"pl-8 pr-24 py-8":"px-20 py-8"),gc("w-full select-none outline-none cursor-pointer","text-sm truncate flex items-center gap-10",!r&&"text-main",c,u,e,s)}function Fb({children:e,value:t,startIcon:n,endIcon:r,endSection:o,description:a,capitalizeFirst:s,textLabel:l,isDisabled:c,onSelected:u,onClick:d,...h}){var f;const{collection:p,showCheckmark:g,virtualFocus:m,listboxId:v,role:y,listItemsRef:b,handleItemSelection:w,state:{selectedValues:x,activeIndex:C,setActiveIndex:_}}=Eb(),S=x.includes(t),k=null==(f=p.get(t))?void 0:f.index,A=C===k;return null==k?null:(0,i.jsx)(Tb,{...h,onFocus:()=>{m||_(k)},onPointerEnter:e=>{_(k),m||e.currentTarget.focus()},onPointerDown:e=>{m&&e.preventDefault()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),w(t),null==u||u())},onClick:e=>{w(t),null==u||u(),null==d||d(e)},ref:e=>b.current[k]=e,id:`${v}-${k}`,role:"menu"===y?"menuitem":"option",tabIndex:m?void 0:A&&!c?-1:0,"aria-selected":A&&S,showCheckmark:g,isDisabled:c,isActive:A,isSelected:S,startIcon:n,description:a,endIcon:r,endSection:o,capitalizeFirst:s,"data-value":t,children:e})}var Pb={exports:{}};!function(e){(function(){var t=Object.assign;function n(e,n){n||(n={});var r,i,o,a=n.vargs||function(e){var t=e+"",n=t.indexOf("...");return n>=0&&(n<t.indexOf(")")||t.indexOf("arguments")>=0)}(e),s=Object.create(null),l=[],c=[],u=new WeakMap,d=n.maxAge>0&&n.maxAge<1/0?function(e,t,r){return setTimeout(function(){if(r)return t.splice(e,1),void r.splice(e,1);t instanceof WeakMap?t.delete(e):delete t[e]},n.maxAge)}:0,h=n.equals?n.equals:function(e,t){return e===t},f=n.maxArgs,p=n.serializer;return 1!==e.length||n.equals||a?i=function(){var t=arguments.length;if(!t&&null!=r)return c[r];var n,i=f||t;for(n=l.length-1;n>=0;n--)if(f||l[n].length===i)for(var o=i-1;o>=0&&h(l[n][o],arguments[o]);o--)if(0===o)return c[n];return n=l.length-(n+1),!t&&null==r&&(r=n),!d||d(n,c,l),c[n]=e.apply(this,l[n]=arguments)}.bind(this):(i=function(t){var n,r=typeof t;if(!p&&("object"===r&&t||"function"===r))return u.get(t)||(!d||d(t,u),u.set(t,n=e.call(this,t)),n);var i="number"===r||"boolean"===r||null==t?t:"string"===r?JSON.stringify(t):p(t);return s[i]||(!d||d(i,s),s[i]=e.call(this,t))}.bind(this),o=1),i.clear=function(){u=new WeakMap,s=Object.create(null),l=[],c=[],r=void 0},i.keys=function(){return o?null:l.slice()},i.values=function(){return o?null:c.slice()},i.keyValues=function(){return o?{primitives:t({},s),objects:u}:null},i}"function"!=typeof t&&(t=function(){var e=arguments,t=arguments[0];if(null==t)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var n=1;n<e.length;n++)if(e[n]&&"object"==typeof e[n])for(var r in e[n])t[r]=e[n][r];return t}),e.exports=n,typeof window<"u"&&(window.nanomemoize=n)}).call(rc)}(Pb);const Mb=ic(Pb.exports);function Rb({children:e,label:t,index:n}){const r=(0,o.useId)();return(0,i.jsxs)("div",{role:"group",className:gc(0!==n&&"border-t my-4"),"aria-labelledby":t?`be-select-${r}`:void 0,children:[t&&(0,i.jsx)("div",{className:"block uppercase text-muted text-xs px-16 py-10",role:"presentation",id:`be-select-${r}`,"aria-hidden":"true",children:t}),e]})}const Lb=Mb(({maxItems:e,children:t,items:n,inputValue:r})=>{let i=Nb({children:t,items:n}),o=Db({collection:i,inputValue:r});return e&&(i=new Map([...i.entries()].slice(0,e)),o=new Map([...o.entries()].slice(0,e))),{collection:i,filteredCollection:o}}),Db=Mb(({collection:e,inputValue:t})=>{let n=new Map;const r=t?`${t}`.toLowerCase().trim():"";if(r){let t=0;e.forEach((e,i)=>{(e.item?JSON.stringify(e.item):e.textLabel).toLowerCase().trim().includes(r)&&n.set(i,{...e,index:t++})})}else n=e;return n}),Nb=Mb(({children:e,items:t})=>{let n;n=t&&"function"==typeof e?t.map(t=>e(t)):e;const r=new Map;let i=0;const a=(e,n,o,a)=>{const s=i++,l=n?null==t?void 0:t[o].items[a]:null==t?void 0:t[s];r.set(e.props.value,{index:s,element:e,textLabel:zb(e),item:l,section:n,isDisabled:e.props.isDisabled,value:e.props.value})};return o.Children.forEach(n,(e,t)=>{(0,o.isValidElement)(e)&&(e.type===Rb?o.Children.forEach(e.props.children,(n,r)=>{a(n,e,t,r)}):a(e))}),r});function zb(e){var t;const n=e.props.children;return e.props.textLabel?e.props.textLabel:null!=(t=null==n?void 0:n.props)&&t.message?n.props.message:`${n}`||""}const Bb=Math.min,Vb=Math.max,Ub=Math.round,Wb=Math.floor,Hb=e=>({x:e,y:e}),$b={left:"right",right:"left",bottom:"top",top:"bottom"},Gb={start:"end",end:"start"};function Yb(e,t,n){return Vb(e,Bb(t,n))}function qb(e,t){return"function"==typeof e?e(t):e}function Xb(e){return e.split("-")[0]}function Kb(e){return e.split("-")[1]}function Zb(e){return"x"===e?"y":"x"}function Jb(e){return"y"===e?"height":"width"}function Qb(e){return["top","bottom"].includes(Xb(e))?"y":"x"}function ew(e){return Zb(Qb(e))}function tw(e){return e.replace(/start|end/g,e=>Gb[e])}function nw(e){return e.replace(/left|right|bottom|top/g,e=>$b[e])}function rw(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function iw(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ow(e,t,n){let{reference:r,floating:i}=e;const o=Qb(t),a=ew(t),s=Jb(a),l=Xb(t),c="y"===o,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[s]/2-i[s]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Kb(t)){case"start":f[a]-=h*(n&&c?-1:1);break;case"end":f[a]+=h*(n&&c?-1:1)}return f}async function aw(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=qb(t,e),p=rw(f),g=s[h?"floating"===d?"reference":"floating":d],m=iw(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},w=iw(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-w.top+p.top)/b.y,bottom:(w.bottom-m.bottom+p.bottom)/b.y,left:(m.left-w.left+p.left)/b.x,right:(w.right-m.right+p.right)/b.x}}function sw(e){return uw(e)?(e.nodeName||"").toLowerCase():"#document"}function lw(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function cw(e){var t;return null==(t=(uw(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function uw(e){return e instanceof Node||e instanceof lw(e).Node}function dw(e){return e instanceof Element||e instanceof lw(e).Element}function hw(e){return e instanceof HTMLElement||e instanceof lw(e).HTMLElement}function fw(e){return!(typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof lw(e).ShadowRoot)}function pw(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=bw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function gw(e){return["table","td","th"].includes(sw(e))}function mw(e){const t=vw(),n=bw(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function vw(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function yw(e){return["html","body","#document"].includes(sw(e))}function bw(e){return lw(e).getComputedStyle(e)}function ww(e){return dw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function xw(e){if("html"===sw(e))return e;const t=e.assignedSlot||e.parentNode||fw(e)&&e.host||cw(e);return fw(t)?t.host:t}function Cw(e){const t=xw(e);return yw(t)?e.ownerDocument?e.ownerDocument.body:e.body:hw(t)&&pw(t)?t:Cw(t)}function _w(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=Cw(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=lw(i);return o?t.concat(a,a.visualViewport||[],pw(i)?i:[],a.frameElement&&n?_w(a.frameElement):[]):t.concat(i,_w(i,[],n))}function Sw(e){const t=bw(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=hw(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=Ub(n)!==o||Ub(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function kw(e){return dw(e)?e:e.contextElement}function Aw(e){const t=kw(e);if(!hw(t))return Hb(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Sw(t);let a=(o?Ub(n.width):n.width)/r,s=(o?Ub(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const jw=Hb(0);function Ew(e){const t=lw(e);return vw()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:jw}function Iw(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=kw(e);let a=Hb(1);t&&(r?dw(r)&&(a=Aw(r)):a=Aw(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==lw(e))&&t}(o,n,r)?Ew(o):Hb(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(o){const e=lw(o),t=r&&dw(r)?lw(r):r;let n=e,i=n.frameElement;for(;i&&r&&t!==n;){const e=Aw(i),t=i.getBoundingClientRect(),r=bw(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=a,n=lw(i),i=n.frameElement}}return iw({width:u,height:d,x:l,y:c})}const Tw=[":popover-open",":modal"];function Ow(e){return Tw.some(t=>{try{return e.matches(t)}catch{return!1}})}function Fw(e){return Iw(cw(e)).left+ww(e).scrollLeft}function Pw(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=lw(e),r=cw(e),i=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;const e=vw();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=cw(e),n=ww(e),r=e.ownerDocument.body,i=Vb(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Vb(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Fw(e);const s=-n.scrollTop;return"rtl"===bw(r).direction&&(a+=Vb(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:a,y:s}}(cw(e));else if(dw(t))r=function(e,t){const n=Iw(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=hw(e)?Aw(e):Hb(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=Ew(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return iw(r)}function Mw(e,t){const n=xw(e);return!(n===t||!dw(n)||yw(n))&&("fixed"===bw(n).position||Mw(n,t))}function Rw(e,t){const n=t.get(e);if(n)return n;let r=_w(e,[],!1).filter(e=>dw(e)&&"body"!==sw(e)),i=null;const o="fixed"===bw(e).position;let a=o?xw(e):e;for(;dw(a)&&!yw(a);){const t=bw(a),n=mw(a);!n&&"fixed"===t.position&&(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||pw(a)&&!n&&Mw(e,a))?r=r.filter(e=>e!==a):i=t,a=xw(a)}return t.set(e,r),r}function Lw(e,t,n){const r=hw(t),i=cw(t),o="fixed"===n,a=Iw(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=Hb(0);if(r||!r&&!o)if(("body"!==sw(t)||pw(i))&&(s=ww(t)),r){const e=Iw(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=Fw(i));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Dw(e){return"static"===bw(e).position}function Nw(e,t){return hw(e)&&"fixed"!==bw(e).position?t?t(e):e.offsetParent:null}function zw(e,t){const n=lw(e);if(Ow(e))return n;if(!hw(e)){let t=xw(e);for(;t&&!yw(t);){if(dw(t)&&!Dw(t))return t;t=xw(t)}return n}let r=Nw(e,t);for(;r&&gw(r)&&Dw(r);)r=Nw(r,t);return r&&yw(r)&&Dw(r)&&!mw(r)?n:r||function(e){let t=xw(e);for(;hw(t)&&!yw(t);){if(mw(t))return t;t=xw(t)}return null}(e)||n}const Bw={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,a=cw(r),s=!!t&&Ow(t.floating);if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Hb(1);const u=Hb(0),d=hw(r);if((d||!d&&!o)&&(("body"!==sw(r)||pw(a))&&(l=ww(r)),hw(r))){const e=Iw(r);c=Aw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:cw,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?Ow(t)?[]:Rw(t,this._c):[].concat(n),r],a=o[0],s=o.reduce((e,n)=>{const r=Pw(t,n,i);return e.top=Vb(r.top,e.top),e.right=Bb(r.right,e.right),e.bottom=Bb(r.bottom,e.bottom),e.left=Vb(r.left,e.left),e},Pw(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:zw,getElementRects:async function(e){const t=this.getOffsetParent||zw,n=this.getDimensions,r=await n(e.floating);return{reference:Lw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Sw(e);return{width:t,height:n}},getScale:Aw,isElement:dw,isRTL:function(e){return"rtl"===bw(e).direction}};function Vw(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=kw(e),u=i||o?[...c?_w(c):[],..._w(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const i=cw(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(s||t(),!d||!h)return;const f={rootMargin:-Wb(u)+"px "+-Wb(i.clientWidth-(c+d))+"px "+-Wb(i.clientHeight-(u+h))+"px "+-Wb(c)+"px",threshold:Vb(0,Bb(1,l))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return a();t?a(!1,t):n=setTimeout(()=>{a(!1,1e-7)},1e3)}p=!1}try{r=new IntersectionObserver(g,{...f,root:i.ownerDocument})}catch{r=new IntersectionObserver(g,f)}r.observe(e)}(!0),o}(c,n):null;let h=-1,f=null;a&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,g=l?Iw(e):null;return l&&function t(){const r=Iw(e);g&&(r.x!==g.x||r.y!==g.y||r.width!==g.width||r.height!==g.height)&&n(),g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=f)||e.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Uw=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),a=Xb(n),s=Kb(n),l="y"===Qb(n),c=["left","top"].includes(a)?-1:1,u=o&&l?-1:1,d=qb(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:a}}}}},Ww=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=qb(e,t),c={x:n,y:r},u=await aw(t,l),d=Qb(Xb(i)),h=Zb(d);let f=c[h],p=c[d];if(o){const e="y"===h?"bottom":"right";f=Yb(f+u["y"===h?"top":"left"],f,f-u[e])}if(a){const e="y"===d?"bottom":"right";p=Yb(p+u["y"===d?"top":"left"],p,p-u[e])}const g=s.fn({...t,[h]:f,[d]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},Hw=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...m}=qb(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const v=Xb(i),y=Xb(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(y||!g?[nw(s)]:function(e){const t=nw(e);return[tw(e),t,tw(t)]}(s));!h&&"none"!==p&&w.push(...function(e,t,n,r){const i=Kb(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:a;default:return[]}}(Xb(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(tw)))),o}(s,g,p,b));const x=[s,...w],C=await aw(t,m),_=[];let S=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&_.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Kb(e),i=ew(e),o=Jb(i);let a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=nw(a)),[a,nw(a)]}(i,a,b);_.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:i,overflows:_}],!_.every(e=>e<=0)){var k,A;const e=((null==(k=o.flip)?void 0:k.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(A=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:A.placement;if(!n)switch(f){case"bestFit":{var j;const e=null==(j=S.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:j[0];e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},$w=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:o}=t,{apply:a=()=>{},...s}=qb(e,t),l=await aw(t,s),c=Xb(n),u=Kb(n),d="y"===Qb(n),{width:h,height:f}=r.floating;let p,g;"top"===c||"bottom"===c?(p=c,g=u===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(g=c,p="end"===u?"top":"bottom");const m=f-l.top-l.bottom,v=h-l.left-l.right,y=Bb(f-l[p],m),b=Bb(h-l[g],v),w=!t.middlewareData.shift;let x=y,C=b;if(d?C=u||w?Bb(b,v):v:x=u||w?Bb(y,m):m,w&&!u){const e=Vb(l.left,0),t=Vb(l.right,0),n=Vb(l.top,0),r=Vb(l.bottom,0);d?C=h-2*(0!==e||0!==t?e+t:Vb(l.left,l.right)):x=f-2*(0!==n||0!==r?n+r:Vb(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:x});const _=await i.getDimensions(o.floating);return h!==_.width||f!==_.height?{reset:{rects:!0}}:{}}}},Gw=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=qb(e,t)||{};if(null==c)return{};const d=rw(u),h={x:n,y:r},f=ew(i),p=Jb(f),g=await a.getDimensions(c),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[f]-h[f]-o.floating[p],x=h[f]-o.reference[f],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let _=C?C[b]:0;(!_||!await(null==a.isElement?void 0:a.isElement(C)))&&(_=s.floating[b]||o.floating[p]);const S=w/2-x/2,k=_/2-g[p]/2-1,A=Bb(d[v],k),j=Bb(d[y],k),E=A,I=_-g[p]-j,T=_/2-g[p]/2+S,O=Yb(E,T,I),F=!l.arrow&&null!=Kb(i)&&T!==O&&o.reference[p]/2-(T<E?A:j)-g[p]/2<0,P=F?T<E?T-E:T-I:0;return{[f]:h[f]+P,data:{[f]:O,centerOffset:T-O-P,...F&&{alignmentOffset:P}},reset:F}}});var Yw=typeof document<"u"?o.useLayoutEffect:o.useEffect;function qw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!==r--;)if(!qw(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!==r--;){const n=i[r];if(!("_owner"===n&&e.$$typeof||qw(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Xw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kw(e,t){const n=Xw(e);return Math.round(t*n)/n}function Zw(e){const t=o.useRef(e);return Yw(()=>{t.current=e}),t}function Jw(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,h]=o.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=o.useState(r);qw(f,r)||p(r);const[g,m]=o.useState(null),[v,y]=o.useState(null),b=o.useCallback(e=>{e!=_.current&&(_.current=e,m(e))},[m]),w=o.useCallback(e=>{e!==S.current&&(S.current=e,y(e))},[y]),x=a||g,C=s||v,_=o.useRef(null),S=o.useRef(null),k=o.useRef(d),A=Zw(c),j=Zw(i),E=o.useCallback(()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:f};j.current&&(e.platform=j.current),((e,t,n)=>{const r=new Map,i={platform:Bw,...n},o={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ow(c,r,l),h=r,f={},p=0;for(let g=0;g<s.length;g++){const{name:n,fn:o}=s[g],{x:m,y:v,data:y,reset:b}=await o({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:a,elements:{reference:e,floating:t}});u=m??u,d=v??d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:u,y:d}=ow(c,h,l))),g=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}})(e,t,{...i,platform:o})})(_.current,S.current,e).then(e=>{const t={...e,isPositioned:!0};I.current&&!qw(k.current,t)&&(k.current=t,ne.flushSync(()=>{h(t)}))})},[f,t,n,j]);Yw(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const I=o.useRef(!1);Yw(()=>(I.current=!0,()=>{I.current=!1}),[]),Yw(()=>{if(x&&(_.current=x),C&&(S.current=C),x&&C){if(A.current)return A.current(x,C,E);E()}},[x,C,E,A]);const T=o.useMemo(()=>({reference:_,floating:S,setReference:b,setFloating:w}),[b,w]),O=o.useMemo(()=>({reference:x,floating:C}),[x,C]),F=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=Kw(O.floating,d.x),r=Kw(O.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...Xw(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,O.floating,d.x,d.y]);return o.useMemo(()=>({...d,update:E,refs:T,elements:O,floatingStyles:F}),[d,E,T,O,F])}function Qw({floatingWidth:e,ref:t,disablePositioning:n=!1,placement:r="bottom",offset:i=2,showArrow:a=!1,maxHeight:s,shiftCrossAxis:l=!0,fallbackPlacements:c}){const u=(0,o.useRef)(null),d={placement:r,strategy:"fixed"};n||(d.whileElementsMounted=Vw,d.middleware=[Uw(i),Ww({padding:16,crossAxis:l,mainAxis:!0}),Hw({padding:16,fallbackPlacements:c}),$w({apply({rects:t,availableHeight:n,availableWidth:r,elements:i}){"matchTrigger"===e&&null!=s?Object.assign(i.floating.style,{width:`${t.reference.width}px`,maxWidth:`${r}`,maxHeight:`${Math.min(n,s)}px`}):null!=s&&Object.assign(i.floating.style,{maxHeight:`${Math.min(n,s)}px`})},padding:16})],a&&d.middleware.push((e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?Gw({element:n.current,padding:r}).fn(t):{}:n?Gw({element:n,padding:r}).fn(t):{}}}))({element:u})));const h=Jw(d),f=(0,o.useMemo)(()=>function(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}([t,h.refs.setReference]),[h.refs.setReference,t]),{x:p,y:g}=h.middlewareData.arrow||{},m={top:"bottom",right:"left",bottom:"top",left:"right"}[h.placement.split("-")[0]],v={left:p,top:g,right:"",bottom:"",[m]:"-4px"};return{...h,reference:f,arrowRef:u,arrowStyle:v}}function ex(e,t){const{children:n,items:r,role:i="listbox",virtualFocus:a,focusLoopingMode:s="stay",autoFocusFirstItem:l=!0,onItemSelected:c,clearInputOnItemSelection:u,blurReferenceOnItemSelection:d,floatingWidth:h="matchTrigger",floatingMinWidth:f,floatingMaxHeight:p,offset:g,placement:m,showCheckmark:v,showEmptyMessage:y,maxItems:b,isAsync:w,allowCustomValue:x,clearSelectionOnInputClear:C}=e,_=e.selectionMode||"none",S=`${(0,o.useId)()}-listbox`,[k,A]=qv(e.inputValue,e.defaultInputValue||"",e.onInputValueChange),[j,E]=(0,o.useState)("all"),I=Lb({children:n,items:r,inputValue:w?void 0:k,maxItems:b}),T="all"===j?I.collection:I.filteredCollection,O=(0,o.useRef)([]),F=(0,o.useMemo)(()=>[...T.values()].map(e=>e.isDisabled?null:e.textLabel),[T]),{selectedValues:P,selectValues:M}=function(e){const{selectionMode:t,allowEmptySelection:n}=e,r="single"===t||"multiple"===t,[i,a]=qv(r?e.selectedValue:void 0,r?e.defaultSelectedValue:void 0,r?e.onSelectionChange:void 0),s=(0,o.useMemo)(()=>typeof i>"u"?[]:Array.isArray(i)?i:[i],[i]),l=(0,o.useCallback)(e=>{const r=Array.isArray(e)?e:[e];"single"===t?a(r[0]):r.forEach(e=>{const t=s.indexOf(e);-1===t?(s.push(e),a([...s])):(s.length>1||n)&&(s.splice(t,1),a([...s]))})},[n,s,t,a]);return{selectedValues:s,selectValues:l}}(e),[R,L]=qv(e.isOpen,e.defaultIsOpen,e.onOpenChange),[D,N]=(0,o.useState)(null),z=Qw({floatingWidth:h,ref:t,placement:m,offset:g,maxHeight:p??420,shiftCrossAxis:!a}),{refs:B,strategy:V,x:U,y:W}=z,H="none"===_?void 0:T.get(P[0]),$="none"===_||null==H?void 0:H.index,G=(0,o.useCallback)((e,t)=>{var n,r;const i=[...T.values()],o=!i.find(e=>!e.isDisabled),l=T.size-1;null==t||!T.size||t>l||t<0||o?N(null):(t=function(e,t,n,r){var i;const o=e.length-1;for(;null!=(i=e[t])&&i.isDisabled;)if("increment"===r){if(++t>=o){if("loop"!==n)return"stay"===n?t-1:null;t=0}}else if(--t<0){if("loop"!==n)return"stay"===n?t+1:null;t=o}return t}(i,t,s,e),N(t),null!=t&&(a?null==(n=O.current[t])||n.scrollIntoView({block:"nearest"}):null==(r=O.current[t])||r.focus()))},[T,a,s]);return{handleItemSelection:e=>{const t=B.reference.current;"none"!==_?M(e):t&&"focus"in t&&t.focus(),a&&(A(u?"":`${e}`),d&&t&&"blur"in t&&t.blur()),E("all"),L(!1),null==c||c(e),N(null)},onInputChange:(0,o.useCallback)(e=>{A(e.target.value),E(e.target.value.trim()?"filtered":"all"),e.target.value?L(!0):C&&M(""),l&&null==D?G("increment",0):N(null)},[A,L,E,M,C,G,l,D]),focusLoopingMode:s,floatingWidth:h,floatingMinWidth:f,floatingMaxHeight:p,showCheckmark:v,collection:T,collections:I,virtualFocus:a,focusItem:G,showEmptyMessage:y&&!!k,allowCustomValue:x,refs:B,reference:z.reference,floating:B.setFloating,positionStyle:{position:V,top:W??"",left:U??""},listContent:F,listItemsRef:O,listboxId:S,role:i,state:{activeIndex:D,setActiveIndex:N,selectedIndex:$,setSelectedIndex:e=>{if("none"!==_){const t=[...T.values()][e];t&&M(t.value)}},selectionMode:_,selectedValues:P,selectValues:M,inputValue:k,setInputValue:A,isOpen:R,setIsOpen:L,setActiveCollection:E}}}let tx=null,nx=new Set,rx=new Map,ix=!1,ox=!1;function ax(e,t){for(let n of nx)n(e,t)}function sx(e){ix=!0,function(e){return!(e.metaKey||!Bv()&&e.altKey||e.ctrlKey||"Control"===e.key||"Shift"===e.key||"Meta"===e.key)}(e)&&(tx="keyboard",ax("keyboard",e))}function lx(e){tx="pointer",("mousedown"===e.type||"pointerdown"===e.type)&&(ix=!0,ax("pointer",e))}function cx(e){(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(function(e){var t;return!(typeof window>"u"||null==window.navigator)&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some(t=>e.test(t.brand)))||e.test(window.navigator.userAgent))}(/Android/i)&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)})(e)&&(ix=!0,tx="virtual")}function ux(e){e.target===window||e.target===document||(!ix&&!ox&&(tx="virtual",ax("virtual",e)),ix=!1,ox=!1)}function dx(){ix=!1,ox=!0}function hx(e){if(typeof window>"u"||rx.get(Lv(e)))return;const t=Lv(e),n=Rv(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){ix=!0,r.apply(this,arguments)},n.addEventListener("keydown",sx,!0),n.addEventListener("keyup",sx,!0),n.addEventListener("click",cx,!0),t.addEventListener("focus",ux,!0),t.addEventListener("blur",dx,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",lx,!0),n.addEventListener("pointermove",lx,!0),n.addEventListener("pointerup",lx,!0)):(n.addEventListener("mousedown",lx,!0),n.addEventListener("mousemove",lx,!0),n.addEventListener("mouseup",lx,!0)),t.addEventListener("beforeunload",()=>{fx(e)},{once:!0}),rx.set(t,{focus:r})}const fx=(e,t)=>{const n=Lv(e),r=Rv(e);t&&r.removeEventListener("DOMContentLoaded",t),rx.has(n)&&(n.HTMLElement.prototype.focus=rx.get(n).focus,r.removeEventListener("keydown",sx,!0),r.removeEventListener("keyup",sx,!0),r.removeEventListener("click",cx,!0),n.removeEventListener("focus",ux,!0),n.removeEventListener("blur",dx,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",lx,!0),r.removeEventListener("pointermove",lx,!0),r.removeEventListener("pointerup",lx,!0)):(r.removeEventListener("mousedown",lx,!0),r.removeEventListener("mousemove",lx,!0),r.removeEventListener("mouseup",lx,!0)),rx.delete(n))};function px(e,t){return"#comment"!==e.nodeName&&function(e){const t=Lv(e);if(!(e instanceof t.HTMLElement||e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i="none"!==n&&"hidden"!==r&&"collapse"!==r;if(i){const{getComputedStyle:t}=e.ownerDocument.defaultView;let{display:n,visibility:r}=t(e);i="none"!==n&&"hidden"!==r&&"collapse"!==r}return i}(e)&&function(e,t){return!e.hasAttribute("hidden")&&!e.hasAttribute("data-react-aria-prevent-focus")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||px(e.parentElement,e))}typeof document<"u"&&function(e){const t=Rv(e);let n;"loading"!==t.readyState?hx(e):(n=()=>{hx(e)},t.addEventListener("DOMContentLoaded",n))}();const gx=o.createContext(null);let mx=null;function vx(e){let{children:t,contain:n,restoreFocus:r,autoFocus:i}=e,a=(0,o.useRef)(null),s=(0,o.useRef)(null),l=(0,o.useRef)([]),{parentNode:c}=(0,o.useContext)(gx)||{},u=(0,o.useMemo)(()=>new Ox({scopeRef:l}),[l]);Av(()=>{let e=c||Fx.root;if(Fx.getTreeNode(e.scopeRef)&&mx&&!Ax(mx,e.scopeRef)){let t=Fx.getTreeNode(mx);t&&(e=t)}e.addChild(u),Fx.addNode(u)},[u,c]),Av(()=>{let e=Fx.getTreeNode(l);e&&(e.contain=!!n)},[n]),Av(()=>{var e;let t=null===(e=a.current)||void 0===e?void 0:e.nextSibling,n=[];for(;t&&t!==s.current;)n.push(t),t=t.nextSibling;l.current=n},[t]),function(e,t,n){Av(()=>{if(t||n)return;let r=e.current;const i=Rv(r?r[0]:void 0);let o=t=>{let n=t.target;Sx(n,e.current)?mx=e:_x(n)||(mx=null)};return i.addEventListener("focusin",o,!1),null==r||r.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==r||r.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,t,n])}(l,r,n),function(e,t){let n=(0,o.useRef)(),r=(0,o.useRef)();Av(()=>{let i=e.current;if(!t)return void(r.current&&(cancelAnimationFrame(r.current),r.current=void 0));const o=Rv(i?i[0]:void 0);let a=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!Cx(e)||t.isComposing)return;let n=o.activeElement,r=e.current;if(!r||!Sx(n,r))return;let i=Ix(xx(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let a=t.shiftKey?i.previousNode():i.nextNode();a||(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,a=t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),a&&jx(a,!0)},s=t=>{mx&&!Ax(mx,e)||!Sx(t.target,e.current)?Cx(e)&&!kx(t.target,e)?n.current?n.current.focus():mx&&mx.current&&Ex(mx.current):Cx(e)&&(n.current=t.target):(mx=e,n.current=t.target)},l=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{if(o.activeElement&&Cx(e)&&!kx(o.activeElement,e))if(mx=e,o.body.contains(t.target)){var r;n.current=t.target,null===(r=n.current)||void 0===r||r.focus()}else mx.current&&Ex(mx.current)})};return o.addEventListener("keydown",a,!1),o.addEventListener("focusin",s,!1),null==i||i.forEach(e=>e.addEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.addEventListener("focusout",l,!1)),()=>{o.removeEventListener("keydown",a,!1),o.removeEventListener("focusin",s,!1),null==i||i.forEach(e=>e.removeEventListener("focusin",s,!1)),null==i||i.forEach(e=>e.removeEventListener("focusout",l,!1))}},[e,t]),Av(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}(l,n),function(e,t,n){const r=(0,o.useRef)(typeof document<"u"?Rv(e.current?e.current[0]:void 0).activeElement:null);Av(()=>{let r=e.current;const i=Rv(r?r[0]:void 0);if(!t||n)return;let o=()=>{(!mx||Ax(mx,e))&&Sx(i.activeElement,e.current)&&(mx=e)};return i.addEventListener("focusin",o,!1),null==r||r.forEach(e=>e.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),null==r||r.forEach(e=>e.removeEventListener("focusin",o,!1))}},[e,n]),Av(()=>{const r=Rv(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if("Tab"!==t.key||t.altKey||t.ctrlKey||t.metaKey||!Cx(e)||t.isComposing)return;let n=r.activeElement;if(!Sx(n,e.current))return;let i=Fx.getTreeNode(e);if(!i)return;let o=i.nodeToRestore,a=Ix(r.body,{tabbable:!0});a.currentNode=n;let s=t.shiftKey?a.previousNode():a.nextNode();if((!o||!r.body.contains(o)||o===r.body)&&(o=void 0,i.nodeToRestore=void 0),(!s||!Sx(s,e.current))&&o){a.currentNode=o;do{s=t.shiftKey?a.previousNode():a.nextNode()}while(Sx(s,e.current));t.preventDefault(),t.stopPropagation(),s?jx(s,!0):_x(o)?jx(o,!0):n.blur()}};return n||r.addEventListener("keydown",i,!0),()=>{n||r.removeEventListener("keydown",i,!0)}},[e,t,n]),Av(()=>{const n=Rv(e.current?e.current[0]:void 0);if(!t)return;let i=Fx.getTreeNode(e);var o;return i?(i.nodeToRestore=null!==(o=r.current)&&void 0!==o?o:void 0,()=>{let r=Fx.getTreeNode(e);if(!r)return;let i=r.nodeToRestore;if(t&&i&&(Sx(n.activeElement,e.current)||n.activeElement===n.body&&function(e){let t=Fx.getTreeNode(mx);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return(null==t?void 0:t.scopeRef)===e}(e))){let t=Fx.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected)return void jx(n.nodeToRestore);n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Fx.getTreeNode(n.scopeRef))return void Ex(n.scopeRef.current,!0);n=n.parent}}})}}):void 0},[e,t])}(l,r,n),function(e,t){const n=o.useRef(t);(0,o.useEffect)(()=>{n.current&&(mx=e,!Sx(Rv(e.current?e.current[0]:void 0).activeElement,mx.current)&&e.current&&Ex(e.current)),n.current=!1},[e])}(l,i),(0,o.useEffect)(()=>{const e=Rv(l.current?l.current[0]:void 0).activeElement;let t=null;if(Sx(e,l.current)){for(let n of Fx.traverse())n.scopeRef&&Sx(e,n.scopeRef.current)&&(t=n);t===Fx.getTreeNode(l)&&(mx=t.scopeRef)}},[l]),Av(()=>()=>{var e,t,n;let r=null!==(n=null===(t=Fx.getTreeNode(l))||void 0===t||null===(e=t.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==n?n:null;(l===mx||Ax(l,mx))&&(!r||Fx.getTreeNode(r))&&(mx=r),Fx.removeTreeNode(l)},[l]);let d=(0,o.useMemo)(()=>function(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:o,accept:a}=t,s=r||Rv(n[0]).activeElement,l=n[0].previousElementSibling,c=Ix(xx(n),{tabbable:i,accept:a},n);c.currentNode=Sx(s,n)?s:l;let u=c.nextNode();return!u&&o&&(c.currentNode=l,u=c.nextNode()),u&&jx(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:o,accept:a}=t,s=r||Rv(n[0]).activeElement,l=n[n.length-1].nextElementSibling,c=Ix(xx(n),{tabbable:i,accept:a},n);c.currentNode=Sx(s,n)?s:l;let u=c.previousNode();return!u&&o&&(c.currentNode=l,u=c.previousNode()),u&&jx(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,o=Ix(xx(n),{tabbable:r,accept:i},n);o.currentNode=n[0].previousElementSibling;let a=o.nextNode();return a&&jx(a,!0),a},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,o=Ix(xx(n),{tabbable:r,accept:i},n);o.currentNode=n[n.length-1].nextElementSibling;let a=o.previousNode();return a&&jx(a,!0),a}}}(l),[]),h=(0,o.useMemo)(()=>({focusManager:d,parentNode:u}),[u,d]);return o.createElement(gx.Provider,{value:h},o.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:a}),t,o.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:s}))}const yx=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],bx=yx.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";yx.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const wx=yx.join(':not([hidden]):not([tabindex="-1"]),');function xx(e){return e[0].parentElement}function Cx(e){let t=Fx.getTreeNode(mx);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function _x(e){return kx(e)}function Sx(e,t){return!(!e||!t)&&t.some(t=>t.contains(e))}function kx(e,t=null){if(e instanceof Element&&e.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of Fx.traverse(Fx.getTreeNode(t)))if(n&&Sx(e,n.current))return!0;return!1}function Ax(e,t){var n;let r=null===(n=Fx.getTreeNode(t))||void 0===n?void 0:n.parent;for(;r;){if(r.scopeRef===e)return!0;r=r.parent}return!1}function jx(e,t=!1){if(null==e||t){if(null!=e)try{e.focus()}catch{}}else try{!function(e){const t=Rv(e);if("virtual"===tx){let n=t.activeElement;!function(e){requestAnimationFrame(()=>{0===Vv.size?e():Uv.add(e)})}(()=>{t.activeElement===n&&e.isConnected&&Nv(e)})}else Nv(e)}(e)}catch{}}function Ex(e,t=!0){let n=e[0].previousElementSibling,r=xx(e),i=Ix(r,{tabbable:t},e);i.currentNode=n;let o=i.nextNode();t&&!o&&(r=xx(e),i=Ix(r,{tabbable:!1},e),i.currentNode=n,o=i.nextNode()),jx(o)}function Ix(e,t,n){let r=null!=t&&t.tabbable?wx:bx,i=Rv(e).createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(e){var i;return null!=t&&null!==(i=t.from)&&void 0!==i&&i.contains(e)?NodeFilter.FILTER_REJECT:!e.matches(r)||!px(e)||n&&!Sx(e,n)||null!=t&&t.accept&&!t.accept(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}});return null!=t&&t.from&&(i.currentNode=t.from),i}class Tx{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Ox({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(null===e)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let i of this.traverse())i!==t&&t.nodeToRestore&&i.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&Sx(i.nodeToRestore,t.scopeRef.current)&&(i.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(null!=e.scopeRef&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){var e;let t=new Tx;var n;for(let r of this.traverse())t.addTreeNode(r.scopeRef,null!==(n=null===(e=r.parent)||void 0===e?void 0:e.scopeRef)&&void 0!==n?n:null,r.nodeToRestore);return t}constructor(){this.fastMap=new Map,this.root=new Ox({scopeRef:null}),this.fastMap.set(null,this.root)}}class Ox{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let Fx=new Tx;function Px(){const{width:e,height:t}=function(){let e=Ov(),[t,n]=(0,o.useState)(()=>e?{width:0,height:0}:Yv());return(0,o.useEffect)(()=>{let e=()=>{n(e=>{let t=Yv();return t.width===e.width&&t.height===e.height?e:t})};return Gv?Gv.addEventListener("resize",e):window.addEventListener("resize",e),()=>{Gv?Gv.removeEventListener("resize",e):window.removeEventListener("resize",e)}},[]),t}();return{"--be-viewport-height":`${t}px`,"--be-viewport-width":`${e}px`}}const Mx={initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{type:"tween",duration:.125}},Rx=(0,o.forwardRef)(({children:e,style:t,autoFocus:n=!1,restoreFocus:r=!0,isDismissable:a,isContextMenu:s,isOpen:l,onClose:c,triggerRef:u,arrowRef:d,arrowStyle:h,onPointerLeave:f,onPointerEnter:p},g)=>{const m=Px(),v=$v(g),{domProps:y}=function({onClose:e,isDismissable:t=!0,triggerRef:n,isContextMenu:r=!1},i){const a=(0,o.useRef)({isPointerDown:!1,isContextMenu:r,onClose:e}),s=a.current;s.isContextMenu=r,s.onClose=e;const l=(0,o.useCallback)(e=>{const t=e.target;if(t){const e=t.ownerDocument;if(!e||!e.documentElement.contains(t))return!1}return i.current&&!i.current.contains(t)},[i]),c=(0,o.useCallback)(()=>Lx[Lx.length-1]===i,[i]),u=(0,o.useCallback)(()=>{c()&&s.onClose()},[c,s]),d=(0,o.useCallback)(e=>{var t,r;return!(!n.current||!("contains"in n.current))&&(null==(r=(t=n.current).contains)?void 0:r.call(t,e))},[n]),h=(0,o.useCallback)(e=>{d(e.target)||c()&&(e.stopPropagation(),e.preventDefault())},[d,c]),f=(0,o.useCallback)(e=>{d(e.target)||(c()&&(e.stopPropagation(),e.preventDefault()),(!s.isContextMenu||2!==e.button)&&u())},[d,u,s,c]);return(0,o.useEffect)(()=>{Lx.push(i);const e=e=>{l(e)&&(h(e),a.current.isPointerDown=!0)},t=e=>{a.current.isPointerDown&&l(e)&&(a.current.isPointerDown=!1,f(e))},r=e=>{e.preventDefault(),l(e)&&u()},o=e=>{if(!n.current)return;const t=e.target;let r;n.current instanceof Node?r=n.current:"contextElement"in n.current&&(r=n.current.contextElement),(!(t instanceof Node)||!r||t.contains(r))&&s.onClose()};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointerup",t,!0),document.addEventListener("contextmenu",r,!0),document.addEventListener("scroll",o,!0),()=>{const n=Lx.indexOf(i);n>=0&&Lx.splice(n,1),document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointerup",t,!0),document.removeEventListener("contextmenu",r,!0),document.removeEventListener("scroll",o,!0)}},[i,l,s,f,h,n,d,u]),{domProps:{onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),u())}}}}({isDismissable:a,onClose:c,triggerRef:u,isContextMenu:s},v);return(0,i.jsx)(gv.div,{className:"isolate z-popover",role:"presentation",ref:v,style:{...m,...t,position:"fixed"},...Mx,...Dv(y,{onPointerLeave:f,onPointerEnter:p}),children:(0,i.jsx)(vx,{restoreFocus:r,autoFocus:n,contain:!1,children:e})})}),Lx=[],Dx={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2}};function Nx({position:e="absolute",className:t,isTransparent:n=!1,disableInitialTransition:r,...o}){return(0,i.jsx)(gv.div,{...o,className:gc(t,!n&&"bg-background/80","inset-0 z-10 h-full w-full",e,"backdrop-blur-sm"),"aria-hidden":!0,initial:r?void 0:{opacity:0},animate:{opacity:1},exit:{opacity:0},...Dx,transition:{duration:.15}})}const zx=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:n=!0,isDismissable:r,isOpen:o,onClose:a},s)=>{const l=Px(),c=$v(s);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-tray",style:l,children:[(0,i.jsx)(Nx,{onClick:()=>{r&&a()}},"tray-underlay"),(0,i.jsx)(gv.div,{ref:c,className:"absolute bottom-0 left-0 right-0 z-20 mx-auto max-h-tray w-full max-w-375 overflow-hidden rounded-t pb-safe-area",role:"presentation",initial:{opacity:0,y:"100%"},animate:{opacity:1,y:0},exit:{opacity:0,y:"100%"},transition:{type:"tween",duration:.2},children:(0,i.jsx)(vx,{restoreFocus:n,autoFocus:t,contain:!0,children:e})})]})});function Bx(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let o=0;o<i;o++){const r=n[o];if(e[r]!==t[r]||!Object.prototype.hasOwnProperty.call(t,r))return!1}return!0}function Vx(){const{i18n:e}=Ch(e=>e.data);return{locale:e,localeCode:(null==e?void 0:e.language)||"en",lines:null==e?void 0:e.lines}}function Ux(e,{message:t,values:n}){const r=t.match(/\[(.+?)]/),i=null==n?void 0:n.count;if(r&&r[1]&&!Number.isNaN(i)){const[n,o]=r,a=o.split("|");if(!a.length)return t;const s=Wx(e).select(i);let l=a.find(e=>e.startsWith(s));l||(l=a[0]);const c=l.substring(l.indexOf(" ")+1);return t.replace(n,c)}return t}const Wx=Mb(e=>new Intl.PluralRules(e));function Hx(e,t){return null!=e&&(void 0!==Object.hasOwn?Object.hasOwn(e,t):Object.hasOwnProperty(t))}const $x=(0,o.memo)(e=>{const{message:t,values:n}=e,{lines:r,localeCode:a}=Vx();let s;if(s=Hx(r,t)?null==r?void 0:r[t]:Hx(r,null==t?void 0:t.toLowerCase())?null==r?void 0:r[null==t?void 0:t.toLowerCase()]:t,!n||!s)return(0,i.jsx)(o.Fragment,{children:s});s=Ux(a,{message:s,values:n});const l=[],c=[];if(Object.entries(n).forEach(([e,t])=>{"function"==typeof t?c.push(e):(0,o.isValidElement)(t)?l.push(e):null!=t&&(s=null==s?void 0:s.replace(`:${e}`,`${t}`))}),c.length||l.length){const e=[];if(c.length){const t=c.join("");e.push(`(<[${t}]>.+?<\\/[${t}]>)`)}if(l.length){const t=l.join("|");e.push(`(:(?:${t}))`)}const t=new RegExp(e.join("|"),"gm"),r=s.split(t).filter(Boolean).map((e,t)=>{if(e.startsWith("<")&&e.endsWith(">")){const r=e.match(/<([a-z]+)>(.+?)<\/([a-z]+)>/);if(r){const[,e,i]=r,a=null==n?void 0:n[e];if("function"==typeof a){const e=a(i);return(0,o.cloneElement)(e,{key:t})}}}if(e.startsWith(":")){const r=e.replace(":",""),i=null==n?void 0:n[r];if((0,o.isValidElement)(i))return(0,o.cloneElement)(i,{key:t})}return e});return(0,i.jsx)(o.Fragment,{children:r})}return(0,i.jsx)(o.Fragment,{children:s})},function(e,t){const{values:n,...r}=e,{values:i,...o}=t;return Bx(i,n)&&Bx(r,o)});function Gx({listbox:e,children:t,isLoading:n,mobileOverlay:r=zx,searchField:a,onClose:s,prepend:l,className:c,...u}){const d=Ov()||typeof window>"u"?Ch.getState().data.is_mobile_device??!1:window.screen.width<=768,{floatingWidth:h,floatingMinWidth:f="min-w-180",collection:p,showEmptyMessage:g,state:{isOpen:m,setIsOpen:v},positionStyle:y,floating:b,refs:w}=e,x=!l&&d?r:Rx,C=gc("text-base sm:text-sm outline-none bg max-h-inherit flex flex-col",!l&&"shadow-xl border py-4",c,x===Rx&&"rounded-panel",x===Rx&&"auto"===h?`max-w-288 ${f}`:""),_=(0,o.useMemo)(()=>{let e=0;const t=[];return[...p.values()].reduce((n,r)=>{if(r.section){if(!t.includes(r.section)){const i=(0,o.cloneElement)(r.section,{key:r.section.key||e,index:e});n.push(i),t.push(r.section),e++}}else n.push((0,o.cloneElement)(r.element,{key:r.element.key||r.element.props.value}));return n},[])},[p]),S=_.length>0||g&&!n,k=S?(0,i.jsxs)("div",{className:C,role:"presentation",children:[a,(0,i.jsx)(Yx,{isLoading:n,...u,children:_})]}):null;return(0,i.jsxs)(jb.Provider,{value:e,children:[t,l?k:wh&&(0,ne.createPortal)((0,i.jsx)(Cv,{children:m&&S&&(0,i.jsx)(x,{triggerRef:w.reference,restoreFocus:!0,isOpen:m,onClose:()=>{null==s||s(),v(!1)},isDismissable:!0,style:y,ref:b,children:k})}),wh)]})}function Yx({className:e,children:t,isLoading:n,...r}){const{role:a,listboxId:s,virtualFocus:l,focusItem:c,state:{activeIndex:u,setActiveIndex:d,selectedIndex:h}}=Eb(),f=(0,o.useRef)(!0),p=(0,o.useRef)(null);return(0,o.useEffect)(()=>()=>d(null),[d]),(0,o.useEffect)(()=>{if(f.current){const e=u??h;null!=e||l?null!=e&&requestAnimationFrame(()=>{c("increment",e)}):requestAnimationFrame(()=>{var e;null==(e=p.current)||e.focus({preventScroll:!0})})}f.current=!1},[u,h,c,l]),(0,i.jsx)("div",{tabIndex:l?void 0:-1,role:a,id:s,className:"flex-auto overflow-y-auto overscroll-contain outline-none",ref:p,...r,children:t.length?t:(0,i.jsx)(qx,{})})}function qx(){return(0,i.jsx)("div",{className:"px-8 py-4 text-sm italic text-muted",children:(0,i.jsx)($x,{message:"There are no items matching your query"})})}function Xx({state:{isOpen:e,setIsOpen:t,selectedIndex:n,activeIndex:r,setInputValue:i,setActiveIndex:o},focusLoopingMode:a,collection:s,focusItem:l,handleItemSelection:c,allowCustomValue:u}){const d=r=>{if(!e&&r.currentTarget.contains(r.target)){if("ArrowDown"===r.key)return r.preventDefault(),t(!0),l("increment",n??0),!0;if("ArrowUp"===r.key)return r.preventDefault(),t(!0),l("decrement",n??s.size-1),!0;if("Enter"===r.key||"Space"===r.key)return r.preventDefault(),t(!0),l("increment",n??0),!0}},h=n=>{const i=Math.max(0,s.size-1);if(e&&n.currentTarget.contains(n.target))switch(n.key){case"ArrowDown":return n.preventDefault(),null==r?l("increment",0):r>=i?"loop"===a?l("increment",0):"deselect"===a&&o(null):l("increment",r+1),!0;case"ArrowUp":return n.preventDefault(),null==r?l("decrement",i):r<=0?"loop"===a?l("decrement",i):"deselect"===a&&o(null):l("decrement",r-1),!0;case"Home":return n.preventDefault(),l("increment",0),!0;case"End":return n.preventDefault(),l("decrement",i),!0;case"Tab":return t(!1),!0}};return{handleTriggerKeyDown:d,handleListboxKeyboardNavigation:h,handleListboxSearchFieldKeydown:n=>{var o,a;if("Enter"===n.key&&null!=r&&s.size){n.preventDefault();const[e,t]=[...s.entries()][r];return void(e&&(c(e),null==(a=(o=t.element.props).onSelected)||a.call(o)))}"Escape"===n.key&&e&&(t(!1),u||i("")),d(n)||h(n)}}}const Kx=new Map;function Zx(){const e=function(e){const{localeCode:t}=Vx(),n=t+(e?Object.entries(e).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(Kx.has(n))return Kx.get(n);const r=new Intl.Collator(t,e);return Kx.set(n,r),r}({usage:"search",sensitivity:"base"}),t=(0,o.useRef)({search:"",timeout:void 0}).current,n=(n,r)=>{let i=r??0;for(;null!=i;){const r=n[i],o=null==r?void 0:r.slice(0,t.search.length);if(o&&0===e.compare(o,t.search))return i;if(!(i<n.length-1))return null;i++}return null};return{findMatchingItem:(e,r,i=0)=>{const o=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(e.key);if(!o||e.ctrlKey||e.metaKey)return null;" "===o&&t.search.trim().length>0&&(e.preventDefault(),e.stopPropagation()),t.search+=o;let a=n(r,i);return null==a&&(a=n(r,0)),clearTimeout(t.timeout),t.timeout=setTimeout(()=>{t.search=""},500),a??null}}}function Jx(e){return function(e,{noSSR:t}={noSSR:!0}){const n=typeof window<"u"&&"function"==typeof window.matchMedia,[r,i]=(0,o.useState)(t?()=>!!n&&window.matchMedia(e).matches:null);return(0,o.useEffect)(()=>{if(!n)return;const r=window.matchMedia(e),o=()=>{i(r.matches)};return r.addEventListener("change",o),t||o(),()=>{r.removeEventListener("change",o)}},[n,e,t]),typeof window>"u"?null:r}("(max-width: 768px)",e)}const Qx=yc((0,i.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),"SearchOutlined");var eC=e=>null==e,tC=e=>!eC(e)&&!Array.isArray(e)&&(e=>"object"==typeof e)(e)&&!(e=>e instanceof Date)(e),nC=e=>tC(e)&&e.target?(e=>"checkbox"===e.type)(e.target)?e.target.checked:e.target.value:e,rC=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function iC(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(rC&&(e instanceof Blob||e instanceof FileList)||!n&&!tC(e))return e;if(t=n?[]:{},n||(e=>{const t=e.constructor&&e.constructor.prototype;return tC(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)e.hasOwnProperty(n)&&(t[n]=iC(e[n]));else t=e}return t}var oC=e=>Array.isArray(e)?e.filter(Boolean):[],aC=e=>void 0===e,sC=(e,t,n)=>{if(!t||!tC(e))return n;const r=oC(t.split(/[,[\].]+?/)).reduce((e,t)=>eC(e)?e:e[t],e);return aC(r)||r===e?aC(e[t])?n:e[t]:r},lC=e=>"boolean"==typeof e,cC=(e,t,n)=>{let r=-1;const i=(e=>/^\w*$/.test(e))(t)?[t]:(e=>oC(e.replace(/["|']|\]/g,"").split(/\.|\[/)))(t),o=i.length,a=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==a){const n=e[t];o=tC(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if("__proto__"===t)return;e[t]=o,e=e[t]}return e};const uC=o.createContext(null),dC=()=>o.useContext(uC);var hC=(e,t,n)=>!e||!t||e===t||(e=>Array.isArray(e)?e:[e])(e).some(e=>e&&(n?e===t:e.startsWith(t)||t.startsWith(e)));function fC(e){const t=o.useRef(e);t.current=e,o.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function pC(e){const t=dC(),{control:n=t.control,disabled:r,name:i,exact:a}=e||{},[s,l]=o.useState(n._formState),c=o.useRef(!0),u=o.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=o.useRef(i);return d.current=i,fC({disabled:r,next:e=>c.current&&hC(d.current,e.name,a)&&((e,t,n)=>{n(e);const{name:r,...i}=e;return(e=>tC(e)&&!Object.keys(e).length)(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(e=>!0===t[e])})(e,u.current,n._updateFormState)&&l({...n._formState,...e}),subject:n._subjects.state}),o.useEffect(()=>(c.current=!0,u.current.isValid&&n._updateValid(!0),()=>{c.current=!1}),[n]),((e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return"all"!==t._proxyFormState[i]&&(t._proxyFormState[i]=!r||"all"),n&&(n[i]=!0),e[i]}});return i})(s,n,u.current,!1)}function gC(e={}){const{size:t="md",startAppend:n,endAppend:r,className:i,labelPosition:o,labelDisplay:a="block",inputClassName:s,inputWrapperClassName:l,unstyled:c,invalid:u,disabled:d,background:h="bg-transparent",flexibleHeight:f,inputShadow:p="shadow-sm",descriptionPosition:g="bottom",inputRing:m,inputFontSize:v,labelSuffix:y}={...e};if(c)return{label:"",input:s||"",wrapper:i||"",inputWrapper:l||"",adornment:"",append:{size:"",radius:""},size:{font:"",height:""},description:"",error:""};const b=function({size:e,flexibleHeight:t}){switch(e){case"2xs":return{font:"text-xs",height:t?"min-h-24":"h-24"};case"xs":return{font:"text-xs",height:t?"min-h-30":"h-30"};case"sm":return{font:"text-sm",height:t?"min-h-36":"h-36"};case"lg":return{font:"text-md md:text-lg",height:t?"min-h-50":"h-50"};case"xl":return{font:"text-xl",height:t?"min-h-60":"h-60"};default:return{font:"text-sm",height:t?"min-h-42":"h-42"}}}({size:e.size,flexibleHeight:f});v&&(b.font=v);const w=n||r,x=m||"focus:ring "+(u?"focus:ring-danger/focus focus:border-danger/60":"focus:ring-primary/focus focus:border-primary/60"),C=function(e){const{startAppend:t,endAppend:n,inputRadius:r}=e,i=t||n;return"rounded-full"===r?{input:gc(!i&&"rounded-full",t&&"rounded-r-full rounded-l-none",n&&"rounded-l-full rounded-r-none"),append:t?"rounded-l-full":"rounded-r-full"}:"rounded-none"===r?{input:"",append:""}:r?{input:r,append:r}:{input:gc(!i&&"rounded-input",t&&"rounded-r-input rounded-l-none",n&&"rounded-l-input rounded-r-none"),append:t?"rounded-l-input":"rounded-r-input"}}(e);return{label:gc(a,"first-letter:capitalize text-left whitespace-nowrap",d&&"text-disabled",b.font,y?"":"side"===o?"mr-16":"mb-4"),input:gc("block text-left relative w-full appearance-none transition-shadow text",h,C.input,mC(e),!d&&`${x} focus:outline-none ${p}`,d&&"text-disabled cursor-not-allowed",s,b.font,b.height,vC(e)),adornment:yC(t),append:{size:xb(t),radius:C.append},wrapper:gc(i,b.font,{"flex items-center":"side"===o}),inputWrapper:gc("isolate relative",l,w&&"flex items-stretch"),size:b,description:`text-muted ${"bottom"===g?"pt-10":"pb-10"} text-xs`,error:"text-danger pt-10 text-xs"}}function mC({startAppend:e,endAppend:t,inputBorder:n,invalid:r}){if(n)return n;const i=r?"border-danger":"border-divider";return e||t?e?`${i} border-y border-r`:`${i} border-y border-l`:`${i} border`}function vC({startAdornment:e,endAdornment:t,inputRadius:n}){return"rounded-full"===n?gc(e?"pl-54":"pl-28",t?"pr-54":"pr-28"):gc(e?"pl-46":"pl-12",t?"pr-46":"pr-12")}function yC(e){switch(e){case"2xs":return"icon-2xs";case"xs":return"icon-xs";case"sm":case"md":return"icon-sm";case"lg":return"icon-lg";case"xl":return"icon-xl";default:return""}}function bC({children:e,direction:t,className:n,position:r=("start"===t?"left-0":"right-0")}){return e?(0,i.jsx)("div",{className:gc("pointer-events-none absolute top-0 z-10 flex h-full min-w-42 items-center justify-center text-muted",r,n),children:e}):null}function wC(e,t){const n={...e};return Object.keys(n).forEach(e=>{const t=e;(null==n[t]||""===n[t])&&delete n[t]}),n}const xC=o.forwardRef((e,t)=>{const{children:n,description:r,errorMessage:o,descriptionProps:a={},errorMessageProps:s={},startAdornment:l,endAdornment:c,adornmentPosition:u,startAppend:d,endAppend:h,fieldClassNames:f,disabled:p,wrapperProps:g}=e;return(0,i.jsxs)("div",{className:f.wrapper,ref:t,...g,children:[(0,i.jsx)(CC,{...e}),(0,i.jsxs)("div",{className:f.inputWrapper,children:[(0,i.jsx)(bC,{direction:"start",className:f.adornment,position:u,children:l}),d&&(0,i.jsx)(_C,{style:f.append,disabled:p,children:d}),n,h&&(0,i.jsx)(_C,{style:f.append,disabled:p,children:h}),(0,i.jsx)(bC,{direction:"end",className:f.adornment,position:u,children:c})]}),r&&!o&&(0,i.jsx)("div",{className:f.description,...a,children:r}),o&&(0,i.jsx)("div",{className:f.error,...s,children:o})]})});function CC({labelElementType:e,fieldClassNames:t,labelProps:n,label:r,labelSuffix:o,labelSuffixPosition:a="spaced",required:s}){if(!r)return null;const l=(0,i.jsxs)(e||"label",{className:t.label,...n,children:[r,s&&(0,i.jsx)("span",{className:"text-danger",children:" *"})]});return o?(0,i.jsxs)("div",{className:gc("mb-4 flex w-full gap-4","spaced"===a?"items-end":"items-center"),children:[l,(0,i.jsx)("div",{className:gc("text-xs text-muted","spaced"===a?"ml-auto":""),children:o})]}):l}function _C({children:e,style:t,disabled:n}){return o.cloneElement(e,{...e.props,disabled:e.props.disabled||n,...wC(t)})}function SC({autoFocus:e,autoSelectText:t},n){const r=(0,o.useRef)(e);(0,o.useEffect)(()=>{r.current&&n.current&&requestAnimationFrame(()=>{var e,r;null==(e=n.current)||e.focus(),t&&"input"===(null==(r=n.current)?void 0:r.nodeName.toLowerCase())&&n.current.select()}),r.current=!1},[n,t])}function kC(e){const{focusRef:t,labelElementType:n="label",label:r,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:k,disabled:A,id:j,inputRadius:E,inputBorder:I,inputShadow:T,inputRing:O,inputFontSize:F,...P}=e;SC(e,t);const M=(0,o.useId)(),R=j||M,L={id:`${R}-label`,htmlFor:"label"===n?R:void 0},D={id:`${R}-description`},N={id:`${R}-error`},z={"aria-label":e.label||e["aria-label"]||!e.placeholder?e["aria-label"]:e.placeholder,"aria-invalid":k||void 0,id:R,disabled:A,...P},B=[];r&&B.push(L.id),z["aria-labelledby"]&&B.push(z["aria-labelledby"]),z["aria-labelledby"]=B.length?B.join(" "):void 0;const V=[];return f&&V.push(D.id),h&&V.push(N.id),z["aria-describedby"]&&V.push(z["aria-describedby"]),z["aria-describedby"]=V.length?V.join(" "):void 0,{fieldProps:{errorMessageProps:N,descriptionProps:D,labelProps:L,disabled:A,label:r,labelSuffix:i,labelSuffixPosition:a,autoFocus:s,autoSelectText:l,labelPosition:c,descriptionPosition:u,size:d,errorMessage:h,description:f,flexibleHeight:p,startAdornment:g,endAdornment:m,startAppend:v,adornmentPosition:y,endAppend:b,className:w,inputClassName:x,inputWrapperClassName:C,unstyled:_,background:S,invalid:k},inputProps:z}}const AC=(0,o.forwardRef)(({inputElementType:e="input",flexibleHeight:t,inputRef:n,inputTestId:r,...o},a)=>{const s=$v(n),{fieldProps:l,inputProps:c}=kC({...o,focusRef:s}),u="textarea"===e,d=u?"textarea":"input",h=gC({...o,flexibleHeight:t||"textarea"===e});return"textarea"===e&&!o.unstyled&&(h.input=`${h.input} py-12`),(0,i.jsx)(xC,{ref:a,fieldClassNames:h,...l,children:(0,i.jsx)(d,{"data-testid":r,ref:s,...c,rows:u?c.rows||4:void 0,className:h.input})})});o.forwardRef(({name:e,...t},n)=>{const{field:{onChange:r,onBlur:a,value:s="",ref:l},fieldState:{invalid:c,error:u}}=function(e){const t=dC(),{name:n,disabled:r,control:i=t.control,shouldUnregister:a}=e,s=((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(i._names.array,n),l=function(e){const t=dC(),{control:n=t.control,name:r,defaultValue:i,disabled:a,exact:s}=e||{},l=o.useRef(r);l.current=r,fC({disabled:a,subject:n._subjects.values,next:e=>{hC(l.current,e.name,s)&&u(iC(((e,t,n,r,i)=>(e=>"string"==typeof e)(e)?sC(n,e,i):Array.isArray(e)?e.map(e=>sC(n,e)):n)(l.current,n._names,e.values||n._formValues,0,i)))}});const[c,u]=o.useState(n._getWatch(r,i));return o.useEffect(()=>n._removeUnmounted()),c}({control:i,name:n,defaultValue:sC(i._formValues,n,sC(i._defaultValues,n,e.defaultValue)),exact:!0}),c=pC({control:i,name:n}),u=o.useRef(i.register(n,{...e.rules,value:l,...lC(e.disabled)?{disabled:e.disabled}:{}}));return o.useEffect(()=>{const e=i._options.shouldUnregister||a,t=(e,t)=>{const n=sC(i._fields,e);n&&(n._f.mount=t)};if(t(n,!0),e){const e=iC(sC(i._options.defaultValues,n));cC(i._defaultValues,n,e),aC(sC(i._formValues,n))&&cC(i._formValues,n,e)}return()=>{(s?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,s,a]),o.useEffect(()=>{sC(i._fields,n)&&i._updateDisabledField({disabled:r,fields:i._fields,name:n,value:sC(i._fields,n)._f.value})},[r,n,i]),{field:{name:n,value:l,...lC(r)||c.disabled?{disabled:c.disabled||r}:{},onChange:o.useCallback(e=>u.current.onChange({target:{value:nC(e),name:n},type:"change"}),[n]),onBlur:o.useCallback(()=>u.current.onBlur({target:{value:sC(i._formValues,n),name:n},type:"blur"}),[n,i]),ref:e=>{const t=sC(i._fields,n);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!sC(c.errors,n)},isDirty:{enumerable:!0,get:()=>!!sC(c.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!sC(c.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!sC(c.validatingFields,n)},error:{enumerable:!0,get:()=>sC(c.errors,n)}})}}({name:e}),d={onChange:r,onBlur:a,value:s??"",invalid:c,errorMessage:null==u?void 0:u.message,inputRef:l,name:e};return(0,i.jsx)(AC,{ref:n,...Dv(d,t)})});const jC=(0,o.forwardRef)((e,t)=>{const{searchPlaceholder:n,showSearchField:r,children:[a,s],floatingWidth:l="auto",isLoading:c}=e,u=(0,o.useId)(),d=Jx(),h=ex({...e,clearInputOnItemSelection:!0,showEmptyMessage:r,floatingWidth:d?"auto":l,virtualFocus:r,role:r?"listbox":"menu",focusLoopingMode:r?"stay":"loop",children:s.props.children},t),{state:{isOpen:f,setIsOpen:p,activeIndex:g,inputValue:m,setInputValue:v},listboxId:y,focusItem:b,listContent:w,reference:x,onInputChange:C}=h,{handleTriggerKeyDown:_,handleListboxKeyboardNavigation:S,handleListboxSearchFieldKeydown:k}=Xx(h),{findMatchingItem:A}=Zx();return(0,i.jsx)(Gx,{onClick:e=>e.stopPropagation(),listbox:h,onKeyDownCapture:r?void 0:e=>{if(!f)return;const t=A(e,w,g);null!=t&&b("increment",t)},onKeyDown:S,onClose:r?()=>v(""):void 0,"aria-labelledby":u,isLoading:c,searchField:r?(0,i.jsx)(AC,{size:"sm",placeholder:n,startAdornment:(0,i.jsx)(Qx,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":f?"true":"false","aria-haspopup":"listbox","aria-controls":f?y:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:m,onChange:C,onKeyDown:e=>{k(e)}}):null,children:(0,o.cloneElement)(a,{id:u,"aria-expanded":f?"true":"false","aria-haspopup":"menu","aria-controls":f?y:void 0,ref:x,onKeyDown:_,onClick:_b(e=>{var t,n;null==(n=null==(t=a.props)?void 0:t.onClick)||n.call(t,e),p(!f)})})})});function EC({children:e}){return e}function IC({item:e,button:t}){return(0,i.jsxs)(jC,{children:[t,(0,i.jsx)(EC,{children:(e.menuItems||[]).map(e=>(0,i.jsx)(Fb,{value:e.label,onSelected:()=>{e.action(jh().editor)},children:e.label},e.label))})]})}const TC=(0,o.forwardRef)(({children:e,size:t="md",iconSize:n=(t&&t.length<=3?t:"md"),variant:r="text",radius:a="rounded-button",className:s,padding:l,equalWidth:c=!0,badge:u,...d},h)=>{const f=gc(xb(t,{padding:l,equalWidth:c,variant:r}),s,u&&"relative");return(0,i.jsxs)(Sb,{...d,ref:h,radius:a,variant:r,className:f,children:[(0,o.cloneElement)(e,{size:n}),u]})}),OC=o.memo(function({icon:e,className:t,size:n}){let r;return r=o.isValidElement(e)?o.cloneElement(e,{className:"svg-iconEl"}):"string"==typeof e?(0,i.jsx)("img",{className:"w-font h-font",src:e,alt:""}):Array.isArray(e)?o.createElement(bc(e),{size:n}):o.createElement(e,{size:n}),(0,i.jsx)("span",{className:gc(t,"leading-none"),children:r})});function FC({value:e}){return e?(0,i.jsx)($x,"string"==typeof e?{message:e}:{...e}):null}function PC({item:e}){const t=e.label?(0,i.jsx)(RC,{item:e}):(0,i.jsx)(MC,{item:e});return e.menuItems?(0,i.jsx)(IC,{item:e,button:t}):o.cloneElement(t,{onClick:()=>{var t;null==(t=e.action)||t.call(e,jh().editor)}})}const MC=(0,o.forwardRef)(({item:e,...t},n)=>(0,i.jsx)(TC,{ref:n,radius:"rounded-full",size:"sm",...t,children:(0,i.jsx)(OC,{icon:e.icon})})),RC=(0,o.forwardRef)(({item:e,...t},n)=>(0,i.jsx)(kb,{ref:n,radius:"rounded-full",size:"xs",color:e.buttonColor||"primary",variant:e.buttonVariant||"flat",startIcon:e.icon&&(0,i.jsx)(OC,{icon:e.icon}),...t,children:(0,i.jsx)(FC,{value:e.label})}));function LC({children:e,color:t,variant:n,radius:r="rounded-button",size:a,className:s,value:l,onChange:c,multiple:u,disabled:d}){const h=o.Children.map(e,(i,s)=>{if(o.isValidElement(i)){const h=(e=>void 0!==l&&(u?l.includes(e):e===l))(i.props.value),f=h?"primary":t;return o.cloneElement(i,{color:h?"primary":t,variant:n,size:a,radius:null,disabled:i.props.disabled||d,...i.props,onClick:e=>{i.props.onClick&&i.props.onClick(e),c&&(u?null==c||c((e=>{const t=[...l],n=l.indexOf(e);return n>-1?t.splice(n,1):t.push(e),t})(i.props.value)):null==c||c(i.props.value))},className:gc(i.props.className,h?"z-20":"z-10",DC(s,e,r,f))})}});return(0,i.jsx)("div",{className:gc(r,"isolate inline-flex",s),children:h})}function DC(e,t,n,r){return 0===e?gc(n,"rounded-tr-none rounded-br-none",!r&&"border-r-transparent disabled:border-r-transparent"):e===t.length-1?gc(n,"rounded-tl-none rounded-bl-none -ml-1"):gc("rounded-none -ml-1",!r&&"border-r-transparent disabled:border-r-transparent")}const NC=yc((0,i.jsx)("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"}),"UndoOutlined"),zC=yc((0,i.jsx)("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"}),"RedoOutlined");function BC(){const e=Ah(e=>e.history.canUndo),t=Ah(e=>e.history.canRedo);return(0,i.jsxs)(LC,{variant:"outline",children:[(0,i.jsx)(TC,{equalWidth:!1,size:"xs",padding:"pl-12 pr-10",radius:"rounded-full",disabled:!e,onClick:()=>{Eh().history.undo()},children:(0,i.jsx)(NC,{})},"undo"),(0,i.jsx)(TC,{equalWidth:!1,padding:"pl-10 pr-12",size:"xs",radius:"rounded-full",disabled:!t,onClick:()=>{Eh().history.redo()},children:(0,i.jsx)(zC,{})},"redo")]})}const VC=yc((0,i.jsx)("path",{d:"M19 13H5v-2h14v2z"}),"RemoveOutlined"),UC=yc((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"AddOutlined");function WC(){var e,t;const n=Ah(e=>e.zoom)||1;return Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.zoom)?void 0:n.allowUserZoom})??1?(0,i.jsxs)("div",{className:"flex items-center select-none",children:[(0,i.jsx)(TC,{size:"sm",disabled:!(null!=(e=Eh().zoom)&&e.canZoomOut()),onClick:()=>{Eh().zoom.zoomOut(Eh().zoom.step)},children:(0,i.jsx)(VC,{})}),(0,i.jsxs)("div",{className:"w-[4ch] text-sm text-center",children:[Math.round(100*n),"%"]}),(0,i.jsx)(TC,{size:"sm",disabled:!(null!=(t=Eh().zoom)&&t.canZoomIn()),onClick:()=>{Eh().zoom.zoomIn(Eh().zoom.step)},children:(0,i.jsx)(UC,{})})]}):null}function HC({item:e}){switch(e.type){case"undoWidget":return(0,i.jsx)(BC,{});case"zoomWidget":return(0,i.jsx)(WC,{});case"button":return(0,i.jsx)(PC,{item:e});case"image":return(0,i.jsx)("img",{className:"h-30 object-cover",src:vy(e.src),alt:""});default:return null}}const $C=yc((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"}),"CloseOutlined");function GC(){var e;let t=Ah(e=>{var t;return(null==(t=e.config.ui)?void 0:t.mode)===oc.OVERLAY});const{width:n}=Ah(e=>e.stageSize),r=n<=700;return r&&null!=(e=jh().config.ui)&&e.forceOverlayModeOnMobile&&(t=!0),{isModal:t,isMobile:r}}function YC(){const{isModal:e,isMobile:t}=GC(),n=Ah(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,r=Ah(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.menubar)?void 0:n.items}),{left:a,center:s,right:l}=(0,o.useMemo)(()=>function(e,t){const n={left:[],center:[],right:[]};(e||[]).filter(e=>!t&&!e.mobileOnly||t&&!e.desktopOnly).forEach(e=>{"left"===e.align?n.left.push({...e,position:e.position??1}):"right"===e.align?n.right.push({...e,position:e.position??1}):n.center.push({...e,position:e.position??1})});const r=Object.entries(n).map(([e,t])=>[e,t.sort((e,t)=>(e.position??0)-(t.position??0))]);return Object.fromEntries(r)}(r||[],t),[r,t]),c=e&&t&&n&&(0,i.jsx)(TC,{size:"sm",className:"ml-10",onClick:()=>{jh().editor.close()},children:(0,i.jsx)($C,{})});return(0,i.jsxs)(gv.div,{className:bb,...wb,children:[(0,i.jsx)("div",{className:"mr-auto flex items-center gap-8",children:a.map((e,t)=>(0,i.jsx)(HC,{item:e},t))}),(0,i.jsx)("div",{className:"flex items-center gap-10",children:s.map((e,t)=>(0,i.jsx)(HC,{item:e},t))}),(0,i.jsx)("div",{className:"ml-auto flex items-center gap-8",children:l.map((e,t)=>(0,i.jsx)(HC,{item:e},t))}),c]})}function qC(){const e=Ah(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.width})||1,t=Ah(e=>{var t;return null==(t=e.crop.zoneRect)?void 0:t.height})||1;return(0,i.jsx)("div",{className:"text-sm",children:`${e}x${t}`})}function XC(){const e=Ah(e=>e.activeTool);return(0,i.jsxs)(gv.div,{className:bb,...wb,children:[(0,i.jsx)(KC,{}),ZC(e),(0,i.jsx)(JC,{})]})}function KC(){const{isMobile:e}=GC(),t=Ah(e=>e.dirty);return e?(0,i.jsx)(TC,{size:"sm",onClick:()=>{jh().cancelChanges()},children:(0,i.jsx)($C,{})}):(0,i.jsx)(kb,{variant:"outline",size:"xs",startIcon:(0,i.jsx)($C,{}),radius:"rounded-full",className:"min-w-92",onClick:()=>{jh().cancelChanges()},children:(0,i.jsx)($x,t?{message:"Cancel"}:{message:"Close"})})}function ZC(e){var t,n;if(!e)return null;const r=(0,i.jsx)("div",{className:"capitalize text-sm",children:(0,i.jsx)($x,{message:e})});return e===fc.CROP&&((null==(n=null==(t=jh().config.tools)?void 0:t.crop)?void 0:n.allowCustomRatio)??1)?(0,i.jsx)(qC,{}):r}function JC(){const{isMobile:e}=GC(),t=Ah(e=>e.dirty);return e?(0,i.jsx)(TC,{size:"sm",disabled:!t,onClick:()=>{jh().applyChanges()},children:(0,i.jsx)(Ib,{})}):(0,i.jsx)(kb,{variant:"flat",color:"primary",size:"xs",disabled:!t,startIcon:(0,i.jsx)(Ib,{}),radius:"rounded-full",onClick:()=>{jh().applyChanges()},children:(0,i.jsx)($x,{message:"Apply"})})}function QC(){const e=Ah(e=>e.activeTool);return(0,i.jsx)(Cv,{initial:!1,children:e?(0,i.jsx)(XC,{},"activeToolbar"):(0,i.jsx)(YC,{},"mainToolbar")})}const e_={newCanvas:sc("Loading Canvas"),mainImage:sc("Loading Image"),state:sc("Loading State"),merge:sc("Processing Image")};function t_(){const[e,t]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{Ah.subscribe(e=>e.loading,e=>{e&&t(e)})},[]),(0,i.jsx)(Cv,{children:e&&(0,i.jsx)(gv.div,{initial:{y:"60%",opacity:0},animate:{y:0,opacity:1},exit:{y:"-60%",opacity:0},transition:{type:"tween",duration:.3},onAnimationComplete:()=>{setTimeout(()=>{t(!1)},400)},className:"absolute z-loading-indicator inset-0 m-auto p-6 w-144 h-32 text-center text-sm bg-paper rounded-full shadow-lg",children:(0,i.jsx)($x,{...e_[e]})})})}const n_={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function r_(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function i_(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-r_(t-e,n-t,r)+t:e>n?+r_(e-n,n-t,r)+n:e}function o_(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s_(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a_(Object(n),!0).forEach(function(t){o_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}const l_={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function c_(e){return e?e[0].toUpperCase()+e.slice(1):""}const u_=["enter","leave"];const d_=["gotpointercapture","lostpointercapture"];function h_(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=d_.includes(t)?"capturecapture":"capture",i=!!~t.indexOf(r);return i&&(t=t.replace("capture","")),{device:t,capture:i,passive:n}}function f_(e){return"touches"in e}function p_(e){return f_(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function g_(e){return f_(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function m_(e,t){try{const n=t.clientX-e.clientX,r=t.clientY-e.clientY,i=(t.clientX+e.clientX)/2,o=(t.clientY+e.clientY)/2,a=Math.hypot(n,r);return{angle:-180*Math.atan2(n,r)/Math.PI,distance:a,origin:[i,o]}}catch{}return null}function v_(e,t){const[n,r]=Array.from(e.touches).filter(e=>t.includes(e.identifier));return m_(n,r)}function y_(e){const t=g_(e);return f_(e)?t.identifier:t.pointerId}function b_(e){const t=g_(e);return[t.clientX,t.clientY]}function w_(e){let{deltaX:t,deltaY:n,deltaMode:r}=e;return 1===r?(t*=40,n*=40):2===r&&(t*=800,n*=800),[t,n]}function x_(e,...t){return"function"==typeof e?e(...t):e}function C_(){}function __(...e){return 0===e.length?C_:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function S_(e,t){return Object.assign({},t,e||{})}class k_{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?x_(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let i=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:o})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,i=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);n_.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[o,a]=t._movement,[s,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(o)>=s&&u[0]),!1===c[1]&&(c[1]=Math.abs(a)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(o)>=s&&Math.sign(o)*s),!1===c[1]&&(c[1]=Math.abs(a)>=l&&Math.sign(a)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?o-c[0]:0,d[1]=!1!==c[1]?a-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const h=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=x_(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[p,g]=t.offset,[[m,v],[y,b]]=t._bounds;t.overflow=[p<m?-1:p>v?1:0,g<y?-1:g>b?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const w=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,i]){const[[o,a],[s,l]]=e;return[i_(t,o,a,r),i_(n,s,l,i)]}(t._bounds,t.offset,w),t.delta=n_.sub(t.offset,h),this.computeMovement(),f&&(!t.last||i>32)){t.delta=n_.sub(t.offset,h);const e=t.delta.map(Math.abs);n_.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&i>0&&(t.velocity=[e[0]/i,e[1]/i],t.timeDelta=i)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(s_(s_(s_({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class A_ extends k_{constructor(...e){super(...e),o_(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=n_.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=n_.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[p_(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),i=Math.abs(t);return r>i&&r>n?"x":i>r&&i>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const j_=e=>e,E_={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>s_(s_({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return n_.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?n_.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||j_},threshold:e=>n_.toVector(e,0)},I_=s_(s_({},E_),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>I_.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=e;return[[t,n],[r,i]]}}),T_={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},O_=typeof window<"u"&&window.document&&window.document.createElement;function F_(){return O_&&"ontouchstart"in window}const P_={isBrowser:O_,gesture:function(){try{return"constructor"in GestureEvent}catch{return!1}}(),touch:F_(),touchscreen:F_()||O_&&window.navigator.maxTouchPoints>1,pointer:O_&&"onpointerdown"in window,pointerLock:O_&&"exitPointerLock"in window.document},M_={mouse:0,touch:0,pen:8},R_=s_(s_({},I_),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&P_.pointerLock,P_.touch&&n?"touch":this.pointerLock?"mouse":P_.pointer&&!i?"pointer":P_.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,P_.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:i}){const o=n_.toVector(e,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(n_.toVector(e)),distance:this.transform(n_.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?s_(s_({},M_),e):M_,keyboardDisplacement:(e=10)=>e}),L_=s_(s_({},E_),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!P_.touch&&P_.gesture)return"gesture";if(P_.touch&&r)return"touch";if(P_.touchscreen){if(P_.pointer)return"pointer";if(P_.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const i=e=>{const t=S_(x_(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},o=e=>{const t=S_(x_(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[i(),o()]:e=>[i(e),o(e)]},threshold(e,t,n){return this.lockDirection="lock"===n.axis,n_.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});s_(s_({},I_),{},{mouseOnly:(e=!0)=>e}),s_(s_({},I_),{},{mouseOnly:(e=!0)=>e});const D_=new Map,N_=new Map;function z_(e){D_.set(e.key,e.engine),N_.set(e.key,e.resolver)}const B_={key:"drag",engine:class extends A_{constructor(...e){super(...e),o_(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=I_.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(r&&r.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=y_(e),n._pointerActive=!0,this.computeValues(b_(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==p_(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=y_(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const i=b_(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=n_.sub(i,t._values),this.computeValues(i)),n_.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=y_(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[i,o]=t._distance;if(t.tap=i<=n.tapsThreshold&&o<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[i,o]=t._movement,[a,s]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){const n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>a&&Math.abs(i)>l&&(t.swipe[0]=Math.sign(e)),u>s&&Math.abs(o)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=T_[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,n_.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in T_&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:R_},V_={key:"pinch",engine:class extends k_{constructor(...e){super(...e),o_(this,"ingKey","pinching"),o_(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;this.state.offset="wheel"===e?n_.add(t,n):[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const r=30*Math.abs(t)-Math.abs(n);r<0?e.axis="angle":r>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(e=>n.has(e))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const r=v_(e,t._touchIds);r&&this.pinchStart(e,r)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,r=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(e=>r.has(e))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const i=m_(...Array.from(n.values()));i&&this.pinchStart(e,i)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=v_(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=m_(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,r=n._values[1],i=t.angle-r;let o=0;Math.abs(i)>270&&(o+=Math.sign(i)),this.computeValues([t.distance,t.angle-360*o]),n.origin=t.origin,n.turns=o,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(e=>!this.ctrl.touchIds.has(e))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=n_.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(t=>e[t]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const t=this.state;t._delta=[-w_(e)[1]/100*t.offset[0],0],n_.addTo(t._movement,t._delta),function(e){const[t,n]=e.overflow,[r,i]=e._delta,[o,a]=e._direction;(t<0&&r>0&&o<0||t>0&&r<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(n<0&&i>0&&a<0||n>0&&i<0&&a>0)&&(e._movement[1]=e._movementBound[1])}(t),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:L_};const U_={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(P_.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},W_=["target","eventOptions","window","enabled","transform"];function H_(e={},t){const n={};for(const[r,i]of Object.entries(t))switch(typeof i){case"function":n[r]=i.call(n,e[r],r,e);break;case"object":n[r]=H_(e[r],i);break;case"boolean":i&&(n[r]=e[r])}return n}class $_{constructor(e,t){o_(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,i){const o=this._listeners,a=function(e,t=""){const n=l_[e];return e+(n&&n[t]||t)}(t,n),s=s_(s_({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),i);e.addEventListener(a,r,s);const l=()=>{e.removeEventListener(a,r,s),o.delete(l)};return o.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class G_{constructor(){o_(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}}class Y_{constructor(e){o_(this,"gestures",new Set),o_(this,"_targetEventStore",new $_(this)),o_(this,"gestureEventStores",{}),o_(this,"gestureTimeoutStores",{}),o_(this,"handlers",{}),o_(this,"config",{}),o_(this,"pointerIds",new Set),o_(this,"touchIds",new Set),o_(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&q_(e,"drag"),t.wheel&&q_(e,"wheel"),t.scroll&&q_(e,"scroll"),t.move&&q_(e,"move"),t.pinch&&q_(e,"pinch"),t.hover&&q_(e,"hover")}(this,e)}setEventIds(e){return f_(e)?(this.touchIds=new Set(function(e){return function(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))})}(e).map(e=>e.identifier)}(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:i,eventOptions:o,window:a,enabled:s,transform:l}=r,c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(r,W_);if(n.shared=H_({target:i,eventOptions:o,window:a,enabled:s,transform:l},U_),t){const e=N_.get(t);n[t]=H_(s_({shared:n.shared},c),e)}else for(const u in c){const e=N_.get(u);e&&(n[u]=H_(s_({shared:n.shared},c[u]),e))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const i=this.config[t],o=X_(n,i.eventOptions,!!r);i.enabled&&new(D_.get(t))(this,e,t).bind(o)}const i=X_(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)i(t,"",n=>this.nativeHandlers[t](s_(s_({},this.state.shared),{},{event:n,args:e})),void 0,!0)}for(const e in n)n[e]=__(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:i,passive:o}=h_(e);this._targetEventStore.add(r,t,"",n[e],{capture:i,passive:o})}}}}function q_(e,t){e.gestures.add(t),e.gestureEventStores[t]=new $_(e,t),e.gestureTimeoutStores[t]=new G_}const X_=(e,t,n)=>(r,i,o,a={},s=!1)=>{var l,c;const u=null!==(l=a.capture)&&void 0!==l?l:t.capture,d=null!==(c=a.passive)&&void 0!==c?c:t.passive;let h=s?r:function(e,t="",n=!1){const r=l_[e],i=r&&r[t]||t;return"on"+c_(e)+c_(i)+(function(e=!1,t){return e&&!u_.includes(t)}(n,i)?"Capture":"")}(r,i,u);n&&d&&(h+="Passive"),e[h]=e[h]||[],e[h].push(o)},K_=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Z_(e,t,n,r,i,o){if(!e.has(n)||!D_.has(r))return;const a=n+"Start",s=n+"End";i[r]=e=>{let r;return e.first&&a in t&&t[a](e),n in t&&(r=t[n](e)),e.last&&s in t&&t[s](e),r},o[r]=o[r]||{}}function J_({e:e,rect:t,deltaX:n,deltaY:r}){return{rect:t,x:e.clientX,y:e.clientY,deltaX:n??0,deltaY:r??0,nativeEvent:e}}function Q_({onMoveStart:e,onMove:t,onMoveEnd:n,minimumMovement:r=0,preventDefault:i,stopPropagation:a=!0,onPress:s,onLongPress:l,...c}){const u=(0,o.useRef)({lastPosition:{x:0,y:0},started:!1,longPressTriggered:!1}).current,{addGlobalListener:d,removeGlobalListener:h}=Hv(),f=n=>{if(n.pointerId===u.id){const i=n.clientX-u.lastPosition.x,o=n.clientY-u.lastPosition.y;(Math.abs(i)>=r||Math.abs(o)>=r)&&!u.started&&(t=>{!u.el||!1===(null==e?void 0:e(t,u.el))||(u.originalTouchAction=u.el.style.touchAction,u.el.style.touchAction="none",u.originalUserSelect=document.documentElement.style.userSelect,document.documentElement.style.userSelect="none",u.started=!0)})(n),u.started&&(null==t||t(n,i,o),u.lastPosition={x:n.clientX,y:n.clientY})}},p=e=>{var t;if(e.pointerId===u.id){u.longPressTimer&&clearTimeout(u.longPressTimer);const r=u.longPressTriggered;u.longPressTriggered=!1,u.started&&(null==n||n(e)),u.el&&("pointercancel"!==e.type&&(null==(t=c.onPointerUp)||t.call(c,e,u.el),e.target&&u.el.contains(e.target)&&(r?null==l||l(e,u.el):null==s||s(e,u.el))),document.documentElement.style.userSelect=u.originalUserSelect||"",u.el.style.touchAction=u.originalTouchAction||""),u.id=void 0,u.started=!1,h(window,"pointermove",f,!1),h(window,"pointerup",p,!1),h(window,"pointercancel",p,!1)}};return{domProps:{onPointerDown:_b(n=>{var r;if(0===n.button&&null==u.id){if(u.started=!1,!1===(null==(r=c.onPointerDown)?void 0:r.call(c,n)))return;a&&n.stopPropagation(),i&&n.preventDefault(),u.id=n.pointerId,u.el=n.currentTarget,u.lastPosition={x:n.clientX,y:n.clientY},l&&(u.longPressTimer=setTimeout(()=>{l(n,u.el),u.longPressTriggered=!0},400)),(e||t)&&d(window,"pointermove",f,!1),d(window,"pointerup",p,!1),d(window,"pointercancel",p,!1)}})}}}function eS(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}var tS=(e=>(e.topLeft="topLeft",e.topRight="topRight",e.bottomLeft="bottomLeft",e.bottomRight="bottomRight",e))(tS||{});let nS={};const rS=(e={})=>{ry(null),nS=e};function iS({aspectRatio:e,boundaryRef:t,boundaryRect:n,restrictWithinBoundary:r=!0,minWidth:i=50,minHeight:o=50,...a}){const s={onMoveStart:(e,r)=>{var i;const o=e.target;if(!o.dataset.resizeHandle||ny||(rS({currentRect:eS(r.getBoundingClientRect()),resizeDir:o.dataset.resizeHandle}),!nS.currentRect))return!1;ry("resize"),n?nS.boundaryRect=n:null!=t&&t.current&&(nS.boundaryRect=eS(t.current.getBoundingClientRect())),nS.currentRect&&nS.boundaryRect&&(nS.currentRect.left-=nS.boundaryRect.left,nS.currentRect.top-=nS.boundaryRect.top),nS.initialAspectRatio=nS.currentRect.width/nS.currentRect.height,null==(i=a.onResizeStart)||i.call(a,J_({rect:nS.currentRect,e:e}))},onMove:(t,n,r)=>{var s;if(!nS.resizeDir||!nS.currentRect)return;const l="initial"===e?nS.initialAspectRatio:e,c=function(e,t,n,r){const i={...e},o={...e};return"topRight"===nS.resizeDir?(o.width=Math.floor(o.width+t),o.height=r?Math.floor(o.width/r):Math.floor(o.height-n),o.top=Math.floor(o.top+(i.height-o.height))):"bottomRight"===nS.resizeDir?(o.width=Math.floor(o.width+t),o.height=r?Math.floor(o.width/r):Math.floor(o.height+n)):"topLeft"===nS.resizeDir?(o.width=Math.floor(o.width-t),o.height=r?Math.floor(o.width/r):Math.floor(o.height-n),o.left=Math.floor(o.left+(i.width-o.width)),o.top=Math.floor(o.top+(i.height-o.height))):"bottomLeft"===nS.resizeDir&&(o.width=Math.floor(o.width-t),o.height=r?Math.floor(o.width/r):Math.floor(o.height+n),o.left=Math.floor(o.left+t)),o}(nS.currentRect,n,r,l),u=function(e,t,n,r){const i="bottomLeft"===nS.resizeDir||"topLeft"===nS.resizeDir,o="topRight"===nS.resizeDir||"topLeft"===nS.resizeDir;let a={...e};a.width=Math.max(t,e.width),a.height=Math.max(n,e.height);const s=a.width-e.width;i&&s>0&&(a.left-=s);const l=a.height-e.height;if(o&&l>0&&(a.top-=l),nS.boundaryRect&&(a=function(e,t){const n={...e};n.left=Math.max(0,n.left);const r=n.left-e.left;r>0&&(n.width-=r),n.top=Math.max(0,n.top);const i=n.top-e.top;return i>0&&(n.height-=i),n.width=Math.min(n.width,t.width-n.left),n.height=Math.min(n.height,t.height-n.top),n}(a,nS.boundaryRect)),r){const e=a.width,t=a.height,n=Ly(r,a.width,a.height);a.width=n.width,a.height=n.height,o&&(a.top+=t-a.height),i&&(a.left+=e-a.width)}return a}(c,i,o,l);null==(s=a.onResize)||s.call(a,J_({rect:u,e:t,deltaX:n,deltaY:r})),nS.currentRect=c},onMoveEnd:e=>{var t;nS.currentRect&&(null==(t=a.onResizeEnd)||t.call(a,J_({rect:nS.currentRect,e:e}))),rS()}},{domProps:l}=Q_(s);return{resizeProps:l}}function oS({position:e,inset:t=!1}){const n=function(e,t){const n=t?"left-0":"-left-5",r=t?"top-0":"-top-5",i=t?"bottom-0":"-bottom-5",o=t?"right-0":"-right-5";switch(e){case tS.topLeft:return`${n} ${r} border-l-4 border-t-4 cursor-nwse-resize`;case tS.topRight:return`${o} ${r} border-r-4 border-t-4 cursor-nesw-resize`;case tS.bottomRight:return`${o} ${i} border-r-4 border-b-4 cursor-se-resize`;case tS.bottomLeft:return`${n} ${i} border-l-4 border-b-4 cursor-sw-resize`;default:return""}}(e,t);return(0,i.jsx)("div",{"data-resize-handle":e,className:`border-white absolute w-20 h-20 ${n}`})}var aS=(e=>(e.top="maskTop",e.right="maskRight",e.bottom="maskBottom",e.left="maskLeft",e))(aS||{});function sS({position:e,refs:t}){const n=function(e){switch(e){case"maskTop":return"left-0 top-0";case"maskBottom":return"bottom-0 left-0";default:return""}}(e);return(0,i.jsx)("div",{className:`cropzone-transition bg-black/50 bottom absolute ${n}`,ref:n=>t.current[e]=n})}function lS({name:e,refs:t}){const n=gc("cropzone-transition pointer-events-none absolute left-0 top-0 bg-white/50",e.startsWith("lineHor")?"h-px":"w-px");return(0,i.jsx)("div",{className:n,ref:n=>{t.current[e]=n}})}function cS(e,t,n){return Math.min(Math.max(e,t),n)}let uS={};function dS({boundaryRef:e,boundaryRect:t,minimumMovement:n,restrictWithinBoundary:r=!0,...i}){const o={minimumMovement:n,onMoveStart:(n,r)=>{var o;if(ny)return!1;uS={currentRect:eS(r.getBoundingClientRect())},ry("move"),t?uS.boundaryRect=t:null!=e&&e.current&&(uS.boundaryRect=eS(e.current.getBoundingClientRect())),uS.currentRect&&uS.boundaryRect&&(uS.currentRect.left-=uS.boundaryRect.left,uS.currentRect.top-=uS.boundaryRect.top),null==(o=i.onMoveStart)||o.call(i,J_({rect:uS.currentRect,e:n}))},onMove:(e,t,n)=>{var o;if(!uS.currentRect)return;const a={...uS.currentRect,left:uS.currentRect.left+t,top:uS.currentRect.top+n},s={...a};uS.boundaryRect&&r&&(s.left=cS(a.left,0,uS.boundaryRect.width-a.width),s.top=cS(a.top,0,uS.boundaryRect.height-a.height)),null==(o=i.onMove)||o.call(i,J_({rect:s,e:e,deltaX:t,deltaY:n})),uS.currentRect=a},onMoveEnd:e=>{var t;uS.currentRect&&(null==(t=i.onMoveEnd)||t.call(i,J_({rect:uS.currentRect,e:e})),ry(null),uS={})}},{domProps:a}=Q_(o);return{moveProps:a}}function hS(){const e=(0,o.useRef)({}),[t,n]=(0,o.useState)(!0),r=Ah(e=>e.canvasSize),a=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.cropzone}),s=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.defaultRatio})||null,l=Ah(e=>e.crop.selectedAspectRatio)||null,{moveProps:c}=dS({boundaryRect:r,onMoveStart:()=>n(!0),onMove:e=>Eh().crop.drawZone(e.rect),onMoveEnd:()=>n(!1)}),{resizeProps:u}=iS({boundaryRect:r,minHeight:50,minWidth:50,aspectRatio:Dy(l),onResizeStart:()=>n(!0),onResize:e=>Eh().crop.drawZone(e.rect),onResizeEnd:()=>n(!1)});(0,o.useLayoutEffect)(()=>{Eh().crop.registerRefs(e),Eh().crop.resetCropzone(s)},[s,r]);const d=gc("cropzone absolute z-cropzone isolate left-0 top-0 w-full h-full overflow-hidden",t&&"moving");return(0,i.jsxs)("div",{className:d,onPointerDown:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,i.jsxs)("div",{className:"cropzone-transition border-white/50 absolute z-10 left-0 top-0 border",...Dv(u,c),ref:t=>e.current.innerZone=t,children:[!(null!=a&&a.hideTopLeft)&&(0,i.jsx)(oS,{position:tS.topLeft,inset:!0}),!(null!=a&&a.hideTopRight)&&(0,i.jsx)(oS,{position:tS.topRight,inset:!0}),!(null!=a&&a.hideBottomLeft)&&(0,i.jsx)(oS,{position:tS.bottomLeft,inset:!0}),!(null!=a&&a.hideBottomRight)&&(0,i.jsx)(oS,{position:tS.bottomRight,inset:!0}),(0,i.jsx)(lS,{name:"lineVer1",refs:e}),(0,i.jsx)(lS,{name:"lineVer2",refs:e}),(0,i.jsx)(lS,{name:"lineHor1",refs:e}),(0,i.jsx)(lS,{name:"lineHor2",refs:e})]}),(0,i.jsx)(sS,{refs:e,position:aS.top}),(0,i.jsx)(sS,{refs:e,position:aS.left}),(0,i.jsx)(sS,{refs:e,position:aS.right}),(0,i.jsx)(sS,{refs:e,position:aS.bottom})]})}const fS=yc((0,i.jsx)("path",{d:"M 7 2 C 6.448 2 6 2.448 6 3 C 6 3.552 6.448 4 7 4 L 20 4 L 20 17 C 20 17.552 20.448 18 21 18 C 21.552 18 22 17.552 22 17 L 22 4 C 22 2.895 21.105 2 20 2 L 7 2 z M 4 6 C 2.895 6 2 6.895 2 8 L 2 20 C 2 21.105 2.895 22 4 22 L 16 22 C 17.105 22 18 21.105 18 20 L 18 8 C 18 6.895 17.105 6 16 6 L 4 6 z M 10 10 C 10.552 10 11 10.448 11 11 L 11 13 L 13 13 C 13.552 13 14 13.448 14 14 C 14 14.552 13.552 15 13 15 L 11 15 L 11 17 C 11 17.552 10.552 18 10 18 C 9.448 18 9 17.552 9 17 L 9 15 L 7 15 C 6.448 15 6 14.552 6 14 C 6 13.448 6.448 13 7 13 L 9 13 L 9 11 C 9 10.448 9.448 10 10 10 z"})),pS=yc((0,i.jsx)("path",{d:"M 11 3 L 2 21 L 11 21 L 11 3 z M 13 3 L 13 21 L 22 21 L 13 3 z M 9 11.472656 L 9 19 L 5.2363281 19 L 9 11.472656 z"})),gS=yc((0,i.jsx)("path",{d:"M 16.476562 2.4511719 C 16.392047 2.4657656 16.308531 2.5061719 16.238281 2.5761719 L 14.130859 4.6835938 C 13.956859 4.8575938 13.956859 5.1394531 14.130859 5.3144531 L 16.238281 7.4238281 C 16.519281 7.7048281 17 7.5054219 17 7.1074219 L 17 6 L 20 6 L 20 9 A 1.0001 1.0001 0 1 0 22 9 L 22 6 C 22 4.9069372 21.093063 4 20 4 L 17 4 L 17 2.8925781 C 17 2.5940781 16.730109 2.4073906 16.476562 2.4511719 z M 4 5 C 2.9069372 5 2 5.9069372 2 7 L 2 14 C 2 15.093063 2.9069372 16 4 16 L 7 16 L 7 19 C 7 20.105 7.895 21 9 21 L 16 21 C 17.105 21 18 20.105 18 19 L 18 12 C 18 10.895 17.105 10 16 10 L 13 10 L 13 7 C 13 5.9069372 12.093063 5 11 5 L 4 5 z M 4 7 L 11 7 L 11 14 L 4 14 L 4 7 z"})),mS=yc((0,i.jsx)("path",{d:"M 10 2 L 9 3 L 3 3 L 3 5 L 21 5 L 21 3 L 15 3 L 14 2 L 10 2 z M 4.3652344 7 L 5.8925781 20.263672 C 6.0245781 21.253672 6.877 22 7.875 22 L 16.123047 22 C 17.121047 22 17.974422 21.254859 18.107422 20.255859 L 19.634766 7 L 4.3652344 7 z"})),vS={width:120,height:30},yS=[{name:"Duplicate",icon:fS,onClick:()=>{Eh().objects.duplicate()}},{name:"Flip",icon:pS,onClick:()=>{Eh().objects.flipHorizontally()}},{name:"Bring to front",icon:gS,onClick:()=>{Eh().objects.bringToFront()}},{name:"Delete",icon:mS,onClick:()=>{Eh().objects.delete()}}],bS=o.forwardRef((e,t)=>{const n=Ah(e=>e.objects.active.isMoving)?"opacity-0":"opacity-100";return(0,i.jsx)("div",{ref:t,className:`${n} absolute z-obj-box left-0 top-0 flex items-center text-white bg-controls rounded shadow transition-opacity overflow-hidden`,children:yS.map(e=>{const t=e.icon;return(0,i.jsx)(TC,{size:"sm",className:"w-30 h-30 hover:bg-white/hover",radius:"rounded-none",onClick:e.onClick,children:(0,i.jsx)(t,{})},e.name)})})});function wS(e,t){const n=Eh().objects.getActive();if(!n||!e.current)return;const r=e.current,i=Jv.fabric.util.degreesToRadians(n.angle??0);let o=Math.round(n.getScaledWidth()*jh().zoom),a=Math.round(n.getScaledHeight()*jh().zoom),s=Math.round((n.left??0)*jh().zoom),l=Math.round((n.top??0)*jh().zoom);const c="center"===n.originX?o/2:0,u="center"===n.originY?a/2:0;n.padding&&(o+=2*n.padding,a+=2*n.padding,s-=n.padding,l-=n.padding),r.style.width=`${o}px`,r.style.height=`${a}px`,r.style.transform=`translate(${s-c}px, ${l-u}px) rotate(${i}rad)`,Eh().canvas.render(),function(e,t){if(!t)return;const n=e.angle||0,r=n>168&&n<188?-30:-15,i=jh().canvasSize,o=jh().stageSize,a=vS,s=i.top-o.top,l=i.left-o.left,c=o.width-(l+i.width),u=o.height-(s+i.height),d=-s,h=-(i.left-o.left),f=i.width-a.width+c,p=i.height-a.height+u,g=e.getBoundingRect();let m=g.top-a.height+r,v=g.left+g.width/2-a.width/2;m=Math.min(p,Math.max(d,m)),v=Math.min(f,Math.max(h,v)),t.style.transform=`translate(${v}px, ${m}px) rotate(0deg)`}(n,t.current)}function xS(){return(0,i.jsx)("div",{className:"absolute -bottom-20 left-1/2 w-2 h-20 bg-white cursor-default -translate-x-1/2",children:(0,i.jsx)("div",{"data-rotate-handle":!0,className:"w-18 h-18 absolute -bottom-10 -left-8 bg-white rounded-full cursor-move"})})}let CS={};function _S(e){const t=CS.centerX||0,n=CS.centerY||0;return Math.atan2(n-e.pageY,t-e.pageX)-(CS.startAngle||0)}const SS=(e={})=>{ry(null),CS=e};function kS(){const e=(0,o.useRef)(null),t=(0,o.useRef)(null),n=Ah(e=>e.objects.active.id),r=Ah(e=>e.objects.isEditingText),a=Ah(e=>e.zoom),s=function(){const e=Eh().objects.getActive();if(!e||!e.name)return{};const t=jh().config.objectControls||{},n=e.name;return{...t.global,...t[n]}}(),l=(0,o.useRef)(null),c=(0,o.useCallback)(()=>{l.current?(clearTimeout(l.current),l.current=null,function(){var e;const t=Eh().objects.getActive();xd(t)&&(t.enterEditing(),null==(e=t.hiddenTextarea)||e.focus())}()):l.current=setTimeout(()=>{l.current=null},300)},[]);let{moveProps:u}=dS({boundaryRef:jh().canvasRef,restrictWithinBoundary:!1,onMoveEnd:()=>{jh().objects.setActiveIsMoving(!1)},onMove:e=>{jh().objects.setActiveIsMoving(!0),function(e){const t=e.rect.width/2,n=e.rect.height/2;Eh().objects.setValues({left:(e.rect.left+t)/jh().zoom,top:(e.rect.top+n)/jh().zoom})}(e)}});s.lockMovement&&(u={});const{resizeProps:d}=iS({minWidth:50,minHeight:50,aspectRatio:s.unlockAspectRatio?null:"initial",boundaryRef:s.containWithinCanvas?jh().canvasRef:void 0,restrictWithinBoundary:!1,onResizeEnd:()=>{jh().objects.setActiveIsMoving(!1)},onResize:e=>{jh().objects.setActiveIsMoving(!0),function(e){const t=Eh().objects.getActive();if(!t)return;const n={};xd(t)?(e.deltaX>0||t.getScaledHeight()>=20&&t.getScaledWidth()>=20)&&(n.fontSize=(t.fontSize||1)+e.deltaX):(t.width&&(n.scaleX=e.rect.width/jh().zoom/t.width),t.height&&(n.scaleY=e.rect.height/jh().zoom/t.height)),Eh().objects.setValues(n)}(e)}}),{rotateProps:h}=function(e){const t={onMoveStart:(t,n)=>{var r,i;if(!t.target.dataset.rotateHandle||ny)return!1;const o=eS(n.getBoundingClientRect());if(!o)return!1;const a=null==(r=n.style.transform.match(/rotate\((.+?)\)/))?void 0:r[1],[s="0"]=a?a.split(","):[];SS({currentRect:o,centerX:o.left+o.width/2,centerY:o.top+o.height/2,startAngle:parseFloat(s)}),ry("rotate"),CS.startAngle=_S(t),null==(i=e.onRotateStart)||i.call(e,J_({rect:o,e:t}))},onMove:(t,n,r)=>{var i;if(!CS.currentRect)return;const o={...CS.currentRect};o.angle=_S(t),o.left+=n,o.top+=r,null==(i=e.onRotate)||i.call(e,J_({rect:o,e:t,deltaX:n,deltaY:r})),CS.currentRect=o},onMoveEnd:t=>{var n;CS.currentRect&&(null==(n=e.onRotateEnd)||n.call(e,J_({rect:CS.currentRect,e:t}))),SS()}},{domProps:n}=Q_(t);return{rotateProps:n}}({boundaryRef:jh().canvasRef,onRotateEnd:()=>{jh().objects.setActiveIsMoving(!1)},onRotate:e=>{jh().objects.setActiveIsMoving(!0),function(e){const t=Eh().objects.getActive();if(!t||!e.rect.angle)return;const n=Jv.fabric.util.radiansToDegrees(e.rect.angle);n!==t.angle&&Eh().objects.setValues({angle:n})}(e)}});return(0,o.useEffect)(()=>{Ih()&&jh().editor.on("object:modified",n=>{n.sizeOrPositionChanged&&wS(e,t)})},[]),(0,o.useEffect)(()=>{wS(e,t)},[n,a,r]),(0,i.jsxs)("div",{className:n&&!r?"block":"hidden",children:[(0,i.jsxs)("div",{ref:e,...Dv(h,d,u),onClick:c,className:"absolute z-obj-box border-2 border-white shadow-md cursor-move",children:[!s.hideTopLeft&&(0,i.jsx)(oS,{position:tS.topLeft}),!s.hideTopRight&&(0,i.jsx)(oS,{position:tS.topRight}),!s.hideBottomLeft&&(0,i.jsx)(oS,{position:tS.bottomLeft}),!s.hideBottomRight&&(0,i.jsx)(oS,{position:tS.bottomRight}),!s.hideRotatingPoint&&(0,i.jsx)(xS,{})]}),(0,i.jsx)(bS,{ref:t})]})}function AS(){const e=Ah(e=>e.activeTool===fc.CROP),t=Ah(e=>e.objects.active.id);return(0,i.jsxs)("div",{children:[e&&(0,i.jsx)(hS,{}),t&&(0,i.jsx)(kS,{})]})}const jS=function(e){return e.forEach(z_),function(e,t){const{handlers:n,nativeHandlers:r,config:i}=function(e,t){const[n,r,i]=function(e){const t={},n={},r=new Set;for(let i in e)K_.test(i)?(r.add(RegExp.lastMatch),n[i]=e[i]):t[i]=e[i];return[n,t,r]}(e),o={};return Z_(i,n,"onDrag","drag",o,t),Z_(i,n,"onWheel","wheel",o,t),Z_(i,n,"onScroll","scroll",o,t),Z_(i,n,"onPinch","pinch",o,t),Z_(i,n,"onMove","move",o,t),Z_(i,n,"onHover","hover",o,t),{handlers:o,config:t,nativeHandlers:r}}(e,t||{});return function(e,t={},n,r){const i=o.useMemo(()=>new Y_(e),[]);if(i.applyHandlers(e,r),i.applyConfig(t,n),o.useEffect(i.effect.bind(i)),o.useEffect(()=>i.clean.bind(i),[]),void 0===t.target)return i.bind.bind(i)}(n,i,void 0,r)}}([B_,V_]),ES=o.forwardRef((e,t)=>{const[n,r]=(0,o.useState)(!1);return(0,o.useEffect)(()=>Ah.subscribe(e=>e.loading,e=>{r(!e)}),[]),(0,i.jsx)(IS,{children:(0,i.jsxs)(gv.div,{initial:{opacity:0},variants:{visible:{opacity:1,transition:{duration:.35,delay:.5}},hidden:{opacity:0,transition:{duration:0}}},animate:n?"visible":"hidden",className:"relative m-auto w-max",style:{backgroundImage:`url(${vy("images/empty-canvas-bg.png")})`},children:[(0,i.jsx)(AS,{}),(0,i.jsx)("canvas",{ref:t})]})})});function IS({children:e}){const t=(0,o.useRef)(null),n=jS({onPinch:e=>{if(!Eh().zoom.allowUserZoom||!TS(e))return e.cancel();1===e.direction[0]?Eh().zoom.zoomIn(.01):Eh().zoom.zoomOut(.01),e.event.stopPropagation(),e.event.preventDefault()},onDrag:e=>{if(e.pinching||!TS(e))return e.cancel();t.current.scrollLeft-=e.delta[0],t.current.scrollTop-=e.delta[1]}});return(0,i.jsx)("div",{ref:t,className:"w-full h-full overflow-hidden touch-none flex",...n(),children:e})}function TS(e){return!(Ih().findTarget(e.event,!1)||Ih().isDrawingMode)}function OS({actionBtn:e,children:t,className:n}){return(0,i.jsxs)("div",{className:gc(n,"flex gap-16 items-center h-full"),children:[e&&(0,i.jsx)("div",{className:"flex-shrink-0",children:e}),(0,i.jsx)("div",{className:"w-full flex-auto",children:t}),e&&(0,i.jsx)("div",{className:"w-96"})]})}function FS(){return(FS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function PS(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)t.indexOf(n=o[r])>=0||(i[n]=e[n]);return i}function MS(e){var t=(0,o.useRef)(e),n=(0,o.useRef)(function(e){t.current&&t.current(e)});return t.current=e,n.current}var RS,LS,DS,NS,zS,BS,VS,US,WS,HS,$S,GS,YS,qS,XS,KS,ZS,JS,QS,ek,tk,nk,rk,ik,ok,ak,sk,lk,ck,uk,dk,hk,fk,pk,gk,mk=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},vk=function(e){return"touches"in e},yk=function(e){return e&&e.ownerDocument.defaultView||self},bk=function(e,t,n){var r=e.getBoundingClientRect(),i=vk(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:mk((i.pageX-(r.left+yk(e).pageXOffset))/r.width),top:mk((i.pageY-(r.top+yk(e).pageYOffset))/r.height)}},wk=function(e){!vk(e)&&e.preventDefault()},xk=o.memo(function(e){var t=e.onMove,n=e.onKey,r=PS(e,["onMove","onKey"]),i=(0,o.useRef)(null),a=MS(t),s=MS(n),l=(0,o.useRef)(null),c=(0,o.useRef)(!1),u=(0,o.useMemo)(function(){var e=function(e){wk(e),(vk(e)?e.touches.length>0:e.buttons>0)&&i.current?a(bk(i.current,e,l.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=c.current,o=yk(i.current),a=n?o.addEventListener:o.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t,r=e.nativeEvent,o=i.current;if(o&&(wk(r),t=r,(!c.current||vk(t))&&o)){if(vk(r)){c.current=!0;var s=r.changedTouches||[];s.length&&(l.current=s[0].identifier)}o.focus(),a(bk(o,r,l.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]},[s,a]),d=u[0],h=u[1],f=u[2];return(0,o.useEffect)(function(){return f},[f]),o.createElement("div",FS({},r,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:i,onKeyDown:h,tabIndex:0,role:"slider"}))}),Ck=function(e){return e.filter(Boolean).join(" ")},_k=function(e){var t=e.color,n=e.left,r=e.top,i=void 0===r?.5:r,a=Ck(["react-colorful__pointer",e.className]);return o.createElement("div",{className:a,style:{top:100*i+"%",left:100*n+"%"}},o.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Sk=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},kk=function(e){return"#"===e[0]&&(e=e.substring(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Sk(parseInt(e[3]+e[3],16)/255,2):1}:{r:parseInt(e.substring(0,2),16),g:parseInt(e.substring(2,4),16),b:parseInt(e.substring(4,6),16),a:8===e.length?Sk(parseInt(e.substring(6,8),16)/255,2):1}},Ak=function(e){var t=function(e){var t=e.s,n=e.v,r=e.a,i=(200-t)*n/100;return{h:Sk(e.h),s:Sk(i>0&&i<200?t*n/100/(i<=100?i:200-i)*100:0),l:Sk(i/2),a:Sk(r,2)}}(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},jk=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ek=o.memo(function(e){var t=e.hue,n=e.onChange,r=Ck(["react-colorful__hue",e.className]);return o.createElement("div",{className:r},o.createElement(xk,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:mk(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":Sk(t),"aria-valuemax":"360","aria-valuemin":"0"},o.createElement(_k,{className:"react-colorful__hue-pointer",left:t/360,color:Ak({h:t,s:100,v:100,a:1})})))}),Ik=o.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Ak({h:t.h,s:100,v:100,a:1})};return o.createElement("div",{className:"react-colorful__saturation",style:r},o.createElement(xk,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:mk(t.s+100*e.left,0,100),v:mk(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Sk(t.s)+"%, Brightness "+Sk(t.v)+"%"},o.createElement(_k,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Ak(t)})))}),Tk=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},Ok=typeof window<"u"?o.useLayoutEffect:o.useEffect,Fk=new Map,Pk=function(e){var t=e.className,r=e.colorModel,i=e.color,a=void 0===i?r.defaultColor:i,s=e.onChange,l=PS(e,["className","colorModel","color","onChange"]),c=(0,o.useRef)(null);!function(e){Ok(function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!Fk.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',Fk.set(t,r);var i=n.nc;i&&r.setAttribute("nonce",i),t.head.appendChild(r)}},[])}(c);var u=function(e,t,n){var r=MS(n),i=(0,o.useState)(function(){return e.toHsva(t)}),a=i[0],s=i[1],l=(0,o.useRef)({color:t,hsva:a});(0,o.useEffect)(function(){if(!e.equal(t,l.current.color)){var n=e.toHsva(t);l.current={hsva:n,color:t},s(n)}},[t,e]),(0,o.useEffect)(function(){var t;Tk(a,l.current.hsva)||e.equal(t=e.fromHsva(a),l.current.color)||(l.current={hsva:a,color:t},r(t))},[a,e,r]);var c=(0,o.useCallback)(function(e){s(function(t){return Object.assign({},t,e)})},[]);return[a,c]}(r,a,s),d=u[0],h=u[1],f=Ck(["react-colorful",t]);return o.createElement("div",FS({},l,{ref:c,className:f}),o.createElement(Ik,{hsva:d,onChange:h}),o.createElement(Ek,{hue:d.h,onChange:h,className:"react-colorful__last-control"}))},Mk={defaultColor:"000",toHsva:function(e){return function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=Math.max(t,n,r),a=o-Math.min(t,n,r),s=a?o===t?(n-r)/a:o===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Sk(60*(s<0?s+6:s)),s:Sk(o?a/o*100:0),v:Sk(o/255*100),a:i}}(kk(e))},fromHsva:function(e){return function(e){return function(e){var t=e.r,n=e.g,r=e.b,i=e.a,o=i<1?jk(Sk(255*i)):"";return"#"+jk(t)+jk(n)+jk(r)+o}(function(e){var t=e.h,n=e.s,r=e.v,i=e.a;t=t/360*6,n/=100,r/=100;var o=Math.floor(t),a=r*(1-n),s=r*(1-(t-o)*n),l=r*(1-(1-t+o)*n),c=o%6;return{r:Sk(255*[r,s,a,a,l,r][c]),g:Sk(255*[l,r,r,s,a,a][c]),b:Sk(255*[a,a,l,r,r,s][c]),a:Sk(i,2)}}(e))}({h:e.h,s:e.s,v:e.v,a:1})},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||Tk(kk(e),kk(t))}},Rk=function(e){return o.createElement(Pk,FS({},e,{colorModel:Mk}))},Lk=/^#?([0-9A-F]{3,8})$/i,Dk=function(e){var t=e.color,n=void 0===t?"":t,r=e.onChange,i=e.onBlur,a=e.escape,s=e.validate,l=e.format,c=e.process,u=PS(e,["color","onChange","onBlur","escape","validate","format","process"]),d=(0,o.useState)(function(){return a(n)}),h=d[0],f=d[1],p=MS(r),g=MS(i),m=(0,o.useCallback)(function(e){var t=a(e.target.value);f(t),s(t)&&p(c?c(t):t)},[a,c,s,p]),v=(0,o.useCallback)(function(e){s(e.target.value)||f(a(n)),g(e)},[n,a,s,g]);return(0,o.useEffect)(function(){f(a(n))},[n,a]),o.createElement("input",FS({},u,{value:l?l(h):h,spellCheck:"false",onChange:m,onBlur:v}))},Nk=function(e){return"#"+e},zk=function(e){var t=e.prefixed,n=e.alpha,r=PS(e,["prefixed","alpha"]),i=(0,o.useCallback)(function(e){return e.replace(/([^0-9A-F]+)/gi,"").substring(0,n?8:6)},[n]),a=(0,o.useCallback)(function(e){return function(e,t){var n=Lk.exec(e),r=n?n[1].length:0;return 3===r||6===r||!!t&&4===r||!!t&&8===r}(e,n)},[n]);return o.createElement(Dk,FS({},r,{escape:i,format:t?Nk:void 0,process:Nk,validate:a}))};RS={alpha:"\u0623\u0644\u0641\u0627",black:"\u0623\u0633\u0648\u062f",blue:"\u0623\u0632\u0631\u0642","blue purple":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0645\u0632\u0631\u0642",brightness:"\u0627\u0644\u0633\u0637\u0648\u0639",brown:"\u0628\u0646\u064a","brown yellow":"\u0623\u0635\u0641\u0631 \u0628\u0646\u064a",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0633\u0645\u0627\u0648\u064a","cyan blue":"\u0623\u0632\u0631\u0642 \u0633\u0645\u0627\u0648\u064a",dark:"\u062f\u0627\u0643\u0646",gray:"\u0631\u0645\u0627\u062f\u064a",grayish:"\u0645\u0627\u0626\u0644 \u0644\u0644\u0631\u0645\u0627\u062f\u064a",green:"\u0623\u062e\u0636\u0631","green cyan":"\u0633\u0645\u0627\u0648\u064a \u0645\u062e\u0636\u0631",hue:"\u062f\u0631\u062c\u0629 \u0627\u0644\u0644\u0648\u0646",light:"\u0641\u0627\u062a\u062d",lightness:"\u0627\u0644\u0625\u0636\u0627\u0621\u0629",magenta:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","magenta pink":"\u0623\u0631\u062c\u0648\u0627\u0646\u064a \u0648\u0631\u062f\u064a",orange:"\u0628\u0631\u062a\u0642\u0627\u0644\u064a","orange yellow":"\u0623\u0635\u0641\u0631 \u0628\u0631\u062a\u0642\u0627\u0644\u064a",pale:"\u0628\u0627\u0647\u062a",pink:"\u0648\u0631\u062f\u064a","pink red":"\u0623\u062d\u0645\u0631 \u0648\u0631\u062f\u064a",purple:"\u0623\u0631\u062c\u0648\u0627\u0646\u064a","purple magenta":"\u0628\u0646\u0641\u0633\u062c\u064a",red:"\u0623\u062d\u0645\u0631","red orange":"\u0628\u0631\u062a\u0642\u0627\u0644\u064a \u0645\u062d\u0645\u0631",saturation:"\u0627\u0644\u062a\u0634\u0628\u0639",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u0634\u0641\u0627\u0641`,"very dark":"\u062f\u0627\u0643\u0646 \u062c\u062f\u064b\u0627","very light":"\u0641\u0627\u062a\u062d \u062c\u062f\u064b\u0627",vibrant:"\u0633\u0627\u0637\u0639",white:"\u0623\u0628\u064a\u0636",yellow:"\u0623\u0635\u0641\u0631","yellow green":"\u0623\u062e\u0636\u0631 \u0645\u0635\u0641\u0631"},LS={alpha:"\u0410\u043b\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u043e",blue:"\u0421\u0438\u043d\u044c\u043e","blue purple":"\u0441\u0438\u043d\u044c\u043e \u043b\u0438\u043b\u0430\u0432\u043e",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442",brown:"\u043a\u0430\u0444\u044f\u0432\u043e","brown yellow":"\u043a\u0430\u0444\u044f\u0432\u043e \u0436\u044a\u043b\u0442\u043e",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0446\u0438\u0430\u043d","cyan blue":"\u0446\u0438\u0430\u043d \u0441\u0438\u043d\u044c\u043e",dark:"\u0442\u044a\u043c\u043d\u043e",gray:"\u0441\u0438\u0432\u043e",grayish:"\u0441\u0438\u0432\u043a\u0430\u0432",green:"\u0417\u0435\u043b\u0435\u043d\u043e","green cyan":"\u0437\u0435\u043b\u0435\u043d \u0446\u0438\u0430\u043d",hue:"\u041e\u0442\u0442\u0435\u043d\u044a\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u043e",lightness:"\u041b\u0435\u043a\u043e\u0442\u0430",magenta:"\u043c\u0430\u0433\u0435\u043d\u0442\u0430","magenta pink":"\u043c\u0430\u0433\u0435\u043d\u0442\u0430 \u0440\u043e\u0437\u043e\u0432\u043e",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e \u0436\u044a\u043b\u0442\u043e",pale:"\u0431\u043b\u0435\u0434\u043e",pink:"\u0440\u043e\u0437\u043e\u0432\u043e","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e \u0447\u0435\u0440\u0432\u0435\u043d\u043e",purple:"\u043b\u0438\u043b\u0430\u0432\u043e","purple magenta":"\u043b\u0438\u043b\u0430\u0432\u043e \u043c\u0430\u0433\u0435\u043d\u0442\u0430",red:"\u0427\u0435\u0440\u0432\u0435\u043d\u043e","red orange":"\u0447\u0435\u0440\u0432\u0435\u043d \u043f\u043e\u0440\u0442\u043e\u043a\u0430\u043b",saturation:"\u041d\u0430\u0441\u0438\u0442\u0435\u043d\u043e\u0441\u0442",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u0435\u043d`,"very dark":"\u043c\u043d\u043e\u0433\u043e \u0442\u044a\u043c\u043d\u043e","very light":"\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u0435\u0442\u043b\u043e",vibrant:" \u044f\u0440\u043a\u043e",white:"\u0431\u044f\u043b\u043e",yellow:"\u0436\u044a\u043b\u0442\u043e","yellow green":"\u0436\u044a\u043b\u0442\u043e \u0437\u0435\u043b\u0435\u043d"},DS={alpha:"Alfa",black:"\u010dern\xe1",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hn\u011bd\xe1","brown yellow":"hn\u011bdo\u017elut\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"tyrkysov\xe1","cyan blue":"tyrkysovomodr\xe1",dark:"tmav\xe1",gray:"\u0161ed\xe1",grayish:"na\u0161edl\xe1",green:"Zelen\xe1","green cyan":"zelenotyrkysov\xe1",hue:"Odst\xedn",light:"sv\u011btl\xe1",lightness:"Sv\u011btlost",magenta:"purpurov\xe1","magenta pink":"purpurov\u011b r\u016f\u017eov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elut\xe1",pale:"bled\xe1",pink:"r\u016f\u017eov\xe1","pink red":"r\u016f\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\u011b purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"Sytost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} pr\u016fhledn\xe9`,"very dark":"velmi tmav\xe1","very light":"velmi sv\u011btl\xe1",vibrant:"z\xe1\u0159iv\xe1",white:"b\xedl\xe1",yellow:"\u017elut\xe1","yellow green":"\u017elutozelen\xe1"},NS={alpha:"Alfa",black:"sort",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyan bl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5lig",green:"Gr\xf8n","green cyan":"gr\xf8n cyan",hue:"Tone",light:"lys",lightness:"Lyshed",magenta:"magenta","magenta pink":"magenta pink",orange:"orange","orange yellow":"orangegul",pale:"bleg",pink:"lyser\xf8d","pink red":"lyser\xf8dlig r\xf8d",purple:"lilla","purple magenta":"lilla magenta",red:"R\xf8d","red orange":"r\xf8dorange",saturation:"Farvem\xe6tning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gennemsigtig`,"very dark":"meget m\xf8rk","very light":"meget lys",vibrant:"klar",white:"hvid",yellow:"gul","yellow green":"gulgr\xf8n"},zS={alpha:"Alpha",black:"Schwarz",blue:"Blau","blue purple":"Blaulila",brightness:"Helligkeit",brown:"Braun","brown yellow":"Braungelb",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Cyanblau",dark:"dunkles",gray:"Grau",grayish:"gr\xe4uliches",green:"Gr\xfcn","green cyan":"Gr\xfcncyan",hue:"Farbton",light:"helles",lightness:"Leuchtkraft",magenta:"Magenta","magenta pink":"Magentarosa",orange:"Orange","orange yellow":"Orangegelb",pale:"blasses",pink:"Rosa","pink red":"Rosarot",purple:"Lila","purple magenta":"Lilamagenta",red:"Rot","red orange":"Rotorange",saturation:"S\xe4ttigung",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, zu ${e.percentTransparent} transparent`,"very dark":"sehr dunkles","very light":"sehr helles",vibrant:"lebhaftes",white:"Wei\xdf",yellow:"Gelb","yellow green":"Gelbgr\xfcn"},BS={alpha:"\u0386\u03bb\u03c6\u03b1",black:"\u03bc\u03b1\u03cd\u03c1\u03bf",blue:"\u039c\u03c0\u03bb\u03b5","blue purple":"\u03bc\u03c0\u03bb\u03b5 \u03bc\u03c9\u03b2",brightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",brown:"\u03ba\u03b1\u03c6\u03ad","brown yellow":"\u03ba\u03b1\u03c6\u03ad \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u03ba\u03c5\u03b1\u03bd\u03cc","cyan blue":"\u03ba\u03c5\u03b1\u03bd\u03cc \u03bc\u03c0\u03bb\u03b5",dark:"\u03c3\u03ba\u03bf\u03cd\u03c1\u03bf",gray:"\u03b3\u03ba\u03c1\u03b9",grayish:"\u03b3\u03ba\u03c1\u03b9\u03b6\u03c9\u03c0\u03cc",green:"\u03a0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf","green cyan":"\u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf \u03ba\u03c5\u03b1\u03bd\u03cc",hue:"\u03a4\u03cc\u03bd\u03bf\u03c2",light:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",lightness:"\u03a6\u03c9\u03c4\u03b5\u03b9\u03bd\u03cc\u03c4\u03b7\u03c4\u03b1",magenta:"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1","magenta pink":"\u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1 \u03c1\u03bf\u03b6",orange:"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af","orange yellow":"\u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af \u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf",pale:"\u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",pink:"\u03c1\u03bf\u03b6","pink red":"\u03c1\u03bf\u03b6 \u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf",purple:"\u03bc\u03c9\u03b2","purple magenta":"\u03bc\u03c9\u03b2 \u03bc\u03b1\u03c4\u03b6\u03ad\u03bd\u03c4\u03b1",red:"\u039a\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf","red orange":"\u03ba\u03cc\u03ba\u03ba\u03b9\u03bd\u03bf \u03c0\u03bf\u03c1\u03c4\u03bf\u03ba\u03b1\u03bb\u03af",saturation:"\u039a\u03bf\u03c1\u03b5\u03c3\u03bc\u03cc\u03c2",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u03b4\u03b9\u03b1\u03c6\u03b1\u03bd\u03ad\u03c2`,"very dark":"\u03c0\u03bf\u03bb\u03cd \u03c3\u03ba\u03bf\u03cd\u03c1\u03bf","very light":"\u03c0\u03bf\u03bb\u03cd \u03b1\u03bd\u03bf\u03b9\u03c7\u03c4\u03cc",vibrant:"\u03ad\u03bd\u03c4\u03bf\u03bd\u03bf",white:"\u03bb\u03b5\u03c5\u03ba\u03cc",yellow:"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf","yellow green":"\u03ba\u03af\u03c4\u03c1\u03b9\u03bd\u03bf \u03c0\u03c1\u03ac\u03c3\u03b9\u03bd\u03bf"},VS={hue:"Hue",saturation:"Saturation",lightness:"Lightness",brightness:"Brightness",red:"Red",green:"Green",blue:"Blue",alpha:"Alpha",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"very dark",dark:"dark",light:"light","very light":"very light",pale:"pale",grayish:"grayish",vibrant:"vibrant",black:"black",white:"white",gray:"gray",pink:"pink","pink red":"pink red","red orange":"red orange",brown:"brown",orange:"orange","orange yellow":"orange yellow","brown yellow":"brown yellow",yellow:"yellow","yellow green":"yellow green","green cyan":"green cyan",cyan:"cyan","cyan blue":"cyan blue","blue purple":"blue purple",purple:"purple","purple magenta":"purple magenta",magenta:"magenta","magenta pink":"magenta pink"},US={alpha:"Alpha",black:"negro",blue:"Azul","blue purple":"p\xfarpura azulado",brightness:"Brillo",brown:"marr\xf3n","brown yellow":"amarillo amarronado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"azul cian",dark:"oscuro",gray:"gris",grayish:"gris\xe1ceo",green:"Verde","green cyan":"cian verdoso",hue:"Tono",light:"claro",lightness:"Luminosidad",magenta:"magenta","magenta pink":"rosa magenta",orange:"naranja","orange yellow":"amarillo anaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rojo rosado",purple:"morado","purple magenta":"magenta viol\xe1ceo",red:"Rojo","red orange":"naranja rojizo",saturation:"Saturaci\xf3n",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muy oscuro","very light":"muy claro",vibrant:"intenso",white:"blanco",yellow:"amarillo","yellow green":"verde amarillento"},WS={alpha:"Alfa",black:"must",blue:"Sinine","blue purple":"sinakaslilla",brightness:"Heledus",brown:"pruun","brown yellow":"pruunikaskollane",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ts\xfcaan","cyan blue":"ts\xfcaansinine",dark:"tume",gray:"hall",grayish:"hallikas",green:"Roheline","green cyan":"ts\xfcaanroheline",hue:"V\xe4rv",light:"valgus",lightness:"Valgus",magenta:"magentapunane","magenta pink":"magentaroosa",orange:"oran\u017e","orange yellow":"oran\u017eikaskollane",pale:"kahvatu",pink:"roosa","pink red":"vaarikapunane",purple:"lilla","purple magenta":"purpurne magenta",red:"Punane","red orange":"punakasoran\u017e",saturation:"K\xfcllastus",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4bipaistev`,"very dark":"v\xe4ga tume","very light":"v\xe4ga hele",vibrant:"ere",white:"valge",yellow:"kollane","yellow green":"kollakasroheline"},HS={alpha:"Alpha",black:"musta",blue:"Sininen","blue purple":"sinivioletti",brightness:"Kirkkaus",brown:"ruskea","brown yellow":"ruskeankeltainen",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"syaani","cyan blue":"syaaninsininen",dark:"tumma",gray:"harmaa",grayish:"harmahtava",green:"Vihre\xe4","green cyan":"vihre\xe4nsyaani",hue:"S\xe4vy",light:"vaalea",lightness:"Valom\xe4\xe4r\xe4",magenta:"magenta","magenta pink":"magentapinkki",orange:"oranssi","orange yellow":"oranssinkeltainen",pale:"vaalea",pink:"pinkki","pink red":"vaaleanpunainen",purple:"violetti","purple magenta":"violettimagenta",red:"Punainen","red orange":"punaoranssi",saturation:"V\xe4rikyll\xe4isyys",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} l\xe4pin\xe4kyv\xe4`,"very dark":"hyvin tumma","very light":"eritt\xe4in vaalea",vibrant:"eloisa",white:"valkea",yellow:"keltainen","yellow green":"keltavihre\xe4"},$S={alpha:"Alpha",black:"Noir",blue:"Bleu","blue purple":"Violet bleu",brightness:"Luminosit\xe9",brown:"Brun","brown yellow":"Jaune brun",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"Cyan","cyan blue":"Bleu cyan",dark:"Sombre",gray:"Gris",grayish:"Gris\xe2tre",green:"Vert","green cyan":"Cyan vert",hue:"Teinte",light:"Clair",lightness:"Luminosit\xe9",magenta:"Magenta","magenta pink":"Rose magenta",orange:"Orange","orange yellow":"Jaune orang\xe9",pale:"P\xe2le",pink:"Rose","pink red":"Rouge ros\xe9",purple:"Violet","purple magenta":"Magenta violet",red:"Rouge","red orange":"Orange rouge",saturation:"Saturation",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"Tr\xe8s sombre","very light":"Tr\xe8s clair",vibrant:"Vif",white:"Blanc",yellow:"Jaune","yellow green":"Vert jaune"},GS={alpha:"\u05d0\u05dc\u05e4\u05d0",black:"\u05e9\u05d7\u05d5\u05e8",blue:"\u05db\u05d7\u05d5\u05dc","blue purple":"\u05db\u05d7\u05d5\u05dc \u05e1\u05d2\u05d5\u05dc",brightness:"\u05d1\u05d4\u05d9\u05e8\u05d5\u05ea",brown:"\u05d7\u05d5\u05dd","brown yellow":"\u05d7\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u05d8\u05d5\u05e8\u05e7\u05d9\u05d6","cyan blue":"\u05db\u05d7\u05d5\u05dc \u05e6\u05d9\u05d0\u05df",dark:"\u05db\u05d4\u05d4",gray:"\u05d0\u05e4\u05d5\u05e8",grayish:"\u05d0\u05e4\u05e8\u05e4\u05e8",green:"\u05d9\u05e8\u05d5\u05e7","green cyan":"\u05e6\u05d9\u05d0\u05df \u05d9\u05e8\u05d5\u05e7",hue:"\u05d2\u05d5\u05d5\u05df",light:"\u05d0\u05d5\u05e8",lightness:"\u05db\u05de\u05d5\u05ea \u05d0\u05d5\u05e8",magenta:"\u05de\u05d2'\u05e0\u05d8\u05d4","magenta pink":"\u05d5\u05e8\u05d5\u05d3 \u05de\u05d2'\u05e0\u05d8\u05d4",orange:"\u05db\u05ea\u05d5\u05dd","orange yellow":"\u05db\u05ea\u05d5\u05dd \u05e6\u05d4\u05d5\u05d1",pale:"\u05d7\u05d9\u05d5\u05d5\u05e8",pink:"\u05d5\u05e8\u05d5\u05d3","pink red":"\u05d5\u05e8\u05d5\u05d3 \u05d0\u05d3\u05d5\u05dd",purple:"\u05e1\u05d2\u05d5\u05dc","purple magenta":"\u05de\u05d2'\u05e0\u05d8\u05d4 \u05e1\u05d2\u05d5\u05dc",red:"\u05d0\u05d3\u05d5\u05dd","red orange":"\u05db\u05ea\u05d5\u05dd \u05d0\u05d3\u05d5\u05dd",saturation:"\u05e8\u05d5\u05d5\u05d9\u05d4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u05e9\u05e7\u05d5\u05e3`,"very dark":"\u05db\u05d4\u05d4 \u05de\u05d0\u05d5\u05d3","very light":"\u05d1\u05d4\u05d9\u05e8 \u05de\u05d0\u05d5\u05d3",vibrant:"\u05ea\u05d5\u05e1\u05e1",white:"\u05dc\u05d1\u05df",yellow:"\u05e6\u05d4\u05d5\u05d1","yellow green":"\u05e6\u05d4\u05d5\u05d1 \u05d9\u05e8\u05d5\u05e7"},YS={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavo ljubi\u010dasta",brightness:"Svjetlina",brown:"sme\u0111a","brown yellow":"sme\u0111e \u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasto",green:"Zelena","green cyan":"zelena cijan",hue:"Nijansa",light:"svjetlo",lightness:"Osvijetljenost",magenta:"magenta","magenta pink":"magentno ru\u017ei\u010dasta",orange:"naran\u010dasta","orange yellow":"naran\u010dasto \u017euta",pale:"blijeda",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dasto crvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crveno naran\u010dasta",saturation:"Zasi\u0107enost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirnosti`,"very dark":"jako tamna","very light":"vrlo svijetlo",vibrant:"vibrantna",white:"bijela",yellow:"\u017euto","yellow green":"\u017euto zelena"},qS={alpha:"Alfa",black:"fekete",blue:"K\xe9k","blue purple":"k\xe9k lila",brightness:"F\xe9nyess\xe9g",brown:"barna","brown yellow":"barna s\xe1rga",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\xe1nk\xe9k","cyan blue":"ci\xe1nk\xe9k",dark:"s\xf6t\xe9t",gray:"sz\xfcrke",grayish:"sz\xfcrk\xe9s",green:"Z\xf6ld","green cyan":"z\xf6ld ci\xe1nk\xe9k",hue:"Sz\xedn\xe1rnyalat",light:"vil\xe1gos",lightness:"Vil\xe1goss\xe1g",magenta:"b\xedbor","magenta pink":"b\xedbor r\xf3zsasz\xedn",orange:"narancs","orange yellow":"narancss\xe1rga",pale:"halv\xe1ny",pink:"r\xf3zsasz\xedn","pink red":"r\xf3zsasz\xedn piros",purple:"lila","purple magenta":"lila b\xedbor",red:"Piros","red orange":"piros narancs",saturation:"Tel\xedtetts\xe9g",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \xe1tl\xe1tsz\xf3`,"very dark":"nagyon s\xf6t\xe9t","very light":"nagyon vil\xe1gos",vibrant:"\xe9l\xe9nk",white:"feh\xe9r",yellow:"s\xe1rga","yellow green":"s\xe1rga z\xf6ld"},XS={alpha:"Alfa",black:"nero",blue:"Blu","blue purple":"blu viola",brightness:"Luminosit\xe0",brown:"marrone","brown yellow":"giallo bruno",colorName:e=>`${e.hue} ${e.chroma} ${e.lightness}`,cyan:"ciano","cyan blue":"blu ciano",dark:"scuro",gray:"grigio",grayish:"grigiastro",green:"Verde","green cyan":"verde ciano",hue:"Tonalit\xe0",light:"chiaro",lightness:"Luminosit\xe0",magenta:"magenta","magenta pink":"rosa magenta",orange:"arancio","orange yellow":"giallo arancio",pale:"tenue",pink:"rosa","pink red":"rosa rosso",purple:"viola","purple magenta":"viola magenta",red:"Rosso","red orange":"rosso arancio",saturation:"Saturazione",transparentColorName:e=>`${e.hue} ${e.chroma} ${e.lightness}, trasparenza ${e.percentTransparent}`,"very dark":"molto scuro","very light":"molto chiaro",vibrant:"vivace",white:"bianco",yellow:"giallo","yellow green":"giallo verde"},KS={alpha:"\u30a2\u30eb\u30d5\u30a1",black:"\u30d6\u30e9\u30c3\u30af",blue:"\u9752","blue purple":"\u30d6\u30eb\u30fc\u30d1\u30fc\u30d7\u30eb",brightness:"\u660e\u308b\u3055",brown:"\u30d6\u30e9\u30a6\u30f3","brown yellow":"\u30d6\u30e9\u30a6\u30f3\u30a4\u30a8\u30ed\u30fc",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u30b7\u30a2\u30f3","cyan blue":"\u30b7\u30a2\u30f3\u30d6\u30eb\u30fc",dark:"\u30c0\u30fc\u30af",gray:"\u30b0\u30ec\u30fc",grayish:"\u30b0\u30ec\u30a4\u30c3\u30b7\u30e5",green:"\u7dd1","green cyan":"\u30b0\u30ea\u30fc\u30f3\u30b7\u30a2\u30f3",hue:"\u8272\u76f8",light:"\u30e9\u30a4\u30c8",lightness:"\u660e\u5ea6",magenta:"\u30de\u30bc\u30f3\u30bf","magenta pink":"\u30de\u30bc\u30f3\u30bf\u30d4\u30f3\u30af",orange:"\u30aa\u30ec\u30f3\u30b8","orange yellow":"\u30aa\u30ec\u30f3\u30b8\u30a4\u30a8\u30ed\u30fc",pale:"\u30da\u30fc\u30eb",pink:"\u30d4\u30f3\u30af","pink red":"\u30d4\u30f3\u30af\u30ec\u30c3\u30c9",purple:"\u30d1\u30fc\u30d7\u30eb","purple magenta":"\u30d1\u30fc\u30d7\u30eb\u30de\u30bc\u30f3\u30bf",red:"\u8d64","red orange":"\u30ec\u30c3\u30c9\u30aa\u30ec\u30f3\u30b8",saturation:"\u5f69\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u6700\u3082\u6697\u3044","very light":"\u30d9\u30ea\u30fc\u30e9\u30a4\u30c8",vibrant:"\u9bae\u3084\u304b",white:"\u30db\u30ef\u30a4\u30c8",yellow:"\u30a4\u30a8\u30ed\u30fc","yellow green":"\u30a4\u30a8\u30ed\u30fc\u30b0\u30ea\u30fc\u30f3"},ZS={alpha:"\uc54c\ud30c",black:"\uac80\uc740\uc0c9",blue:"\ud30c\ub791","blue purple":"\uccad\uc790\uc0c9",brightness:"\uba85\ub3c4",brown:"\uac08\uc0c9","brown yellow":"\ud669\uac08\uc0c9",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\uccad\ub85d\uc0c9","cyan blue":"\uccad\ub85d\uc0c9",dark:"\ub2e4\ud06c",gray:"\ud68c\uc0c9",grayish:"\ud68c\uac08\uc0c9",green:"\ucd08\ub85d","green cyan":"\uccad\ub85d\uc0c9",hue:"\uc0c9\uc870",light:"\ub77c\uc774\ud2b8",lightness:"\ubc1d\uae30",magenta:"\uc790\ud64d\uc0c9","magenta pink":"\ub9c8\uc820\ud0c0 \ud551\ud06c",orange:"\uc8fc\ud669\uc0c9","orange yellow":"\ubd88\uadf8\uc2a4\ub984\ud55c \ub178\ub791",pale:"\ud759\uc0c9",pink:"\ubd84\ud64d\uc0c9","pink red":"\ud551\ud06c \ub808\ub4dc",purple:"\uc790\uc8fc\uc0c9","purple magenta":"\ubcf4\ub77c\ube5b \uc790\ud64d\uc0c9",red:"\ube68\uac15","red orange":"\ubd89\uc740 \uc8fc\ud669\uc0c9",saturation:"\ucc44\ub3c4",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \ud22c\uba85\ub3c4`,"very dark":"\ub9e4\uc6b0 \uc5b4\ub450\uc6b4","very light":"\ub9e4\uc6b0 \uc5f0\ud568",vibrant:"\uac15\ub82c\ud55c",white:"\ud770\uc0c9",yellow:"\ub178\ub780\uc0c9","yellow green":"\uc5f0\ub450\uc0c9"},JS={alpha:"Alfa",black:"juoda",blue:"M\u0117lyna","blue purple":"melsvai violetin\u0117",brightness:"Ry\u0161kumas",brown:"ruda","brown yellow":"rusvai geltona",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u017ealsvai m\u0117lyna","cyan blue":"\u017ealsvai m\u0117lyna",dark:"tamsi",gray:"pilka",grayish:"pilk\u0161va",green:"\u017dalia","green cyan":"\u017ealsvai m\u0117lyna",hue:"Atspalvis",light:"\u0161viesi",lightness:"\u0160viesumas",magenta:"rausvai raudona","magenta pink":"purpurin\u0117",orange:"oran\u017ein\u0117","orange yellow":"oran\u017einio atspalvio geltona",pale:"bly\u0161ki",pink:"ro\u017ein\u0117","pink red":"ro\u017ein\u0117 raudona",purple:"violetin\u0117","purple magenta":"purpurin\u0117 rausvai raudona",red:"Raudona","red orange":"rausvai oran\u017ein\u0117",saturation:"\u012esotinimas",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} skaidri`,"very dark":"labai tamsi","very light":"labai \u0161viesi",vibrant:"ry\u0161ki",white:"balta",yellow:"geltona","yellow green":"gelsvai \u017ealia"},QS={alpha:"Alfa",black:"melns",blue:"Zila","blue purple":"zili violets",brightness:"Spilgtums",brown:"br\u016bns","brown yellow":"br\u016bni dzeltens",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ci\u0101ns","cyan blue":"ci\u0101na zils",dark:"tum\u0161s",gray:"pel\u0113ks",grayish:"pel\u0113c\u012bgs",green:"Za\u013ca","green cyan":"za\u013c\u0161 ci\u0101ns",hue:"Nokr\u0101sa",light:"gai\u0161s",lightness:"Gai\u0161ums",magenta:"fuksiju","magenta pink":"fuksiju roz\u0101",orange:"oran\u017es","orange yellow":"oran\u017ei dzeltens",pale:"b\u0101ls",pink:"roz\u0101","pink red":"roz\u012bgi sarkans",purple:"violets","purple magenta":"violets fuksiju",red:"Sarkana","red orange":"sarkan\u012bgi oran\u017es",saturation:"Pies\u0101tin\u0101jums",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} caursp\u012bd\u012bgs`,"very dark":"\u013coti tum\u0161s","very light":"\u013coti gai\u0161s",vibrant:"ko\u0161s",white:"balts",yellow:"dzeltens","yellow green":"dzelteni za\u013c\u0161"},ek={alpha:"Alfa",black:"svart",blue:"Bl\xe5","blue purple":"bl\xe5lilla",brightness:"Lysstyrke",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf8rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf8nn","green cyan":"gr\xf8nncyan",hue:"Fargetone",light:"lys",lightness:"Lyshet",magenta:"magenta","magenta pink":"magentarosa",orange:"oransje","orange yellow":"oransjegul",pale:"blek",pink:"rosa","pink red":"rosar\xf8d",purple:"lilla","purple magenta":"lillamagenta",red:"R\xf8d","red orange":"r\xf8doransje",saturation:"Metning",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} gjennomsiktig`,"very dark":"sv\xe6rt m\xf8rk","very light":"sv\xe6rt lys",vibrant:"levende",white:"hvit",yellow:"gul","yellow green":"gulgr\xf8nn"},tk={alpha:"Alfa",black:"zwart",blue:"Blauw","blue purple":"paarsblauw",brightness:"Helderheid",brown:"bruin","brown yellow":"bruingeel",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyaan","cyan blue":"cyaanblauw",dark:"donker",gray:"grijs",grayish:"grijsachtig",green:"Groen","green cyan":"cyaangroen",hue:"Kleurtoon",light:"licht",lightness:"Lichtsterkte",magenta:"magenta","magenta pink":"magentaroze",orange:"oranje","orange yellow":"oranjegeel",pale:"bleek",pink:"roze","pink red":"rozerood",purple:"paars","purple magenta":"magentapaars",red:"Rood","red orange":"roodoranje",saturation:"Verzadiging",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparant`,"very dark":"heel donker","very light":"heel licht",vibrant:"levendig",white:"wit",yellow:"geel","yellow green":"geelgroen"},nk={alpha:"Alfa",black:"czarny",blue:"Niebieski","blue purple":"niebiesko-fioletowy",brightness:"Jasno\u015b\u0107",brown:"br\u0105zowy","brown yellow":"br\u0105zowo-\u017c\xf3\u0142ty",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyjanowy","cyan blue":"cyjanowo-niebieski",dark:"ciemny",gray:"szary",grayish:"szarawy",green:"Zielony","green cyan":"zielono-cyjanowy",hue:"Odcie\u0144",light:"jasny",lightness:"Jaskrawo\u015b\u0107",magenta:"purpurowy","magenta pink":"purpurowo-r\xf3\u017cowy",orange:"pomara\u0144czowy","orange yellow":"pomara\u0144czowo-\u017c\xf3\u0142ty",pale:"blady",pink:"r\xf3\u017cowy","pink red":"r\xf3\u017cowo-czerwony",purple:"fioletowy","purple magenta":"fioletowo-purpurowy",red:"Czerwony","red orange":"czerwono-pomara\u0144czowy",saturation:"Nasycenie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} przezroczysto\u015bci`,"very dark":"bardzo ciemny","very light":"bardzo jasny",vibrant:"intensywny",white:"bia\u0142y",yellow:"\u017c\xf3\u0142ty","yellow green":"\u017c\xf3\u0142to-zielony"},rk={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"roxo azulado",brightness:"Brilho",brown:"marrom","brown yellow":"marrom amarelado",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinza",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Matiz",light:"claro",lightness:"Luminosidade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo alaranjado",pale:"p\xe1lido",pink:"rosa","pink red":"rosa avermelhado",purple:"roxo","purple magenta":"roxo-magenta",red:"Vermelho","red orange":"laranja avermelhado",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde amarelado"},ik={alpha:"Alfa",black:"preto",blue:"Azul","blue purple":"azul-p\xfarpura",brightness:"Luminosidade",brown:"castanho","brown yellow":"amarelo-castanho",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"ciano","cyan blue":"azul-ciano",dark:"escuro",gray:"cinzento",grayish:"acinzentado",green:"Verde","green cyan":"verde-ciano",hue:"Tonalidade",light:"claro",lightness:"Claridade",magenta:"magenta","magenta pink":"rosa-magenta",orange:"laranja","orange yellow":"amarelo-laranja",pale:"p\xe1lido",pink:"cor-de-rosa","pink red":"vermelho-rosa",purple:"p\xfarpura","purple magenta":"p\xfarpura-magenta",red:"Vermelho","red orange":"laranja-vermelho",saturation:"Satura\xe7\xe3o",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparente`,"very dark":"muito escuro","very light":"muito claro",vibrant:"vibrante",white:"branco",yellow:"amarelo","yellow green":"verde-amarelo"},ok={alpha:"Alfa",black:"negru",blue:"Albastru","blue purple":"albastru-violet",brightness:"Luminozitate",brown:"maro","brown yellow":"galben maro",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"bleu","cyan blue":"albastru-bleu",dark:"\xeenchis",gray:"gri",grayish:"cenu\u0219iu",green:"Verde","green cyan":"verde bleu",hue:"Nuan\u021b\u0103",light:"deschis",lightness:"Luminozitate",magenta:"fucsia","magenta pink":"roz-fucsia",orange:"portocaliu","orange yellow":"galben-portocaliu",pale:"pal",pink:"roz","pink red":"roz-ro\u0219u",purple:"violet","purple magenta":"violet-fucsia",red:"Ro\u0219u","red orange":"portocaliu-ro\u0219u",saturation:"Satura\u021bie",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} transparent`,"very dark":"foarte \xeenchis","very light":"foarte deschis",vibrant:"plin de via\u021b\u0103",white:"alb",yellow:"galben","yellow green":"galben-verde"},ak={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u0435\u0440\u043d\u044b\u0439",blue:"\u0421\u0438\u043d\u0438\u0439","blue purple":"\u0441\u0438\u043d\u0435-\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439",brightness:"\u042f\u0440\u043a\u043e\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u044b\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0433\u043e\u043b\u0443\u0431\u043e\u0439","cyan blue":"\u0446\u0432\u0435\u0442 \u043c\u043e\u0440\u0441\u043a\u043e\u0439 \u0432\u043e\u043b\u043d\u044b",dark:"\u0442\u0435\u043c\u043d\u044b\u0439",gray:"\u0441\u0435\u0440\u044b\u0439",grayish:"\u0441\u0435\u0440\u043e\u0432\u0430\u0442\u044b\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u044b\u0439","green cyan":"\u0441\u0438\u043d\u0435-\u0437\u0435\u043b\u0435\u043d\u044b\u0439",hue:"\u041e\u0442\u0442\u0435\u043d\u043e\u043a",light:"\u0441\u0432\u0435\u0442\u043b\u044b\u0439",lightness:"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u043e-\u0440\u043e\u0437\u043e\u0432\u044b\u0439",orange:"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439","orange yellow":"\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u043e-\u0436\u0435\u043b\u0442\u044b\u0439",pale:"\u0431\u043b\u0435\u0434\u043d\u044b\u0439",pink:"\u0440\u043e\u0437\u043e\u0432\u044b\u0439","pink red":"\u0440\u043e\u0437\u043e\u0432\u043e-\u043a\u0440\u0430\u0441\u043d\u044b\u0439",purple:"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u044b\u0439","purple magenta":"\u0444\u0438\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043d\u044b\u0439",red:"\u041a\u0440\u0430\u0441\u043d\u044b\u0439","red orange":"\u043a\u0440\u0430\u0441\u043d\u043e-\u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u0439",saturation:"\u041d\u0430\u0441\u044b\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u043e\u0447\u0435\u043d\u044c \u0442\u0435\u043c\u043d\u044b\u0439","very light":"\u043e\u0447\u0435\u043d\u044c \u0441\u0432\u0435\u0442\u043b\u044b\u0439",vibrant:"\u044f\u0440\u043a\u0438\u0439",white:"\u0431\u0435\u043b\u044b\u0439",yellow:"\u0436\u0435\u043b\u0442\u044b\u0439","yellow green":"\u0436\u0435\u043b\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u044b\u0439"},sk={alpha:"Alfa",black:"\u010dierna",blue:"Modr\xe1","blue purple":"modrofialov\xe1",brightness:"Jas",brown:"hned\xe1","brown yellow":"hnedo\u017elt\xe1",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"az\xfarov\xe1","cyan blue":"az\xfarov\xe1 modr\xe1",dark:"tmav\xe1",gray:"siv\xe1",grayish:"sivast\xe1",green:"Zelen\xe1","green cyan":"zelen\xe1 az\xfarov\xe1",hue:"Odtie\u0148",light:"svetl\xe1",lightness:"Svetlos\u0165",magenta:"purpurov\xe1","magenta pink":"ru\u017eov\xe1 purpurov\xe1",orange:"oran\u017eov\xe1","orange yellow":"oran\u017eovo\u017elt\xe1",pale:"bled\xe1",pink:"ru\u017eov\xe1","pink red":"ru\u017eovo\u010derven\xe1",purple:"fialov\xe1","purple magenta":"fialov\xe1 purpurov\xe1",red:"\u010cerven\xe1","red orange":"\u010dervenooran\u017eov\xe1",saturation:"S\xfdtos\u0165",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prieh\u013eadn\xe1`,"very dark":"ve\u013emi tmav\xe1","very light":"ve\u013emi svetl\xe1",vibrant:"energick\xe1",white:"biela",yellow:"\u017elt\xe1","yellow green":"\u017eltozelen\xe1"},lk={alpha:"Alfa",black:"\u010drna",blue:"Modra","blue purple":"modro vijoli\u010dna",brightness:"Svetlost",brown:"rjava","brown yellow":"rjavo rumena",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cian","cyan blue":"cian modra",dark:"temna",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zelena cian",hue:"Barva",light:"svetla",lightness:"Lahkost",magenta:"\u0161krlatna","magenta pink":"\u0161krlatno roza",orange:"oran\u017ena","orange yellow":"oran\u017eno rumena",pale:"bleda",pink:"roza","pink red":"roza rde\u010da",purple:"vijoli\u010dna","purple magenta":"vijoli\u010dno \u0161krlatna",red:"Rde\u010da","red orange":"rde\u010de oran\u017ena",saturation:"Nasi\u010denost",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozorna`,"very dark":"zelo temna","very light":"zelo svetla",vibrant:"\u017eivahna",white:"bela",yellow:"rumena","yellow green":"rumeno zelena"},ck={alpha:"Alfa",black:"crno",blue:"Plava","blue purple":"plavoljubi\u010dasta",brightness:"Osvetljenost",brown:"sme\u0111a","brown yellow":"sme\u0111e\u017euta",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cijan","cyan blue":"cijan plava",dark:"tamno",gray:"siva",grayish:"sivkasta",green:"Zelena","green cyan":"zeleno cijan",hue:"Nijansa",light:"svetla",lightness:"Osvetljenje",magenta:"purpurnocrvena","magenta pink":"magenta ru\u017ei\u010dasta",orange:"narand\u017easta","orange yellow":"narand\u017easto\u017euta",pale:"bledo",pink:"ru\u017ei\u010dasta","pink red":"ru\u017ei\u010dastocrvena",purple:"ljubi\u010dasta","purple magenta":"ljubi\u010dasta magenta",red:"Crvena","red orange":"crvenonarand\u017easta",saturation:"Zasi\u0107enje",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} prozirna`,"very dark":"veoma tamno","very light":"vrlo svetlo",vibrant:"\u017eivopisna",white:"bela",yellow:"\u017euto","yellow green":"\u017eutozelena"},uk={alpha:"Alfa",black:"svart",blue:"Bl\xe5tt","blue purple":"bl\xe5lila",brightness:"Ljusstyrka",brown:"brun","brown yellow":"brungul",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"cyan","cyan blue":"cyanbl\xe5",dark:"m\xf6rk",gray:"gr\xe5",grayish:"gr\xe5aktig",green:"Gr\xf6nt","green cyan":"gr\xf6n cyan",hue:"Nyans",light:"ljus",lightness:"Ljushet",magenta:"magenta","magenta pink":"magentarosa",orange:"orange","orange yellow":"orangegul",pale:"blek",pink:"rosa","pink red":"rosar\xf6d",purple:"lila","purple magenta":"lila magenta",red:"R\xf6tt","red orange":"r\xf6dorange",saturation:"M\xe4ttnad",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} genomskinlig`,"very dark":"mycket m\xf6rk","very light":"mycket ljus",vibrant:"livfull",white:"vit",yellow:"gul","yellow green":"gulgr\xf6n"},dk={alpha:"Alfa",black:"siyah",blue:"Mavi","blue purple":"mavi mor",brightness:"Parlakl\u0131k",brown:"kahverengi","brown yellow":"kahverengi sar\u0131",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"camg\xf6be\u011fi","cyan blue":"camg\xf6be\u011fi mavi",dark:"koyu",gray:"gri",grayish:"grimsi",green:"Ye\u015fil","green cyan":"ye\u015fil camg\xf6be\u011fi",hue:"Ton",light:"a\xe7\u0131k",lightness:"Canl\u0131l\u0131k",magenta:"eflatun","magenta pink":"eflatun pembe",orange:"turuncu","orange yellow":"turuncu sar\u0131",pale:"solgun",pink:"pembe","pink red":"pembe k\u0131rm\u0131z\u0131",purple:"mor","purple magenta":"mor eflatun",red:"K\u0131rm\u0131z\u0131","red orange":"k\u0131rm\u0131z\u0131 portakal",saturation:"Doygunluk",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} saydam`,"very dark":"\xe7ok koyu","very light":"\xe7ok a\xe7\u0131k",vibrant:"canl\u0131",white:"beyaz",yellow:"sar\u0131","yellow green":"sar\u0131 ye\u015fil"},hk={alpha:"\u0410\u043b\u044c\u0444\u0430",black:"\u0447\u043e\u0440\u043d\u0438\u0439",blue:"\u0421\u0438\u043d\u0456\u0439","blue purple":"\u0441\u0438\u043d\u044c\u043e-\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439",brightness:"\u042f\u0441\u043a\u0440\u0430\u0432\u0456\u0441\u0442\u044c",brown:"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u0438\u0439","brown yellow":"\u043a\u043e\u0440\u0438\u0447\u043d\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439","cyan blue":"\u0441\u0438\u043d\u044c\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",dark:"\u0442\u0435\u043c\u043d\u0438\u0439",gray:"\u0441\u0456\u0440\u0438\u0439",grayish:"\u0441\u0456\u0440\u0443\u0432\u0430\u0442\u0438\u0439",green:"\u0417\u0435\u043b\u0435\u043d\u0438\u0439","green cyan":"\u0437\u0435\u043b\u0435\u043d\u043e-\u0431\u043b\u0430\u043a\u0438\u0442\u043d\u0438\u0439",hue:"\u0422\u043e\u043d",light:"\u0441\u0432\u0456\u0442\u043b\u0438\u0439",lightness:"\u041e\u0441\u0432\u0456\u0442\u043b\u0435\u043d\u0456\u0441\u0442\u044c",magenta:"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439","magenta pink":"\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u043e-\u0440\u043e\u0436\u0435\u0432\u0438\u0439",orange:"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439","orange yellow":"\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u043e-\u0436\u043e\u0432\u0442\u0438\u0439",pale:"\u0431\u043b\u0456\u0434\u0438\u0439",pink:"\u0440\u043e\u0436\u0435\u0432\u0438\u0439","pink red":"\u0440\u043e\u0436\u0435\u0432\u043e-\u0447\u0435\u0440\u0432\u043e\u043d\u0438\u0439",purple:"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u0438\u0439","purple magenta":"\u0444\u0456\u043e\u043b\u0435\u0442\u043e\u0432\u043e-\u043f\u0443\u0440\u043f\u0443\u0440\u043e\u0432\u0438\u0439",red:"\u0427\u0435\u0440\u0432\u043e\u043d\u0438\u0439","red orange":"\u0447\u0435\u0440\u0432\u043e\u043d\u043e-\u043f\u043e\u043c\u0430\u0440\u0430\u043d\u0447\u0435\u0432\u0438\u0439",saturation:"\u041d\u0430\u0441\u0438\u0447\u0435\u043d\u0456\u0441\u0442\u044c",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, \u043f\u0440\u043e\u0437\u043e\u0440\u0438\u0439 \u043d\u0430 ${e.percentTransparent}`,"very dark":"\u0434\u0443\u0436\u0435 \u0442\u0435\u043c\u043d\u0438\u0439","very light":"\u0434\u0443\u0436\u0435 \u0441\u0432\u0456\u0442\u043b\u0438\u0439",vibrant:"\u044f\u0441\u043a\u0440\u0430\u0432\u0438\u0439",white:"\u0431\u0456\u043b\u0438\u0439",yellow:"\u0436\u043e\u0432\u0442\u0438\u0439","yellow green":"\u0436\u043e\u0432\u0442\u043e-\u0437\u0435\u043b\u0435\u043d\u0438\u0439"},fk={alpha:"Alpha",black:"\u9ed1\u8272",blue:"\u84dd\u8272","blue purple":"\u84dd\u7d2b\u8272",brightness:"\u4eae\u5ea6",brown:"\u68d5\u8272\u7684","brown yellow":"\u68d5\u9ec4\u8272",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u84dd\u7eff\u8272","cyan blue":"\u9752\u84dd\u8272",dark:"\u6df1\u8272",gray:"\u7070\u8272",grayish:"\u6d45\u7070\u8272\u7684",green:"\u7eff\u8272","green cyan":"\u7eff\u9752\u8272",hue:"\u8272\u76f8",light:"\u6d45\u8272",lightness:"\u660e\u4eae\u5ea6",magenta:"\u7d2b\u7ea2\u8272","magenta pink":"\u7d2b\u7c89\u8272",orange:"\u6a59\u8272","orange yellow":"\u6a59\u9ec4\u8272",pale:"\u82cd\u767d\u7684",pink:"\u7c89\u8272","pink red":"\u7c89\u7ea2\u8272",purple:"\u7d2b\u8272","purple magenta":"\u7d2b\u6d0b\u7ea2\u8272",red:"\u7ea2\u8272","red orange":"\u7ea2\u6a59\u8272",saturation:"\u9971\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6d45",vibrant:"\u751f\u673a\u52c3\u52c3",white:"\u767d\u8272",yellow:"\u9ec4\u8272","yellow green":"\u9ec4\u8272/\u7eff\u8272"},pk={alpha:"Alpha",black:"\u9ed1",blue:"\u85cd\u8272","blue purple":"\u85cd\u7d2b",brightness:"\u4eae\u5ea6",brown:"\u68d5","brown yellow":"\u68d5\u9ec3",colorName:e=>`${e.lightness} ${e.chroma} ${e.hue}`,cyan:"\u9752","cyan blue":"\u9752\u85cd",dark:"\u6697",gray:"\u7070",grayish:"\u504f\u7070",green:"\u7da0\u8272","green cyan":"\u9752\u7da0",hue:"\u8272\u76f8",light:"\u6dfa",lightness:"\u660e\u4eae",magenta:"\u6d0b\u7d05","magenta pink":"\u6dfa\u6d0b\u7d05",orange:"\u6a59","orange yellow":"\u6a59\u9ec3",pale:"\u6de1",pink:"\u7c89\u7d05","pink red":"\u7c89\u7d05",purple:"\u7d2b","purple magenta":"\u7d2b\u6d0b\u7d05",red:"\u7d05\u8272","red orange":"\u6a59\u7d05",saturation:"\u98fd\u548c\u5ea6",transparentColorName:e=>`${e.lightness} ${e.chroma} ${e.hue}, ${e.percentTransparent} \u900f\u660e`,"very dark":"\u5f88\u6697","very light":"\u5f88\u6dfa",vibrant:"\u9bae\u8c54",white:"\u767d",yellow:"\u9ec3","yellow green":"\u9ec3\u7da0"},gk={"ar-AE":RS,"bg-BG":LS,"cs-CZ":DS,"da-DK":NS,"de-DE":zS,"el-GR":BS,"en-US":VS,"es-ES":US,"et-EE":WS,"fi-FI":HS,"fr-FR":$S,"he-IL":GS,"hr-HR":YS,"hu-HU":qS,"it-IT":XS,"ja-JP":KS,"ko-KR":ZS,"lt-LT":JS,"lv-LV":QS,"nb-NO":ek,"nl-NL":tk,"pl-PL":nk,"pt-BR":rk,"pt-PT":ik,"ro-RO":ok,"ru-RU":ak,"sk-SK":sk,"sl-SI":lk,"sr-SP":ck,"sv-SE":uk,"tr-TR":dk,"uk-UA":hk,"zh-CN":fk,"zh-TW":pk};const Bk=Symbol.for("react-aria.i18n.locale"),Vk=Symbol.for("react-aria.i18n.strings");let Uk;class Wk{getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw new Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=function(e,t,n="en-US"){if(t[e])return t[e];let r=function(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}(e);if(t[r])return t[r];for(let i in t)if(i.startsWith(r+"-"))return t[i];return t[n]}(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let t=window[Bk];if(void 0===Uk){let e=window[Vk];if(!e)return null;Uk={};for(let n in e)Uk[n]=new Wk({[t]:e[n]},t)}let n=null==Uk?void 0:Uk[e];if(!n)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return n}constructor(e,t="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}}const Hk=new Map,$k=new Map;class Gk{format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return"function"==typeof n?n(t,this):n}plural(e,t,n="cardinal"){let r=t["="+e];if(r)return"function"==typeof r?r():r;let i=this.locale+":"+n,o=Hk.get(i);return o||(o=new Intl.PluralRules(this.locale,{type:n}),Hk.set(i,o)),r=t[o.select(e)]||t.other,"function"==typeof r?r():r}number(e){let t=$k.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),$k.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return"function"==typeof n?n():n}constructor(e,t){this.locale=e,this.strings=t}}let Yk=new Map,qk=!1;try{qk="exceptZero"===new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay}catch{}let Xk=!1;try{Xk="unit"===new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style}catch{}const Kk={degree:{narrow:{default:"\xb0","ja-JP":" \u5ea6","zh-TW":"\u5ea6","sl-SI":" \xb0"}}};class Zk{format(e){let t="";if(t=qk||null==this.options.signDisplay?this.numberFormatter.format(e):function(e,t,n){if("auto"===t)return e.format(n);if("never"===t)return e.format(Math.abs(n));{let r=!1;if("always"===t?r=n>0||Object.is(n,0):"exceptZero"===t&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let t=e.format(-n),r=e.format(n),i=t.replace(r,"").replace(/\u200e|\u061C/,"");return t.replace(r,"!!!").replace(i,"+").replace("!!!",r)}return e.format(n)}}(this.numberFormatter,this.options.signDisplay,e),"unit"===this.options.style&&!Xk){var n;let{unit:e,unitDisplay:r="short",locale:i}=this.resolvedOptions();if(!e)return t;let o=null===(n=Kk[e])||void 0===n?void 0:n[r];t+=o[i]||o.default}return t}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,t){if("function"==typeof this.numberFormatter.formatRange)return this.numberFormatter.formatRange(e,t);if(t<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} \u2013 ${this.format(t)}`}formatRangeToParts(e,t){if("function"==typeof this.numberFormatter.formatRangeToParts)return this.numberFormatter.formatRangeToParts(e,t);if(t<e)throw new RangeError("End date must be >= start date");let n=this.numberFormatter.formatToParts(e),r=this.numberFormatter.formatToParts(t);return[...n.map(e=>({...e,source:"startRange"})),{type:"literal",value:" \u2013 ",source:"shared"},...r.map(e=>({...e,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!qk&&null!=this.options.signDisplay&&(e={...e,signDisplay:this.options.signDisplay}),!Xk&&"unit"===this.options.style&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,t={}){this.numberFormatter=function(e,t={}){let{numberingSystem:n}=t;if(n&&e.includes("-nu-")&&(e.includes("-u-")||(e+="-u-"),e+=`-nu-${n}`),"unit"===t.style&&!Xk){var r;let{unit:e,unitDisplay:n="short"}=t;if(!e)throw new Error('unit option must be provided with style: "unit"');if(null===(r=Kk[e])||void 0===r||!r[n])throw new Error(`Unsupported unit ${e} with unitDisplay = ${n}`);t={...t,style:"decimal"}}let i=e+(t?Object.entries(t).sort((e,t)=>e[0]<t[0]?-1:1).join():"");if(Yk.has(i))return Yk.get(i);let o=new Intl.NumberFormat(e,t);return Yk.set(i,o),o}(e,t),this.options=t}}let Jk=new Wk(function(e){return e&&e.__esModule?e.default:e}(gk));const Qk=[[0,"pink"],[15,"red"],[48,"orange"],[94,"yellow"],[135,"green"],[175,"cyan"],[264,"blue"],[284,"purple"],[320,"magenta"],[349,"pink"]];class eA{toHexInt(){return this.toFormat("rgb").toHexInt()}getChannelValue(e){if(e in this)return this[e];throw new Error("Unsupported color channel: "+e)}withChannelValue(e,t){if(e in this){let n=this.clone();return n[e]=t,n}throw new Error("Unsupported color channel: "+e)}getChannelName(e,t){return(Wk.getGlobalDictionaryForPackage("@react-stately/color")||Jk).getStringForLocale(e,t)}getColorSpaceAxes(e){let{xChannel:t,yChannel:n}=e,r=t||this.getColorChannels().find(e=>e!==n),i=n||this.getColorChannels().find(e=>e!==r),o=this.getColorChannels().find(e=>e!==r&&e!==i);return{xChannel:r,yChannel:i,zChannel:o}}getColorName(e){let t,[n,r,i]=sA(this),o=Wk.getGlobalDictionaryForPackage("@react-stately/color")||Jk;if(n>.999)return o.getStringForLocale("white",e);if(n<.001)return o.getStringForLocale("black",e);[t,n]=this.getOklchHue(n,r,i,e);let a="",s="";r<=.1&&r>=.001?s=n>=.7?"pale":"grayish":r>=.15&&(s="vibrant"),n<.3?a="very dark":n<.55?a="dark":n<.7||(a=n<.85?"light":"very light"),s&&(s=o.getStringForLocale(s,e)),a&&(a=o.getStringForLocale(a,e));let l=this.getChannelValue("alpha"),c=new Gk(e,o);if(l<1){let n=new Zk(e,{style:"percent"}).format(1-l);return c.format("transparentColorName",{lightness:a,chroma:s,hue:t,percentTransparent:n}).replace(/\s+/g," ").trim()}return c.format("colorName",{lightness:a,chroma:s,hue:t}).replace(/\s+/g," ").trim()}getOklchHue(e,t,n,r){let i=Wk.getGlobalDictionaryForPackage("@react-stately/color")||Jk;if(t<.001)return[i.getStringForLocale("gray",r),e];for(let o=0;o<Qk.length;o++){let[t,a]=Qk[o],[s,l]=Qk[o+1]||[360,"pink"];if(n>=t&&n<s)return"orange"===a&&(e<.68?a="brown":e=e-.68+.55),n>t+(s-t)/2&&a!==l?a=`${a} ${l}`:"yellow"===a&&e<.85&&(a="yellow green"),[i.getStringForLocale(a,r).toLocaleLowerCase(r),e]}throw new Error("Unexpected hue")}getHueName(e){let[t,n,r]=sA(this),[i]=this.getOklchHue(t,n,r,e);return i}}class tA extends eA{static parse(e){let t=[];if(/^#[\da-f]+$/i.test(e)&&[4,5,7,9].includes(e.length)){const n=(e.length<6?e.replace(/[^#]/gi,"$&$&"):e).slice(1).split("");for(;n.length>0;)t.push(parseInt(n.splice(0,2).join(""),16));t[3]=void 0!==t[3]?t[3]/255:void 0}const n=e.match(/^rgba?\((.*)\)$/);var r;return null!=n&&n[1]&&(t=n[1].split(",").map(e=>Number(e.trim())),t=t.map((e,t)=>Xv(e,0,t<3?255:1))),t.length<3?void 0:new tA(t[0],t[1],t[2],null!==(r=t[3])&&void 0!==r?r:1)}toString(e="css"){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(255*this.alpha).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hex":case"hexa":case"rgb":case"rgba":return this;case"hsb":case"hsba":return this.toHSB();case"hsl":case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,t=this.green/255,n=this.blue/255,r=Math.min(e,t,n),i=Math.max(e,t,n),o=i-r,a=0===i?0:o/i;let s=0;if(0!==o){switch(i){case e:s=(t-n)/o+(t<n?6:0);break;case t:s=(n-e)/o+2;break;case n:s=(e-t)/o+4}s/=6}return new rA(Zv(360*s,2),Zv(100*a,2),Zv(100*i,2),this.alpha)}toHSL(){const e=this.red/255,t=this.green/255,n=this.blue/255,r=Math.min(e,t,n),i=Math.max(e,t,n),o=(i+r)/2,a=i-r;let s,l;if(0===a)s=l=0;else{switch(l=a/(o<.5?i+r:2-i-r),i){case e:s=(t-n)/a+(t<n?6:0);break;case t:s=(n-e)/a+2;break;case n:s=(e-t)/a+4}s/=6}return new aA(Zv(360*s,2),Zv(100*l,2),Zv(100*o,2),this.alpha)}clone(){return new tA(this.red,this.green,this.blue,this.alpha)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return new Zk(t,n).format(r)}getColorSpace(){return"rgb"}getColorChannels(){return tA.colorChannels}constructor(e,t,n,r){super(),this.red=e,this.green=t,this.blue=n,this.alpha=r}}tA.colorChannels=["red","green","blue"];const nA=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;class rA extends eA{static parse(e){let t;if(t=e.match(nA)){var n;const[e,r,i,o]=(null!==(n=t[1])&&void 0!==n?n:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new rA(oA(e,360),Xv(r,0,100),Xv(i,0,100),Xv(o??1,0,1))}}toString(e="css"){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${Zv(this.saturation,2)}%, ${Zv(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${Zv(this.saturation,2)}%, ${Zv(this.brightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsb":case"hsba":return this;case"hsl":case"hsla":return this.toHSL();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,t=this.brightness/100,n=t*(1-e/2);return e=0===n||1===n?0:(t-n)/Math.min(n,1-n),new aA(Zv(this.hue,2),Zv(100*e,2),Zv(100*n,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,n=this.brightness/100,r=(r,i=(r+e/60)%6)=>n-t*n*Math.max(Math.min(i,4-i,1),0);return new tA(Math.round(255*r(5)),Math.round(255*r(3)),Math.round(255*r(1)),this.alpha)}clone(){return new rA(this.hue,this.saturation,this.brightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return("saturation"===e||"brightness"===e)&&(r/=100),new Zk(t,n).format(r)}getColorSpace(){return"hsb"}getColorChannels(){return rA.colorChannels}constructor(e,t,n,r){super(),this.hue=e,this.saturation=t,this.brightness=n,this.alpha=r}}rA.colorChannels=["hue","saturation","brightness"];const iA=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/;function oA(e,t){return(e%t+t)%t}class aA extends eA{static parse(e){let t;if(t=e.match(iA)){var n;const[e,r,i,o]=(null!==(n=t[1])&&void 0!==n?n:t[2]).split(",").map(e=>Number(e.trim().replace("%","")));return new aA(oA(e,360),Xv(r,0,100),Xv(i,0,100),Xv(o??1,0,1))}}toString(e="css"){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${Zv(this.saturation,2)}%, ${Zv(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${Zv(this.saturation,2)}%, ${Zv(this.lightness,2)}%, ${this.alpha})`;default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsl":case"hsla":return this;case"hsb":case"hsba":return this.toHSB();case"rgb":case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,t=this.lightness/100,n=t+e*Math.min(t,1-t);return e=0===n?0:2*(1-t/n),new rA(Zv(this.hue,2),Zv(100*e,2),Zv(100*n,2),this.alpha)}toRGB(){let e=this.hue,t=this.saturation/100,n=this.lightness/100,r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return new tA(Math.round(255*i(0)),Math.round(255*i(8)),Math.round(255*i(4)),this.alpha)}clone(){return new aA(this.hue,this.saturation,this.lightness,this.alpha)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,t){let n=this.getChannelFormatOptions(e),r=this.getChannelValue(e);return("saturation"===e||"lightness"===e)&&(r/=100),new Zk(t,n).format(r)}getColorSpace(){return"hsl"}getColorChannels(){return aA.colorChannels}constructor(e,t,n,r){super(),this.hue=e,this.saturation=t,this.lightness=n,this.alpha=r}}function sA(e){let t=e.toFormat("rgb"),n=t.getChannelValue("red")/255,r=t.getChannelValue("green")/255,i=t.getChannelValue("blue")/255;[n,r,i]=function(e,t,n){return[lA(e),lA(t),lA(n)]}(n,r,i);let[o,a,s]=function(e,t,n){return cA([.4123907992659595,.35758433938387796,.1804807884018343,.21263900587151036,.7151686787677559,.07219231536073371,.01933081871559185,.11919477979462599,.9505321522496606],e,t,n)}(n,r,i),[l,c,u]=function(e,t,n){let[r,i,o]=cA([.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],e,t,n);return cA([.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Math.cbrt(r),Math.cbrt(i),Math.cbrt(o))}(o,a,s);return function(e,t,n){var r=180*Math.atan2(n,t)/Math.PI;return[e,Math.sqrt(t**2+n**2),r>=0?r:r+360]}(l,c,u)}function lA(e){let t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*Math.pow((n+.055)/1.055,2.4)}function cA(e,t,n,r){return[e[0]*t+e[1]*n+e[2]*r,e[3]*t+e[4]*n+e[5]*r,e[6]*t+e[7]*n+e[8]*r]}function uA({onChange:e,value:t,colors:n}){const r=n.map(n=>{const r=t===n;return(0,i.jsx)(Sb,{onClick:()=>{null==e||e(n)},className:gc("relative block flex-shrink-0 w-26 h-26 border rounded",r&&"shadow-md"),style:{backgroundColor:n},children:r&&(0,i.jsx)("span",{className:"absolute inset-0 m-auto rounded-full w-8 h-8 bg-white"})},n)});return(0,i.jsx)("div",{className:"flex flex-wrap gap-6",children:r})}aA.colorChannels=["hue","saturation","lightness"];const dA=[{color:"rgb(255, 255, 255)",name:sc("White")},{color:"rgb(239,245,245)",name:sc("Solitude")},{color:"rgb(245,213,174)",name:sc("Wheat")},{color:"rgb(253,227,167)",name:sc("Cape Honey")},{color:"rgb(242,222,186)",name:sc("Milk punch")},{color:"rgb(97,118,75)",name:sc("Dingy"),foreground:"rgb(255, 255, 255)"},{color:"rgb(4, 147, 114)",name:sc("Aquamarine"),foreground:"rgb(255, 255, 255)"},{color:"rgb(222,245,229)",name:sc("Cosmic Latte")},{color:"rgb(233,119,119)",name:sc("Geraldine"),foreground:"rgb(90,14,14)"},{color:"rgb(247,164,164)",name:sc("Sundown")},{color:"rgb(30,139,195)",name:sc("Pelorous"),foreground:"rgb(255, 255, 255)"},{color:"rgb(142,68,173)",name:sc("Deep Lilac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(108,74,182)",name:sc("Blue marguerite"),foreground:"rgb(255, 255, 255)"},{color:"rgb(139,126,116)",name:sc("Americano"),foreground:"rgb(255, 255, 255)"},{color:"rgb(0,0,0)",name:sc("Black"),foreground:"rgb(255, 255, 255)"},{color:"rgb(64,66,88)",name:sc("Blue zodiac"),foreground:"rgb(255, 255, 255)"},{color:"rgb(101,100,124)",name:sc("Comet"),foreground:"rgb(255, 255, 255)"}].map(({color:e})=>e).slice(0,14);function hA({defaultValue:e,onChange:t,colorPresets:n,showInput:r}){const[a,s]=(0,o.useState)(e),l=n||dA,c=gC({size:"sm"});return(0,i.jsxs)("div",{children:[(0,i.jsx)(Rk,{className:"!w-auto",color:a,onChange:e=>{null==t||t(e),s(e)}}),(0,i.jsxs)("div",{className:"px-12 py-20",children:[l&&(0,i.jsx)(uA,{colors:l,onChange:e=>{if(e){const n=function(e){let t=tA.parse(e)||rA.parse(e)||aA.parse(e);if(t)return t;throw new Error("Invalid color value: "+e)}(e).toString("hex");null==t||t(n),s(n)}},value:a}),r&&(0,i.jsx)("div",{className:"pt-20",children:(0,i.jsx)(zk,{autoComplete:"off",role:"textbox",autoCorrect:"off",spellCheck:"false",required:!0,"aria-label":"Hex color",prefixed:!0,className:c.input,color:a,onChange:e=>{null==t||t(e),s(e)}})})]})]})}const fA=o.createContext(null);function pA(){return(0,o.useContext)(fA)}function gA(){const{lines:e,localeCode:t}=Vx();return{trans:(0,o.useCallback)(n=>mA({...n,lines:e,localeCode:t}),[e,t])}}const mA=Mb(e=>{let{lines:t,message:n,values:r,localeCode:i}=e;return null==n?"":(n=(null==t?void 0:t[n])||(null==t?void 0:t[n.toLowerCase()])||n,r&&(n=Ux(i,e),Object.entries(r).forEach(([e,t])=>{n=n.replace(`:${e}`,`${t}`)})),n)},{equals:Bx,callTimeout:0});function vA({onDismiss:e}){const{trans:t}=gA();return(0,i.jsx)("button",{className:"sr-only","aria-label":t(sc("Dismiss")),tabIndex:-1,onClick:()=>{e&&e()}})}function yA(e){const{type:t="modal",dialogProps:n,...r}=(0,o.useContext)(fA),{children:a,className:s,size:l="md",background:c,radius:u="rounded",maxWidth:d="max-w-dialog",...h}=e;let f=null;("popover"===t||"tray"===t)&&(f=(0,i.jsx)(vA,{onDismiss:r.close}));const p="fullscreenTakeover"===l||"tray"===t,g=gc("mx-auto pointer-events-auto outline-none flex flex-col overflow-hidden",c||"bg","tray"!==t&&function(e){switch(e){case"2xs":return"w-256";case"xs":return"w-320";case"sm":return"w-384";case"md":return"w-440";case"lg":return"w-620";case"xl":return"w-780";case"2xl":return"w-850";case"fullscreen":return"w-1280";case"fullscreenTakeover":return"w-full h-full";default:return e}}(l),"tray"===t&&"rounded-t border-b-bg","fullscreenTakeover"!==l&&"shadow-2xl border max-h-dialog",!p&&`${u} ${d}`,s);return(0,i.jsxs)("div",{...Dv({role:"dialog",tabIndex:-1},n,h),style:{...e.style,"--be-dialog-padding":"24px"},"aria-modal":!0,className:g,children:[o.Children.toArray(a).map(e=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{size:e.props.size??l}):e),f]})}const bA=yc((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDownOutlined"),wA=(0,o.forwardRef)(({children:e,autoFocus:t=!1,restoreFocus:n=!0,isDismissable:r=!0,isOpen:o=!1,placement:a="center",onClose:s},l)=>{const c=Px(),u=$v(l);return(0,i.jsxs)("div",{className:"fixed inset-0 isolate z-modal",style:c,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),e.preventDefault(),s())},children:[(0,i.jsx)(Nx,{onClick:()=>{r&&s()}},"modal-underlay"),(0,i.jsx)(gv.div,{ref:u,className:gc("pointer-events-none absolute inset-0 z-20 flex h-full w-full","center"===a&&"items-center justify-center","top"===a&&"items-start justify-center pt-40"),role:"presentation",initial:{opacity:0,scale:"top"===a?1:.7},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1},transition:{duration:.1},children:(0,i.jsx)(vx,{restoreFocus:n,autoFocus:t,contain:!0,children:e})})]})});function xA(e){let{children:t,type:n,disableInitialTransition:r,isDismissable:a=!0,moveFocusToDialog:s=!0,returnFocusToTrigger:l=!0,triggerOnHover:c=!1,triggerOnContextMenu:u=!1,usePortal:d=!0,mobileType:h,alwaysReturnCurrentValueOnClose:f}=e;const p=(0,o.useRef)(null),g=u&&!e.triggerRef?p:e.triggerRef,m=(0,o.useRef)(e.value),[v,y]=qv(e.isOpen,e.defaultIsOpen,e.onOpenChange),[b,w]=qv(e.value,e.defaultValue,e.onValueChange);Jx()&&"popover"===n&&(n=h||"modal");const x=(0,o.useRef)(null),{x:C,y:_,reference:S,strategy:k,refs:A}=Qw({...e,disablePositioning:"modal"===n}),j="popover"===n?{position:k,top:_??"",left:C??""}:{},E=(0,o.useId)(),I=`${E}-label`,T=`${E}-description`,O=`${E}-form`,F=function(e){const t=(0,o.useRef)(e);return(0,o.useEffect)(()=>{t.current=e}),(0,o.useMemo)(()=>(...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}(e.onClose),P=(0,o.useCallback)(e=>{typeof e>"u"&&f&&(e=b);const t=typeof e<"u"?e:m.current;null==F||F(t,{initialValue:m.current,valueChanged:t!==m.current}),y(!1)},[F,y,b,f]),M=(0,o.useCallback)(()=>{y(!0),m.current=e.value},[e.value,y]);Av(()=>{null!=g&&g.current&&A.reference.current!==g.current&&S(g.current)},[S,null==g?void 0:g.current,A]);const R=(0,o.useMemo)(()=>({"aria-labelledby":I,"aria-describedby":T}),[I,T]);let L;L="modal"===n?wA:"tray"===n?zx:Rx;const D=(0,o.useMemo)(()=>({dialogProps:R,type:n,labelId:I,descriptionId:T,isDismissable:a,close:P,value:b,initialValue:m.current,setValue:w,formId:O}),[P,T,R,O,I,n,a,b,w]);c=c&&"popover"===n;const N={onPointerEnter:_b(e=>{M()}),onPointerLeave:_b(e=>{x.current=setTimeout(()=>{P()},150)})},z={onPointerEnter:_b(e=>{x.current&&clearTimeout(x.current)}),onPointerLeave:_b(e=>{P()})},B={onContextMenu:_b(e=>{e.preventDefault(),p.current=function({x:e,y:t},n){return{getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,right:e,bottom:t,left:e}),contextElement:n}}({x:e.clientX,y:e.clientY},e.currentTarget),M()})},V={onClick:_b(e=>{e.stopPropagation(),v?P():M()})},{dialogTrigger:U,dialog:W}=function(e,t){const n=Array.isArray(e)?e:o.Children.toArray(e);let r=2===n.length?n[1]:n[0];return r="function"==typeof r?r(t):r,2===n.length?{dialogTrigger:n[0],dialog:r}:{dialog:r}}(t,D),H=(0,i.jsx)(Cv,{initial:!r,children:v&&(0,i.jsx)(fA.Provider,{value:D,children:(0,i.jsx)(L,{...c?z:{},ref:A.setFloating,triggerRef:A.reference,style:j,restoreFocus:l,autoFocus:s,isOpen:v,onClose:P,isDismissable:a,isContextMenu:u,placement:e.placement,children:W})})});return(0,i.jsxs)(o.Fragment,{children:[U&&(0,o.cloneElement)(U,Dv({...g||u?{}:{ref:S},...u?{}:V,...c?N:{},...u?B:{}},{...U.props})),d?wh&&(0,ne.createPortal)(H,wh):H]})}function CA(e){const{label:t,className:n,value:r,onChange:a,size:s,width:l="w-max"}=e,c=Ah(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.colorPresets)?void 0:n.items})||[],u=gC({size:s}),[d,h]=(0,o.useState)(r),[f,p]=(0,o.useState)(!1);return(0,i.jsxs)("div",{className:gc(n,l),children:[t&&(0,i.jsx)("span",{className:u.label,children:t}),(0,i.jsxs)(xA,{type:"popover",isOpen:f,onOpenChange:p,children:[(0,i.jsxs)(Sb,{className:gc(u.input,"inline-flex items-center"),"aria-label":e["aria-label"],children:[(0,i.jsx)("span",{className:"block flex-shrink-0 mr-5 border rounded h-2/4 aspect-square",style:{backgroundColor:d}}),(0,i.jsx)(_A,{isActive:f,className:u.adornment})]}),(0,i.jsx)(yA,{size:"auto",children:(0,i.jsx)(hA,{onChange:e=>{h(e),null==a||a(e)},defaultValue:d,colorPresets:c})})]})]})}function _A({isActive:e,className:t}){return(0,i.jsx)(bA,{size:"sm",className:`transition-transform ml-auto flex-shrink-0 ${e?"rotate-180":"rotate-0"} ${t}`})}function SA(e){const{size:t="md",inline:n,label:r,showValueLabel:o=!!r,className:a,width:s="w-full",slider:l,children:c,trackColor:u="primary",fillColor:d="primary"}=e,{domProps:h,trackRef:f,getThumbPercent:p,getThumbValueLabel:g,labelId:m,groupId:v,thumbIds:y,isDisabled:b,numberFormatter:w,minValue:x,maxValue:C,step:_,values:S,getValueLabel:k}=l;let A="",j=Math.max([...w.format(x)].length,[...w.format(C)].length,[...w.format(_)].length);k?A=k(S[0]):1===S.length?A=g(0):2===S.length&&(A=`${g(0)} \u2013 ${g(1)}`,j=3+2*Math.max(j,[...w.format(x)].length,[...w.format(C)].length));const E=gC({size:t,disabled:b,labelDisplay:"flex"}),I=gc("touch-none",a,s,{"flex items-center":n});return(0,i.jsxs)("div",{className:I,role:"group",id:v,children:[(r||o)&&(0,i.jsxs)("div",{className:gc(E.label,"select-none"),children:[r&&(0,i.jsx)("label",{onClick:()=>{var e;null==(e=document.getElementById(y[0]))||e.focus()},id:m,htmlFor:v,children:r}),o&&(0,i.jsx)("output",{htmlFor:y[0],className:"ml-auto text-right","aria-live":"off",style:j?{width:`${j}ch`,minWidth:`${j}ch`}:void 0,children:A})]}),(0,i.jsxs)("div",{ref:f,className:gc("relative",kA(e)),...h,role:"presentation",children:[(0,i.jsx)("div",{className:gc("absolute inset-0 m-auto rounded",jA(u,b),AA(t))}),(0,i.jsx)("div",{className:gc("absolute inset-0 my-auto rounded",EA(d,b),AA(t)),style:{width:`${Math.max(100*p(0),0)}%`}}),c]})]})}function kA({size:e,wrapperHeight:t}){if(t)return t;switch(e){case"xs":return"h-14";case"sm":return"h-20";default:return"h-30"}}function AA(e){switch(e){case"xs":return"h-2";case"sm":return"h-3";default:return"h-4"}}function jA(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled/60";case"primary":return"bg-primary-light";case"neutral":return"bg-divider";default:return e}}function EA(e,t){switch(t&&(e="disabled"),e){case"disabled":return"bg-slider-disabled";case"primary":return"bg-primary";default:return e}}function IA(e={}){const{localeCode:t}=Vx();return(0,o.useMemo)(()=>new Zk(t,e),[t,e])}function TA({minValue:e=0,maxValue:t=100,isDisabled:n=!1,step:r=1,formatOptions:i,onChangeEnd:a,onPointerDown:s,label:l,getValueLabel:c,showThumbOnHoverOnly:u,thumbSize:d,onPointerMove:h,...f}){const[p,g]=(0,o.useState)(!1),m=IA(i),{addGlobalListener:v,removeGlobalListener:y}=Hv(),b=(0,o.useRef)(null),[w,x]=qv(f.value?f.value:void 0,f.defaultValue??[e],f.onChange),C=(0,o.useRef)(null);C.current=w;const[_,S]=(0,o.useState)(new Array(w.length).fill(!1)),k=(0,o.useRef)(null);k.current=_;const A=t=>0===t?e:w[t-1],j=e=>e===w.length-1?t:w[e+1],E=(e,t)=>{!n&&R(e)&&C.current&&(t=function(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(isNaN(t)?0:t))%r,o=Kv(2*Math.abs(i)>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return isNaN(t)?!isNaN(n)&&o>n&&(o=Math.floor(Kv(n/r,r))*r):o<t?o=t:!isNaN(n)&&o>n&&(o=t+Math.floor(Kv((n-t)/r,r))*r),o=Kv(o,r),o}(t,A(e),j(e),r),C.current=OA(C.current,e,t),x(C.current))},I=(e,t)=>{var r;if(n||!R(e))return;const i=null==(r=k.current)?void 0:r[e];k.current=OA(k.current||[],e,t),S(k.current),a&&i&&!k.current.some(Boolean)&&a(C.current||[])},[T,O]=(0,o.useState)(void 0),F=n=>(n=>{const r=Math.min(1,(n-e)/(t-e));return isNaN(r)?0:r})(C.current[n]),P=n=>cS((t=>Math.round((t-e)/r)*r+e)(n*(t-e)+e),e,t),M=(0,o.useRef)(new Array(w.length).fill(!0)),R=e=>M.current[e],L=(0,o.useRef)(null),D=(0,o.useRef)(void 0),N=(0,o.useRef)(null),{domProps:z}=Q_({onPointerDown:e=>{if(("mouse"!==e.pointerType||!(0!==e.button||e.altKey||e.ctrlKey||e.metaKey))&&(null==s||s(),b.current&&!n&&w.every((e,t)=>!_[t]))){const t=b.current.offsetWidth,n=b.current.getBoundingClientRect().left,r=(e.clientX-n)/t,i=P(r);let o;const a=w.findIndex(e=>i-e<0);if(0===a)o=a;else if(-1===a)o=w.length-1;else{const e=w[a-1],t=w[a];o=Math.abs(e-i)<Math.abs(t-i)?a-1:a}o>=0&&R(o)?(e.preventDefault(),L.current=o,O(o),D.current=e.pointerId,I(L.current,!0),E(o,i),v(window,"pointerup",V,!1)):L.current=null}},onMoveStart(){N.current=null},onMove(e,t){var n;const r=(null==(n=b.current)?void 0:n.offsetWidth)||0;if(null==N.current&&(N.current=F(L.current||0)*r),N.current+=t,null!=L.current&&b.current){const e=cS(N.current/r,0,1);((e,t)=>{E(e,P(t))})(L.current,e)}},onMoveEnd(){null!=L.current&&(I(L.current,!1),L.current=null)}}),B=Dv(z,{onPointerEnter:()=>{g(!0)},onPointerLeave:()=>{g(!1)},onPointerMove:e=>{null==h||h(e)}}),V=e=>{e.pointerId===D.current&&(null!=L.current&&(I(L.current,!1),L.current=null),y(window,"pointerup",V,!1))},U=(0,o.useId)(),W=l?`${U}-label`:void 0,H=`${U}-group`,$=[...Array(w.length)].map((e,t)=>`${U}-thumb-${t}`);return{domProps:B,trackRef:b,isDisabled:n,step:r,values:w,minValue:e,maxValue:t,focusedThumb:T,labelId:W,groupId:H,thumbIds:$,numberFormatter:m,getThumbPercent:F,getThumbMinValue:A,getThumbMaxValue:j,getThumbValueLabel:e=>function(e){return m.format(e)}(w[e]),isThumbDragging:e=>{var t;return(null==(t=k.current)?void 0:t[e])||!1},setThumbValue:E,updateDraggedThumbs:I,setThumbEditable:(e,t)=>{M.current[e]=t},setFocusedThumb:O,getValueLabel:c,isPointerOver:p,showThumbOnHoverOnly:u,thumbSize:d}}function OA(e,t,n){return e[t]===n?e:[...e.slice(0,t),n,...e.slice(t+1)]}function FA({index:e,slider:t,isDisabled:n,ariaLabel:r,inputRef:a,onBlur:s,fillColor:l="primary"}){const c=$v(a),{addGlobalListener:u,removeGlobalListener:d}=Hv(),{step:h,values:f,focusedThumb:p,labelId:g,thumbIds:m,isDisabled:v,getThumbPercent:y,getThumbMinValue:b,getThumbMaxValue:w,getThumbValueLabel:x,setThumbValue:C,updateDraggedThumbs:_,isThumbDragging:S,setThumbEditable:k,setFocusedThumb:A,isPointerOver:j,showThumbOnHoverOnly:E,thumbSize:I="w-18 h-18"}=t,T=S(e),O=f[e];k(e,!n);const F=n||v,P=(0,o.useCallback)(()=>{c.current&&c.current.focus({preventScroll:!0})},[c]),M=p===e;(0,o.useEffect)(()=>{M&&P()},[M,P]);const R=(0,o.useRef)(void 0),L=t=>{t.pointerId===R.current&&(P(),_(e,!1),d(window,"pointerup",L,!1))},D=gc("outline-none rounded-full top-1/2 -translate-y-1/2 -translate-x-1/2 absolute inset-0 transition-button duration-200",I,!F&&"shadow-md",function({isDisabled:e,isDragging:t,fillColor:n}){return e?"bg-slider-disabled cursor-default":n&&"primary"!==n?n:gc("hover:bg-primary-dark",t?"bg-primary-dark":"bg-primary")}({fillColor:l,isDisabled:F,isDragging:T}),!E||E&&T||j?"visible":"invisible");return(0,i.jsx)("div",{role:"presentation",className:D,style:{left:`${Math.max(100*y(e),0)}%`},onPointerDown:t=>{0!==t.button||t.altKey||t.ctrlKey||t.metaKey||(P(),R.current=t.pointerId,_(e,!0),u(window,"pointerup",L,!1))},children:(0,i.jsx)("input",{id:m[e],onKeyDown:_b(()=>{_(e,!0)}),onKeyUp:_b(()=>{_(e,!1)}),ref:c,tabIndex:F?void 0:0,min:b(e),max:w(e),step:h,value:O,disabled:F,"aria-label":r,"aria-labelledby":g,"aria-orientation":"horizontal","aria-valuetext":x(e),onFocus:()=>{A(e)},onBlur:t=>{A(void 0),_(e,!1),null==s||s(t)},onChange:t=>{C(e,parseFloat(t.target.value))},type:"range",className:"sr-only"})})}function PA({inputRef:e,onBlur:t,...n}){const{onChange:r,onChangeEnd:o,value:a,defaultValue:s,...l}=n,c={...l,value:null!=a?[a]:void 0,defaultValue:null!=s?[s]:void 0,onChange:e=>{null==r||r(e[0])},onChangeEnd:e=>{null==o||o(e[0])}},u=TA(c);return(0,i.jsx)(SA,{...c,slider:u,children:(0,i.jsx)(FA,{fillColor:n.fillColor,index:0,slider:u,inputRef:e,onBlur:t})})}const MA=o.forwardRef((e,t)=>{let{value:n=0,minValue:r=0,maxValue:o=100,size:a="md",isIndeterminate:s=!1,className:l,position:c="relative",trackColor:u,fillColor:d="border-primary",...h}=e;n=cS(n,r,o);const f=function(e){switch(e){case"xs":return"w-20 h-20";case"sm":return"w-24 h-24";case"md":return"w-32 h-32";case"lg":return"w-42 h-42";default:return e}}(a),p=(n-r)/(o-r),g=IA({style:"percent"});let m="";!s&&!m&&(m=g.format(p));const v={},y={};if(!s){const e=(n-r)/(o-r)*100;let t;e>0&&e<=50?(t=e/50*180-180,v.transform=`rotate(${t}deg)`,y.transform="rotate(-180deg)"):e>50&&(t=(e-50)/50*180-180,v.transform="rotate(0deg)",y.transform=`rotate(${t}deg)`)}return(0,i.jsxs)("div",{...h,"aria-valuenow":s?void 0:n,"aria-valuemin":r,"aria-valuemax":o,"aria-valuetext":s?void 0:m,role:"progressbar",ref:t,className:gc("progress-circle",c,f,s&&"indeterminate",l),children:[(0,i.jsx)("div",{className:gc(f,u,"rounded-full border-4")}),(0,i.jsxs)("div",{className:gc("fills absolute left-0 top-0 h-full w-full",s&&"progress-circle-fills-animate"),children:[(0,i.jsx)(RA,{circleSize:f,subMaskStyle:v,isIndeterminate:s,className:"rotate-180",fillColor:d,subMaskClassName:gc(s&&"progress-circle-fill-submask-1-animate")}),(0,i.jsx)(RA,{circleSize:f,subMaskStyle:y,isIndeterminate:s,fillColor:d,subMaskClassName:gc(s&&"progress-circle-fill-submask-2-animate")})]})]})});function RA({subMaskStyle:e,subMaskClassName:t,className:n,circleSize:r,isIndeterminate:o,fillColor:a}){return(0,i.jsx)("div",{className:gc("absolute h-full w-1/2 origin-[100%] overflow-hidden",n),children:(0,i.jsx)("div",{className:gc("h-full w-full origin-[100%] rotate-180 overflow-hidden",!o&&"transition-transform duration-100",t),style:e,children:(0,i.jsx)("div",{className:gc(r,a,"rounded-full border-4")})})})}function LA({isLoading:e,icon:t}){const n=(0,o.useRef)(null),{trans:r}=gA(),[a,s]=(0,o.useState)(!1),{state:{isOpen:l,inputValue:c}}=Eb(),u=(0,o.useRef)(c);return(0,o.useEffect)(()=>{e&&!a?(null===n.current&&(n.current=setTimeout(()=>{s(!0)},500)),c!==u.current&&(clearTimeout(n.current),n.current=setTimeout(()=>{s(!0)},500))):e||(s(!1),clearTimeout(n.current),n.current=null),u.current=c},[e,a,c]),a&&(l||e)?(0,i.jsx)(MA,{"aria-label":r({message:"Loading"}),size:"sm",isIndeterminate:!0}):t||(0,i.jsx)(bA,{})}const DA=o.forwardRef(function(e,t){const n=Jx(),{hideCaret:r,placeholder:o=(0,i.jsx)($x,{message:"Select an option..."}),selectedValue:a,onItemSelected:s,onOpenChange:l,onInputValueChange:c,onSelectionChange:u,selectionMode:d,minWidth:h="min-w-128",children:f,searchPlaceholder:p,showEmptyMessage:g,showSearchField:m,defaultInputValue:v,inputValue:y,isLoading:b,isAsync:w,valueClassName:x,floatingWidth:C=(n?"auto":"matchTrigger"),..._}=e,S=ex({...e,clearInputOnItemSelection:!0,showEmptyMessage:g||m,floatingWidth:C,selectionMode:"single",role:"listbox",virtualFocus:m},t),{state:{selectedValues:k,isOpen:A,setIsOpen:j,activeIndex:E,setSelectedIndex:I,inputValue:T,setInputValue:O},collections:F,focusItem:P,listboxId:M,reference:R,refs:L,listContent:D,onInputChange:N}=S,{fieldProps:z,inputProps:B}=kC({..._,focusRef:L.reference}),V=F.collection.get(k[0]),U=V?(0,i.jsxs)("span",{className:"flex items-center gap-10",children:[V.element.props.startIcon,(0,i.jsx)("span",{className:gc("overflow-hidden overflow-ellipsis whitespace-nowrap",x),children:V.element.props.children})]}):(0,i.jsx)("span",{className:"italic",children:o}),W=gC({...e,endAdornment:!0}),{handleTriggerKeyDown:H,handleListboxKeyboardNavigation:$,handleListboxSearchFieldKeydown:G}=Xx(S),{findMatchingItem:Y}=Zx();return(0,i.jsx)(Gx,{listbox:S,onKeyDownCapture:m?void 0:e=>{if(!A)return;const t=Y(e,D,E);null!=t&&P("increment",t)},onKeyDown:$,onClose:m?()=>O(""):void 0,isLoading:b,searchField:m&&(0,i.jsx)(AC,{size:"xs"===e.size||"sm"===e.size?"xs":"sm",placeholder:p,startAdornment:(0,i.jsx)(Qx,{}),className:"flex-shrink-0 px-8 pb-8 pt-4",autoFocus:!0,"aria-expanded":A?"true":"false","aria-haspopup":"listbox","aria-controls":A?M:void 0,"aria-autocomplete":"list",autoComplete:"off",autoCorrect:"off",spellCheck:"false",value:T,onChange:N,onKeyDown:e=>{G(e)}}),children:(0,i.jsx)(xC,{fieldClassNames:W,...z,endAdornment:!r&&(0,i.jsx)(LA,{isLoading:b}),children:(0,i.jsx)("button",{...B,type:"button","data-selected-value":null==V?void 0:V.value,"aria-expanded":A?"true":"false","aria-haspopup":"listbox","aria-controls":A?M:void 0,ref:R,onKeyDown:H,onKeyDownCapture:m?void 0:e=>{if(A)return;const t=Y(e,D,E);null!=t&&I(t)},disabled:_.disabled,onClick:()=>{j(!A)},className:gc(W.input,!z.unstyled&&h),children:U})})})});function NA(){const e=Ah(e=>e.filter.selected);if(!e)return null;const t=Eh().filter.getByName(e).options,n=(t,n)=>{var r;null==(r=Eh().filter)||r.applyValue(e,t,n),jh().setDirty(!0)},r=Eh().canvas.getMainImage().filters,o=Eh().filter.findFilterIndex(e,r),a=null==r?void 0:r[o];if(t){const e=Object.entries(t).map(([e,t])=>{let r;const o=a?a[e]:t.current;return"slider"===t.type?r=(0,i.jsx)(PA,{label:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)($x,{...Ay[e]})}),minValue:t.min,maxValue:t.max,step:t.step,defaultValue:o,formatOptions:{style:"percent"},size:"sm",onChange:t=>{n(e,t)}}):"colorPicker"===t.type?r=(0,i.jsx)(CA,{label:(0,i.jsx)($x,{...Ay[e]}),size:"sm",width:"w-full",value:o,onChange:t=>{n(e,t)}}):"select"===t.type&&(r=(0,i.jsx)(DA,{selectionMode:"single",size:"sm",label:(0,i.jsx)($x,{...Ay[e]}),defaultValue:o,onSelectionChange:t=>{n(e,t)},children:t.available.map(e=>(0,i.jsx)(Fb,{value:e.key,children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)($x,{message:e.key})})},e.key))})),(0,i.jsx)("div",{className:"pb-10",children:r},e)});return(0,i.jsx)(OS,{children:(0,i.jsx)("div",{className:"max-w-240 pt-10 mx-auto",children:e})})}return null}function zA(){const e=Ah(e=>e.frame.active),t="basic"===(null==e?void 0:e.mode),n=(0,o.useCallback)(e=>`${e}%`,[]);return(0,i.jsx)(OS,{className:"pb-18 pt-6",children:(0,i.jsxs)("div",{className:"max-w-288 m-auto",children:[t&&(0,i.jsx)(CA,{className:"mb-20",width:"w-full",size:"sm",label:(0,i.jsx)($x,{message:"Color"}),value:Eh().frame.builder.defaultColor,onChange:e=>{Eh().frame.active.changeColor(e)}}),(0,i.jsx)(PA,{size:"sm",label:(0,i.jsx)($x,{message:"Size"}),step:1,minValue:Eh().frame.active.getMinSize(),maxValue:Eh().frame.active.getMaxSize(),defaultValue:Eh().frame.active.currentSizeInPercent,getValueLabel:n,onChange:e=>{Eh().frame.resize(e)}})]})})}const BA=o.createContext(null);function VA(){const{tabsRef:e,selectedTab:t}=(0,o.useContext)(BA),[n,r]=(0,o.useState)({width:void 0,transform:void 0,className:void 0});return Av(()=>{if(null!=t&&e.current){const n=e.current[t];if(!n)return;r(e=>({width:`${n.offsetWidth}px`,transform:`translateX(${n.offsetLeft}px)`,className:void 0===e.width?"":"transition-all"}))}},[r,t,e]),(0,i.jsx)("div",{className:gc("absolute bottom-0 left-0 h-2 bg-primary",n.className),role:"presentation",style:{width:n.width,transform:n.transform}})}function UA({children:e,center:t,expand:n,className:r}){const a=o.Children.toArray(e);return(0,i.jsx)(vx,{children:(0,i.jsxs)("div",{className:gc("flex relative max-w-full overflow-auto border-b max-sm:hidden-scrollbar md:compact-scrollbar",r),role:"tablist","aria-orientation":"horizontal",children:[a.map((e,r)=>(0,o.isValidElement)(e)?(0,o.cloneElement)(e,{index:r,className:gc(e.props.className,n&&"flex-auto",t&&0===r&&"ml-auto",t&&r===a.length-1&&"mr-auto")}):null),(0,i.jsx)(VA,{})]})})}function WA(e){const{size:t="md",children:n,className:r,isLazy:a,overflow:s="overflow-hidden"}=e,l=(0,o.useRef)([]),c=(0,o.useId)(),[u,d]=qv(e.selectedTab,e.defaultSelectedTab||0,e.onTabChange),h=(0,o.useMemo)(()=>({selectedTab:u,setSelectedTab:d,tabsRef:l,size:t,isLazy:a,id:c}),[u,c,a,d,t]);return(0,i.jsx)(BA.Provider,{value:h,children:(0,i.jsx)("div",{className:gc(r,s,"max-w-full"),children:n})})}const HA=yc((0,i.jsx)("path",{d:"M12 17c3.31 0 6-2.69 6-6V3h-2.5v8c0 1.93-1.57 3.5-3.5 3.5S8.5 12.93 8.5 11V3H6v8c0 3.31 2.69 6 6 6zm-7 2v2h14v-2H5z"}),"FormatUnderlinedOutlined"),$A=yc((0,i.jsx)("path",{d:"M10 19h4v-3h-4v3zM5 4v3h5v3h4V7h5V4H5zM3 14h18v-2H3v2z"}),"FormatStrikethroughOutlined"),GA=yc((0,i.jsx)("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4h-8z"}),"FormatItalicOutlined"),YA=yc((0,i.jsx)("path",{d:"M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18v-2H3v2zm6-4h12V7H9v2zM3 3v2h18V3H3z"}),"FormatAlignRightOutlined"),qA=yc((0,i.jsx)("path",{d:"M15 15H3v2h12v-2zm0-8H3v2h12V7zM3 13h18v-2H3v2zm0 8h18v-2H3v2zM3 3v2h18V3H3z"}),"FormatAlignLeftOutlined"),XA=yc((0,i.jsx)("path",{d:"M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z"}),"FormatAlignCenterOutlined");function KA(){return(0,i.jsxs)("div",{className:"flex gap-20 justify-center",children:[(0,i.jsx)(ZA,{}),(0,i.jsx)(JA,{}),(0,i.jsx)(QA,{})]})}function ZA(){const e=Ah(e=>e.objects.active.editableProps.fontSize)??40,{trans:t}=gA();return(0,i.jsx)(AC,{type:"number",size:"xs","aria-label":t({message:"Font Size"}),min:1,max:300,className:"w-64 flex-shrink-0",value:e,onChange:e=>{Eh().objects.setValues({fontSize:e.target.valueAsNumber}),jh().setDirty(!0)}})}function JA(){const e=Ah(e=>e.objects.active.editableProps.fontStyle),t=Ah(e=>e.objects.active.editableProps.underline),n=Ah(e=>e.objects.active.editableProps.linethrough),[r,a]=(0,o.useState)([e,t&&"underline",n&&"linethrough"]);return(0,i.jsxs)(LC,{size:"xs",variant:"outline",radius:"rounded",value:r,multiple:!0,onChange:e=>{a(e),Eh().objects.setValues({underline:e.includes("underline"),linethrough:e.includes("linethrough"),fontStyle:e.includes("italic")?"italic":""}),jh().setDirty(!0)},children:[(0,i.jsx)(TC,{value:"underline",children:(0,i.jsx)(HA,{})}),(0,i.jsx)(TC,{value:"linethrough",children:(0,i.jsx)($A,{})}),(0,i.jsx)(TC,{value:"italic",children:(0,i.jsx)(GA,{})})]})}function QA(){const e=Ah(e=>e.objects.active.editableProps.textAlign);return(0,i.jsxs)(LC,{size:"xs",variant:"outline",radius:"rounded",value:e,onChange:e=>{Eh().objects.setValues({textAlign:e}),jh().setDirty(!0)},children:[(0,i.jsx)(TC,{value:"left",children:(0,i.jsx)(qA,{})}),(0,i.jsx)(TC,{value:"center",children:(0,i.jsx)(XA,{})}),(0,i.jsx)(TC,{value:"right",children:(0,i.jsx)(YA,{})})]})}function ej({children:e,className:t}){const{selectedTab:n,isLazy:r}=(0,o.useContext)(BA),a=o.Children.toArray(e).filter(e=>!!e);let s;if(r){const e=a[n];s=(0,o.isValidElement)(e)?(0,o.cloneElement)(a[n],{index:n}):null}else s=a.map((e,t)=>{if((0,o.isValidElement)(e)){const r=t===n;return(0,o.cloneElement)(e,{index:t,"aria-hidden":!r,className:r?e.props.className:gc(e.props.className,"hidden")})}return null});return(0,i.jsx)("div",{className:t,children:s})}function tj({className:e,children:t,index:n,...r}){const{id:a}=(0,o.useContext)(BA),[s,l]=(0,o.useState)(0),c=(0,o.useRef)(null);return Av(()=>{if(null!=c&&c.current){const e=()=>{const e=Ix(c.current,{tabbable:!0});l(e.nextNode()?void 0:0)};e();const t=new MutationObserver(e);return t.observe(c.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{t.disconnect()}}},[c]),(0,i.jsx)("div",{tabIndex:s,ref:c,id:`${a}-${n}-tabpanel`,"aria-labelledby":`${a}-${n}-tab`,className:gc(e,"focus-visible:outline-primary-light"),role:"tabpanel",...r,children:t})}const nj=[{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{color:"#ffe47b",offset:0},{color:"rgb(111,154,211)",offset:1}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{color:"#ff4040",offset:0},{color:"#e6399b",offset:1}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#200772"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#FF4F4F"},{offset:1,color:"rgb(255, 239, 64)"}]},{type:"radial",coords:{r1:100,r2:10,x1:0,y1:0,x2:20,y2:20},colorStops:[{offset:0,color:"#ffe47b"},{offset:.5,color:"rgb(111,154,211)"},{offset:1,color:"rgb(166,111,213)"}]},{type:"radial",coords:{r1:50,r2:80,x1:45,y1:45,x2:52,y2:50},colorStops:[{offset:0,color:"rgb(155, 237, 0)"},{offset:1,color:"rgba(0, 164, 128,0.4)"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"#9ecb2d"},{offset:.5,color:"#72aa00"},{offset:1,color:"#bfd255"}]},{type:"radial",coords:{r1:100,r2:50,x1:30,y1:0,x2:0,y2:0},colorStops:[{offset:0,color:"#aebcbf"},{offset:1,color:"#0a0809"}]},{type:"linear",coords:{x1:-80,y1:0,x2:80,y2:0},colorStops:[{offset:0,color:"#ffffff"},{offset:1,color:"#f6f6f6"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#fefcea"},{offset:1,color:"#f1da36"}]},{type:"linear",coords:{x1:-90,y1:-90,x2:90,y2:90},colorStops:[{offset:0,color:"rgb(166,111,213)"},{offset:.5,color:"rgba(106, 72, 215, 0.5)"},{offset:1,color:"#ff1a00"}]},{type:"linear",coords:{x1:0,y1:-120,x2:0,y2:120},colorStops:[{offset:0,color:"#b7deed"},{offset:1,color:"#21b4e2"}]},{type:"linear",coords:{x1:-80,y1:100,x2:80,y2:-100},colorStops:[{offset:0,color:"#ffe47b"},{offset:1,color:"rgb(111,154,211)"}]}],rj=yc((0,i.jsx)("path",{d:"M19.51 3.08 3.08 19.51c.09.34.27.65.51.9.25.24.56.42.9.51L20.93 4.49c-.19-.69-.73-1.23-1.42-1.41zM11.88 3 3 11.88v2.83L14.71 3h-2.83zM5 3c-1.1 0-2 .9-2 2v2l4-4H5zm14 18c.55 0 1.05-.22 1.41-.59.37-.36.59-.86.59-1.41v-2l-4 4h2zm-9.71 0h2.83L21 12.12V9.29L9.29 21z"}),"TextureOutlined"),ij=yc((0,i.jsx)("path",{d:"M11 9h2v2h-2V9zm-2 2h2v2H9v-2zm4 0h2v2h-2v-2zm2-2h2v2h-2V9zM7 9h2v2H7V9zm12-6H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9 18H7v-2h2v2zm4 0h-2v-2h2v2zm4 0h-2v-2h2v2zm2-7h-2v2h2v2h-2v-2h-2v2h-2v-2h-2v2H9v-2H7v2H5v-2h2v-2H5V5h14v6z"}),"GradientOutlined"),oj=yc((0,i.jsx)("path",{d:"M18 20H4V6h9V4H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-9h-2v9zm-7.79-3.17-1.96-2.36L5.5 18h11l-3.54-4.71zM20 4V1h-2v3h-3c.01.01 0 2 0 2h3v2.99c.01.01 2 0 2 0V6h3V4h-3z"}),"AddPhotoAlternateOutlined");function aj({property:e}){const{trans:t}=gA(),n=Ah(t=>t.objects.active.editableProps[e]);return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-14",children:[(0,i.jsx)(CA,{className:"flex-shrink-0",size:"xs","aria-label":t({message:"Color"}),value:"string"==typeof n?n:cc.fill,onChange:t=>{Eh().objects.setValues({[e]:t}),jh().setDirty(!0)}}),(0,i.jsx)(sj,{type:"gradient",property:e}),(0,i.jsx)(sj,{type:"texture",property:e})]})}function sj({type:e,property:t}){return(0,i.jsx)(o.Fragment,{children:(0,i.jsxs)(xA,{type:"popover",children:[(0,i.jsx)(kb,{className:"flex-shrink-0",id:`${e}-panel-trigger`,variant:"outline",size:"xs",startIcon:(0,i.jsx)("texture"===e?rj:ij,{}),endIcon:(0,i.jsx)(bA,{}),children:(0,i.jsx)("span",{className:"capitalize",children:(0,i.jsx)($x,"gradient"===e?{message:"Gradient"}:{message:"Texture"})})}),(0,i.jsx)(yA,{size:"auto",children:(0,i.jsx)("div",{className:"grid gap-8 grid-cols-5-min-content p-10 bg-paper rounded shadow-md",children:(0,i.jsx)(lj,{property:t,type:e})})})]})})}function lj({type:e,property:t}){const{close:n}=pA(),r=Array.from(Array("gradient"===e?nj.length:28).keys()),a="w-56 h-56 bg border shadow-sm hover:scale-110",s=r.map(r=>{const o=vy(`images/${e}s/${r}.png`);return(0,i.jsx)(Sb,{radius:"rounded",className:a,style:{backgroundImage:`url(${o})`},"aria-label":`Select ${e} #${r}`,onClick:async()=>{n();const i="gradient"===e?new Jv.fabric.Gradient(nj[r]):await uj(o);Eh().objects.setValues({[t]:i}),jh().setDirty(!0)}},r)});return"texture"===e&&s.unshift((0,i.jsx)(cj,{property:t,className:a},"upload-btn")),(0,i.jsx)(o.Fragment,{children:s})}function cj({className:e,property:t}){const{close:n}=pA();return(0,i.jsx)(Sb,{radius:"rounded",className:e,"aria-label":"Upload an image",onClick:async()=>{const e=await Eh().import.openUploadWindow();if(n(),e){const n=await uj(await e.data);Eh().objects.setValues({[t]:n})}},children:(0,i.jsx)(oj,{className:"icon-md"})})}function uj(e){return new Promise(t=>{Jv.fabric.util.loadImage(e,e=>{const n=new Jv.fabric.Pattern({source:e,repeat:"repeat"});t(n)})})}function dj(){const e=Ah(e=>e.objects.active.editableProps.opacity);return(0,i.jsx)(PA,{className:"max-w-240 w-full mx-auto","aria-label":"Opacity",value:e,minValue:.1,step:.1,maxValue:1,onChange:e=>{Eh().objects.setValues({opacity:e}),jh().setDirty(!0)}})}function hj(){const{trans:e}=gA(),t=Ah(e=>e.objects.active.editableProps.stroke),n=Ah(e=>e.objects.active.editableProps.strokeWidth);return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(CA,{className:"ml-auto flex-shrink-0",size:"xs",value:t,"aria-label":e({message:"Outline Color"}),onChange:e=>{Eh().objects.setValues({stroke:e}),jh().setDirty(!0)}}),(0,i.jsx)(PA,{"aria-label":"Outline Width",className:"max-w-240 mr-auto flex-shrink-0",value:n,onChange:e=>{Eh().objects.setValues({strokeWidth:e}),jh().setDirty(!0)}})]})}const fj=yc((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"}),"ImageOutlined");function pj(){return(0,i.jsx)("div",{className:"flex justify-center",children:(0,i.jsx)(kb,{type:"button",variant:"outline",size:"xs",startIcon:(0,i.jsx)(fj,{}),radius:"rounded-full",onClick:async()=>{const e=await Eh().import.openUploadWindow();if(e){const t=Eh().objects.getActive();if(t&&"setSrc"in t){const n=await e.data;t.setSrc(n,()=>{cy({src:n}),Eh().canvas.render()})}}},children:(0,i.jsx)($x,{message:"Replace Image"})})})}const gj={color:"rgba(0, 0, 0, 0.6)",blur:3,offsetX:-1,offsetY:0};function mj(){const{trans:e}=gA(),t=Ah(e=>e.objects.active.editableProps.shadow)||gj;return(0,i.jsxs)("div",{className:"flex items-center gap-40",children:[(0,i.jsx)(CA,{className:"ml-auto flex-shrink-0",value:t.color,size:"xs","aria-label":e({message:"Shadow Color"}),onChange:e=>{Eh().objects.setValues({shadow:vj({color:e})}),jh().setDirty(!0)}}),(0,i.jsx)(PA,{"aria-label":"Shadow Blur",className:"max-w-240 mr-auto flex-shrink-0",defaultValue:t.blur,onChange:e=>{Eh().objects.setValues({shadow:vj({blur:e})}),jh().setDirty(!0)}})]})}function vj(e){var t;const n=null==(t=Eh().objects.getActive())?void 0:t.shadow;return n?(Object.entries(e).forEach(([e,t])=>{n[e]=t}),n):new Jv.fabric.Shadow({...gj,...e})}function yj({index:e,className:t,isDisabled:n,children:r,padding:a,elementType:s="button",to:l,relative:c,width:u="min-w-min"}){const{selectedTab:d,setSelectedTab:h,tabsRef:f,size:p="md",id:g}=(0,o.useContext)(BA),m=e===d,v=function(){var e;return null===(e=(0,o.useContext)(gx))||void 0===e?void 0:e.focusManager}(),y=a||("sm"===p?"px-12":"px-18"),b=gc("tracking-wide overflow-hidden capitalize text-sm flex items-center justify-center outline-none transition-colors","focus-visible:ring focus-visible:ring-2 ring-inset rounded whitespace-nowrap cursor-pointer",u,function({isDisabled:e,isSelected:t}){return e?"text-disabled cursor-default":t?"text-primary":"text-muted hover:text-main"}({isDisabled:n,isSelected:m}),t,"md"===p&&`${y} h-48`,"sm"===p&&`${y} h-32`,n&&"pointer-events-none");return(0,i.jsx)(s,{disabled:n,id:`${g}-${e}-tab`,"aria-controls":`${g}-${e}-tabpanel`,type:"button",role:"tab","aria-selected":m,tabIndex:n?void 0:m?0:-1,onKeyDown:e=>{switch(e.key){case"ArrowLeft":null==v||v.focusPrevious();break;case"ArrowRight":null==v||v.focusNext();break;case"Home":null==v||v.focusFirst();break;case"End":null==v||v.focusLast()}},onClick:()=>{h(e)},to:l,relative:c,className:b,ref:t=>{f.current&&t&&(f.current[e]=t)},children:r})}function bj(){const e=Ah(e=>e.objects.active);return(0,i.jsxs)(WA,{size:"sm",className:"pb-18 pt-6",children:[(0,i.jsxs)(UA,{center:!0,children:[e.isText&&(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Font"})}),!e.isImage&&(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Color"})}),!e.isImage&&(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Background"})}),e.isImage&&(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Image"})}),(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Opacity"})}),(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Outline"})}),(0,i.jsx)(yj,{children:(0,i.jsx)($x,{message:"Shadow"})})]}),(0,i.jsxs)(ej,{className:"pt-16 h-50",children:[e.isText&&(0,i.jsx)(tj,{children:(0,i.jsx)(KA,{})},"font"),!e.isImage&&(0,i.jsx)(tj,{children:(0,i.jsx)(aj,{property:"fill"})}),!e.isImage&&(0,i.jsx)(tj,{children:(0,i.jsx)(aj,{property:"backgroundColor"})}),e.isImage&&(0,i.jsx)(tj,{children:(0,i.jsx)(pj,{})}),(0,i.jsx)(tj,{children:(0,i.jsx)(dj,{})}),(0,i.jsx)(tj,{children:(0,i.jsx)(hj,{})}),(0,i.jsx)(tj,{children:(0,i.jsx)(mj,{})})]})]})}function wj(){const e=!Jx()&&(0,i.jsx)(kb,{size:"sm",color:"primary",variant:"outline",onClick:()=>{Eh().text.add(),jh().setDirty(!0)},children:(0,i.jsx)($x,{message:"New Text"})});return(0,i.jsx)(OS,{actionBtn:e,children:(0,i.jsx)(bj,{})})}const xj=yc((0,i.jsx)("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"}),"ArrowDownwardOutlined"),Cj={};let _j=!1,Sj=null,kj=null;const Aj=e=>{var t;for(const n in Cj)n!==e&&(null==(t=Cj[n])||t.call(Cj,!0),delete Cj[n])},jj=(0,o.forwardRef)(({children:e,label:t,placement:n="top",offset:r=10,variant:a="neutral",delay:s=1500,isDisabled:l,usePortal:c=!0,...u},d)=>{const{x:h,y:f,reference:p,strategy:g,arrowRef:m,arrowStyle:v,refs:y}=Qw({placement:n,offset:r,ref:d,showArrow:!0}),[b,w]=(0,o.useState)(!1),x=(0,o.useId)(),C=(0,o.useRef)(),_=()=>{clearTimeout(C.current),C.current=void 0,Aj(x),Cj[x]=S,_j=!0,w(!0),Sj&&(clearTimeout(Sj),Sj=null),kj&&(clearTimeout(kj),kj=null)},S=(0,o.useCallback)(e=>{e?(clearTimeout(C.current),C.current=void 0,w(!1)):C.current||(C.current=setTimeout(()=>{C.current=void 0,w(!1)},500)),Sj&&(clearTimeout(Sj),Sj=null),_j&&(kj&&clearTimeout(kj),kj=setTimeout(()=>{delete Cj[x],kj=null,_j=!1},500))},[x]),k=e=>{!e&&s>0&&!C.current?(Aj(x),Cj[x]=S,b||Sj||_j?b||_():Sj=setTimeout(()=>{Sj=null,_j=!0,_()},s)):_()};(0,o.useEffect)(()=>()=>{clearTimeout(C.current),Cj[x]&&delete Cj[x]},[x]),(0,o.useEffect)(()=>{const e=e=>{"Escape"===e.key&&S(!0)};if(b)return document.addEventListener("keydown",e,!0),()=>{document.removeEventListener("keydown",e,!0)}},[b,S]);const A=(0,i.jsx)(Cv,{children:b&&(0,i.jsxs)(gv.div,{...Mx,ref:y.setFloating,id:x,role:"tooltip",onPointerEnter:()=>{k(!0)},onPointerLeave:()=>{S()},className:gc("z-tooltip my-4 max-w-240 break-words rounded px-8 py-4 text-xs text-white shadow","positive"===a&&"bg-positive","danger"===a&&"bg-danger","neutral"===a&&"bg-toast"),style:{position:g,top:f??"",left:h??""},children:[(0,i.jsx)("div",{ref:m,className:"absolute h-8 w-8 rotate-45 bg-inherit",style:v}),t]})});return(0,i.jsxs)(o.Fragment,{children:[(0,o.cloneElement)(e,Dv({"aria-describedby":b?x:void 0,ref:p,onPointerEnter:e=>{"mouse"===e.pointerType&&k()},onFocus:e=>{e.target.matches(":focus-visible")&&k(!0)},onPointerLeave:e=>{"mouse"===e.pointerType&&S()},onPointerDown:()=>{S(!0)},onBlur:()=>{S()},"aria-label":"string"==typeof t?t:t.props.message},u)),c?wh&&(0,ne.createPortal)(A,wh):A]})});function Ej(){const e=function(e,t){switch(e){case md.Filter:return(0,i.jsx)(NA,{});case md.Frame:return(0,i.jsx)(zA,{});case md.Text:return t&&(0,i.jsx)(wj,{});case md.ActiveObject:return t&&(0,i.jsx)(bj,{});default:return null}}(Ah(e=>e.activeToolOverlay),Ah(e=>e.objects.active.id)),[t,n]=(0,o.useState)(!0);return(0,i.jsxs)("div",{className:"relative z-tool-overlay text-sm",children:[e&&(0,i.jsx)("div",{className:gc("absolute right-16 text-muted z-50 transition-all",!t&&"rotate-180",t?"-top-144":"-top-40"),children:(0,i.jsx)(jj,{label:(0,i.jsx)($x,t?{message:"Hide options"}:{message:"Show options"}),children:(0,i.jsx)(TC,{variant:"outline",radius:"rounded-lg",size:"xs",onClick:()=>{n(!t)},children:(0,i.jsx)(xj,{})})})}),(0,i.jsx)(Cv,{children:e&&t&&(0,i.jsx)(gv.div,{initial:{y:0,opacity:0},animate:{y:"-100%",opacity:1},exit:{y:0,opacity:0},transition:{type:"tween",duration:.15},className:"absolute inset-x-0 gap-16 px-5vw bg bg-opacity-95 border-t",children:e},"tool-controls-overlay")})]})}const Ij=yc((0,i.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined");function Tj({filter:e}){const t=Ah(t=>t.filter.applied.includes(e)),n=Eh().filter.hasOptions(e),r=gc("block flex-shrink-0 rounded",{"text-primary border-primary":t}),a=ky[e],s=(0,i.jsxs)(o.Fragment,{children:[(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)(Oj,{filter:e}),t&&(0,i.jsx)(Fj,{filter:e,hasOptions:n})]}),(0,i.jsx)("div",{className:"mt-4 text-center text-xs capitalize",children:a?(0,i.jsx)($x,{...a}):e})]});return t&&n?(0,i.jsx)("div",{className:r,children:s}):(0,i.jsx)(Sb,{className:r,onClick:()=>{t?Eh().filter.remove(e):Eh().filter.apply(e)},children:s})}function Oj({filter:e}){const t=gc("m-auto w-96 h-56 border rounded object-cover",{shadow:Ah(t=>t.filter.selected===e)});return(0,i.jsx)("img",{src:vy(`images/filter/${e}.jpg`),className:t,alt:""})}function Fj({filter:e,hasOptions:t}){return(0,i.jsxs)("div",{className:"flex items-center justify-center bg-background/70 absolute inset-0 border-2 border-primary rounded",children:[t?(0,i.jsx)(TC,{color:"primary",size:"md",onClick:()=>{Eh().filter.remove(e)},children:(0,i.jsx)(Ij,{})}):(0,i.jsx)(Ij,{className:"svg-icon icon-md"}),t&&(0,i.jsx)(Pj,{filter:e,hasOptions:t})]})}function Pj({filter:e,hasOptions:t}){return(0,i.jsx)(TC,{color:"primary",size:"md",onClick:()=>{jh().activeToolOverlay===md.Filter&&jh().filter.selected===e?jh().setActiveTool(jh().activeTool,null):jh().filter.select(e,t)},children:(0,i.jsx)(xc,{})})}const Mj=(0,o.forwardRef)(({children:e,className:t,gap:n="gap-10"},r)=>{const a=o.Children.map(e,(t,n)=>o.isValidElement(t)?o.cloneElement(t,{isFirst:0===n,isLast:o.Children.count(e)===n+1}):t);return(0,i.jsx)("div",{ref:r,className:gc("tiny-scrollbar pb-4 overflow-x-auto relative flex items-center",n,t),children:a})});function Rj({isFirst:e,isLast:t,children:n,className:r}){const o=gc(r,"flex-shrink-0",{"ml-auto":e,"mr-auto":t});return(0,i.jsx)("div",{className:o,children:n})}function Lj(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.filter)?void 0:n.items})||[];(0,o.useEffect)(()=>{Eh().filter.syncState()},[]);const t=e.map(e=>(0,i.jsx)(Rj,{children:(0,i.jsx)(Tj,{filter:e})},e));return(0,i.jsx)(Mj,{children:t})}const Dj=yc((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOutlined"),Nj=yc((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6h2c0-1.66 1.34-3 3-3s3 1.34 3 3v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}),"LockOpenOutlined"),zj=yc((0,i.jsx)("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlankOutlined"),Bj=yc((0,i.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Vj=yc((0,i.jsx)("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M17,13H7v-2h10V13z"}),"CheckBox"),Uj=(0,o.forwardRef)((e,t)=>{const{size:n="md",children:r,className:a,icon:s,checkedIcon:l,disabled:c,isIndeterminate:u,errorMessage:d,invalid:h,orientation:f="horizontal",onChange:p,autoFocus:g,required:m,value:v,name:y,inputTestId:b}=e,w=gC({...e,label:r}),x=s||zj,C=l||(u?Vj:Bj),_=$v(t);SC({autoFocus:g},_),(0,o.useEffect)(()=>{_.current&&(_.current.indeterminate=u||!1)});const[S,k]=qv(e.checked,e.defaultChecked||!1),A=(0,o.useCallback)(e=>{null==p||p(e),k(e.target.checked)},[p,k]),j=gc("select-none",a,h&&"text-danger",!h&&c&&"text-disabled");let E,I=h?"text-danger":null;return u?(E=Vj,I=I||"text-primary"):S?(E=C,I=I||"text-primary"):(E=x,I=I||"text-muted"),(0,i.jsxs)("div",{children:[(0,i.jsx)("label",{className:j,children:(0,i.jsxs)("div",{className:gc("relative flex items-center","vertical"===f&&"flex-col flex-col-reverse"),children:[(0,i.jsx)("input",{className:"absolute left-0 top-0 h-24 w-24 appearance-none overflow-hidden rounded outline-none ring-inset transition-shadow focus-visible:ring",type:"checkbox","aria-checked":u?"mixed":S,"aria-invalid":h||void 0,onChange:A,ref:_,required:m,disabled:c,value:v,name:y,"data-testid":b}),(0,i.jsx)(E,{size:n,className:gc("pointer-events-none",c?"text-disabled":I)}),r&&(0,i.jsx)("div",{className:gc("first-letter:capitalize",w.size.font,"vertical"===f?"mb-6":"ml-6"),children:r})]})}),d&&(0,i.jsx)("div",{className:w.error,children:d})]})});function Wj(){const{trans:e}=gA(),{minWidth:t=50,minHeight:n=50,maxHeight:r=2400,maxWidth:a=2400}=Ah(e=>{var t;return null==(t=e.config.tools)?void 0:t.resize})||{},s=Ah(e=>e.original),l=Ah(e=>e.resize.formValue);return(0,o.useEffect)(()=>{jh().resize.setFormValue({...s})},[s]),(0,o.useEffect)(()=>{jh().setDirty(!0)},[]),(0,i.jsxs)("form",{className:"flex items-center justify-center gap-16 w-full",onSubmit:e=>{e.preventDefault(),jh().applyChanges()},children:[(0,i.jsx)(AC,{type:"number",min:t,max:a,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)($x,{message:"Width"}),value:l.width,onChange:e=>{(e=>{const t={...l,width:e};l.maintainAspect&&(t.height=My(e,l.usePercentages)),jh().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("div",{className:"mt-24",children:(0,i.jsx)(Uj,{size:"md",checked:l.maintainAspect,onChange:e=>{(e=>{const t={...l,maintainAspect:e};e&&(t.height=My(t.width,t.usePercentages)),jh().resize.setFormValue(t)})(!l.maintainAspect)},"aria-label":e({message:"Maintain aspect ratio"}),checkedIcon:Dj,icon:Nj})}),(0,i.jsx)(AC,{type:"number",min:n,max:r,size:"sm",className:"w-full max-w-112",label:(0,i.jsx)($x,{message:"Height"}),value:l.height,onChange:e=>{(e=>{const t={...l,height:e};e&&l.maintainAspect&&(t.width=Py(e,l.usePercentages)),jh().resize.setFormValue(t)})(e.target.valueAsNumber)}}),(0,i.jsx)("button",{type:"submit",className:"hidden",children:(0,i.jsx)($x,{message:"Resize"})})]})}function Hj(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.presets})||[],t=Ah(e=>e.crop.selectedAspectRatio),n=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.crop)?void 0:n.allowCustomRatio})??!0,r=e.filter(e=>e.ratio||!e.ratio&&n).map(e=>(0,i.jsx)(Rj,{children:(0,i.jsxs)(Sb,{onClick:()=>Eh().crop.resetCropzone(e.ratio),className:"flex flex-col items-center justify-between cursor-pointer h-56",children:[(0,i.jsx)($j,{preset:e,selectedRatio:t}),(0,i.jsx)(Gj,{preset:e,selectedRatio:t})]})},e.ratio||e.name));return(0,i.jsx)(Mj,{gap:"gap-18",children:r})}function $j({preset:e,selectedRatio:t}){let n=40,r=30;if(e.ratio){const t=Dy(e.ratio);({width:n,height:r}=Ly(t,n,r))}const o=gc("border-2",{"border-dotted":null===e.ratio,"border-primary":t===e.ratio});return(0,i.jsx)("div",{style:{width:`${n}px`,height:`${r}px`},className:o})}function Gj({preset:e,selectedRatio:t}){const n=gc("mt-4 text-center text-xs",{"text-primary":t===e.ratio});return(0,i.jsx)("div",{className:n,children:e.name?(0,i.jsx)($x,{message:e.name}):e.ratio})}const Yj=yc((0,i.jsx)("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"}),"FlipOutlined");function qj(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(TC,{size:"sm",onClick:()=>{Eh().transform.flip("vertical"),jh().setDirty(!0)},children:(0,i.jsx)(Yj,{})}),(0,i.jsx)(TC,{size:"sm",onClick:()=>{Eh().transform.flip("horizontal"),jh().setDirty(!0)},children:(0,i.jsx)(Yj,{className:"rotate-90"})})]})}const Xj=yc((0,i.jsx)("path",{d:"M7.11 8.53 5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47zM6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47zm1.01 5.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32zM13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93z"}),"RotateLeftOutlined"),Kj=yc((0,i.jsx)("path",{d:"M15.55 5.55 11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45zM19.93 11c-.17-1.39-.72-2.73-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47h2.02zM13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03zm3.89-2.42 1.42 1.41c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.48z"}),"RotateRightOutlined");function Zj(){return(0,i.jsxs)("div",{children:[(0,i.jsx)(TC,{size:"sm",onClick:()=>{Eh().transform.rotateLeft(),jh().setDirty(!0)},children:(0,i.jsx)(Xj,{})}),(0,i.jsx)(TC,{size:"sm",onClick:()=>{Eh().transform.rotateRight(),jh().setDirty(!0)},children:(0,i.jsx)(Kj,{})})]})}function Jj(){return(0,i.jsxs)("div",{className:"flex items-center justify-center gap-16",children:[(0,i.jsx)(qj,{}),(0,i.jsx)(Qj,{}),(0,i.jsx)(Zj,{})]})}function Qj(){const e=(0,o.useRef)(null),{domProps:t,groupId:n,thumbIds:r,trackRef:a,getThumbValueLabel:s}=TA({minValue:-45,maxValue:45,step:1,defaultValue:[jh().crop.straightenAngle],onChange:t=>{const n=t[0];Eh().transform.straighten(n),jh().crop.setTransformAngle(n),jh().setDirty(!0),e.current.style.transform=`translateX(${n}px)`}});return(0,i.jsx)("div",{id:n,role:"group",className:"flex-auto flex-shrink-0 max-w-320 touch-none isolate",children:(0,i.jsxs)("div",{...t,ref:a,className:"h-36 relative",children:[(0,i.jsxs)("output",{htmlFor:r[0],"aria-live":"off",className:"absolute left-1/2 top-1/2 w-40 text-center bg -translate-x-1/2 -translate-y-1/2 z-10",children:[s(0),"\xb0"]}),(0,i.jsx)(eE,{ref:e})]})})}const eE=o.forwardRef((e,t)=>{const n=[...Array(80).keys()],r=n.map(e=>(0,i.jsx)("circle",{cx:2+10*e,cy:"20",r:e%5?.75:2},e));return(0,i.jsx)("div",{className:"relative h-full cursor-pointer overflow-hidden",children:(0,i.jsx)("svg",{ref:t,style:{width:10*n.length},className:"absolute -left-80 h-full fill-current",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",children:r})})});function tE(){return(0,o.useEffect)(()=>(jh().setDirty(!0),Eh().frame.active.hide(),()=>{Eh().frame.active.show()}),[]),(0,i.jsxs)("div",{className:"pb-16",children:[(0,i.jsx)("div",{className:"mb-10",children:(0,i.jsx)(Jj,{})}),(0,i.jsx)(Hj,{})]})}const nE=yc((0,i.jsx)("path",{d:"M 16 6 C 12.484375 6 9.273438 7.070313 6.90625 8.84375 C 4.539063 10.617188 3 13.15625 3 16 C 3 18.84375 4.539063 21.382813 6.90625 23.15625 C 9.273438 24.929688 12.484375 26 16 26 C 19.515625 26 22.726563 24.929688 25.09375 23.15625 C 27.460938 21.382813 29 18.84375 29 16 C 29 13.15625 27.460938 10.617188 25.09375 8.84375 C 22.726563 7.070313 19.515625 6 16 6 Z M 16 8 C 19.109375 8 21.898438 8.957031 23.875 10.4375 C 25.851563 11.917969 27 13.875 27 16 C 27 18.125 25.851563 20.082031 23.875 21.5625 C 21.898438 23.042969 19.109375 24 16 24 C 12.890625 24 10.101563 23.042969 8.125 21.5625 C 6.148438 20.082031 5 18.125 5 16 C 5 13.875 6.148438 11.917969 8.125 10.4375 C 10.101563 8.957031 12.890625 8 16 8 Z "})),rE=yc((0,i.jsx)("path",{d:"M 16 4 C 9.382813 4 4 9.382813 4 16 C 4 22.617188 9.382813 28 16 28 C 22.617188 28 28 22.617188 28 16 C 28 9.382813 22.617188 4 16 4 Z M 16 6 C 21.535156 6 26 10.464844 26 16 C 26 21.535156 21.535156 26 16 26 C 10.464844 26 6 21.535156 6 16 C 6 10.464844 10.464844 6 16 6 Z "})),iE=yc((0,i.jsx)("path",{d:"M 3 6 L 3 26 L 29 26 L 29 6 Z M 5 8 L 27 8 L 27 24 L 5 24 Z "})),oE=yc((0,i.jsx)("path",{d:"M 16 4.90625 L 15.125 6.40625 L 4.71875 24.5 L 3.875 26 L 28.125 26 L 27.28125 24.5 L 16.875 6.40625 Z M 16 8.9375 L 24.65625 24 L 7.34375 24 Z "}));function aE(){const e=(Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.shapes)?void 0:n.items})||[]).map(e=>(0,i.jsx)(Rj,{children:(0,i.jsx)(TC,{variant:"outline",radius:"rounded-2xl",size:"xl",onClick:()=>{Eh().shape.addBasicShape(e.name),jh().setDirty(!0)},children:(0,i.jsx)(sE,{shape:e})})},e.name));return(0,i.jsx)(Mj,{children:e})}function sE({shape:e}){var t;return"Path"===e.type?(0,i.jsx)("svg",{className:"m-auto w-36 h-36",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -100 512 700",children:(0,i.jsx)("path",{className:"fill-transparent stroke-current",d:null==(t=e.options)?void 0:t.path,strokeWidth:25})}):o.cloneElement(lE[e.name],{className:"w-30 h-30"})}const lE={circle:(0,i.jsx)(rE,{viewBox:"0 0 32 32"}),square:(0,i.jsx)(iE,{viewBox:"0 0 32 32"}),triangle:(0,i.jsx)(oE,{viewBox:"0 0 32 32"}),ellipse:(0,i.jsx)(nE,{viewBox:"0 0 32 32"})};function cE(e,t,n){let r,i=n.initialDeps??[];return()=>{var o,a,s,l;let c;n.key&&null!=(o=n.debug)&&o.call(n)&&(c=Date.now());const u=e();if(u.length===i.length&&!u.some((e,t)=>i[t]!==e))return r;let d;if(i=u,n.key&&null!=(a=n.debug)&&a.call(n)&&(d=Date.now()),r=t(...u),n.key&&null!=(s=n.debug)&&s.call(n)){Math.round(100*(Date.now()-c)),Math.round(100*(Date.now()-d))}return null==(l=null==n?void 0:n.onChange)||l.call(n,r),r}}function uE(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const dE=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},hE=e=>e,fE=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},pE=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=e=>{const{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(e=>{const t=e[0];if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return void i({width:e.inlineSize,height:e.blockSize})}i(n.getBoundingClientRect())});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},gE={passive:!0},mE=typeof window>"u"||"onscrollend"in window,vE=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const o=mE?()=>{}:dE(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=r=>()=>{i=n[e.options.horizontal?"scrollLeft":"scrollTop"],o(),t(i,r)},s=a(!0),l=a(!1);return l(),n.addEventListener("scroll",s,gE),n.addEventListener("scrollend",l,gE),()=>{n.removeEventListener("scroll",s),n.removeEventListener("scrollend",l)}},yE=(e,t,n)=>{if(null!=t&&t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},bE=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;const a=e+t;null==(o=null==(i=r.scrollElement)?void 0:i.scrollTo)||o.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})};class wE{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{this._measureElement(e.target,e)})}):null);return{disconnect:()=>{var e;return null==(e=t())?void 0:e.disconnect()},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,n])=>{typeof n>"u"&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hE,rangeExtractor:fE,onChange:()=>{},measureElement:yE,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,...e}},this.notify=(e,t)=>{var n,r;const{startIndex:i,endIndex:o}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(e||i!==(null==a?void 0:a.startIndex)||o!==(null==a?void 0:a.endIndex))&&(null==(r=(n=this.options).onChange)||r.call(n,this,t))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.scrollElement=null},this._didMount=()=>(this.measureElementCache.forEach(this.observer.observe),()=>{this.observer.disconnect(),this.cleanup()}),this._willUpdate=()=>{var e;const t=this.options.getScrollElement();this.scrollElement!==t&&(this.cleanup(),this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this._scrollToOffset(this.scrollOffset,{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.scrollOffset<e?"forward":"backward":null,this.scrollOffset=e;const n=this.isScrolling;this.isScrolling=t,this.notify(n!==t,t)})))},this.getSize=()=>this.scrollRect[this.options.horizontal?"width":"height"],this.getMeasurementOptions=cE(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey],(e,t,n,r)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:n,getItemKey:r}),{key:!1}),this.getFurthestMeasurement=(e,t)=>{const n=new Map,r=new Map;for(let i=t-1;i>=0;i--){const t=e[i];if(n.has(t.lane))continue;const o=r.get(t.lane);if(null==o||t.end>o.end?r.set(t.lane,t):t.end<o.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurements=cE(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r},i)=>{const o=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const a=this.measurementsCache.slice(0,o);for(let s=o;s<e;s++){const e=r(s),o=1===this.options.lanes?a[s-1]:this.getFurthestMeasurement(a,s),l=o?o.end+this.options.gap:t+n,c=i.get(e),u="number"==typeof c?c:this.options.estimateSize(s),d=l+u,h=o?o.lane:s%this.options.lanes;a[s]={index:s,start:l,size:u,end:d,key:e,lane:h}}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=cE(()=>[this.getMeasurements(),this.getSize(),this.scrollOffset],(e,t,n)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=xE(0,r,t=>e[t].start,n);let o=i;for(;o<r&&e[o].end<n+t;)o++;return{startIndex:i,endIndex:o}}({measurements:e,outerSize:t,scrollOffset:n}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=cE(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(e,t,n,r)=>null===t?[]:e({startIndex:t.startIndex,endIndex:t.endIndex,overscan:n,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):-1},this._measureElement=(e,t)=>{const n=this.measurementsCache[this.indexFromElement(e)];if(!n||!e.isConnected)return void this.measureElementCache.forEach((t,n)=>{t===e&&(this.observer.unobserve(e),this.measureElementCache.delete(n))});const r=this.measureElementCache.get(n.key);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.measureElementCache.set(n.key,e));const i=this.options.measureElement(e,t,this);this.resizeItem(n,i)},this.resizeItem=(e,t)=>{const n=t-(this.itemSizeCache.get(e.key)??e.size);0!==n&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(e,n,this):e.start<this.scrollOffset+this.scrollAdjustments)&&this._scrollToOffset(this.scrollOffset,{adjustments:this.scrollAdjustments+=n,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(e.index),this.itemSizeCache=new Map(this.itemSizeCache.set(e.key,t)),this.notify(!0,!1))},this.measureElement=e=>{e&&this._measureElement(e,void 0)},this.getVirtualItems=cE(()=>[this.getIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let r=0,i=e.length;r<i;r++){const i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();return uE(t[xE(0,t.length-1,e=>uE(t[e]).start,e)])},this.getOffsetForAlignment=(e,t)=>{const n=this.getSize();"auto"===t&&(t=e<=this.scrollOffset?"start":e>=this.scrollOffset+n?"end":"start"),"start"===t||("end"===t?e-=n:"center"===t&&(e-=n/2));const r=this.options.horizontal?"scrollWidth":"scrollHeight",i=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[r]:this.scrollElement[r]:0)-this.getSize();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=uE(this.getMeasurements()[e]);if("auto"===t)if(n.end>=this.scrollOffset+this.getSize()-this.options.scrollPaddingEnd)t="end";else{if(!(n.start<=this.scrollOffset+this.options.scrollPaddingStart))return[this.scrollOffset,t];t="start"}const r="end"===t?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(r,t),t]},this.isDynamicMode=()=>this.measureElementCache.size>0,this.cancelScrollToIndex=()=>{null!==this.scrollToIndexTimeoutId&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(e,{align:t="start",behavior:n}={})=>{this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode(),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:n})},this.scrollToIndex=(e,{align:t="auto",behavior:n}={})=>{e=Math.max(0,Math.min(e,this.options.count-1)),this.cancelScrollToIndex(),"smooth"===n&&this.isDynamicMode();const[r,i]=this.getOffsetForIndex(e,t);this._scrollToOffset(r,{adjustments:void 0,behavior:n}),"smooth"!==n&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.measureElementCache.has(this.options.getItemKey(e))){const[t]=this.getOffsetForIndex(e,i);((e,t)=>Math.abs(e-t)<1)(t,this.scrollOffset)||this.scrollToIndex(e,{align:i,behavior:n})}else this.scrollToIndex(e,{align:i,behavior:n})}))},this.scrollBy=(e,{behavior:t}={})=>{this.cancelScrollToIndex(),"smooth"===t&&this.isDynamicMode(),this._scrollToOffset(this.scrollOffset+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;return n=0===t.length?this.options.paddingStart:1===this.options.lanes?(null==(e=t[t.length-1])?void 0:e.end)??0:Math.max(...t.slice(-this.options.lanes).map(e=>e.end)),n-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{var e,t;this.itemSizeCache=new Map,null==(t=(e=this.options).onChange)||t.call(e,this,!1)},this.setOptions(e),this.scrollRect=this.options.initialRect,this.scrollOffset="function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}),this.notify(!1,!1)}}const xE=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(o<r)e=i+1;else{if(!(o>r))return i;t=i-1}}return e>0?e-1:0},CE=typeof document<"u"?o.useLayoutEffect:o.useEffect;function _E(){const e=Ah(e=>{var t;return null==(t=e.config.ui)?void 0:t.activeTheme});return Ah(t=>{var n;return((null==(n=t.config.ui)?void 0:n.themes)||[]).find(t=>t.name===e)})}function SE({category:e}){const t=_E(),n=e.name,r=e.list?e.list:Array.from(Array(e.items).keys()),a=(0,o.useRef)(null),s=function(e){return function(e){const t=o.useReducer(()=>({}),{})[1],n={...e,onChange:(n,r)=>{var i;r?(0,ne.flushSync)(t):t(),null==(i=e.onChange)||i.call(e,n,r)}},[r]=o.useState(()=>new wE(n));return r.setOptions(n),o.useEffect(()=>r._didMount(),[]),CE(()=>r._willUpdate()),r}({observeElementRect:pE,observeElementOffset:vE,scrollToFn:bE,...e})}({horizontal:!0,count:r.length,getScrollElement:()=>a.current,estimateSize:(0,o.useCallback)(()=>52,[]),overscan:5});return(0,o.useEffect)(()=>{s.scrollToIndex(0)},[n]),(0,i.jsx)(o.Fragment,{children:(0,i.jsx)("div",{ref:a,className:"tiny-scrollbar overflow-x-auto overflow-y-hidden",style:{height:"52px"},children:(0,i.jsx)("div",{className:"h-full relative mx-auto",style:{width:`${s.getTotalSize()}px`},children:s.getVirtualItems().map(n=>{const o=`${r[n.index]}`;return(0,i.jsx)("div",{className:"absolute top-0 left-0 h-full",style:{width:`${n.size}px`,transform:`translateX(${n.start}px)`},children:(0,i.jsx)(kb,{variant:"outline",radius:"rounded-xl",size:"md",equalWidth:!0,onClick:async()=>{await Eh().shape.addSticker(e.name,o),jh().setDirty(!0)},children:(0,i.jsx)("img",{className:gc("m-auto m-auto w-28 h-28",e.invertPreview&&(null==t?void 0:t.isDark)&&"invert"),src:By(e,o),alt:o})})},n.index)})})})})}function kE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.stickers)?void 0:n.items})||[],[t,n]=(0,o.useState)(e[0]),r=e.map(e=>{const n=t===e,r=lc[e.name];return(0,i.jsx)(kb,{size:"xs",color:n?"primary":null,value:e,children:(0,i.jsx)("span",{className:"capitalize",children:r?(0,i.jsx)($x,{...r}):e.name})},e.name)});return(0,i.jsxs)("div",{className:"h-92",children:[(0,i.jsx)("div",{className:"mb-10 w-full hide-scrollbar overflow-x-auto overflow-y-hidden flex",children:(0,i.jsx)(LC,{value:t,onChange:e=>n(e),variant:"outline",radius:"rounded-full",className:"mx-auto",children:r})}),t&&(0,i.jsx)(SE,{category:t})]})}function AE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.frame)?void 0:n.items})||[],t=Ah(e=>e.frame.active);(0,o.useEffect)(()=>{jh().frame.active&&jh().frame.showOptionsPanel()},[]);const n=e.map(e=>{const n=vy(`images/frames/${e.name}/thumbnail.png`),r=(null==t?void 0:t.name)===e.name;return(0,i.jsx)(Rj,{children:(0,i.jsxs)("button",{type:"button",className:"border-2 overflow-hidden relative rounded border cursor-pointer "+(r?"border-primary":""),onClick:()=>{jh().setDirty(!0),r?Eh().frame.remove():Eh().frame.add(e.name)},children:[r&&(0,i.jsx)(jE,{}),(0,i.jsx)("img",{draggable:"false",className:"w-64 h-64",src:n,alt:e.name})]})},e.name)});return(0,i.jsx)(Mj,{children:n})}function jE(){return(0,i.jsx)("span",{className:"bg-background/70 absolute inset-0 text-primary",children:(0,i.jsx)(Ij,{className:"svg-icon icon-md absolute inset-0 block m-auto"})})}function EE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.text)?void 0:n.items});(0,o.useEffect)(()=>{e&&xy(e,{prefixSrc:vy,id:"pixie-fonts"}).catch(()=>{})},[e]),(0,o.useEffect)(()=>{Eh().text.selectOrAddText()&&jh().setDirty(!0)},[]);const t=(e||[]).map(e=>(0,i.jsx)(Rj,{children:(0,i.jsx)(IE,{fontConfig:e})},e.family));return(0,i.jsx)(Mj,{className:"pt-6",children:t})}function IE({fontConfig:e}){var t;const n=Ah(e=>e.objects.active.editableProps.fontFamily),r=gc("block px-6 w-110 h-68 text-sm bg border rounded-2xl",{"border-primary":n===e.family,"text-primary":n===e.family});return(0,i.jsx)("button",{type:"button",className:r,style:{fontFamily:e.family.includes('"')?e.family:`"${e.family}"`,fontWeight:(null==(t=e.descriptors)?void 0:t.weight)||"normal"},onClick:async()=>{Eh().text.selectOrAddText(),jh().setDirty(!0),Eh().objects.setValues({fontFamily:e.family})},children:e.family})}const TE=yc((0,i.jsx)("path",{d:"M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7H288h9.4H512c17.7 0 32-14.3 32-32s-14.3-32-32-32H387.9L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416H288l-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"}),"EraserFA","0 0 576 512");function OE(){return(0,o.useEffect)(()=>(Eh().draw.enable(),()=>{Eh().draw.disable()}),[]),(0,i.jsxs)(Mj,{gap:"gap-16",children:[(0,i.jsx)(Rj,{children:(0,i.jsx)(CA,{size:"sm",label:(0,i.jsx)($x,{message:"Brush Color"}),value:Eh().draw.currentBrush.color,onChange:e=>{Eh().draw.setBrushColor(e)}})}),(0,i.jsx)(Rj,{children:(0,i.jsx)(PE,{})}),(0,i.jsx)(Rj,{children:(0,i.jsx)(FE,{})})]})}function FE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.draw)?void 0:n.brushSizes})||[],[t,n]=(0,o.useState)(Eh().draw.currentBrush.width);return(0,i.jsx)(DA,{selectionMode:"single",selectedValue:t,onSelectionChange:e=>{n(e),Eh().draw.setBrushSize(e)},size:"sm",label:(0,i.jsx)($x,{message:"Brush Size"}),children:e.map(e=>(0,i.jsx)(Fb,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:[(0,i.jsx)("div",{className:"flex-shrink-0 mr-8 border-[3px] rounded-full",style:{width:`${e}px`,height:`${e}px`}}),e]})},e))})}function PE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.tools)?void 0:t.draw)?void 0:n.brushTypes})||[],t=_E(),[n,r]=(0,o.useState)(Eh().draw.currentBrush.type);return(0,i.jsx)(DA,{selectionMode:"single",selectedValue:n,onSelectionChange:e=>{r(e),Eh().draw.setBrushType(e)},size:"sm",label:(0,i.jsx)($x,{message:"Brush Type"}),children:e.map(e=>(0,i.jsx)(Fb,{value:e,children:(0,i.jsxs)("div",{className:"flex items-center",children:["EraserBrush"===e?(0,i.jsx)(TE,{className:"mr-8"}):(0,i.jsx)("img",{className:"flex-shrink-0 mr-8 w-24 h-24",src:ME(e,null==t?void 0:t.isDark),alt:""}),(0,i.jsx)($x,{message:e.replace(/([A-Z])/g," $1").trim()})]})},e))})}function ME(e,t=!1){return vy(`images/brushes/${t?"white":"black"}/${e.replace("Brush","").toLowerCase()}.png`)}function RE(){const{trans:e}=gA(),t=Ah(e=>e.corners.radius);return(0,o.useEffect)(()=>(jh().setDirty(!0),Eh().corners.showPreview(),()=>Eh().corners.hidePreview()),[]),(0,i.jsx)("div",{className:"max-w-320 mx-auto",children:(0,i.jsx)(PA,{minValue:1,maxValue:300,label:e({message:"Radius"}),getValueLabel:e=>`${e}px`,onChange:e=>{Eh().corners.updatePreview(e),jh().corners.setRadius(e)},value:t})})}const LE={initial:{y:"130%",opacity:0},animate:{y:0,opacity:1},exit:{y:"130%",opacity:0,left:0,position:"absolute",overflowY:"hidden"},transition:{type:"tween",duration:.15}};function DE({activeTool:e}){const t=function(e){switch(e){case fc.FILTER:return(0,i.jsx)(Lj,{});case fc.RESIZE:return(0,i.jsx)(Wj,{});case fc.CROP:return(0,i.jsx)(tE,{});case fc.DRAW:return(0,i.jsx)(OE,{});case fc.TEXT:return(0,i.jsx)(EE,{});case fc.SHAPES:return(0,i.jsx)(aE,{});case fc.STICKERS:return(0,i.jsx)(kE,{});case fc.FRAME:return(0,i.jsx)(AE,{});case fc.CORNERS:return(0,i.jsx)(RE,{});default:return null}}(e);return(0,i.jsx)(gv.div,{className:"relative h-full w-full text-sm bg select-none overflow-hidden",...LE,children:t})}function NE({className:e}){const t=Ah(e=>e.activeTool);return(0,i.jsx)("nav",{className:gc("z-navbar min-h-86 flex-shrink-0 px-16 relative overflow-hidden",e),children:(0,i.jsx)(Cv,{initial:!1,children:t?(0,i.jsx)(DE,{activeTool:t},"tool-controls"):(0,i.jsx)(zE,{},"nav-items")})})}function zE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.nav)?void 0:n.items})||[];return(0,i.jsx)(gv.div,{className:"w-full h-full bg-inherit",...LE,children:(0,i.jsx)(Mj,{children:e.map(e=>(0,i.jsx)(Rj,{children:(0,i.jsx)(BE,{item:e})},e.name))})})}function BE({item:e}){const t=Nc[e.name];return(0,i.jsxs)(Sb,{variant:"outline",color:"paper",className:"flex-col flex-shrink-0 w-68 h-68",radius:"rounded-2xl",onClick:()=>{"string"==typeof e.action?Mh(e.action):"function"==typeof e.action&&e.action(jh().editor)},children:[(0,i.jsx)("div",{className:"mb-1",children:(0,i.jsx)(OC,{className:"icon-md",icon:e.icon})}),(0,i.jsx)("div",{className:"mt-6 text-xs capitalize max-w-[90%] overflow-hidden overflow-ellipsis",children:t?(0,i.jsx)($x,{...t}):e.name})]})}function VE(){const e=Ah(e=>e.history.items),t=Ah(e=>e.history.pointer);return(0,i.jsxs)(gv.div,{...Mx,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)($x,{message:"History"}),(0,i.jsx)(TC,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{jh().togglePanel("history",!1)},children:(0,i.jsx)($C,{})})]}),(0,i.jsx)("div",{className:"p-10",children:e.map(n=>{const r=n.id===e[t].id,a=Lc[n.name],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(kb,{onClick:()=>{r||Eh().history.load(n)},variant:"outline",color:r?"primary":null,size:"sm",className:gc("w-full mb-8",r&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)($x,{...a.name})},n.id)})})]})}function UE(e){const{children:t,className:n,color:r,onDismiss:a,leftAdornment:s,rightAdornment:l,hideDismissButton:c=!1,size:u,showDivider:d,justify:h="justify-between",titleFontWeight:f="font-semibold",titleTextSize:p=("xs"===u?"text-xs":"text-sm"),closeButtonSize:g=("xs"===u?"xs":"sm"),actions:m}=e,{labelId:v,isDismissable:y,close:b}=(0,o.useContext)(fA);return(0,i.jsxs)("div",{className:gc(n,"flex flex-shrink-0 items-center gap-10",f,d&&"border-b",WE(e),r||"text-main",h),children:[s,(0,i.jsx)("h3",{id:v,className:gc(p,"mr-auto leading-5 opacity-90"),children:t}),l,m,y&&!c&&(0,i.jsx)(TC,{"aria-label":"Dismiss",onClick:()=>{a?a():b()},size:g,className:gc("-mr-8 text-muted",l&&"sr-only"),children:(0,i.jsx)($C,{})})]})}function WE({size:e,padding:t}){if(t)return t;switch(e){case"2xs":case"xs":return"px-14 py-4";case"sm":return"px-18 py-4";default:return"px-24 py-6"}}const HE=(0,o.forwardRef)((e,t)=>{const{children:n,className:r,padding:o,size:a,...s}=e;return(0,i.jsx)("div",{...s,ref:t,className:gc(r,$E(e),"overflow-y-auto overflow-x-hidden overscroll-contain text-sm flex-auto"),children:n})});function $E({size:e,padding:t}){if(t)return t;switch(e){case"xs":return"p-14";case"sm":return"p-18";default:return"px-24 py-20"}}function GE(){const e=Ah(e=>e.openPanels.newImage);return(0,i.jsx)(xA,{isOpen:e,disableInitialTransition:!0,type:"modal",isDismissable:!1,children:(0,i.jsx)(YE,{})})}function YE(){const[e,t]=(0,o.useState)("default");return(0,i.jsxs)(yA,{className:"text-center max-w-max text-main",size:"auto",children:[(0,i.jsx)(UE,{padding:"px-24 pt-24 pb-12",showDivider:!1,children:(0,i.jsx)($x,{message:"Open a photo or design to get started"})}),(0,i.jsx)(HE,{children:(0,i.jsx)("default"===e?qE:KE,{setActivePanel:t})})]})}function qE({setActivePanel:e}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(kb,{className:"mr-20",size:"sm",variant:"raised",color:"primary",onClick:()=>{Eh().import.uploadAndReplaceMainImage()},children:(0,i.jsx)($x,{message:"Open Photo"})}),(0,i.jsx)(kb,{variant:"outline",size:"sm",color:"primary",onClick:()=>{e("newCanvas")},children:(0,i.jsx)($x,{message:"Create New"})}),(0,i.jsx)(XE,{})]})}function XE(){const e=Ah(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.openImageDialog)?void 0:n.sampleImages});return null!=e&&e.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"relative py-20 text-main",children:[(0,i.jsx)("hr",{className:"absolute h-1 border-none bg-divider w-full top inset-0 m-auto"}),(0,i.jsx)("span",{className:"text-sm bg px-6 relative",children:(0,i.jsx)($x,{message:"or use sample"})})]}),(0,i.jsx)("ul",{className:"flex items-center gap-16",children:e.map(e=>(0,i.jsx)("li",{className:"shrink-0",children:(0,i.jsx)("button",{type:"button",onClick:async()=>{"function"==typeof e.action?e.action():e.url.endsWith(".json")?(await Oh(vy(e.url)),jh().togglePanel("newImage",!1)):(await Eh().import.openBackgroundImage(vy(e.url)),jh().togglePanel("newImage",!1))},children:(0,i.jsx)("img",{className:"w-80 h-80 rounded overflow-hidden transition-shadow hover:shadow-md",src:vy(e.thumbnail),alt:""})})},e.url||e.thumbnail))})]}):null}function KE({setActivePanel:e}){const[t,n]=(0,o.useState)({width:800,height:600,bgColor:"transparent"});return(0,i.jsxs)("form",{onSubmit:e=>{e.preventDefault();const{width:n,height:r,bgColor:i}=t;n&&r&&(jh().setConfig({blankCanvasSize:{width:n,height:r}}),Eh().canvas.openNew(n,r,i),jh().togglePanel("newImage",!1),Eh().history.addInitial())},children:[(0,i.jsx)(AC,{type:"number",label:(0,i.jsx)($x,{message:"Width"}),value:t.width,min:1,required:!0,className:"mb-16",onChange:e=>{n({...t,width:e.target.valueAsNumber})}}),(0,i.jsx)(AC,{type:"number",label:(0,i.jsx)($x,{message:"Height"}),value:t.height,min:1,required:!0,className:"mb-16",onChange:e=>{n({...t,height:e.target.valueAsNumber})}}),(0,i.jsx)(CA,{onChange:e=>{n({...t,bgColor:e})},className:"mb-16",value:t.bgColor,label:(0,i.jsx)($x,{message:"Background color"})}),(0,i.jsxs)("div",{className:"text-right",children:[(0,i.jsx)(kb,{size:"sm",variant:"text",className:"mr-10",onClick:()=>{e("default")},children:(0,i.jsx)($x,{message:"Cancel"})}),(0,i.jsx)(kb,{size:"sm",type:"submit",variant:"raised",color:"primary",children:(0,i.jsx)($x,{message:"Create"})})]})]})}const ZE=(0,o.forwardRef)((e,t)=>{const n=gC(e),{label:r,children:a,size:s,className:l,orientation:c="horizontal",disabled:u,required:d,invalid:h,errorMessage:f,description:p}=e,g=(0,o.useId)(),m=e.name||g;return(0,i.jsxs)("fieldset",{"aria-describedby":p?`${g}-description`:void 0,ref:t,className:gc("text-left",l),children:[r&&(0,i.jsx)("legend",{className:n.label,children:r}),(0,i.jsx)("div",{className:gc("flex",r?"mt-6":"mt-0","vertical"===c?"flex-col gap-10":"flex-row gap-16"),children:o.Children.map(a,e=>{if((0,o.isValidElement)(e))return(0,o.cloneElement)(e,{name:m,size:s,invalid:e.props.invalid||h||void 0,disabled:e.props.disabled||u,required:e.props.required||d})})}),p&&!f&&(0,i.jsx)("div",{className:n.description,id:`${g}-description`,children:p}),f&&(0,i.jsx)("div",{className:n.error,children:f})]})}),JE=(0,o.forwardRef)((e,t)=>{const{children:n,autoFocus:r,size:o,invalid:a,isFirst:s,...l}=e,c=$v(t);SC({autoFocus:r},c);const u=function(e){switch(e){case"xs":return{circle:"h-12 w-12",label:"text-xs"};case"sm":return{circle:"h-16 w-16",label:"text-sm"};case"lg":return{circle:"h-24 w-24",label:"text-lg"};default:return{circle:"h-20 w-20",label:"text-base"}}}(o);return(0,i.jsxs)("label",{className:gc("inline-flex gap-8 select-none items-center whitespace-nowrap align-middle",u.label,e.disabled&&"text-disabled pointer-events-none",e.invalid&&"text-danger"),children:[(0,i.jsx)("input",{type:"radio",className:gc("focus-visible:ring outline-none","rounded-full transition-button border-2 appearance-none","border-text-muted disabled:border-disabled-fg checked:border-primary checked:hover:border-primary-dark","before:bg-primary disabled:before:bg-disabled-fg before:hover:bg-primary-dark","before:h-full before:w-full before:block before:rounded-full before:scale-10 before:opacity-0 before:transition before:duration-200","checked:before:scale-[.65] checked:before:opacity-100",u.circle),ref:c,...l}),n&&(0,i.jsx)("span",{children:n})]})});function QE(){const e=Ah(e=>e.openPanels.export);return(0,i.jsx)(xA,{isOpen:e,onOpenChange:e=>{e||jh().togglePanel("export",!1)},type:"modal",children:(0,i.jsx)(eI,{})})}function eI(){const[e,t]=(0,o.useState)(()=>{var e,t,n,r,i,o;return{filename:(null==(t=null==(e=jh().config.tools)?void 0:e.export)?void 0:t.defaultName)||"image",format:(null==(r=null==(n=jh().config.tools)?void 0:n.export)?void 0:r.defaultFormat)||"jpeg",quality:(null==(o=null==(i=jh().config.tools)?void 0:i.export)?void 0:o.defaultQuality)||.8}});return(0,i.jsx)(yA,{className:"text-center max-w-max text-main",size:"auto",children:(0,i.jsx)(HE,{children:(0,i.jsxs)("form",{onSubmit:t=>{t.preventDefault(),Eh().export.save(e.filename,e.format,e.quality),jh().togglePanel("export",!1)},children:[(0,i.jsx)(AC,{required:!0,size:"sm",label:(0,i.jsx)($x,{message:"Save As"}),value:e.filename,onChange:n=>{t({...e,filename:n.target.value})}}),(0,i.jsxs)(ZE,{size:"sm",className:"my-20","aria-label":"Image format",children:[(0,i.jsx)(JE,{value:"jpeg",checked:"jpeg"===e.format,onChange:n=>{t({...e,format:n.target.value})},children:"JPEG"}),(0,i.jsx)(JE,{value:"png",checked:"png"===e.format,onChange:n=>{t({...e,format:n.target.value})},children:"PNG"}),(0,i.jsx)(JE,{value:"json",checked:"json"===e.format,onChange:n=>{t({...e,format:n.target.value})},children:"JSON"})]}),(0,i.jsx)(PA,{size:"sm",minValue:.1,step:.1,maxValue:1,value:e.quality,onChange:n=>{t({...e,quality:n})},formatOptions:{style:"percent"},label:(0,i.jsx)($x,{message:"Quality"})}),(0,i.jsx)(kb,{variant:"raised",color:"primary",type:"submit",className:"mt-20 w-full",size:"sm",children:(0,i.jsx)($x,{message:"Save"})})]})})})}function tI(){const e=Ah(e=>e.objects.all),t=Ah(e=>e.objects.active.id);return(0,i.jsxs)(gv.div,{...Mx,className:"absolute bottom-20 right-20 w-224 max-w-[calc(100%-40px)] max-h-[calc(100%-40px)] bg-paper shadow-xl border focus:outline-none rounded overflow-hidden",children:[(0,i.jsxs)("div",{className:"px-10 py-2 mb-4 font-medium text-sm border-b flex items-center",children:[(0,i.jsx)($x,{message:"Objects"}),(0,i.jsx)(TC,{size:"xs",className:"ml-auto flex-shrink-0",onClick:()=>{jh().togglePanel("objects",!1)},children:(0,i.jsx)($C,{})})]}),(0,i.jsx)("div",{className:"p-8",children:e.map(e=>{const n=e.id===t,r=e.name;if(!r)return null;const a=_d[r],s=a.icon&&o.createElement(a.icon,{className:"icon-sm"});return(0,i.jsx)(kb,{onClick:()=>{n||!e.selectable||Eh().objects.select(e.id)},variant:"outline",color:n?"primary":null,size:"sm",className:gc("w-full mb-8",(n||!e.selectable)&&"pointer-events-none"),justify:"justify-start",startIcon:s,children:(0,i.jsx)($x,{...a.name})},e.id)})})]})}function nI(){const e=Ah(e=>e.openPanels.history),t=Ah(e=>e.openPanels.objects);return(0,i.jsxs)("div",{className:"z-modal",children:[(0,i.jsxs)(Cv,{children:[e&&(0,i.jsx)(VE,{},"historyPanel"),t&&(0,i.jsx)(tI,{},"objListPanel")]}),(0,i.jsx)(GE,{}),(0,i.jsx)(QE,{})]})}function rI(){return rI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rI.apply(this,arguments)}var iI,oI;function aI(e,t){if(!1===e||null===e||typeof e>"u")throw new Error(t)}function sI(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function lI(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function cI(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}function uI(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function dI(e,t){let n=function(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}(e);return t?n.map((t,n)=>n===e.length-1?t.pathname:t.pathnameBase):n.map(e=>e.pathnameBase)}function hI(e,t,n,r){let i;void 0===r&&(r=!1),"string"==typeof e?i=lI(e):(i=rI({},e),aI(!i.pathname||!i.pathname.includes("?"),uI("?","pathname","search",i)),aI(!i.pathname||!i.pathname.includes("#"),uI("#","pathname","hash",i)),aI(!i.search||!i.search.includes("#"),uI("#","search","hash",i)));let o,a=""===e||""===i.pathname,s=a?"/":i.pathname;if(null==s)o=n;else{let e=t.length-1;if(!r&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?lI(e):e;return{pathname:n?n.startsWith("/")?n:cI(n,t):t,search:pI(r),hash:gI(i)}}(i,o),c=s&&"/"!==s&&s.endsWith("/"),u=(a||"."===s)&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}!function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(iI||(iI={})),function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(oI||(oI={}));const fI=e=>e.join("/").replace(/\/\/+/g,"/"),pI=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",gI=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"",mI=["post","put","patch","delete"];new Set(mI);const vI=["get",...mI];function yI(){return yI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yI.apply(this,arguments)}new Set(vI);const bI=o.createContext(null),wI=o.createContext(null),xI=o.createContext(null),CI=o.createContext({outlet:null,matches:[],isDataRoute:!1});function _I(){return null!=o.useContext(xI)}function SI(){return _I()||aI(!1),o.useContext(xI).location}function kI(e){o.useContext(wI).static||o.useLayoutEffect(e)}function AI(){let{isDataRoute:e}=o.useContext(CI);return e?function(){let{router:e}=function(){let e=o.useContext(bI);return e||aI(!1),e}(EI.UseNavigateStable),t=function(){let e=function(){let e=o.useContext(CI);return e||aI(!1),e}(),t=e.matches[e.matches.length-1];return t.route.id||aI(!1),t.route.id}(II.UseNavigateStable),n=o.useRef(!1);return kI(()=>{n.current=!0}),o.useCallback(function(r,i){void 0===i&&(i={}),n.current&&("number"==typeof r?e.navigate(r):e.navigate(r,yI({fromRouteId:t},i)))},[e,t])}():function(){_I()||aI(!1);let e=o.useContext(bI),{basename:t,future:n,navigator:r}=o.useContext(wI),{matches:i}=o.useContext(CI),{pathname:a}=SI(),s=JSON.stringify(dI(i,n.v7_relativeSplatPath)),l=o.useRef(!1);return kI(()=>{l.current=!0}),o.useCallback(function(n,i){if(void 0===i&&(i={}),!l.current)return;if("number"==typeof n)return void r.go(n);let o=hI(n,JSON.parse(s),a,"path"===i.relative);null==e&&"/"!==t&&(o.pathname="/"===o.pathname?t:fI([t,o.pathname])),(i.replace?r.replace:r.push)(o,i.state,i)},[t,r,s,a,e])}()}function jI(e,t){let{relative:n}=void 0===t?{}:t,{future:r}=o.useContext(wI),{matches:i}=o.useContext(CI),{pathname:a}=SI(),s=JSON.stringify(dI(i,r.v7_relativeSplatPath));return o.useMemo(()=>hI(e,JSON.parse(s),a,"path"===n),[e,s,a,n])}var EI=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(EI||{}),II=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(II||{});function TI(){return TI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TI.apply(this,arguments)}new Promise(()=>{});const OI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"];try{window.__reactRouterVersion="6"}catch{}const FI=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",PI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MI=o.forwardRef(function(e,t){let n,{onClick:r,relative:i,reloadDocument:a,replace:s,state:l,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&(i[n]=e[n]);return i}(e,OI),{basename:p}=o.useContext(wI),g=!1;if("string"==typeof u&&PI.test(u)&&(n=u,FI))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=function(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}(t.pathname,p);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:g=!0}catch{}let m=function(e,t){let{relative:n}=void 0===t?{}:t;_I()||aI(!1);let{basename:r,navigator:i}=o.useContext(wI),{hash:a,pathname:s,search:l}=jI(e,{relative:n}),c=s;return"/"!==r&&(c="/"===s?r:fI([r,s])),i.createHref({pathname:c,search:l,hash:a})}(u,{relative:i}),v=function(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l}=void 0===t?{}:t,c=AI(),u=SI(),d=jI(e,{relative:s});return o.useCallback(t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,n)){t.preventDefault();let n=void 0!==r?r:sI(u)===sI(d);c(e,{replace:n,state:i,preventScrollReset:a,relative:s,unstable_viewTransition:l})}},[u,c,d,r,i,n,e,a,s,l])}(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:i,unstable_viewTransition:h});return o.createElement("a",TI({},f,{href:n||m,onClick:g||a?r:function(e){r&&r(e),e.defaultPrevented||v(e)},ref:t,target:c}))});var RI,LI;!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"}(RI||(RI={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(LI||(LI={}));const DI=yc((0,i.jsx)("path",{d:"M11 15h2v2h-2v-2zm0-8h2v6h-2V7zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutlineOutlined"),NI=yc((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlined"),zI={opacity:0,y:50,scale:.3},BI={opacity:1,y:0,scale:1},VI={opacity:0,scale:.5};function UI(){const e=Nh(e=>e.toasts);return(0,i.jsx)("div",{className:"pointer-events-none relative",children:(0,i.jsx)(Cv,{initial:!1,children:e.map(e=>(0,i.jsx)("div",{className:gc("fixed z-toast mx-auto p-20","bottom-center"===e.position?"bottom-0 left-0 right-0":"bottom-0 right-0"),children:(0,i.jsxs)(gv.div,{initial:e.disableEnterAnimation?void 0:zI,animate:e.disableEnterAnimation?void 0:BI,exit:e.disableExitAnimation?void 0:VI,className:gc("pointer-events-auto mx-auto flex max-h-100 min-h-50 w-min min-w-288 max-w-500 items-center gap-10 rounded-lg border bg-paper bg-paper py-6 pl-16 pr-6 text-sm text-main shadow-lg"),onPointerEnter:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onPointerLeave:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},role:"alert","aria-live":"danger"===e.type?"assertive":"polite",children:["danger"===e.type&&(0,i.jsx)(DI,{className:"flex-shrink-0 text-danger",size:"md"}),"loading"===e.type&&(0,i.jsx)(MA,{size:"sm",className:"flex-shrink-0",isIndeterminate:!0}),"positive"===e.type&&(0,i.jsx)(NI,{className:"flex-shrink-0 text-positive",size:"md"}),(0,i.jsx)("div",{className:"mr-auto w-max overflow-hidden overflow-ellipsis","data-testid":"toast-message",children:(0,i.jsx)(FC,{value:e.message})}),e.action&&(0,i.jsx)(kb,{variant:"text",color:"primary",size:"sm",className:"flex-shrink-0",onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},onClick:()=>zh().remove(e.id),elementType:MI,to:e.action.action,children:(0,i.jsx)(FC,{value:e.action.label})}),"loading"!==e.type&&(0,i.jsx)(TC,{onFocus:()=>{var t;return null==(t=e.timer)?void 0:t.pause()},onBlur:()=>{var t;return null==(t=e.timer)?void 0:t.resume()},type:"button",className:"flex-shrink-0",onClick:()=>{zh().remove(e.id)},size:"sm",children:(0,i.jsx)($C,{})})]})},e.id))})})}function WI(e){return Bv()?e.metaKey:e.ctrlKey}function HI(e){switch(e.key){case"z":WI(e)&&(e.preventDefault(),e.stopPropagation(),e.shiftKey?Eh().history.redo():Eh().history.undo());break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),Eh().objects.move("up");break;case"ArrowRight":e.preventDefault(),e.stopPropagation(),Eh().objects.move("right");break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),Eh().objects.move("down");break;case"ArrowLeft":e.preventDefault(),e.stopPropagation(),Eh().objects.move("left");break;case"Delete":e.preventDefault(),e.stopPropagation(),Eh().objects.delete();break;case"v":WI(e)&&(e.preventDefault(),e.stopPropagation(),async function(){try{const e=await navigator.clipboard.read();for(const t of e)for(const e of t.types)if(e.startsWith("image/")){const n=await t.getType(e),r=new FileReader;return r.onload=e=>{var t;null!=(t=e.target)&&t.result&&Eh().import.addImageFromData(e.target.result)},void r.readAsDataURL(n)}}catch(e){}}())}}const $I=new Map,GI=new Map,YI={};async function*qI(e){const t=e.createReader();let n;do{n=await new Promise((e,n)=>{t.readEntries(e,n)});for(const e of n)if(e.isFile){if(".DS_Store"===e.name)continue;const t=await XI(e);yield new tb(t,e.fullPath)}else e.isDirectory&&(yield*qI(e))}while(n.length>0)}function XI(e){return new Promise((t,n)=>e.file(t,n))}function KI(e){return null!=YI.dragTargetId?$I.get(YI.dragTargetId):e.dataTransfer.types.includes("Files")?{type:"nativeFile",el:null,ref:null,getData:()=>async function(e){const t=[];for await(const n of e)t.push(n);return t}(async function*(e){const t=[];for(const n of e.items)if("file"===n.kind){const e=n.webkitGetAsEntry();e&&t.push(e)}for(const n of t)if(n.isFile){if(".DS_Store"===n.name)continue;const e=await XI(n);yield new tb(e,n.fullPath)}else n.isDirectory&&(yield*qI(n))}(e.dataTransfer))}:void 0}function ZI(){const e=Ah(e=>{var t;return null==(t=e.config.ui)?void 0:t.visible})??!0,t=Ah(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.nav)?void 0:n.position})??"bottom",n=Ah(e=>{var t,n;return null==(n=null==(t=e.config.ui)?void 0:t.menubar)?void 0:n.position})??"top",r=Ah(e=>{var t;return null==(t=e.config.ui)?void 0:t.allowEditorClose})??!0,a=(0,o.useRef)(null),s=(0,o.useRef)(null),{isModal:l,isMobile:c}=GC(),u=(0,o.useCallback)(async e=>{var t,n;if(jh().activeTool||jh().dirty||"nativeFile"!==e.type)return;const r=await e.getData();Eh().import.fileIsValid(r[0])&&((null==(n=null==(t=jh().config.tools)?void 0:t.import)?void 0:n.openDroppedImageAsBackground)?await Eh().import.openBackgroundImage(r[0]):await Eh().import.openUploadedFile(r[0]))},[]),{droppableProps:d}=function({id:e,disabled:t,ref:n,...r}){const i=(0,o.useRef)({dragOverElements:new Set,dropActivateTimer:void 0}).current,a=(0,o.useRef)(r);a.current=r,(0,o.useLayoutEffect)(()=>(GI.set(e,{...GI.get(e),disabled:t,id:e,ref:n}),()=>{GI.delete(e)}),[e,a,t,n]);const s=e=>{var t;const r=a.current,i=r.allowDragEventsFromItself||n.current!==(null==(t=e.ref)?void 0:t.current);return!(!(null!=e&&e.type&&i&&r.types.includes(e.type))||r.acceptsDrop&&!r.acceptsDrop(e))},l=e=>{var t,n;const r=KI(e);r&&(null==(n=(t=a.current).onDragLeave)||n.call(t,r))};return{droppableProps:t?{}:{onDragOver:e=>{var t,n;e.preventDefault(),e.stopPropagation();const r=KI(e);r&&s(r)&&(null==(n=(t=a.current).onDragOver)||n.call(t,r,e))},onDragEnter:e=>{var t,n;if(e.stopPropagation(),i.dragOverElements.add(e.target),i.dragOverElements.size>1)return;const r=KI(e);r&&s(r)&&(null==(n=(t=a.current).onDragEnter)||n.call(t,r),clearTimeout(i.dropActivateTimer),"function"==typeof a.current.onDropActivate&&(i.dropActivateTimer=setTimeout(()=>{var e,t;r&&(null==(t=(e=a.current).onDropActivate)||t.call(e,r))},400)))},onDragLeave:e=>{e.stopPropagation(),i.dragOverElements.delete(e.target);for(const n of i.dragOverElements)e.currentTarget.contains(n)||i.dragOverElements.delete(n);if(i.dragOverElements.size>0)return;const t=KI(e);t&&s(t)&&(l(e),clearTimeout(i.dropActivateTimer))},onDrop:async e=>{var t,n,r,o;e.preventDefault(),e.stopPropagation(),i.dragOverElements.clear(),l(e),clearTimeout(i.dropActivateTimer);const c=KI(e);c&&(null==(n=(t=a.current).onDragLeave)||n.call(t,c),s(c)&&(null==(o=(r=a.current).onDrop)||o.call(r,c)))}}}}({id:"pixie-root",ref:s,types:["nativeFile"],onDrop:u});(0,o.useEffect)(()=>{var e,t;jh().fabric||(Ah.setState({canvasRef:a}),function(e){const t=function(e){var t;const n=new Jv.fabric.Canvas(e,{width:1,height:1});n.preserveObjectStacking=!0,n.selection=!1,n.renderOnAddRemove=!1;const r=jh().config.textureSize;r&&(Jv.fabric.textureSize=r);const i={...null==(t=jh().config.objectDefaults)?void 0:t.global,...ey};Object.keys(i).forEach(e=>{Jv.fabric.Object.prototype[e]=i[e]}),n.on("object:added",e=>{var t,n;e.target&&(null==(n=null==(t=e.target)?void 0:t.data)||!n.id)&&(e.target.data||(e.target.data={}),e.target.data.id=ty(10))});const o=Jv.fabric.Object.prototype.controls;return Object.keys(o).forEach(e=>{delete o[e]}),n}(e);jh().editor.fabric=t,Ah.setState({fabric:t}),jh().editor.tools={canvas:new sy,objects:new fy,zoom:new iy,history:new Cy,filter:new Ey,resize:new Ry,crop:new Ny,merge:new _y,shape:new zy,frame:new Hy,text:new $y,draw:new Jy,transform:new mb,import:new cb,watermark:new db,export:new pb,corners:new gb}}(a.current),null!=(e=jh().config.ui)&&e.defaultTool&&jh().setActiveTool(null==(t=jh().config.ui)?void 0:t.defaultTool,null),Eh().canvas.loadInitialContent().then(()=>{var e,t;null==(t=(e=jh().config).onLoad)||t.call(e,jh().editor)}));const n=vb(s,()=>{jh().setStageSize(yb(s.current))}),r=vb(a,()=>{jh().setCanvasSize(yb(a.current))});return()=>{n(),r()}},[s]);const h=gc("pixie-root flex flex-col overflow-hidden bg-background text-main no-tap-highlight w-full h-full",{relative:!l,"fixed inset-0 w-full h-full z-20":l,"shadow-lg border rounded-md m-auto max-h-[calc(100vh-90px)] max-w-[calc(100vw-90px)]":l&&!c});return(0,i.jsxs)(_v,{features:kv,strict:!0,children:[l&&e&&!c&&r&&(0,i.jsx)(TC,{className:"z-20 fixed right-2 top-2 text-white",size:"lg",onClick:()=>{jh().editor.close()},children:(0,i.jsx)($C,{})}),l&&e&&(0,i.jsx)(Nx,{position:"fixed",disableInitialTransition:!0}),(0,i.jsxs)(gv.div,{initial:!1,variants:{visible:{opacity:1,scale:1,display:"flex"},hidden:{opacity:0,transitionEnd:{display:"none"}}},animate:e?"visible":"hidden",className:h,children:["top"===n&&(0,i.jsx)(QC,{}),"top"===t&&(0,i.jsx)(NE,{className:"pt-14"}),(0,i.jsxs)("main",{className:"relative flex-auto my-20 overflow-hidden outline-none",tabIndex:-1,...Dv(d,{onKeyDownCapture:HI}),ref:s,children:[(0,i.jsx)(t_,{}),(0,i.jsx)(ES,{ref:a})]}),(0,i.jsx)(Ej,{}),"bottom"===t&&(0,i.jsx)(NE,{}),"bottom"===n&&(0,i.jsx)(QC,{}),(0,i.jsx)(nI,{}),(0,i.jsx)(UI,{})]})]})}!function(){fabric.Object.ENLIVEN_PROPS.push("eraser");var e=fabric.Object.prototype._drawClipPath,t=fabric.Object.prototype.needsItsOwnCache,n=fabric.Object.prototype.toObject,r=fabric.Object.prototype.getSvgCommons,i=fabric.Object.prototype._createBaseClipPathSVGMarkup,o=fabric.Object.prototype._createBaseSVGMarkup;fabric.Object.prototype.cacheProperties.push("eraser"),fabric.Object.prototype.stateProperties.push("eraser"),fabric.util.object.extend(fabric.Object.prototype,{erasable:!0,eraser:void 0,needsItsOwnCache:function(){return t.call(this)||!!this.eraser},_drawClipPath:function(t,n){if(e.call(this,t,n),this.eraser){var r=this._getNonTransformedDimensions();this.eraser.isType("eraser")&&this.eraser.set({width:r.x,height:r.y}),e.call(this,t,this.eraser)}},toObject:function(e){var t=n.call(this,["erasable"].concat(e));return this.eraser&&!this.eraser.excludeFromExport&&(t.eraser=this.eraser.toObject(e)),t},getSvgCommons:function(){return r.call(this)+(this.eraser?'mask="url(#'+this.eraser.clipPathId+')" ':"")},_createEraserSVGMarkup:function(e){return this.eraser?(this.eraser.clipPathId="MASK_"+fabric.Object.__uid++,['<mask id="',this.eraser.clipPathId,'" >',this.eraser.toSVG(e),"</mask>","\n"].join("")):""},_createBaseClipPathSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),i.call(this,e,t)].join("")},_createBaseSVGMarkup:function(e,t){return[this._createEraserSVGMarkup(t&&t.reviver),o.call(this,e,t)].join("")}});var a=fabric.Group.prototype._restoreObjectsState;fabric.util.object.extend(fabric.Group.prototype,{_addEraserPathToObjects:function(e){this._objects.forEach(function(t){fabric.EraserBrush.prototype._addPathToObjectEraser.call(fabric.EraserBrush.prototype,t,e)})},applyEraserToObjects:function(){var e=this,t=this.eraser;if(t){delete this.eraser;var n=e.calcTransformMatrix();t.clone(function(t){var r=e.clipPath;t.getObjects("path").forEach(function(t){var i=fabric.util.multiplyTransformMatrices(n,t.calcTransformMatrix());fabric.util.applyTransformToObject(t,i),r?r.clone(function(r){var i=fabric.EraserBrush.prototype.applyClipPathToPath.call(fabric.EraserBrush.prototype,t,r,n);e._addEraserPathToObjects(i)},["absolutePositioned","inverted"]):e._addEraserPathToObjects(t)})})}},_restoreObjectsState:function(){return!0===this.erasable&&this.applyEraserToObjects(),a.call(this)}}),fabric.Eraser=fabric.util.createClass(fabric.Group,{type:"eraser",originX:"center",originY:"center",drawObject:function(e){e.save(),e.fillStyle="black",e.fillRect(-this.width/2,-this.height/2,this.width,this.height),e.restore(),this.callSuper("drawObject",e)},_getBounds:function(){},_toSVG:function(e){var t=["<g ","COMMON_PARTS"," >\n"],n=["<rect ",'fill="white" ','x="',-this.width/2,'" y="',-this.height/2,'" width="',this.width,'" height="',this.height,'" />\n'].join("");t.push("\t\t",n);for(var r=0,i=this._objects.length;r<i;r++)t.push("\t\t",this._objects[r].toSVG(e));return t.push("</g>\n"),t}}),fabric.Eraser.fromObject=function(e,t){var n=e.objects;fabric.util.enlivenObjects(n,function(n){var r=fabric.util.object.clone(e,!0);delete r.objects,fabric.util.enlivenObjectEnlivables(e,r,function(){t&&t(new fabric.Eraser(n,r,!0))})})};var s=fabric.Canvas.prototype._renderOverlay;fabric.util.object.extend(fabric.Canvas.prototype,{isErasing:function(){return this.isDrawingMode&&this.freeDrawingBrush&&"eraser"===this.freeDrawingBrush.type&&this.freeDrawingBrush._isErasing},_renderOverlay:function(e){s.call(this,e),this.isErasing()&&!this.freeDrawingBrush.inverted&&this.freeDrawingBrush._render()}}),fabric.EraserBrush=fabric.util.createClass(fabric.PencilBrush,{type:"eraser",inverted:!1,_isErasing:!1,_isErasable:function(e){return!1!==e.erasable},_prepareCollectionTraversal:function(e,t,n){e.forEachObject(function(r){r.forEachObject&&"deep"===r.erasable?this._prepareCollectionTraversal(r,t,n):!this.inverted&&r.erasable&&r.visible?(r.visible=!1,e.dirty=!0,n.visibility.push(r),n.collection.push(e)):this.inverted&&r.visible&&(r.erasable&&r.eraser?(r.eraser.inverted=!0,r.dirty=!0,e.dirty=!0,n.eraser.push(r),n.collection.push(e)):(r.visible=!1,e.dirty=!0,n.visibility.push(r),n.collection.push(e)))},this)},preparePattern:function(){this._patternCanvas||(this._patternCanvas=fabric.util.createCanvasElement());var e=this._patternCanvas;e.width=this.canvas.width,e.height=this.canvas.height;var t=e.getContext("2d");if(this.canvas._isRetinaScaling()){var n=this.canvas.getRetinaScaling();this.canvas.__initRetinaScaling(n,e,t)}var r=this.canvas.backgroundImage,i=r&&this._isErasable(r),o=this.canvas.overlayImage,a=o&&this._isErasable(o);if(!this.inverted&&(r&&!i||this.canvas.backgroundColor))i&&(this.canvas.backgroundImage=void 0),this.canvas._renderBackground(t),i&&(this.canvas.backgroundImage=r);else if(this.inverted&&r&&i){var l=this.canvas.backgroundColor;this.canvas.backgroundColor=void 0,this.canvas._renderBackground(t),this.canvas.backgroundColor=l}t.save(),t.transform.apply(t,this.canvas.viewportTransform);var c={visibility:[],eraser:[],collection:[]};this._prepareCollectionTraversal(this.canvas,t,c),this.canvas._renderObjects(t,this.canvas._objects),c.visibility.forEach(function(e){e.visible=!0}),c.eraser.forEach(function(e){e.eraser.inverted=!1,e.dirty=!0}),c.collection.forEach(function(e){e.dirty=!0}),t.restore(),!this.inverted&&(o&&!a||this.canvas.overlayColor)?(a&&(this.canvas.overlayImage=void 0),s.call(this.canvas,t),a&&(this.canvas.overlayImage=o)):this.inverted&&o&&a&&(l=this.canvas.overlayColor,this.canvas.overlayColor=void 0,s.call(this.canvas,t),this.canvas.overlayColor=l)},_setBrushStyles:function(e){this.callSuper("_setBrushStyles",e),e.strokeStyle="black"},_saveAndTransform:function(e){this.callSuper("_saveAndTransform",e),this._setBrushStyles(e),e.globalCompositeOperation=e===this.canvas.getContext()?"destination-out":"source-over"},needsFullRender:function(){return!0},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this.preparePattern(),this._isErasing=!0,this.canvas.fire("erasing:start"),this._render())},_render:function(){var e;this.inverted||(e=this.canvas.getContext(),this.callSuper("_render",e)),e=this.canvas.contextTop,this.canvas.clearContext(e),this.callSuper("_render",e),e.save();var t=1/this.canvas.getRetinaScaling();e.scale(t,t),e.globalCompositeOperation="source-in",e.drawImage(this._patternCanvas,0,0),e.restore()},createPath:function(e){var t=this.callSuper("createPath",e);return t.globalCompositeOperation=this.inverted?"source-over":"destination-out",t.stroke=this.inverted?"white":"black",t},applyClipPathToPath:function(e,t,n){var r=fabric.util.invertTransform(e.calcTransformMatrix()),i=t.calcTransformMatrix(),o=t.absolutePositioned?r:fabric.util.multiplyTransformMatrices(r,n);return t.absolutePositioned=!1,fabric.util.applyTransformToObject(t,fabric.util.multiplyTransformMatrices(o,i)),e.clipPath=e.clipPath?fabric.util.mergeClipPaths(t,e.clipPath):t,e},clonePathWithClipPath:function(e,t,n){var r=t.calcTransformMatrix(),i=t.clipPath,o=this;e.clone(function(e){i.clone(function(t){n(o.applyClipPathToPath(e,t,r))},["absolutePositioned","inverted"])})},_addPathToObjectEraser:function(e,t){var n=this;if(e.forEachObject&&"deep"===e.erasable){var r=e._objects.filter(function(e){return e.erasable});r.length>0&&e.clipPath?this.clonePathWithClipPath(t,e,function(e){r.forEach(function(t){n._addPathToObjectEraser(t,e)})}):r.length>0&&r.forEach(function(e){n._addPathToObjectEraser(e,t)})}else{var i=e.eraser;i||(i=new fabric.Eraser,e.eraser=i),t.clone(function(t){var r=fabric.util.multiplyTransformMatrices(fabric.util.invertTransform(e.calcTransformMatrix()),t.calcTransformMatrix());fabric.util.applyTransformToObject(t,r),i.addWithUpdate(t),e.set("dirty",!0),e.fire("erasing:end",{path:t}),e.group&&Array.isArray(n.__subTargets)&&n.__subTargets.push(e)})}},applyEraserToCanvas:function(e){var t=this.canvas,n={};return["backgroundImage","overlayImage"].forEach(function(r){var i=t[r];i&&i.erasable&&(this._addPathToObjectEraser(i,e),n[r]=i)},this),n},_finalizeAndAddPath:function(){var e=this.canvas.contextTop,t=this.canvas;e.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate)),t.clearContext(t.contextTop),this._isErasing=!1;var n=this._points&&this._points.length>1?this.convertPointsToSVGPath(this._points):null;if(!n||this._isEmptySVGPath(n))return t.fire("erasing:end"),void t.requestRenderAll();var r=this.createPath(n);r.setCoords(),t.fire("before:path:created",{path:r});var i=this.applyEraserToCanvas(r),o=this;this.__subTargets=[];var a=[];t.forEachObject(function(e){e.erasable&&e.intersectsWithObject(r,!0,!0)&&(o._addPathToObjectEraser(e,r),a.push(e))}),t.fire("erasing:end",{path:r,targets:a,subTargets:this.__subTargets,drawables:i}),delete this.__subTargets,t.requestRenderAll(),this._resetShadow(),t.fire("path:created",{path:r})}})}(),qi(!1);const JI=class e{constructor(e){if(Ni(this,"tools",{}),Ni(this,"fabric",null),e.sentryDsn&&function(e){const t={...e};Gs(t,"react"),nc(t)}({dsn:e.sentryDsn}),function(e,t){void 0===t&&(t={});var n=t.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/.pi *,.pi :after,.pi :before{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity));border-style:solid;border-width:0;box-sizing:border-box}.pi :after,.pi :before{--tw-content:""}.pi hr{border-top-width:1px;color:inherit;height:0}.pi abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6{font-size:inherit;font-weight:inherit}.pi a{color:inherit;text-decoration:inherit}.pi b,.pi strong{font-weight:bolder}.pi code,.pi kbd,.pi pre,.pi samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}.pi small{font-size:80%}.pi sub,.pi sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.pi sub{bottom:-.25em}.pi sup{top:-.5em}.pi table{border-collapse:collapse;border-color:inherit;text-indent:0}.pi button,.pi input,.pi optgroup,.pi select,.pi textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}.pi button,.pi select{text-transform:none}.pi [type=button],.pi [type=reset],.pi [type=submit],.pi button{-webkit-appearance:button;background-color:transparent;background-image:none}.pi :-moz-focusring{outline:auto}.pi :-moz-ui-invalid{box-shadow:none}.pi progress{vertical-align:baseline}.pi ::-webkit-inner-spin-button,.pi ::-webkit-outer-spin-button{height:auto}.pi [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.pi ::-webkit-search-decoration{-webkit-appearance:none}.pi ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.pi summary{display:list-item}.pi blockquote,.pi dd,.pi dl,.pi figure,.pi h1,.pi h2,.pi h3,.pi h4,.pi h5,.pi h6,.pi hr,.pi p,.pi pre{margin:0}.pi fieldset{margin:0;padding:0}.pi legend{padding:0}.pi menu,.pi ol,.pi ul{list-style:none;margin:0;padding:0}.pi textarea{resize:vertical}.pi input::-moz-placeholder,.pi textarea::-moz-placeholder{color:#9ca3af;opacity:1}.pi input::placeholder,.pi textarea::placeholder{color:#9ca3af;opacity:1}.pi [role=button],.pi button{cursor:pointer}.pi :disabled{cursor:default}.pi audio,.pi canvas,.pi embed,.pi iframe,.pi img,.pi object,.pi svg,.pi video{display:block;vertical-align:middle}.pi img,.pi video{height:auto;max-width:100%}.pi [hidden]{display:none}.pi *,.pi :after,.pi :before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi ::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.pi .\\!container{width:100%!important}.pi .container{width:100%}@media (min-width:640px){.pi .\\!container{max-width:640px!important}.pi .container{max-width:640px}}@media (min-width:768px){.pi .\\!container{max-width:768px!important}.pi .container{max-width:768px}}@media (min-width:1024px){.pi .\\!container{max-width:1024px!important}.pi .container{max-width:1024px}}@media (min-width:1280px){.pi .\\!container{max-width:1280px!important}.pi .container{max-width:1280px}}@media (min-width:1536px){.pi .\\!container{max-width:1536px!important}.pi .container{max-width:1536px}}.pi .sr-only{height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;clip:rect(0,0,0,0);border-width:0;white-space:nowrap}.pi .pointer-events-none{pointer-events:none}.pi .pointer-events-auto{pointer-events:auto}.pi .\\!visible{visibility:visible!important}.pi .visible{visibility:visible}.pi .invisible{visibility:hidden}.pi .collapse{visibility:collapse}.pi .static{position:static}.pi .fixed{position:fixed}.pi .absolute{position:absolute}.pi .relative{position:relative}.pi .inset-0{top:0;right:0;bottom:0;left:0}.pi .inset-x-0{left:0;right:0}.pi .-bottom-10{bottom:-10px}.pi .-bottom-20{bottom:-20px}.pi .-bottom-5{bottom:-5px}.pi .-left-5{left:-5px}.pi .-left-8{left:-8px}.pi .-left-80{left:-80px}.pi .-right-5{right:-5px}.pi .-top-144{top:-144px}.pi .-top-40{top:-40px}.pi .-top-5{top:-5px}.pi .bottom-0{bottom:0}.pi .bottom-20{bottom:20px}.pi .left-0{left:0}.pi .left-1\\/2{left:50%}.pi .left-20{left:20px}.pi .right-0{right:0}.pi .right-16{right:16px}.pi .right-2{right:2px}.pi .right-20{right:20px}.pi .right-4{right:4px}.pi .top-0{top:0}.pi .top-1\\/2{top:50%}.pi .top-2{top:2px}.pi .isolate{isolation:isolate}.pi .z-10{z-index:10}.pi .z-20{z-index:20}.pi .z-50{z-index:50}.pi .z-cropzone{z-index:10}.pi .z-loading-indicator{z-index:50}.pi .z-modal{z-index:110}.pi .z-navbar{z-index:40}.pi .z-obj-box{z-index:20}.pi .z-popover{z-index:130}.pi .z-toast{z-index:160}.pi .z-tool-overlay{z-index:30}.pi .z-tooltip{z-index:150}.pi .z-tray{z-index:120}.pi .m-auto{margin:auto}.pi .mx-20{margin-left:20px;margin-right:20px}.pi .mx-8{margin-left:8px;margin-right:8px}.pi .mx-auto{margin-left:auto;margin-right:auto}.pi .my-20{margin-bottom:20px;margin-top:20px}.pi .my-4{margin-bottom:4px;margin-top:4px}.pi .my-6{margin-bottom:6px;margin-top:6px}.pi .my-8{margin-bottom:8px;margin-top:8px}.pi .my-auto{margin-bottom:auto;margin-top:auto}.pi .-ml-1{margin-left:-1px}.pi .-ml-10{margin-left:-10px}.pi .-ml-12{margin-left:-12px}.pi .-ml-3{margin-left:-3px}.pi .-ml-4{margin-left:-4px}.pi .-ml-6{margin-left:-6px}.pi .-mr-4{margin-right:-4px}.pi .-mr-8{margin-right:-8px}.pi .mb-1{margin-bottom:1px}.pi .mb-10{margin-bottom:10px}.pi .mb-16{margin-bottom:16px}.pi .mb-2{margin-bottom:2px}.pi .mb-20{margin-bottom:20px}.pi .mb-24{margin-bottom:24px}.pi .mb-4{margin-bottom:4px}.pi .mb-6{margin-bottom:6px}.pi .mb-8{margin-bottom:8px}.pi .ml-10{margin-left:10px}.pi .ml-12{margin-left:12px}.pi .ml-4{margin-left:4px}.pi .ml-6{margin-left:6px}.pi .ml-8{margin-left:8px}.pi .ml-auto{margin-left:auto}.pi .mr-10{margin-right:10px}.pi .mr-16{margin-right:16px}.pi .mr-20{margin-right:20px}.pi .mr-4{margin-right:4px}.pi .mr-5{margin-right:5px}.pi .mr-6{margin-right:6px}.pi .mr-8{margin-right:8px}.pi .mr-auto{margin-right:auto}.pi .mt-0{margin-top:0}.pi .mt-10{margin-top:10px}.pi .mt-14{margin-top:14px}.pi .mt-20{margin-top:20px}.pi .mt-24{margin-top:24px}.pi .mt-4{margin-top:4px}.pi .mt-6{margin-top:6px}.pi .box-content{box-sizing:content-box}.pi .block{display:block}.pi .inline-block{display:inline-block}.pi .inline{display:inline}.pi .flex{display:flex}.pi .inline-flex{display:inline-flex}.pi .grid{display:grid}.pi .contents{display:contents}.pi .hidden{display:none}.pi .aspect-square{aspect-ratio:1/1}.pi .h-1{height:1px}.pi .h-12{height:12px}.pi .h-128{height:128px}.pi .h-14{height:14px}.pi .h-16{height:16px}.pi .h-18{height:18px}.pi .h-2{height:2px}.pi .h-2\\/4{height:50%}.pi .h-20{height:20px}.pi .h-22{height:22px}.pi .h-24{height:24px}.pi .h-26{height:26px}.pi .h-28{height:28px}.pi .h-3{height:3px}.pi .h-30{height:30px}.pi .h-32{height:32px}.pi .h-36{height:36px}.pi .h-38{height:2.375rem}.pi .h-4{height:4px}.pi .h-40{height:40px}.pi .h-42{height:42px}.pi .h-48{height:48px}.pi .h-50{height:50px}.pi .h-56{height:56px}.pi .h-6{height:6px}.pi .h-60{height:60px}.pi .h-64{height:64px}.pi .h-68{height:68px}.pi .h-8{height:8px}.pi .h-80{height:80px}.pi .h-84{height:84px}.pi .h-92{height:92px}.pi .h-\\[54px\\]{height:54px}.pi .h-font{height:1em}.pi .h-full{height:100%}.pi .h-px{height:1px}.pi .h-screen{height:100dvh}.pi .max-h-100{max-height:6.25rem}.pi .max-h-\\[calc\\(100\\%-40px\\)\\]{max-height:calc(100% - 40px)}.pi .max-h-\\[calc\\(100vh-90px\\)\\]{max-height:calc(100vh - 90px)}.pi .max-h-dialog{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .max-h-full{max-height:100%}.pi .max-h-inherit{max-height:inherit}.pi .max-h-tray{max-height:calc(var(--be-viewport-height, 100vh)*.9)}.pi .min-h-24{min-height:24px}.pi .min-h-30{min-height:30px}.pi .min-h-36{min-height:36px}.pi .min-h-42{min-height:42px}.pi .min-h-50{min-height:50px}.pi .min-h-60{min-height:60px}.pi .min-h-86{min-height:86px}.pi .\\!w-auto{width:auto!important}.pi .w-1\\/2{width:50%}.pi .w-110{width:110px}.pi .w-12{width:12px}.pi .w-1280{width:80rem}.pi .w-14{width:14px}.pi .w-144{width:144px}.pi .w-16{width:16px}.pi .w-18{width:18px}.pi .w-2{width:2px}.pi .w-20{width:20px}.pi .w-22{width:22px}.pi .w-224{width:224px}.pi .w-24{width:24px}.pi .w-256{width:256px}.pi .w-26{width:26px}.pi .w-28{width:28px}.pi .w-280{width:17.5rem}.pi .w-30{width:30px}.pi .w-32{width:32px}.pi .w-320{width:320px}.pi .w-36{width:36px}.pi .w-38{width:2.375rem}.pi .w-384{width:384px}.pi .w-40{width:40px}.pi .w-42{width:42px}.pi .w-440{width:27.5rem}.pi .w-46{width:2.875rem}.pi .w-50{width:50px}.pi .w-56{width:56px}.pi .w-60{width:60px}.pi .w-620{width:38.75rem}.pi .w-64{width:64px}.pi .w-68{width:68px}.pi .w-780{width:48.75rem}.pi .w-8{width:8px}.pi .w-80{width:80px}.pi .w-850{width:53.125rem}.pi .w-96{width:96px}.pi .w-\\[4ch\\]{width:4ch}.pi .w-auto{width:auto}.pi .w-font{width:1em}.pi .w-full{width:100%}.pi .w-max{width:-moz-max-content;width:max-content}.pi .w-min{width:-moz-min-content;width:min-content}.pi .w-px{width:1px}.pi .w-screen{width:100vw}.pi .min-w-0{min-width:0}.pi .min-w-128{min-width:128px}.pi .min-w-180{min-width:11.25rem}.pi .min-w-192{min-width:192px}.pi .min-w-288{min-width:288px}.pi .min-w-30{min-width:30px}.pi .min-w-4{min-width:4px}.pi .min-w-42{min-width:42px}.pi .min-w-92{min-width:92px}.pi .min-w-min{min-width:-moz-min-content;min-width:min-content}.pi .max-w-112{max-width:112px}.pi .max-w-240{max-width:240px}.pi .max-w-288{max-width:288px}.pi .max-w-320{max-width:320px}.pi .max-w-375{max-width:375px}.pi .max-w-500{max-width:31.25rem}.pi .max-w-\\[90\\%\\]{max-width:90%}.pi .max-w-\\[calc\\(100\\%-40px\\)\\]{max-width:calc(100% - 40px)}.pi .max-w-\\[calc\\(100vw-90px\\)\\]{max-width:calc(100vw - 90px)}.pi .max-w-dialog{max-width:calc(var(--be-viewport-width, 100vw)*.9)}.pi .max-w-full{max-width:100%}.pi .max-w-max{max-width:-moz-max-content;max-width:max-content}.pi .flex-\\[1_1_60px\\]{flex:1 1 60px}.pi .flex-auto{flex:1 1 auto}.pi .flex-shrink-0,.pi .shrink-0{flex-shrink:0}.pi .origin-\\[0_55\\%\\]{transform-origin:0 55%}.pi .origin-\\[100\\%\\]{transform-origin:100%}.pi .-translate-x-1\\/2{--tw-translate-x:-50%}.pi .-translate-x-1\\/2,.pi .-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .-translate-y-1\\/2{--tw-translate-y:-50%}.pi .rotate-0{--tw-rotate:0deg}.pi .rotate-0,.pi .rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-180{--tw-rotate:180deg}.pi .rotate-45{--tw-rotate:45deg}.pi .rotate-45,.pi .rotate-90{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .rotate-90{--tw-rotate:90deg}.pi .scale-y-\\[0\\.6\\]{--tw-scale-y:.6}.pi .scale-y-\\[0\\.6\\],.pi .transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .cursor-default{cursor:default}.pi .cursor-move{cursor:move}.pi .cursor-nesw-resize{cursor:nesw-resize}.pi .cursor-not-allowed{cursor:not-allowed}.pi .cursor-nwse-resize{cursor:nwse-resize}.pi .cursor-pointer{cursor:pointer}.pi .cursor-se-resize{cursor:se-resize}.pi .cursor-sw-resize{cursor:sw-resize}.pi .touch-none{touch-action:none}.pi .select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.pi .resize{resize:both}.pi .appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.pi .grid-cols-5-min-content{grid-template-columns:repeat(5,min-content)}.pi .flex-row{flex-direction:row}.pi .flex-col{flex-direction:column}.pi .flex-col-reverse{flex-direction:column-reverse}.pi .flex-wrap{flex-wrap:wrap}.pi .flex-nowrap{flex-wrap:nowrap}.pi .items-start{align-items:flex-start}.pi .items-end{align-items:flex-end}.pi .items-center{align-items:center}.pi .items-stretch{align-items:stretch}.pi .justify-start{justify-content:flex-start}.pi .justify-center{justify-content:center}.pi .justify-between{justify-content:space-between}.pi .gap-10{gap:10px}.pi .gap-14{gap:14px}.pi .gap-16{gap:16px}.pi .gap-18{gap:18px}.pi .gap-20{gap:20px}.pi .gap-36{gap:36px}.pi .gap-4{gap:4px}.pi .gap-40{gap:40px}.pi .gap-6{gap:6px}.pi .gap-8{gap:8px}.pi .space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(10px*var(--tw-space-y-reverse));margin-top:calc(10px*(1 - var(--tw-space-y-reverse)))}.pi .overflow-auto{overflow:auto}.pi .overflow-hidden{overflow:hidden}.pi .overflow-x-auto{overflow-x:auto}.pi .overflow-y-auto{overflow-y:auto}.pi .overflow-x-hidden{overflow-x:hidden}.pi .overflow-y-hidden{overflow-y:hidden}.pi .overscroll-contain{overscroll-behavior:contain}.pi .truncate{overflow:hidden;white-space:nowrap}.pi .overflow-ellipsis,.pi .text-ellipsis,.pi .truncate{text-overflow:ellipsis}.pi .whitespace-normal{white-space:normal}.pi .whitespace-nowrap{white-space:nowrap}.pi .break-words{overflow-wrap:break-word}.pi .rounded{border-radius:4px}.pi .rounded-2xl{border-radius:16px}.pi .rounded-3xl{border-radius:24px}.pi .rounded-button{border-radius:var(--be-button-radius,.25rem)}.pi .rounded-full{border-radius:9999px}.pi .rounded-input{border-radius:var(--be-input-radius,.25rem)}.pi .rounded-lg{border-radius:8px}.pi .rounded-md{border-radius:6px}.pi .rounded-none{border-radius:0}.pi .rounded-panel{border-radius:var(--be-panel-radius,.25rem)}.pi .rounded-xl{border-radius:12px}.pi .rounded-l{border-bottom-left-radius:4px;border-top-left-radius:4px}.pi .rounded-l-full{border-bottom-left-radius:9999px;border-top-left-radius:9999px}.pi .rounded-l-input{border-bottom-left-radius:var(--be-input-radius,.25rem);border-top-left-radius:var(--be-input-radius,.25rem)}.pi .rounded-l-none{border-bottom-left-radius:0;border-top-left-radius:0}.pi .rounded-r-full{border-bottom-right-radius:9999px;border-top-right-radius:9999px}.pi .rounded-r-input{border-bottom-right-radius:var(--be-input-radius,.25rem);border-top-right-radius:var(--be-input-radius,.25rem)}.pi .rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.pi .rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.pi .rounded-bl-none{border-bottom-left-radius:0}.pi .rounded-br-none{border-bottom-right-radius:0}.pi .rounded-tl-none{border-top-left-radius:0}.pi .rounded-tr-none{border-top-right-radius:0}.pi .border{border-width:1px}.pi .border-2{border-width:2px}.pi .border-4{border-width:4px}.pi .border-\\[3px\\]{border-width:3px}.pi .border-y{border-top-width:1px}.pi .border-b,.pi .border-y{border-bottom-width:1px}.pi .border-b-4{border-bottom-width:4px}.pi .border-l{border-left-width:1px}.pi .border-l-4{border-left-width:4px}.pi .border-r{border-right-width:1px}.pi .border-r-4{border-right-width:4px}.pi .border-t{border-top-width:1px}.pi .border-t-4{border-top-width:4px}.pi .border-dotted{border-style:dotted}.pi .border-none{border-style:none}.pi .border-background{--tw-border-opacity:1;border-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-bg-alt{--tw-border-opacity:1;border-color:rgb(var(--be-background-alt)/var(--tw-border-opacity))}.pi .border-chip{--tw-border-opacity:1;border-color:rgb(var(--be-background-chip)/var(--tw-border-opacity))}.pi .border-danger{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .border-danger\\/50{border-color:#ef444480}.pi .border-divider{border-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .border-paper{--tw-border-opacity:1;border-color:rgb(var(--be-paper)/var(--tw-border-opacity))}.pi .border-positive\\/50{border-color:#22c55e80}.pi .border-primary{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .border-primary\\/50{border-color:rgb(var(--be-primary)/.5)}.pi .border-text-muted{border-color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .border-transparent{border-color:transparent}.pi .border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .border-white\\/50{border-color:#ffffff80}.pi .border-b-bg{--tw-border-opacity:1;border-bottom-color:rgb(var(--be-background)/var(--tw-border-opacity))}.pi .border-b-transparent{border-bottom-color:transparent}.pi .border-r-transparent{border-right-color:transparent}.pi .bg{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-alt{--tw-bg-opacity:1;background-color:rgb(var(--be-background-alt)/var(--tw-bg-opacity))}.pi .bg-background{--tw-bg-opacity:1;background-color:rgb(var(--be-background)/var(--tw-bg-opacity))}.pi .bg-background\\/70{background-color:rgb(var(--be-background)/.7)}.pi .bg-background\\/80{background-color:rgb(var(--be-background)/.8)}.pi .bg-black\\/50{background-color:#00000080}.pi .bg-black\\/80{background-color:#000c}.pi .bg-chip{--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi .bg-controls{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-danger{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .bg-danger-lighter{--tw-bg-opacity:1;background-color:rgb(254 202 202/var(--tw-bg-opacity))}.pi .bg-divider{background-color:rgb(var(--be-foreground-base)/var(--be-divider-opacity))}.pi .bg-fg-base\\/4{background-color:rgb(var(--be-foreground-base)/4%)}.pi .bg-focus{background-color:rgb(var(--be-foreground-base)/var(--be-focus-opacity))}.pi .bg-inherit{background-color:inherit}.pi .bg-paper{--tw-bg-opacity:1;background-color:rgb(var(--be-paper)/var(--tw-bg-opacity))}.pi .bg-positive{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pi .bg-positive-lighter{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.pi .bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .bg-primary-dark{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .bg-primary-light{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-light)/var(--tw-bg-opacity))}.pi .bg-primary\\/focus{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .bg-primary\\/selected{background-color:rgb(var(--be-primary)/var(--be-selected-opacity))}.pi .bg-slider-disabled{--tw-bg-opacity:1;background-color:rgb(189 189 189/var(--tw-bg-opacity))}.pi .bg-slider-disabled\\/60{background-color:#bdbdbd99}.pi .bg-toast{--tw-bg-opacity:1;background-color:rgb(50 50 50/var(--tw-bg-opacity))}.pi .bg-transparent{background-color:transparent}.pi .bg-warning{--tw-bg-opacity:1;background-color:rgb(243 164 50/var(--tw-bg-opacity))}.pi .bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .bg-white\\/50{background-color:#ffffff80}.pi .bg-opacity-95{--tw-bg-opacity:.95}.pi .bg-no-repeat{background-repeat:no-repeat}.pi .fill-current{fill:currentColor}.pi .fill-transparent{fill:transparent}.pi .stroke-current{stroke:currentColor}.pi .object-contain{-o-object-fit:contain;object-fit:contain}.pi .object-cover{-o-object-fit:cover;object-fit:cover}.pi .p-0{padding:0}.pi .p-10{padding:10px}.pi .p-14{padding:14px}.pi .p-16{padding:16px}.pi .p-18{padding:18px}.pi .p-2{padding:2px}.pi .p-20{padding:20px}.pi .p-4{padding:4px}.pi .p-40{padding:40px}.pi .p-6{padding:6px}.pi .p-8{padding:8px}.pi .px-10{padding-left:10px;padding-right:10px}.pi .px-12{padding-left:12px;padding-right:12px}.pi .px-14{padding-left:14px;padding-right:14px}.pi .px-16{padding-left:16px;padding-right:16px}.pi .px-18{padding-left:18px;padding-right:18px}.pi .px-20{padding-left:20px;padding-right:20px}.pi .px-22{padding-left:22px;padding-right:22px}.pi .px-24{padding-left:24px;padding-right:24px}.pi .px-26{padding-left:26px;padding-right:26px}.pi .px-32{padding-left:32px;padding-right:32px}.pi .px-4{padding-left:4px;padding-right:4px}.pi .px-5vw{padding-left:5vw;padding-right:5vw}.pi .px-6{padding-left:6px;padding-right:6px}.pi .px-8{padding-left:8px;padding-right:8px}.pi .py-10{padding-bottom:10px;padding-top:10px}.pi .py-12{padding-bottom:12px;padding-top:12px}.pi .py-14{padding-bottom:14px;padding-top:14px}.pi .py-2{padding-bottom:2px;padding-top:2px}.pi .py-20{padding-bottom:20px;padding-top:20px}.pi .py-3{padding-bottom:3px;padding-top:3px}.pi .py-4{padding-bottom:4px;padding-top:4px}.pi .py-5{padding-bottom:5px;padding-top:5px}.pi .py-6{padding-bottom:6px;padding-top:6px}.pi .py-8{padding-bottom:8px;padding-top:8px}.pi .py-\\[9px\\]{padding-bottom:9px;padding-top:9px}.pi .pb-10{padding-bottom:10px}.pi .pb-12{padding-bottom:12px}.pi .pb-14{padding-bottom:14px}.pi .pb-16{padding-bottom:16px}.pi .pb-18{padding-bottom:18px}.pi .pb-20{padding-bottom:20px}.pi .pb-4{padding-bottom:4px}.pi .pb-8{padding-bottom:8px}.pi .pb-safe-area{padding-bottom:env(safe-area-inset-bottom)}.pi .pl-10{padding-left:10px}.pi .pl-12{padding-left:12px}.pi .pl-14{padding-left:14px}.pi .pl-16{padding-left:16px}.pi .pl-18{padding-left:18px}.pi .pl-28{padding-left:28px}.pi .pl-46{padding-left:2.875rem}.pi .pl-54{padding-left:3.375rem}.pi .pl-8{padding-left:8px}.pi .pr-10{padding-right:10px}.pi .pr-12{padding-right:12px}.pi .pr-18{padding-right:18px}.pi .pr-24{padding-right:24px}.pi .pr-28{padding-right:28px}.pi .pr-46{padding-right:2.875rem}.pi .pr-54{padding-right:3.375rem}.pi .pr-6{padding-right:6px}.pi .pr-8{padding-right:8px}.pi .pt-10{padding-top:10px}.pi .pt-12{padding-top:12px}.pi .pt-14{padding-top:14px}.pi .pt-16{padding-top:16px}.pi .pt-20{padding-top:20px}.pi .pt-24{padding-top:24px}.pi .pt-4{padding-top:4px}.pi .pt-40{padding-top:40px}.pi .pt-6{padding-top:6px}.pi .text-left{text-align:left}.pi .text-center{text-align:center}.pi .text-right{text-align:right}.pi .align-middle{vertical-align:middle}.pi .text-base{font-size:16px;line-height:24px}.pi .text-lg{font-size:18px;line-height:28px}.pi .text-sm{font-size:14px;line-height:20px}.pi .text-xl{font-size:20px;line-height:28px}.pi .text-xs{font-size:12px;line-height:16px}.pi .font-bold{font-weight:700}.pi .font-medium{font-weight:500}.pi .font-semibold{font-weight:600}.pi .uppercase{text-transform:uppercase}.pi .capitalize{text-transform:capitalize}.pi .italic{font-style:italic}.pi .tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.pi .leading-5{line-height:1.25rem}.pi .leading-none{line-height:1}.pi .tracking-wide{letter-spacing:.025em}.pi .\\!text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))!important}.pi .text{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.pi .text-black\\/30{color:#0000004d}.pi .text-danger{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.pi .text-danger-darker{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.pi .text-disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .text-link{--tw-text-opacity:1;color:rgb(var(--be-link-color,var(--be-primary))/var(--tw-text-opacity))}.pi .text-main{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .text-muted{color:rgb(var(--be-foreground-base)/var(--be-text-muted-opacity))}.pi .text-on-primary{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .text-positive{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.pi .text-positive-darker{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.pi .text-primary{--tw-text-opacity:1;color:rgb(var(--be-primary)/var(--tw-text-opacity))}.pi .text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.pi .underline{text-decoration-line:underline}.pi .no-underline{text-decoration-line:none}.pi .caret-transparent{caret-color:transparent}.pi .opacity-0{opacity:0}.pi .opacity-100{opacity:1}.pi .opacity-70{opacity:.7}.pi .opacity-80{opacity:.8}.pi .opacity-90{opacity:.9}.pi .shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.pi .shadow,.pi .shadow-2xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-2xl{--tw-shadow:0 25px 50px -12px rgba(0,0,0,.25);--tw-shadow-colored:0 25px 50px -12px var(--tw-shadow-color)}.pi .shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.pi .shadow-lg,.pi .shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.pi .shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.pi .shadow-sm,.pi .shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.pi .outline-none{outline:2px solid transparent;outline-offset:2px}.pi .outline{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .ring{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .ring-inset{--tw-ring-inset:inset}.pi .blur{--tw-blur:blur(8px)}.pi .blur,.pi .grayscale{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .grayscale{--tw-grayscale:grayscale(100%)}.pi .invert{--tw-invert:invert(100%)}.pi .invert,.pi .sepia{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .sepia{--tw-sepia:sepia(100%)}.pi .filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.pi .backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.pi .transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-button{transition-duration:.15s;transition-property:background-color,box-shadow,border-color,color;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-shadow{transition-duration:.15s;transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .transition-width{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .duration-100{transition-duration:.1s}.pi .duration-200{transition-duration:.2s}.pi .will-change-transform{will-change:transform}.pi .icon-2xs{font-size:.75rem}.pi .icon-xs{font-size:1rem}.pi .icon-sm{font-size:1.25rem}.pi .icon-md{font-size:1.5rem}.pi .icon-lg{font-size:2.1875rem}.pi .icon-xl{font-size:2.6875rem}.pi .no-tap-highlight{-webkit-tap-highlight-color:transparent}@media only screen and (min-device-width:768px){.pi .tiny-scrollbar{scrollbar-color:rgba(0,0,0,.2) transparent;scrollbar-width:thin}.pi .tiny-scrollbar::-webkit-scrollbar{background-color:transparent;height:6px;width:6px}.pi .tiny-scrollbar::-webkit-scrollbar-thumb{background-color:rgb(var(--be-foreground-base)/.2);border-radius:10px}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:start{background:transparent}.pi .tiny-scrollbar::-webkit-scrollbar-track-piece:end{background:transparent}}.pi .hide-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.pi .hide-scrollbar::-webkit-scrollbar{background:transparent;display:none;height:0;width:0}.pi .svg-icon{display:inline-block;flex-shrink:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;fill:currentColor;transition-duration:.15s;transition-property:transform,fill;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .cropzone:not(.moving) .cropzone-transition{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .first-letter\\:capitalize:first-letter{text-transform:capitalize}.pi .file\\:mr-10::file-selector-button{margin-right:10px}.pi .file\\:h-24::file-selector-button{height:24px}.pi .file\\:rounded::file-selector-button{border-radius:4px}.pi .file\\:border-none::file-selector-button{border-style:none}.pi .file\\:bg-primary::file-selector-button{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .file\\:px-10::file-selector-button{padding-left:10px;padding-right:10px}.pi .file\\:text-sm::file-selector-button{font-size:14px;line-height:20px}.pi .file\\:font-semibold::file-selector-button{font-weight:600}.pi .file\\:text-on-primary::file-selector-button{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .before\\:z-10:before{content:var(--tw-content);z-index:10}.pi .before\\:block:before{content:var(--tw-content);display:block}.pi .before\\:h-12:before{content:var(--tw-content);height:12px}.pi .before\\:h-14:before{content:var(--tw-content);height:14px}.pi .before\\:h-18:before{content:var(--tw-content);height:18px}.pi .before\\:h-22:before{content:var(--tw-content);height:22px}.pi .before\\:h-28:before{content:var(--tw-content);height:28px}.pi .before\\:h-full:before{content:var(--tw-content);height:100%}.pi .before\\:w-12:before{content:var(--tw-content);width:12px}.pi .before\\:w-14:before{content:var(--tw-content);width:14px}.pi .before\\:w-18:before{content:var(--tw-content);width:18px}.pi .before\\:w-22:before{content:var(--tw-content);width:22px}.pi .before\\:w-28:before{content:var(--tw-content);width:28px}.pi .before\\:w-full:before{content:var(--tw-content);width:100%}.pi .before\\:translate-x-2:before{--tw-translate-x:2px}.pi .before\\:scale-10:before,.pi .before\\:translate-x-2:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .before\\:scale-10:before{--tw-scale-x:.1;--tw-scale-y:.1}.pi .before\\:rounded-3xl:before{border-radius:24px;content:var(--tw-content)}.pi .before\\:rounded-full:before{border-radius:9999px;content:var(--tw-content)}.pi .before\\:border:before{border-width:1px;content:var(--tw-content)}.pi .before\\:bg-primary:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .before\\:bg-white:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .before\\:opacity-0:before{content:var(--tw-content);opacity:0}.pi .before\\:transition:before{content:var(--tw-content);transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:transition-transform:before{content:var(--tw-content);transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.pi .before\\:duration-200:before{content:var(--tw-content);transition-duration:.2s}.pi .after\\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.pi .after\\:absolute:after{content:var(--tw-content);position:absolute}.pi .after\\:inset-0:after{content:var(--tw-content);top:0;right:0;bottom:0;left:0}.pi .checked\\:border-danger:checked{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .checked\\:border-primary:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .checked\\:bg-danger:checked{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.pi .checked\\:bg-primary:checked{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .checked\\:before\\:translate-x-14:checked:before{--tw-translate-x:14px}.pi .checked\\:before\\:translate-x-14:checked:before,.pi .checked\\:before\\:translate-x-20:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-20:checked:before{--tw-translate-x:20px}.pi .checked\\:before\\:translate-x-24:checked:before{--tw-translate-x:24px}.pi .checked\\:before\\:translate-x-24:checked:before,.pi .checked\\:before\\:translate-x-30:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:translate-x-30:checked:before{--tw-translate-x:30px}.pi .checked\\:before\\:translate-x-36:checked:before{--tw-translate-x:36px}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before,.pi .checked\\:before\\:translate-x-36:checked:before{content:var(--tw-content);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .checked\\:before\\:scale-\\[\\.65\\]:checked:before{--tw-scale-x:.65;--tw-scale-y:.65}.pi .checked\\:before\\:border-white:checked:before{content:var(--tw-content);--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.pi .checked\\:before\\:opacity-100:checked:before{content:var(--tw-content);opacity:1}.pi .focus-within\\:border-primary\\/60:focus-within{border-color:rgb(var(--be-primary)/.6)}.pi .focus-within\\:ring:focus-within{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-within\\:ring-primary\\/focus:focus-within{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.pi .hover\\:border-chip\\/90:hover{border-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:border-danger:hover{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.pi .hover\\:border-danger\\/90:hover{border-color:#ef4444e6}.pi .hover\\:border-paper\\/90:hover{border-color:rgb(var(--be-paper)/.9)}.pi .hover\\:border-positive:hover{--tw-border-opacity:1;border-color:rgb(34 197 94/var(--tw-border-opacity))}.pi .hover\\:border-primary:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary)/var(--tw-border-opacity))}.pi .hover\\:border-primary-dark:hover{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .hover\\:bg-chip\\/90:hover{background-color:rgb(var(--be-background-chip)/.9)}.pi .hover\\:bg-danger\\/4:hover{background-color:#ef44440a}.pi .hover\\:bg-danger\\/90:hover{background-color:#ef4444e6}.pi .hover\\:bg-fg-base\\/15:hover{background-color:rgb(var(--be-foreground-base)/15%)}.pi .hover\\:bg-hover:hover{background-color:rgb(var(--be-foreground-base)/var(--be-hover-opacity))}.pi .hover\\:bg-paper\\/90:hover{background-color:rgb(var(--be-paper)/.9)}.pi .hover\\:bg-positive\\/4:hover{background-color:#22c55e0a}.pi .hover\\:bg-primary-dark:hover{--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:bg-primary\\/4:hover{background-color:rgb(var(--be-primary)/4%)}.pi .hover\\:bg-primary\\/focus:hover{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .hover\\:bg-primary\\/hover:hover{background-color:rgb(var(--be-primary)/var(--be-hover-opacity))}.pi .hover\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.pi .hover\\:bg-white\\/20:hover{background-color:#fff3}.pi .hover\\:bg-white\\/hover:hover{background-color:rgb(255 255 255/var(--be-hover-opacity))}.pi .hover\\:text-main:hover{color:rgb(var(--be-foreground-base)/var(--be-text-main-opacity))}.pi .hover\\:text-primary-dark:hover{--tw-text-opacity:1;color:rgb(var(--be-primary-dark)/var(--tw-text-opacity))}.pi .hover\\:underline:hover{text-decoration-line:underline}.pi .hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .before\\:hover\\:bg-primary-dark:hover:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}.pi .hover\\:after\\:bg-black\\/5:hover:after{background-color:#0000000d;content:var(--tw-content)}.pi .checked\\:hover\\:border-primary-dark:hover:checked{--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi .focus\\:border-danger\\/60:focus{border-color:#ef444499}.pi .focus\\:border-primary\\/60:focus{border-color:rgb(var(--be-primary)/.6)}.pi .focus\\:bg-primary:focus{--tw-bg-opacity:1;background-color:rgb(var(--be-primary)/var(--tw-bg-opacity))}.pi .focus\\:text-on-primary:focus{--tw-text-opacity:1;color:rgb(var(--be-on-primary)/var(--tw-text-opacity))}.pi .focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.pi .focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus\\:ring-danger\\/focus:focus{--tw-ring-color:rgb(239 68 68/var(--be-focus-opacity))}.pi .focus\\:ring-primary\\/focus:focus{--tw-ring-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus\\:after\\:bg-black\\/10:focus:after{background-color:#0000001a;content:var(--tw-content)}.pi .focus-visible\\:bg-primary\\/focus:focus-visible{background-color:rgb(var(--be-primary)/var(--be-focus-opacity))}.pi .focus-visible\\:outline:focus-visible{outline-color:rgb(var(--be-primary-lighter)/1);outline-style:solid;outline-width:2px}.pi .focus-visible\\:outline-primary-light:focus-visible{outline-color:rgb(var(--be-primary-light)/1)}.pi .focus-visible\\:ring:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.pi .disabled\\:pointer-events-none:disabled{pointer-events:none}.pi .disabled\\:cursor-default:disabled{cursor:default}.pi .disabled\\:border-disabled-bg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:border-disabled-fg:disabled{border-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:border-transparent:disabled{border-color:transparent}.pi .disabled\\:border-white\\/70:disabled{border-color:#ffffffb3}.pi .disabled\\:border-r-transparent:disabled{border-right-color:transparent}.pi .disabled\\:bg-disabled:disabled{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-bg-opacity))}.pi .disabled\\:bg-transparent:disabled{background-color:transparent}.pi .disabled\\:text-disabled:disabled{color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity))}.pi .disabled\\:text-white\\/70:disabled{color:#ffffffb3}.pi .disabled\\:shadow-none:disabled{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.pi .disabled\\:before\\:bg-disabled-fg:disabled:before{background-color:rgb(var(--be-foreground-base)/var(--be-disabled-fg-opacity));content:var(--tw-content)}.pi :is(.dark .dark\\:bg-chip){--tw-bg-opacity:1;background-color:rgb(var(--be-background-chip)/var(--tw-bg-opacity))}.pi :is(.dark .dark\\:text-white\\/50){color:#ffffff80}.pi :is(.dark .dark\\:checked\\:border-primary-dark:checked){--tw-border-opacity:1;border-color:rgb(var(--be-primary-dark)/var(--tw-border-opacity))}.pi :is(.dark .dark\\:checked\\:bg-primary-dark:checked){--tw-bg-opacity:1;background-color:rgb(var(--be-primary-dark)/var(--tw-bg-opacity))}@media (min-width:640px){.pi .sm\\:text-sm{font-size:14px;line-height:20px}}@media (min-width:768px){.pi .md\\:text-lg{font-size:18px;line-height:28px}}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-2:focus-visible>.tree-label{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.pi .\\[\\&\\>\\.tree-label\\]\\:focus-visible\\:ring-inset:focus-visible>.tree-label{--tw-ring-inset:inset}\n'),!e.selector)throw new Error('Pixie required "selector" option.');const t=document.querySelector(e.selector);t&&(t.classList.add("pi"),function(e){wh=e,xh=e}(t),this.setConfig(e),Ah.setState({editor:this}),(0,a.H)(t).render((0,i.jsx)(o.StrictMode,{children:(0,i.jsx)(ZI,{})})))}get state(){return jh()}get defaultConfig(){return e.defaultConfig}open(e={}){return new Promise(async t=>{var n;Object.keys(e).length?await this.resetEditor({...dd(e,{ui:{visible:!0},image:e.image||jh().config.image,state:e.state||jh().config.state,blankCanvasSize:e.blankCanvasSize||jh().config.blankCanvasSize})}):null!=(n=jh().config.ui)&&n.visible||jh().setConfig({ui:{visible:!0}}),t()})}close(){var e,t,n;null!=(e=jh().config.ui)&&e.visible&&(this.setConfig({ui:{visible:!1}}),null==(n=(t=jh().config).onClose)||n.call(t))}setConfig(e){jh().setConfig(e)}uploadAndAddImage(){return Eh().import.uploadAndAddImage()}uploadAndReplaceMainImage(){return Eh().import.uploadAndReplaceMainImage()}uploadAndOpenStateFile(){return Eh().import.uploadAndOpenStateFile()}newCanvas(e,t,n){return Eh().canvas.openNew(e,t,n)}getState(e){return JSON.stringify(Ph(e))}setState(e){return Eh().import.loadState(e)}async setStateFromUrl(e){const t=await Oh(e);return Eh().import.loadState(t)}openTool(e){Mh(e)}applyChanges(){jh().applyChanges()}cancelChanges(){jh().cancelChanges()}async resetEditor(e){await Th(e),await Eh().canvas.loadInitialContent()}togglePanel(e,t){"objects"===e&&jh().togglePanel("history",!1),"history"===e&&jh().togglePanel("objects",!1),jh().togglePanel(e,t)}on(e,t){var n;null==(n=this.fabric)||n.on(e,t)}isDirty(){return jh().dirty}get(e){return this.tools[e]}notify(e){return Bh(e)}static init(e){return new Promise(t=>{const n=e.onLoad;e.onLoad=e=>{null==n||n(e),t(e)},new this(e)})}};Ni(JI,"defaultConfig",Bc),Ni(JI,"version","3.0.5");let QI=JI;function eT(e){if(!this.backgroundColor)return;const t=this._getNonTransformedDimensions(),n=-t.x/2,r=-t.y/2,i=t.x,o=t.y,a=this.backgroundColor;if("string"==typeof a||a instanceof CanvasGradient||a instanceof CanvasPattern)e.fillStyle=a,e.fillRect(n,r,i,o);else if("object"!=typeof a||!("type"in a)||"linear"!==a.type&&"radial"!==a.type){if("source"in a&&(a.source instanceof HTMLImageElement||a.source instanceof HTMLCanvasElement))if(a.repeat){const t=e.createPattern(a.source,a.repeat);t&&(e.fillStyle=t,e.fillRect(n,r,i,o))}else e.drawImage(a.source,n,r,i,o)}else{const t=function(e,t,n,r){var i,o;if("linear"===t.type){const i=e.createLinearGradient(n+t.coords.x1,r+t.coords.y1,n+t.coords.x2,r+t.coords.y2);return t.colorStops.forEach(e=>i.addColorStop(e.offset,e.color)),i}if("radial"===t.type){const a=e.createRadialGradient(n+t.coords.x1,r+t.coords.y1,null!==(i=t.coords.r1)&&void 0!==i?i:0,n+t.coords.x2,r+t.coords.y2,null!==(o=t.coords.r2)&&void 0!==o?o:0);return t.colorStops.forEach(e=>a.addColorStop(e.offset,e.color)),a}throw new Error("Unknown gradient type")}(e,a,n,r);e.fillStyle=t,e.fillRect(n,r,i,o)}this._removeShadow(e)}const tT="fm-pixie-editor",nT=new class{constructor(){this._container=document.createElement("div"),this._instance=null,this._container.classList.add(tT),this._container.style.width="100%",this._container.style.height="85vh",this._container.style.minHeight="400px"}get className(){return`.${tT}`}get canvas(){var e,t;return null===(t=null===(e=this._instance)||void 0===e?void 0:e.state.canvasRef)||void 0===t?void 0:t.current}get tools(){var e;return null===(e=this._instance)||void 0===e?void 0:e.tools}isLoaded(){return!!this._instance}async _setConfig(e){var t;this._instance?await this._instance.resetEditor(e):this._instance=await QI.init(Object.assign(Object.assign({},e),{selector:this.className})),(t=this._instance).fabric&&t.fabric.on("object:added",e=>{const t=e.target;t&&"text"===t.name&&(t._renderBackground=eT)})}async show(e,t,n=t.firstChild){t.insertBefore(this._container,n),await this._setConfig(e),this._instance.open()}close(){var e;null===(e=this._container.parentNode)||void 0===e||e.removeChild(this._container)}},rT=({small:e=!1,style:t={},wrap:n=!1})=>{const r=Object.assign({width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},t);return(0,i.jsx)(I.A,{size:"large",style:r,wrap:n,children:(0,i.jsx)(T.A,{})})};function iT(e,t){return e?t?`${e.replace(/\/+$/,"")}/${t.replace(/^\/+/,"")}`:e:t}function oT(e,t){if(/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(t))return t;const r=function(e){const t=n.p;if(e&&/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(e))return e;let r=iT(t,e||"");return!r||r.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(r)||(r="/"+r),r}(e),i=iT(r,t);return!i||i.startsWith("/")||/^[a-zA-Z][a-zA-Z\d+\-.]*?:/.test(i)?i:"/"+i}var aT,sT;!function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(aT||(aT={})),function(e){e.TOP="top",e.BOTTOM="bottom",e.HIDDEN=""}(sT||(sT={}));const lT=(e,t="image/png")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob()),cT=({visible:e,onClose:t,file:n,onSave:r})=>{const a=o.useRef(null),s=zr(),{options:l,actions:u,state:d}=Rr(),{config:h}=l,{setCurrentMenuFile:f,setLoading:p}=u,{loading:g}=d,[m,v]=o.useState(null),[y,b]=o.useState(""),[w,x]=o.useState(!1),[C,S]=o.useState(!1),k=Hr(),A=o.useRef(!1),j=o.useRef(),E=o.useRef(void 0),[I,T]=o.useState(null);o.useEffect(()=>{n&&(p&&p(!0),(async()=>{if(E.current!==n)if("object"!=typeof n)try{if(E.current=n,n.startsWith("data:"))T({thumbnail:n});else{const e=await k.handleAddFileByUrl(n,!0);if(!e)throw new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b");E.current===n&&T(e)}}finally{E.current===n&&(E.current=null)}else T(n)})())},[n,k.handleAddFileByUrl,T,p]),j.current=r;const O=o.useCallback(async e=>{try{if(e.thumbnail&&e.thumbnail.startsWith("data:"))return e.thumbnail;const t=await k.getFileData(e);if(!t)throw new Error("\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u0430");return new Promise(e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(t)})}catch(e){throw e}},[k]);o.useEffect(()=>{(async()=>{var e,n,r;try{const e=I?await O(I):null;v(e);const t=I?I.type:"";b(t||"image/png"),p&&p(!1)}catch(i){s.error({id:"IMAGE_DOWNLOAD_FAILED",innerException:i,message:"\u041e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",placement:"bottomRight",data:{itemId:null!==(e=null==I?void 0:I.id)&&void 0!==e?e:void 0,itemName:null!==(n=null==I?void 0:I.name)&&void 0!==n?n:void 0,folderId:null!==(r=null==I?void 0:I.folderId)&&void 0!==r?r:null,thumbnail:null==I?void 0:I.thumbnail}}),null==t||t()}})()},[e,I,O,t,s,p]);const F=o.useCallback(async(e,n,r)=>{var i,o,a,c,u;if(!I||!j.current)return;const d="object"==typeof I&&null!==I?I:null;let h=null;try{null==p||p(!0);const n=await function(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});let n=`image/${e}`;if("jpg"===e&&(n="image/jpeg"),t.startsWith("data:")){const e=t.match(/^data:([^;]+)/);e&&e[1].startsWith("image/")&&(n=e[1]);const r=t.replace(/data:image\/[^;]+;base64,/,"");return lT(r,n)}return lT(t,n)}(r,e);let a=n.type||`image/${r}`;"jpg"===r&&(a="image/jpeg");const c=e.startsWith("data:")?e:`data:${a};base64,${e}`,u=Object.assign(Object.assign({},I),{thumbnail:c,size:n.size,date:(new Date).toISOString().split("T")[0],type:a,folderId:I.folderId||"",name:I.name,extension:I.extension||I.name.split(".").pop()||""});h=u;const d=await j.current(u);if(d)return s.success({id:"IMAGE_UPDATE_SUCCESS",message:"\u0423\u0441\u043f\u0435\u0445",description:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043e",data:{itemId:null!==(i=d.id)&&void 0!==i?i:void 0,itemName:d.name,folderId:null!==(o=d.folderId)&&void 0!==o?o:null,thumbnail:d.thumbnail}}),l.onEditorOk&&l.onEditorOk(d),null==p||p(!1),d;null==p||p(!1),null==t||t()}catch(e){const t=null!=h?h:d;s.error({id:"IMAGE_SAVE_FAILED",message:"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f",placement:"bottomRight",data:{itemId:null!==(a=null==t?void 0:t.id)&&void 0!==a?a:void 0,itemName:null!==(c=null==t?void 0:t.name)&&void 0!==c?c:n,folderId:null!==(u=null==t?void 0:t.folderId)&&void 0!==u?u:null,thumbnail:null==t?void 0:t.thumbnail},innerException:e}),null==p||p(!1)}},[I,s,t,l,p]),P=o.useCallback(async()=>{var e;if(!nT.isLoaded()||!I)return;const t=I.name||"edited-image",n=I.extension||y.split("/")[1]||"png";try{let r;r="jpg"===n?"jpeg":["png","jpeg","json","svg"].includes(n)?n:"jpeg",await(null===(e=nT.tools)||void 0===e?void 0:e.export.save(t.replace(/\.[^/.]+$/,""),r,.8))}catch(e){try{const e=nT.canvas,r=e?e.toDataURL(`image/${n}`):null;r&&await F(r,t,n)}catch(e){}}},[I,y,F]),M=o.useCallback(async()=>{if(m&&e&&w&&!A.current)try{A.current=!0;const e=a.current;let n=0;for(;n<20&&(0===e.clientWidth||0===e.clientHeight);)await new Promise(e=>setTimeout(e,50)),n++;const r=(null==h?void 0:h.locale)?null==h?void 0:h.locale.replace("_","-"):"ru-RU",o=matchMedia(Rt).matches?Pt:Ft,s=(null==h?void 0:h.theme)===Mt?o:null==h?void 0:h.theme,l={selector:"#pixie-editor",baseUrl:oT((null==h?void 0:h.baseUrl)||"",(null==h?void 0:h.assetsUrl)||"assets/image-editor"),image:m,activeLanguage:r,ui:{activeTheme:s,mode:"inline",forceOverlayModeOnMobile:!1,visible:!0,menubar:{replaceDefaultItems:!0,position:aT.TOP,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",align:"right",desktopOnly:!0,icon:()=>(0,i.jsx)(Z.A,{style:{fontSize:20}}),action:e=>{e.togglePanel("history")}},{type:"button",icon:()=>(0,i.jsx)(H.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:t}]},nav:{position:sT.TOP}},onSave:async function(e,t,n){try{return null==p||p(!0),await F(e,t,n)}catch(e){throw null==p||p(!1),e}}};try{S(!1),await nT.show(l,a.current);const e=nT.canvas;e&&e.focus(),S(!0)}catch(bt){}}catch(bt){s.error({id:"EDITOR_INIT_FAILED",message:"\u041e\u0448\u0438\u0431\u043a\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430",placement:"bottomRight",innerException:bt}),A.current=!1,null==t||t()}},[m,e,w,null==h?void 0:h.locale,t,p,F,s]);return o.useEffect(()=>{e&&m&&w&&M()},[e,m,w,null==I?void 0:I.id,M]),o.useEffect(()=>{if(!e){try{nT.close()}catch(bt){}v(null),b(""),A.current=!1,x(!1),S(!1)}return()=>{try{nT.close()}catch(bt){}}},[e]),(0,i.jsx)(_.A,{title:`\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435: ${(null==I?void 0:I.name)||"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435"}`,open:e,closeIcon:null,onCancel:t,afterOpenChange:e=>x(e),forceRender:!0,width:"95vw",style:{top:20},styles:{body:{height:"85vh",padding:0}},footer:[(0,i.jsx)(c.Ay,{onClick:t,disabled:!w||g,children:"\u041e\u0442\u043c\u0435\u043d\u0430"},"cancel"),(0,i.jsx)(c.Ay,{type:"primary",onClick:P,loading:g,children:"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c"},"save")],maskClosable:!1,destroyOnHidden:!1,afterClose:()=>{f&&f("")},children:(0,i.jsxs)("div",{ref:a,style:{position:"relative",width:"100%",height:"100%"},children:[e&&!C?(0,i.jsx)("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.45)",backdropFilter:"blur(1px)",pointerEvents:"all",zIndex:10},children:(0,i.jsx)("span",{style:{fontSize:14,color:"#555"},children:"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430\u2026"})}):null,g&&(0,i.jsx)(rT,{style:{position:"absolute",top:0,background:"var(--colorBgLayout)",zIndex:100,opacity:.7}})]})})},{Header:uT}=x.A,{Title:dT}=L.A,hT=({activeLibraryItem:e,selectedFolder:t})=>{const{t:n}=hn(),r={[jt]:n("My files"),[Et]:n("GIF"),[It]:n("Stock images"),[Tt]:n("AI image generation")};return(0,i.jsx)(uT,{className:"actions-header",children:(0,i.jsx)("div",{className:"header-title-container",children:(0,i.jsx)(dT,{level:5,className:"header-title",children:e===jt?t:r[e]})})})};var fT=function(e,t){return fT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},fT(e,t)},pT=function(){return pT=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pT.apply(this,arguments)},gT="Pixel",mT="Percent",vT={unit:mT,value:.8};function yT(e){return"number"==typeof e?{unit:mT,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:gT,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:mT,value:parseFloat(e)}:vT:vT}var bT=function(e){function t(t){var n=e.call(this,t)||this;return n.lastScrollTop=0,n.actionTriggered=!1,n.startY=0,n.currentY=0,n.dragging=!1,n.maxPullDownDistance=0,n.getScrollableTarget=function(){return n.props.scrollableTarget instanceof HTMLElement?n.props.scrollableTarget:"string"==typeof n.props.scrollableTarget?document.getElementById(n.props.scrollableTarget):(n.props.scrollableTarget,null)},n.onStart=function(e){n.lastScrollTop||(n.dragging=!0,e instanceof MouseEvent?n.startY=e.pageY:e instanceof TouchEvent&&(n.startY=e.touches[0].pageY),n.currentY=n.startY,n._infScroll&&(n._infScroll.style.willChange="transform",n._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)"))},n.onMove=function(e){n.dragging&&(e instanceof MouseEvent?n.currentY=e.pageY:e instanceof TouchEvent&&(n.currentY=e.touches[0].pageY),n.currentY<n.startY||(n.currentY-n.startY>=Number(n.props.pullDownToRefreshThreshold)&&n.setState({pullToRefreshThresholdBreached:!0}),n.currentY-n.startY>1.5*n.maxPullDownDistance||n._infScroll&&(n._infScroll.style.overflow="visible",n._infScroll.style.transform="translate3d(0px, "+(n.currentY-n.startY)+"px, 0px)")))},n.onEnd=function(){n.startY=0,n.currentY=0,n.dragging=!1,n.state.pullToRefreshThresholdBreached&&(n.props.refreshFunction&&n.props.refreshFunction(),n.setState({pullToRefreshThresholdBreached:!1})),requestAnimationFrame(function(){n._infScroll&&(n._infScroll.style.overflow="auto",n._infScroll.style.transform="none",n._infScroll.style.willChange="unset")})},n.onScrollListener=function(e){"function"==typeof n.props.onScroll&&setTimeout(function(){return n.props.onScroll&&n.props.onScroll(e)},0);var t=n.props.height||n._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;n.actionTriggered||((n.props.inverse?n.isElementAtTop(t,n.props.scrollThreshold):n.isElementAtBottom(t,n.props.scrollThreshold))&&n.props.hasMore&&(n.actionTriggered=!0,n.setState({showLoader:!0}),n.props.next&&n.props.next()),n.lastScrollTop=t.scrollTop)},n.state={showLoader:!1,pullToRefreshThresholdBreached:!1,prevDataLength:t.dataLength},n.throttledOnScrollListener=function(e,t,n,r){var i,o=!1,a=0;function s(){i&&clearTimeout(i)}function l(){var e=this,l=Date.now()-a,c=arguments;function u(){a=Date.now(),n.apply(e,c)}o||(r&&!i&&u(),s(),void 0===r&&l>150?u():!0!==t&&(i=setTimeout(r?function(){i=void 0}:u,void 0===r?150-l:150)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),o=!0},l}(0,n.onScrollListener).bind(n),n.onStart=n.onStart.bind(n),n.onMove=n.onMove.bind(n),n.onEnd=n.onEnd.bind(n),n}return function(e,t){function n(){this.constructor=e}fT(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.componentDidMount=function(){if(void 0===this.props.dataLength)throw new Error('mandatory prop "dataLength" is missing. The prop is needed when loading more content. Check README.md for usage');if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el&&this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el&&this.el instanceof HTMLElement&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&this.el&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown&&this._pullDown.firstChild&&this._pullDown.firstChild.getBoundingClientRect().height||0,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')},t.prototype.componentWillUnmount=function(){this.el&&(this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd)))},t.prototype.componentDidUpdate=function(e){this.props.dataLength!==e.dataLength&&(this.actionTriggered=!1,this.setState({showLoader:!1}))},t.getDerivedStateFromProps=function(e,t){return e.dataLength!==t.prevDataLength?pT(pT({},t),{prevDataLength:e.dataLength}):null},t.prototype.isElementAtTop=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=yT(t);return r.unit===gT?e.scrollTop<=r.value+n-e.scrollHeight+1:e.scrollTop<=r.value/100+n-e.scrollHeight+1},t.prototype.isElementAtBottom=function(e,t){void 0===t&&(t=.8);var n=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,r=yT(t);return r.unit===gT?e.scrollTop+n>=e.scrollHeight-r.value:e.scrollTop+n>=r.value/100*e.scrollHeight},t.prototype.render=function(){var e=this,t=pT({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),n=this.props.hasChildren||!!(this.props.children&&this.props.children instanceof Array&&this.props.children.length),r=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return o.createElement("div",{style:r,className:"infinite-scroll-component__outerdiv"},o.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&o.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},o.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},this.state.pullToRefreshThresholdBreached?this.props.releaseToRefreshContent:this.props.pullDownToRefreshContent)),this.props.children,!this.state.showLoader&&!n&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))},t}(o.Component);function wT(){return wT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wT.apply(this,arguments)}function xT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xT(Object(n),!0).forEach(function(t){_T(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class ST extends o.Component{constructor(e){let t;super(e),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),t=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:t}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})):this.reCalculateColumnCount()}reCalculateColumnCount(){const e=window&&window.innerWidth||1/0;let t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let n=1/0,r=t.default||2;for(let i in t){const o=parseInt(i);o>0&&e<=o&&o<n&&(n=o,r=t[i])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const e=this.state.columnCount,t=new Array(e),n=o.Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const i=r%e;t[i]||(t[i]=[]),t[i].push(n[r])}return t}renderColumns(){const{column:e,columnAttrs:t={},columnClassName:n}=this.props,r=this.itemsInColumns(),i=100/r.length+"%";let a=n;a&&"string"!=typeof a&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===a&&(a="my-masonry-grid_column"));const s=CT(CT(CT({},e),t),{},{style:CT(CT({},t.style),{},{width:i}),className:a});return r.map((e,t)=>o.createElement("div",wT({},s,{key:t}),e))}logDeprecated(e){}render(){const e=this.props,{children:t,breakpointCols:n,columnClassName:r,columnAttrs:i,column:a,className:s}=e,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let c=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(c="my-masonry-grid")),o.createElement("div",wT({},l,{className:c}),this.renderColumns())}}ST.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};var kT={gifTab:"gifTab",scrollableDiv:"scrollableDiv",gifSearchInput:"gifSearchInput",search:"search",searchResults:"searchResults",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",searchOutputWrapper:"searchOutputWrapper",divider:"divider",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle",noFiles:"noFiles"};const AT={default:4,1600:3,1100:2,700:1},jT=({setImageGifList:e,imageGifList:t=[],currentReqGif:n,setCurrentReqGif:r,inputRef:a,customRequest:s})=>{const{t:l}=hn(),{GifPlayIcon:c}=ki(),{options:u}=Rr(),{config:d}=u,[h,f]=(0,o.useState)(null),[p,m]=(0,o.useState)(!1),[v,b]=(0,o.useState)(25),[x,C]=(0,o.useState)(null),_=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{const e=`https://api.giphy.com/v1/gifs/search?api_key=${null==d?void 0:d.REACT_APP_GIPHY_KEY}&q=${n}&limit=25&offset=${t}&lang=en`,r=await fetch(e);return{data:await r.json()}}catch(e){}},S=async()=>{var t,r;const i=await _({query:n,page:0});(null===(r=null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.data)||void 0===r?void 0:r.length)&&i.data.data.length>0&&e(i.data.data)};return(0,o.useEffect)(()=>()=>{x&&clearTimeout(x)},[x]),(0,i.jsx)("div",{className:kT.gifTab,children:(0,i.jsx)("div",{className:kT.searchOutputWrapper,children:(0,i.jsxs)("div",{id:"scrollableDiv",className:kT.scrollableDiv,children:[(0,i.jsxs)(y.A,{onValuesChange:e=>{if(void 0!==e.keywords){r(t=>Object.assign(Object.assign({},t),{keywords:e.keywords})),x&&clearTimeout(x);const t=setTimeout(S,800);C(t)}},className:t.length>0?kT.searchResults:kT.search,children:[(0,i.jsx)(y.A.Item,{name:"keywords",className:kT.gifSearchInput,children:(0,i.jsx)(w.A,{onKeyDown:e=>"Space"===e.code&&S(),onPressEnter:e=>S(),allowClear:!0,placeholder:l("Search GIFs"),ref:a,spellCheck:"false",prefix:(0,i.jsx)(Ar,{size:16,strokeWidth:null==d?void 0:d.iconStrokeWidth,onClick:S})})}),t.length>0&&!p&&(0,i.jsx)("div",{className:`ant-divider ${kT.divider}`,role:"separator"})]}),!t.length&&!p&&(0,i.jsx)(i.Fragment,{children:n.keywords?(0,i.jsx)("div",{className:kT.noFiles,children:l("There are no files for your request.")}):(0,i.jsxs)("div",{className:kT.resultsContainer,children:[(0,i.jsx)("div",{className:kT.videoIcon,children:(0,i.jsx)(c,{className:kT.playButton})}),(0,i.jsx)("h1",{className:kT.title,children:l("Over 350,000 live images")}),(0,i.jsx)("p",{className:kT.subtitle,children:l("Enter a search query and we'll find the perfect image for you")})]})}),!t.length&&p&&(0,i.jsx)(rT,{}),t.length>0&&(0,i.jsx)(bT,{dataLength:t&&t.length,next:async()=>{p||(m(!0),_({query:n,page:v}).then(t=>{t&&t.data&&t.data.data&&e(e=>[...e,...t.data.data]),m(!1),b(e=>e+25)}).catch(()=>{m(!1)}))},hasMore:!!t,endMessage:(0,i.jsxs)(g.A,{plain:!0,children:[l("That`s all we could find.")," \ud83e\udd10"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,i.jsx)(rT,{}),children:(0,i.jsx)(ST,{breakpointCols:AT,className:kT.myMasonryGrid,columnClassName:kT.myMasonryGridColumn,children:t.map((e,t)=>(0,i.jsxs)("div",{className:kT.listItem,onClick:()=>((e,t)=>{f(t),setTimeout(()=>{f(null)},2e3),s(e)})(e.images.downsized.url,e.id),children:[(0,i.jsx)("img",{className:h===e.id?kT.loadedImage:"",width:"100%",src:`${e.images.downsized.url}`,alt:e.title,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(kT.loaded)}}),(0,i.jsx)("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()}),h===e.id&&(0,i.jsx)(T.A,{className:kT.antSpin})]},e.id+t))})})]})})})};var ET={stockTab:"stockTab",stockSearchInput:"stockSearchInput",searchOutputWrapper:"searchOutputWrapper",divider:"divider",search:"search",searchResults:"searchResults",scrollableDiv:"scrollableDiv",myMasonryGrid:"myMasonryGrid",myMasonryGridColumn:"myMasonryGridColumn",listItem:"listItem",loaded:"loaded",loadedImage:"loadedImage",creatorInfo:"creatorInfo",stockColorFilter:"stockColorFilter",allColors:"allColors",blackColor:"blackColor",bwColor:"bwColor",whiteColor:"whiteColor",orangeColor:"orangeColor",redColor:"redColor",purpleColor:"purpleColor",magentaColor:"magentaColor",greenColor:"greenColor",tealColor:"tealColor",blueColor:"blueColor",resultsContainer:"resultsContainer",playButton:"playButton",title:"title",subtitle:"subtitle",noFiles:"noFiles"};const IT={default:4,1600:3,1100:2,700:1},TT=({imageStockList:e,setImageStockList:t,currentReq:n,setCurrentReq:r,inputRef:a,customRequest:s})=>{var l;const{t:c}=hn(),{StockBigIcon:u,MixedViewIcon:d,LandscapeViewIcon:h,PortraitViewIcon:p,SquareViewIcon:m}=ki(),{options:v}=Rr(),{config:b}=v,[x,C]=(0,o.useState)(!1),[_,S]=(0,o.useState)(2),[j,E]=(0,o.useState)(null),[I,O]=(0,o.useState)(null),[F,P]=(0,o.useState)(!0),[R]=y.A.useForm(),L=(0,o.useRef)(n);(0,o.useEffect)(()=>{L.current=n},[n]),(0,o.useEffect)(()=>{0===e.length&&R.setFieldsValue({color:"",orientation:""})},[e,R]);const D=async function({query:e,page:t}){const n=e.keywords.replace(/[^\w\s\u0430-\u044f\u0451\u0410-\u042f\u0401]|_/g,"").replace(/[\s_-]+/g," ");try{let r=`https://api.unsplash.com/search/photos?client_id=${null==b?void 0:b.UNSPLASH_KEY}&lang=ru&per_page=18&query=${n}&page=${t}`;""!==e.color&&(r+=`&color=${e.color}`),""!==e.orientation&&(r+=`&orientation=${e.orientation}`);const i=await fetch(r);return{data:await i.json()}}catch(e){}finally{C(!1)}},N=async()=>{var e,n,r;C(!0);const i=await D({query:L.current,page:1});(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.results)&&(t(i.data.results),P(18===i.data.results.length),(null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.results)||void 0===r?void 0:r.length)&&i.data.results.length>0&&S(2))};(0,o.useEffect)(()=>()=>{I&&clearTimeout(I)},[I]);return(0,i.jsx)("div",{className:ET.stockTab,children:(0,i.jsx)("div",{className:ET.searchOutputWrapper,children:(0,i.jsxs)("div",{className:ET.scrollableDiv,id:"scrollableDiv",children:[(0,i.jsxs)(y.A,{form:R,initialValues:Nt,onValuesChange:(t,n)=>{if(r(Object.assign(Object.assign({},Nt),n)),I&&clearTimeout(I),""!==n.keywords){const e=setTimeout(N,800);O(e)}else e.length||(r(Object.assign({},Nt)),R.resetFields())},className:e.length>0?ET.searchResults:ET.search,children:[(0,i.jsxs)(A.A,{gutter:24,children:[(0,i.jsx)(f.A,{span:e.length>0?void 0:24,children:(0,i.jsx)(y.A.Item,{name:"keywords",className:ET.stockSearchInput,children:(0,i.jsx)(w.A,{allowClear:!0,placeholder:c("Search image"),ref:a,spellCheck:"false",prefix:(0,i.jsx)(Ar,{size:16,strokeWidth:null==b?void 0:b.iconStrokeWidth})})})}),!!e.length&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f.A,{children:(0,i.jsx)(y.A.Item,{name:"orientation",children:(0,i.jsxs)(k.Ay.Group,{onChange:e=>r(t=>Object.assign(Object.assign({},t),{orientation:e.target.value})),children:[(0,i.jsx)(M.A,{title:c("All"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{value:"",children:(0,i.jsx)(d,{})})}),(0,i.jsx)(M.A,{title:c("Landscape"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{value:"landscape",children:(0,i.jsx)(h,{})})}),(0,i.jsx)(M.A,{title:c("Portrait"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{value:"portrait",children:(0,i.jsx)(p,{})})}),(0,i.jsx)(M.A,{title:c("Squarish"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{value:"squarish",children:(0,i.jsx)(m,{})})})]})})}),(0,i.jsx)(f.A,{children:(0,i.jsx)(y.A.Item,{name:"color",children:(0,i.jsxs)(k.Ay.Group,{className:ET.stockColorFilter,onChange:e=>r(t=>Object.assign(Object.assign({},t),{color:e.target.value})),children:[(0,i.jsx)(M.A,{title:c("All"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.allColors,value:"",children:"All"})}),(0,i.jsx)(M.A,{title:c("Black"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.blackColor,value:"black",children:"B"})}),(0,i.jsx)(M.A,{title:c("Black and White"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.bwColor,value:"black_and_white",children:"B&W"})}),(0,i.jsx)(M.A,{title:c("White"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.whiteColor,value:"white",children:"W"})}),(0,i.jsx)(M.A,{title:c("Orange"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.orangeColor,value:"orange",children:"O"})}),(0,i.jsx)(M.A,{title:c("Red"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.redColor,value:"red",children:"R"})}),(0,i.jsx)(M.A,{title:c("Purple"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.purpleColor,value:"purple",children:"P"})}),(0,i.jsx)(M.A,{title:c("Magenta"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.magentaColor,value:"magenta",children:"M"})}),(0,i.jsx)(M.A,{title:c("Green"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.greenColor,value:"green",children:"G"})}),(0,i.jsx)(M.A,{title:c("Teal"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.tealColor,value:"teal",children:"T"})}),(0,i.jsx)(M.A,{title:c("Blue"),placement:"top",children:(0,i.jsx)(k.Ay.Button,{className:ET.blueColor,value:"blue",children:"B"})})]})})})]})]}),e.length>0&&!x&&(0,i.jsx)("div",{className:`ant-divider ${ET.divider}`,role:"separator"})]}),!e.length&&!x&&(0,i.jsx)(i.Fragment,{children:n.keywords?(0,i.jsx)("div",{className:ET.noFiles,children:c("There are no files for your request.")}):(0,i.jsxs)("div",{className:ET.resultsContainer,children:[(0,i.jsx)("div",{className:ET.videoIcon,children:(0,i.jsx)(u,{className:ET.playButton})}),(0,i.jsx)("h1",{className:ET.title,children:c("Millions of free stock images")}),(0,i.jsx)("p",{className:ET.subtitle,children:c("Enter a search query and we'll find the perfect image for you")})]})}),!e.length&&x&&(0,i.jsx)(rT,{}),e.length>0&&(0,i.jsx)(bT,{dataLength:e&&e.length,next:async()=>{if(x||""===L.current.keywords)return C(!1),void(""===L.current.keywords&&P(!1));C(!0),D({query:L.current,page:_}).then(e=>{e&&e.data&&e.data.results&&(t(t=>[...t,...e.data.results]),P(18===e.data.results.length)),S(e=>e+1)}).catch(e=>{}).finally(()=>{C(!1)})},hasMore:F&&""!==(null===(l=L.current)||void 0===l?void 0:l.keywords),endMessage:(0,i.jsxs)(g.A,{plain:!0,children:[c("That`s all we could find.")," \ud83e\udd10"]}),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:(0,i.jsx)(rT,{}),children:(0,i.jsx)(ST,{breakpointCols:IT,className:ET.myMasonryGrid,columnClassName:ET.myMasonryGridColumn,children:e.map((e,t)=>(0,i.jsxs)("div",{className:ET.listItem,onClick:()=>((e,t,n)=>{!async function(e){try{const t=await fetch(`${e}&client_id=${null==b?void 0:b.UNSPLASH_KEY}`);return{data:await t.json()}}catch(e){}}(t.download_location),E(n),setTimeout(()=>E(null),2e3),s(`${e.raw}&w=1200&q=96`)})(e.urls,e.links,e.id),children:[(0,i.jsx)("img",{className:j===e.id?ET.loadedImage:"",width:"100%",src:`${e.urls.raw}&w=644&q=96`,alt:e.description,onLoad:e=>{const t=e.target.parentNode;t&&t instanceof HTMLElement&&t.classList.add(ET.loaded)}}),(0,i.jsxs)("p",{className:ET.creatorInfo,onClick:e=>e.stopPropagation(),children:[c("Photo by")," ",(0,i.jsx)("a",{target:"_blank",href:`${e.user.links.html}?utm_source=${null==b?void 0:b.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:e.user.name})," ",c("on")," ",(0,i.jsx)("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${null==b?void 0:b.APP_NAME_UNSPLASH}&utm_medium=referral`,rel:"noreferrer",children:"Unsplash"})]}),j===e.id&&(0,i.jsx)(T.A,{className:ET.antSpin})]},e.id+t))})})]})})})};const OT=({images:e,transitionDuration:t=1e3,frameHeight:n})=>{const[r,a]=(0,o.useState)([]),s=()=>{a(e=>e.map((t,n)=>n===e.length-1?Object.assign(Object.assign({},t),{opacity:1}):t))};return(0,o.useEffect)(()=>{if(e.length>0){const t=e[e.length-1];a(e=>[...e,{src:t,opacity:0}]),setTimeout(s,1e3)}else a([])},[e]),(0,i.jsx)("div",{className:"slideshowContainer",style:{height:600,minHeight:130},children:r.map((e,n)=>(0,i.jsx)("img",{src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${n+1}`,className:"slideshowImage",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`,display:"block"}},n))})};"function"==typeof SuppressedError&&SuppressedError;const FT=e=>{var{className:t,style:n,color:r,text:o,bordered:a}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["className","style","color","text","bordered"]);const l=o||"";return(0,i.jsx)(F.A,Object.assign({style:n,color:r,bordered:a,className:t},s,{children:l}))},PT=({text:e,counter:t,limits:n,wrapperStyles:r})=>{const{t:o}=hn(),{options:a}=Rr(),s=a.config,{token:l}=P.A.useToken(),c=+n>0,u=!c||t<+n,d=(null==s?void 0:s.billingPageUrl)||"/billing",h=t+" "+o("of")+" "+(c?n:"\u221e")+" "+(e||o("tests",{count:n}))+" "+o("was used",{count:t});return(0,i.jsxs)("div",{className:"limits-couter-wrapper",style:r,children:[(0,i.jsx)(FT,{bordered:!1,text:h,className:"limit-counter",style:{color:u?l.colorText:"white"},color:u?l.colorFillSecondary:"rgb(255, 77, 79)"}),c&&(0,i.jsx)("div",{style:{fontSize:14,textDecoration:"underline",cursor:"pointer"},onClick:()=>window.location.assign(d),children:o("Need more?")})]})};var MT={imageAi:"imageAi",imageAiExample:"imageAiExample",imageItem:"imageItem",textAreaInputHybrid:"textAreaInputHybrid",loading:"loading",carousel:"carousel",arrow:"arrow",arrowNext:"arrowNext",arrowPrev:"arrowPrev",arrowBtn:"arrowBtn",arrowBtnNext:"arrowBtnNext",arrowBtnPrev:"arrowBtnPrev",row:"row",inputAffixWrapper:"inputAffixWrapper",textarea:"textarea",inputIcon:"inputIcon"};const RT=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${MT.arrow} ${MT.arrowNext} ${e||""}`,onClick:t,children:(0,i.jsx)(c.Ay,{className:`${MT.arrowBtn} ${MT.arrowBtnNext}`,size:"large",icon:(0,i.jsx)(V.A,{})})}));RT.displayName="SampleNextArrow";const LT=(0,o.memo)(({className:e,onClick:t})=>(0,i.jsx)("div",{className:`${MT.arrow} ${MT.arrowPrev} ${e||""}`,onClick:t,children:(0,i.jsx)(c.Ay,{className:`${MT.arrowBtn} ${MT.arrowBtnPrev}`,size:"large",icon:(0,i.jsx)(B.A,{})})}));LT.displayName="SamplePrevArrow";const DT=({customRequest:e,aiTabRef:t,inputAiRef:n,isImageUploaded:r,setIsImageUploaded:a,aiImageRequest:s,setAiImageRequest:l,imageAiList:u,setImageAiList:h,isLoadingAi:p,setIsLoadingAi:g})=>{const{t:m}=hn(),{AiIcon_2:v}=ki(),[b,x]=(0,o.useState)("auto"),{aiImageCounter:C,currentAiImgLimits:_,loadingDuringGeneration:S,requestStatus:k,handleGenerate:j,convertBase64ToFile:E,isShiftPressed:I,setIsShiftPressed:T,limitsInPlugin:O}=function({setFrameHeight:e,customRequest:t,aiTabRef:n,isImageUploaded:r,setIsImageUploaded:i,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u}){const{t:d}=hn(),{options:h}=Rr(),f=h.config,p=zr(),g=(()=>{const{options:e}=Rr(),t=e.config;return(0,o.useCallback)((e,n)=>{!1!==(null==t?void 0:t.pushToGTM)&&((e,t)=>{const n=()=>{try{const t=Object.assign(Object.assign({},e),{appLabel:"blocks_app"});window.dataLayer&&"function"==typeof window.dataLayer.push&&window.dataLayer.push(t)}catch(e){}};t?setTimeout(n,t):n()})(e,n)},[null==t?void 0:t.pushToGTM])})(),{messages:m}=h.config,[v,y]=(0,o.useState)([]),[b,w]=(0,o.useState)(0),[x,C]=(0,o.useState)(null),[_,S]=(0,o.useState)(!1),[k,A]=(0,o.useState)(d("Evaluating the task")),[j,E]=(0,o.useState)(!1);(0,o.useEffect)(()=>{y(m)},[m]),(0,o.useEffect)(()=>{s.length||x||y([])},[s,x]);const I=(0,o.useMemo)(()=>f&&"function"==typeof(null==f?void 0:f.sendAIImageRequest)?null==f?void 0:f.sendAIImageRequest:()=>Promise.resolve({}),[f]),T=(0,o.useCallback)(e=>{if("error"!==e.status&&"Canceled"!==e.status){if(e.images){if(A(String(e.status)),100===e.progress){u(!1),l(e.images);const t=x,n=Array.isArray(e.images)?e.images:[];n.length>0&&p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:n}}),C(null),E(!1)}}else if(l([String(e.data)]),100===e.progress){u(!1);const t=x,n=e.data?[String(e.data)]:[];n.length>0&&p.success({id:"AI_IMAGE_GENERERATION_SUCCESS",message:d("Images generated successfully"),placement:"bottomRight",data:{request:a,taskId:t,images:n}}),C(null),E(!1)}}else u(!1),E(!1),p.error({id:"AI_RESPONSE_INVALID",message:d("Something went wrong, please try again"),placement:"bottomRight",description:String(x)||void 0,data:{requestId:x,request:a,response:e},innerException:e})},[a,l,A,d,u,x,p,E]);(0,o.useEffect)(()=>{v.length>1&&T(v[v.length-1])},[T,v]);const O=(0,o.useMemo)(()=>{if(f&&"function"==typeof(null==f?void 0:f.sseQuery)){const e=null==f?void 0:f.sseQuery;return t=>e(t)}return e=>{}},[f]),F=(0,o.useMemo)(()=>f&&"object"==typeof(null==f?void 0:f.handleLimitUsageEmitter)?null==f?void 0:f.handleLimitUsageEmitter:{fire:()=>{}},[f]),P=null==f?void 0:f.elementId,{projectId:M}=f,{limits:R}=(null==f?void 0:f.limits)?f:{limits:{ai_img_limit:0}},{ai_img_limit:L}=R,D=L>0&&b>=L,N=!(!(null==f?void 0:f.limits)||!f.counters)&&false,z=(0,o.useCallback)(()=>{F.fire({name:"AiImgCount",count:b+1})},[F,b]),B=(0,o.useMemo)(()=>!D&&!N,[D,N,b,L]),V=(0,o.useCallback)(async()=>{A(d("Evaluating the task")),""===a||c||(u(!0),E(!0),l([]),g({event:"submit_form",action:"ai_image_generation",entity_id:P,project_id:M}),I({body:{project_id:M,request:"create-image",connection:"midjourney",message:a}}).then(e=>{var t,n,r,i,o;const{data:s,error:l}=e||{};if(l)throw l;const c=s;if(401===(null==c?void 0:c.status)||401===(null===(t=null==c?void 0:c.data)||void 0===t?void 0:t.status))throw new Error("ERROR");const h=(null==c?void 0:c.task)||(null===(n=null==c?void 0:c.data)||void 0===n?void 0:n.task),f=null!==(i=null!==(r=null==h?void 0:h.id)&&void 0!==r?r:x)&&void 0!==i?i:void 0;200===(null==c?void 0:c.status)||200===(null===(o=null==c?void 0:c.data)||void 0===o?void 0:o.status)?((null==h?void 0:h.id)&&(A(h.message),C(h.id)),(null==c?void 0:c.message)&&p.success({id:"AI_IMAGE_GENERATION_STARTED",message:c.message,placement:"bottomRight",description:a,data:{request:a,taskId:f,response:null==c?void 0:c.data}}),O({task_id:null==h?void 0:h.id,entity_id:P})):(u(!1),E(!1),p.error({id:"AI_IMAGE_GENERATION_FAILED",message:(null==c?void 0:c.message)||d("Something went wrong, please try again"),placement:"bottomRight",description:a,data:{request:a,taskId:f,response:c},innerException:c}))}).catch(e=>{u(!1),E(!1);const t=e;return((null==t?void 0:t.error)||(null==t?void 0:t.data))&&(null==p||p.error({id:"AI_IMAGE_GENERATION_FAILED",message:d("Something went wrong, please try again"),placement:"bottomRight",description:a,innerException:e,data:{request:a,taskId:x,response:null==t?void 0:t.data,error:null==t?void 0:t.error}})),t}))},[a,c,u,E,l,g,P,M,I,p,O,d,x]),U=(0,o.useCallback)(()=>{B&&V()},[B,N,w,z,V,p,d]);(0,o.useEffect)(()=>{},[f,N]);const W=(0,o.useCallback)(e=>{if(!r){i(!0);const n=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!n)return;const r=n[1],o=n[2],a=atob(o),s=new Array(a.length);for(let e=0;e<a.length;e++)s[e]=a.charCodeAt(e);const l=new Uint8Array(s),c=new Blob([l],{type:`image/${r}`}),u=new File([c],"image.jpeg",{type:c.type,lastModified:Date.now()});t({file:u})}},[r,i,t]);return(0,o.useEffect)(()=>{(c||s.length>0)&&setTimeout(()=>{let t=350;n.current&&(t=n.current.offsetHeight-120),e(t)},0)},[n,s.length,c,e]),{aiImageCounter:b,setAiImageCounter:w,currentAiImgLimits:L,isFieldsDisabled:D,canGenerateImage:B,aiImageRequest:a,imageAiList:s,setImageAiList:l,isLoadingAi:c,setIsLoadingAi:u,loadingDuringGeneration:j,setLoadingDuringGeneration:E,requestStatus:k,setRequestStatus:A,handleGenerate:U,handleLimitAiImgCount:z,convertBase64ToFile:W,isShiftPressed:_,setIsShiftPressed:S,currentReqId:x,setCurrentReqId:C,limitsInPlugin:N}}({setFrameHeight:x,customRequest:e,aiTabRef:t,isImageUploaded:r,setIsImageUploaded:a,aiImageRequest:s,imageAiList:u,setImageAiList:h,isLoadingAi:p,setIsLoadingAi:g}),[F,P]=(0,o.useState)(!1),M=(0,o.useCallback)(()=>P(!0),[]),R=(0,o.useCallback)(()=>P(!1),[]),L=(0,o.useCallback)(e=>l(e.target.value),[l]),D=(0,o.useCallback)(e=>{"Shift"===e.key?T(!0):"Enter"!==e.key||I||(e.preventDefault(),j())},[I,j,T]),N=(0,o.useCallback)(e=>{"Shift"===e.key&&T(!1)},[T]);return(0,i.jsxs)("div",{className:MT.imageAi,children:[O&&(0,i.jsx)(PT,{text:"images",counter:C,limits:_,wrapperStyles:{marginTop:-25}}),(0,i.jsx)(A.A,{gutter:24,className:MT.row,children:(0,i.jsxs)(f.A,{span:24,children:[(0,i.jsx)(y.A.Item,{children:(0,i.jsxs)("span",{className:`ant-input-affix-wrapper ant-input-affix-wrapper-lg ${MT.inputAffixWrapper}${F?" ant-input-affix-wrapper-focused":""}`,children:[(0,i.jsx)(w.A.TextArea,{ref:n,onKeyDown:D,onKeyUp:N,onFocus:M,onBlur:R,autoSize:!0,allowClear:!0,className:`${MT.textAreaInputHybrid} ${MT.textarea}`,placeholder:m("Generate image"),value:s,onChange:L,spellCheck:"false"}),(0,i.jsx)("span",{className:`ant-input-suffix ${MT.inputSuffix}`,children:p||S?(0,i.jsx)(Q.A,{className:`${MT.inputIcon} input-icon`,spin:!0}):(0,i.jsx)(v,{className:`${MT.inputIcon} input-icon`,onClick:j})})]})}),(0,i.jsxs)("div",{className:MT.imageAiExample,children:[(0,i.jsx)("span",{children:"For example:"})," ",m("A beautiful image of a sunset over a calm ocean.")]})]})}),(p||u.length>0)&&(0,i.jsxs)(d.A,{dotPosition:"top",arrows:!0,nextArrow:(0,i.jsx)(RT,{}),prevArrow:(0,i.jsx)(LT,{}),className:MT.carousel,infinite:!1,children:[p&&!u.length&&(0,i.jsx)("div",{className:MT.loading,children:(0,i.jsxs)("div",{className:"spin",children:[(0,i.jsx)(Q.A,{style:{fontSize:48},spin:!0}),(0,i.jsx)("p",{className:"status",children:k})]})}),u.length>0&&u.map((e,t)=>(0,i.jsxs)("div",{className:MT.imageItem,children:[(0,i.jsx)(OT,{images:u,frameHeight:b}),(0,i.jsx)("div",{className:"buttons",children:u.length>0&&!p&&(0,i.jsx)(c.Ay,{onClick:()=>E(`data:image/jpeg;base64, ${e}`),icon:(0,i.jsx)(W.A,{}),children:m("Use this variant")})})]},t))]})]})},{Sider:NT,Content:zT}=x.A,BT=({itemIds:e,onUndo:t,onClose:n})=>{const{t:r}=hn();return(0,o.useEffect)(()=>{const e=setTimeout(()=>n(),5e3);return()=>clearTimeout(e)},[n]),(0,i.jsx)("div",{style:{position:"fixed",bottom:24,right:24,maxWidth:420,zIndex:1e3},children:(0,i.jsx)(s.A,{message:r("moved_to_trash",{count:e.length}),type:"success",showIcon:!0,action:(0,i.jsx)(c.Ay,{size:"small",type:"text",onClick:()=>t(),children:r("undo")}),closable:!0,onClose:n})})},VT={keywords:""},UT=()=>{var e;const t=Wr(),n=(()=>{const{state:e}=Rr(),{files:t,loading:n,isUrlModalVisible:r}=e,i=Hr(),a=(()=>{const{state:e,actions:t}=Rr(),{selectedFiles:n,files:r,multiSelect:i}=e,{setSelectedFiles:a}=t,s=(0,o.useRef)(null),l=(0,o.useCallback)((e,t,n)=>{const i=Array.isArray(r)?r:[],o=i.findIndex(t=>t.id===e),a=i.findIndex(e=>e.id===t);if(-1===o||-1===a)return n;const[s,l]=o<a?[o,a]:[a,o],c=i.slice(s,l+1).map(e=>e.id),u=new Set(n);return c.forEach(e=>u.add(e)),u},[r]),c=(0,o.useCallback)((e,t)=>{if(!n||!a)return;const r=!1!==i,o=!!(null==t?void 0:t.shiftKey)&&r&&s.current;let c=new Set(r?n:[]);o&&s.current?c=l(s.current,e,c):c.has(e)?c.delete(e):c.add(e),s.current=e,a(c)},[i,n,a,l]);return{state:{selectedFiles:n||new Set},actions:{toggleFileSelection:c}}})(),s=(e=>{var t,n;const{state:r,actions:i,options:a}=Rr(),{t:s}=hn(),l=Wr(),c=zr(),{fetchFolders:u}=l.actions,{files:d,selectedFolder:h,selectedFiles:f,fileToRename:p,renameForm:g,isRenameModalVisible:m,moveForm:v,copyForm:y,pagination:b,currentMenuFile:w}=r,{setFileToRename:x,setIsRenameModalVisible:C,setIsMoveModalVisible:_,setIsCopyModalVisible:S,setSelectedFiles:k,setIsDeleteConfirmVisible:A,setUndoDeletion:j}=i,{apiEndpoints:E,dataProviders:I,config:T}=a,O=e=>{var t,n;if(!e)return null;const r=e;return null!==(n=null!==(t=r.folderId)&&void 0!==t?t:r.parentId)&&void 0!==n?n:null},F=(e,t)=>{var n;return{itemId:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:t,itemName:null==e?void 0:e.name,folderId:O(e)}},P=e=>{if(!e)return;const t=d.find(t=>t.id===e);return null==t?void 0:t.name},M=e=>e.map(P).filter(e=>Boolean(e)),R=e=>e.length>0&&e.length<=5?e.join(", "):null,L=e=>{var t;return null!==(t=e.requestId)&&void 0!==t?t:e.id},D=(e,t,n,r,i)=>({itemIds:e,itemNames:i&&i.length?i:void 0,successCount:t,totalCount:n,folderId:null!=r?r:null}),N=(e,t,n,r,i,o)=>({itemIds:e,itemNames:o&&o.length?o:void 0,failCount:t,totalCount:n,folderId:null!=r?r:null,errors:i}),z=(0,o.useCallback)(e=>{var t,n;const r=null==d?void 0:d.find(t=>t.id===e);if((null==r?void 0:r.isFolder)||e.startsWith("folder_")){if(!1===(null===(t=null==T?void 0:T.features)||void 0===t?void 0:t.enableRenameFolder))return void c.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:s("Folder rename is disabled by config"),placement:"bottomRight",data:F(r,e)});if(!(null==I?void 0:I.renameFolder))throw new Error("renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders")}else{if(!1===(null===(n=null==T?void 0:T.features)||void 0===n?void 0:n.enableRenameFile))return void c.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:s("File rename is disabled by config"),placement:"bottomRight",data:F(r,e)});if(!(null==I?void 0:I.renameFile))throw new Error("renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders")}null==x||x(e),null==C||C(!0),r&&g&&g.setFieldsValue({newFileName:r.name})},[d,x,C,g,null===(t=null==T?void 0:T.features)||void 0===t?void 0:t.enableRenameFolder,null===(n=null==T?void 0:T.features)||void 0===n?void 0:n.enableRenameFile,null==I?void 0:I.renameFolder,null==I?void 0:I.renameFile,c,s]),B=(0,o.useCallback)(()=>{null==C||C(!1),null==x||x(null),null==g||g.resetFields()},[C,x,g]),V=(0,o.useCallback)(async()=>{var t,n,r;if(!p||!g)return;const o=null==d?void 0:d.find(e=>e.id===p);try{const a=await g.validateFields();if(!(null==a?void 0:a.newFileName))return;if((null==o?void 0:o.isFolder)||p.startsWith("folder_")){if(!1===(null===(t=null==T?void 0:T.features)||void 0===t?void 0:t.enableRenameFolder))return void c.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:s("Folder rename is disabled by config"),placement:"bottomRight",data:F(o,p)});if(!(null==I?void 0:I.renameFolder))throw new Error("renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders");{const e=await I.renameFolder(p,a.newFileName.trim());if(!(null==e?void 0:e.id))return void c.error({id:"FOLDER_RENAME_FAILED",message:s("\u041d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0430\u043f\u043a\u0438"),placement:"bottomRight",data:Object.assign(Object.assign({},F(o,p)),{reason:"Invalid rename response"})});c.success({id:"FOLDER_RENAME_SUCCESS",message:s(`${s("Folder renamed to")} ${a.newFileName}`),placement:"bottomRight",data:{itemId:e.id,itemName:e.name,folderId:null!==(n=e.parentId)&&void 0!==n?n:null}}),await u(),p!==e.id&&i.setSelectedFolder&&i.setSelectedFolder(e.id)}}else{if(!1===(null===(r=null==T?void 0:T.features)||void 0===r?void 0:r.enableRenameFile))return void c.error({id:"FILE_RENAME_DISABLED_BY_CONFIG",message:s("File rename is disabled by config"),placement:"bottomRight",data:F(o,p)});if(!(null==I?void 0:I.renameFile))throw new Error("renameFile \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders");await I.renameFile(p,a.newFileName),c.success({id:"FILE_RENAME_SUCCESS",message:`${s("File renamed to")} ${a.newFileName}`,placement:"bottomRight",data:Object.assign(Object.assign({},F(o,p)),{itemName:a.newFileName})})}B(),await e({folderId:h||"",page:b.current,limit:b.pageSize})}catch(e){const n=Ur(e),r=Vr(null==n?void 0:n.code,s);c.error({id:"ITEM_RENAME_FAILED",message:null!=r?r:e instanceof Error?e.message:"\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438",placement:"bottomRight",data:Object.assign(Object.assign({},F(o,p)),{reason:e instanceof Error?e.message:void 0}),innerException:e})}},[p,g,d,I,E,B,e,h,s,b]),U=(0,o.useCallback)(()=>{null==_||_(!0)},[_]),W=(0,o.useCallback)(()=>{null==_||_(!1),null==v||v.resetFields()},[_,v]),H=(0,o.useCallback)(async t=>{var n;if(!((null==w?void 0:w.length)||f&&0!==f.size))return;const r=Array.from((null==w?void 0:w.length)?[w]:f),i=r.length;let o=0,a=0;const l=[],p=r.map(e=>d.find(t=>t.id===e)).filter(e=>!!e),g=p.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let d=t;if(!t){const e=await v.validateFields();d=null==e?void 0:e.targetFolder}if(!d)return void c.error({id:"FILES_MOVE_DIRECTORY_NOT_SELECTED",message:s("\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f"),placement:"bottomRight"});const f="folders"===d?null:d;if(null==I?void 0:I.moveItems)try{const e=await I.moveItems("folders"===d?"":d,p.map(e=>e.id)),t=e.detailed;if(t){const e=t.filter(e=>e.success),n=t.filter(e=>!e.success);o+=e.length,a+=n.length,n.forEach(e=>{const t=L(e),n=e.error,r=Ur(n);l.push({itemId:t,itemName:P(t),reason:n?String(n):void 0,code:null==r?void 0:r.code,httpStatus:null==r?void 0:r.httpStatus})})}else if(e.success)o+=p.length;else{const t=e.error;if(t){a+=p.length;const e=Ur(t);l.push({reason:String(t),code:null==e?void 0:e.code,httpStatus:null==e?void 0:e.httpStatus})}else a+=p.length}}catch(e){a+=p.length;const n=Ur(e);l.push({reason:e instanceof Error?e.message:String(e),code:null==n?void 0:n.code,httpStatus:null==n?void 0:n.httpStatus})}else for(const e of p)try{const t=(null==e?void 0:e.isFolder)||(null===(n=e.id)||void 0===n?void 0:n.startsWith("folder_"));(null==I?void 0:I.moveItem)?(await I.moveItem({itemId:e.id,targetFolderId:"folders"===d?"":d,isFolder:t}),o++):(a++,l.push({itemId:e.id,reason:"Move provider is not configured"}))}catch(t){a++;const n=Ur(t);l.push({itemId:e.id,itemName:e.name,reason:t instanceof Error?t.message:String(t),code:null==n?void 0:n.code,httpStatus:null==n?void 0:n.httpStatus})}if(o>0){const e=M(r),t=R(e),n=t?s("Moved",{names:t}):s("move_success_summary",{successCount:o,totalCount:i});c.success({id:"FILES_MOVE_SUCCESS",message:n,placement:"bottomRight",data:D(r,o,i,f,e)})}if(a>0){const e=M(r),t=R(e);let n;if(1===i&&l.length>0&&l[0].code){const e=Vr(l[0].code,s);n=null!=e?e:t?s("Failed",{names:t}):s("move_fail_summary",{failCount:a,totalCount:i})}else n=t?s("Failed",{names:t}):s("move_fail_summary",{failCount:a,totalCount:i});c.error({id:"FILES_MOVE_ERROR",message:n,placement:"bottomRight",innerException:l.length?l:void 0,data:N(r,a,i,f,l.length?l:void 0,e)})}W(),null==k||k(new Set),g&&await u(),await e({folderId:h||"",page:b.current,limit:b.pageSize})}catch(e){const n=Ur(e),o=Vr(null==n?void 0:n.code,s);c.error({id:"FILES_MOVE_ERROR",innerException:e,message:null!=o?o:s("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438"),placement:"bottomRight",data:N(r,i,i,h||null,[{reason:e instanceof Error?e.message:String(e),code:null==n?void 0:n.code,httpStatus:null==n?void 0:n.httpStatus}],M(r))})}},[w,f,v,W,k,e,h,b,d,I,u]),$=(0,o.useCallback)(()=>{null==S||S(!0)},[S]),G=(0,o.useCallback)(()=>{null==S||S(!1),null==y||y.resetFields()},[S,y]),Y=(0,o.useCallback)(async t=>{if(!((null==w?void 0:w.length)||f&&0!==f.size))return;const n=Array.from((null==w?void 0:w.length)?[w]:f),r=n.length;let i=0,o=0;const a=[],l=n.map(e=>d.find(t=>t.id===e)).filter(e=>!!e),p=l.some(e=>(null==e?void 0:e.isFolder)||e.id.startsWith("folder_"));try{let d=t;if(!t){const e=await y.validateFields();d=null==e?void 0:e.targetFolder}if(!d)return void c.error({id:"FILES_COPY_DIRECTORY_NOT_SELECTED",message:s("\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f"),placement:"bottomRight"});const f="folders"===d?null:d;if(null==I?void 0:I.copyItems)try{const e=await I.copyItems("folders"===d?"":d,l.map(e=>e.id)),t=e.detailed;if(t){const e=t.filter(e=>e.success),n=t.filter(e=>!e.success);i+=e.length,o+=n.length,n.forEach(e=>{const t=L(e),n=e.error,r=Ur(n);a.push({itemId:t,itemName:P(t),reason:n?String(n):void 0,code:null==r?void 0:r.code,httpStatus:null==r?void 0:r.httpStatus})})}else if(e.success)i+=l.length;else{const t=e.error;if(t){o+=l.length;const e=Ur(t);a.push({reason:String(t),code:null==e?void 0:e.code,httpStatus:null==e?void 0:e.httpStatus})}else o+=l.length}}catch(e){o+=l.length;const n=Ur(e);a.push({reason:e instanceof Error?e.message:String(e),code:null==n?void 0:n.code,httpStatus:null==n?void 0:n.httpStatus})}else for(const e of l)try{const t=(null==e?void 0:e.isFolder)||e.id.startsWith("folder_");(null==I?void 0:I.copyItem)?(await I.copyItem({itemId:e.id,targetFolderId:"folders"===d?"":d,isFolder:t}),i++):(o++,a.push({itemId:e.id,reason:"Copy provider is not configured"}))}catch(t){o++;const n=Ur(t);a.push({itemId:e.id,itemName:e.name,reason:t instanceof Error?t.message:String(t),code:null==n?void 0:n.code,httpStatus:null==n?void 0:n.httpStatus})}if(i>0){const e=M(n),t=R(e),o=t?s("Copied",{names:t}):s("copy_success_summary",{successCount:i,totalCount:r});c.success({id:"FILES_COPY_SUCCESS",message:o,placement:"bottomRight",data:D(n,i,r,f,e)})}if(o>0){const e=M(n),t=R(e);let i;if(1===r&&a.length>0&&a[0].code){const e=Vr(a[0].code,s);i=null!=e?e:t?s("Failed",{names:t}):s("copy_fail_summary",{failCount:o,totalCount:r})}else i=t?s("Failed",{names:t}):s("copy_fail_summary",{failCount:o,totalCount:r});c.error({id:"FILES_COPY_ERROR",message:i,placement:"bottomRight",innerException:a.length?a:void 0,data:N(n,o,r,f,a.length?a:void 0,e)})}G(),null==k||k(new Set),p&&await u(),await e({folderId:h||"",page:b.current,limit:b.pageSize})}catch(e){const i=Ur(e),o=Vr(null==i?void 0:i.code,s);c.error({id:"FILES_COPY_ERROR",message:null!=o?o:s("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438"),innerException:e,placement:"bottomRight",data:N(n,r,r,h||null,[{reason:e instanceof Error?e.message:String(e),code:null==i?void 0:i.code,httpStatus:null==i?void 0:i.httpStatus}],M(n))})}},[w,f,y,G,k,e,h,b,d,I,u,c,s]),q=(0,o.useCallback)(()=>{null==A||A(!0)},[A]),X=(0,o.useCallback)(()=>{null==A||A(!1)},[A]),K=(0,o.useCallback)(async()=>{if(!((null==w?void 0:w.length)||f&&0!==f.size))return void(null==A||A(!1));let t=0,n=0;const r=[],i=Array.from(w?[w]:f),o=i.map(e=>d.find(t=>t.id===e)).filter(e=>!!e);try{const a=async()=>{const e="Trash";if(null==I?void 0:I.deleteItems)try{const e=await I.deleteItems(o.map(e=>e.id),{permanent:!1}),a=e.detailed;if(a){const e=a.filter(e=>e.success).length;t+=e;const l=a.filter(e=>!e.success);if(n+=l.length,l.forEach(e=>{const t=L(e),n=e.error,i=Ur(n);r.push({itemId:t,itemName:P(t),reason:n?String(n):void 0,code:null==i?void 0:i.code,httpStatus:null==i?void 0:i.httpStatus})}),e!==o.length){const e=i.length,t=M(i),o=R(t);let a;if(1===e&&r.length>0&&r[0].code){const e=Vr(r[0].code,s);a=null!=e?e:o?s("Failed",{names:o}):s("\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438")}else a=o?s("Failed",{names:o}):s("\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438");c.error({id:"FILES_MOVE_TO_TRASH_ERROR",message:a,placement:"bottomRight",innerException:r.length?r:void 0,data:{failCount:n,totalCount:i.length,itemNames:t}})}}else if(e.success)t+=o.length;else{const t=e.error;if(t){n+=o.length;const e=Ur(t),a=Vr(null==e?void 0:e.code,s),l=i.length,u=M(i);let d;1===l&&(null==e||e.code),d=null!=a?a:String(t),r.push({reason:String(t),code:null==e?void 0:e.code,httpStatus:null==e?void 0:e.httpStatus}),c.error({id:"FILES_MOVE_TO_TRASH_ERROR",message:d,placement:"bottomRight",innerException:t,data:{failCount:n,totalCount:i.length,itemNames:u}})}else n+=o.length}return}catch(e){n+=o.length;const t=Ur(e);r.push({reason:e instanceof Error?e.message:String(e),code:null==t?void 0:t.code,httpStatus:null==t?void 0:t.httpStatus})}if(null==I?void 0:I.moveItems)try{const a=await I.moveItems(e,o.map(e=>e.id)),l=a.detailed;if(l){const e=l.filter(e=>e.success).length;t+=e;const a=l.filter(e=>!e.success);if(n+=a.length,a.forEach(e=>{const t=L(e),n=e.error,i=Ur(n);r.push({itemId:t,itemName:P(t),reason:n?String(n):void 0,code:null==i?void 0:i.code,httpStatus:null==i?void 0:i.httpStatus})}),e!==o.length){const e=i.length,t=M(i),o=R(t);let a;if(1===e&&r.length>0&&r[0].code){const e=Vr(r[0].code,s);a=null!=e?e:o?s("Failed",{names:o}):s("\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438")}else a=o?s("Failed",{names:o}):s("\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0438 \u0432 \u043a\u043e\u0440\u0437\u0438\u043d\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438");c.error({id:"FILES_MOVE_TO_TRASH_ERROR",message:a,placement:"bottomRight",innerException:r.length?r:void 0,data:{failCount:n,totalCount:i.length,itemNames:t}})}}else if(a.success)t+=o.length;else{const e=a.error;if(e){n+=o.length;const t=Ur(e),a=Vr(null==t?void 0:t.code,s),l=i.length,u=M(i);let d;1===l&&(null==t||t.code),d=null!=a?a:String(e),r.push({reason:String(e),code:null==t?void 0:t.code,httpStatus:null==t?void 0:t.httpStatus}),c.error({id:"FILES_MOVE_TO_TRASH_ERROR",message:d,placement:"bottomRight",innerException:e,data:{failCount:n,totalCount:i.length,itemNames:u}})}else n+=o.length}}catch(e){n+=o.length;const t=Ur(e);r.push({reason:e instanceof Error?e.message:String(e),code:null==t?void 0:t.code,httpStatus:null==t?void 0:t.httpStatus})}else for(const i of o)try{const r=(null==i?void 0:i.isFolder)||i.id.startsWith("folder_");(null==I?void 0:I.moveItem)?(await I.moveItem({itemId:i.id,targetFolderId:e,isFolder:r}),t++):n++}catch(e){n++;const t=Ur(e);r.push({itemId:i.id,itemName:i.name,reason:e instanceof Error?e.message:String(e),code:null==t?void 0:t.code,httpStatus:null==t?void 0:t.httpStatus})}},l=async()=>{if(null==I?void 0:I.deleteItems){const e=await I.deleteItems(o.map(e=>e.id),{permanent:!0}),a=e.detailed;if(a){const e=a.filter(e=>e.success);t+=e.length;const l=a.filter(e=>!e.success);if(n+=l.length,l.forEach(e=>{const t=L(e),n=e.error,i=Ur(n);r.push({itemId:t,itemName:P(t),reason:n?String(n):void 0,code:null==i?void 0:i.code,httpStatus:null==i?void 0:i.httpStatus})}),e.length!==o.length){const e=i.length,t=M(i),o=R(t);let a;if(1===e&&r.length>0&&r[0].code){const e=Vr(r[0].code,s);a=null!=e?e:o?s("Failed",{names:o}):s("\u041f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438")}else a=o?s("Failed",{names:o}):s("\u041f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438");c.error({id:"FILES_DELETE_ERROR",message:a,placement:"bottomRight",innerException:r.length?r:void 0,data:{failCount:n,totalCount:i.length,itemNames:t}})}return}if(e.success)return void(t+=o.length);if(e.error){n+=o.length;const t=Ur(e.error),a=Vr(null==t?void 0:t.code,s),l=i.length,u=M(i);let d;1===l&&(null==t||t.code),d=null!=a?a:String(e.error),r.push({reason:String(e.error),code:null==t?void 0:t.code,httpStatus:null==t?void 0:t.httpStatus}),c.error({id:"FILES_DELETE_ERROR",message:d,innerException:e.error,placement:"bottomRight",data:{failCount:n,totalCount:i.length,itemNames:u}})}else n+=o.length;return}for(const e of o)try{(null==e?void 0:e.isFolder)||e.id.startsWith("folder_")?(null==I?void 0:I.deleteFolder)&&await I.deleteFolder(e.id)?t++:n++:(null==I?void 0:I.deleteFile)&&await I.deleteFile(e.id)?t++:n++}catch(t){n++;const o=Ur(t);r.push({itemId:e.id,itemName:e.name,reason:t instanceof Error?t.message:String(t),code:null==o?void 0:o.code,httpStatus:null==o?void 0:o.httpStatus})}},d=(null==T?void 0:T.enableTrashFolder)&&"Trash"===h;(null==T?void 0:T.enableTrashFolder)&&!d?(await a(),t>0&&(null==j||j({itemIds:i,sourceFolderId:h||"folders"}))):await l(),n>0&&c.error({id:"FILES_DELETE_ERROR",message:`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c ${n} \u0438\u0437 ${i.length} \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432`,placement:"bottomRight",data:{failCount:n,totalCount:i.length}}),null==k||k(new Set),null==A||A(!1),await u(),await e({folderId:h||"",page:b.current,limit:b.pageSize})}catch(e){c.error({id:"FILES_DELETE_ERROR",message:s("\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438"),placement:"bottomRight",innerException:e,data:{failCount:n,totalCount:o.length}})}},[w,f,A,I,e,h,b,u,w]);return{state:{isRenamingFile:m||!1,fileToRename:p},actions:{showRenameModal:z,handleRenameCancel:B,handleRenameOk:V,showMoveModal:U,handleMoveCancel:W,handleMoveOk:H,showCopyModal:$,handleCopyCancel:G,handleCopyOk:Y,showDeleteConfirm:q,handleDeleteConfirmCancel:X,handleDeleteConfirmOk:K}}})(i.fetchFiles);return{state:{files:t||[],selectedFiles:a.state.selectedFiles,loading:n||!1,isAddingFileByUrl:r||!1,isRenamingFile:s.state.isRenamingFile,fileToRename:s.state.fileToRename},actions:{fetchFiles:i.fetchFiles,handleDeleteFile:i.handleDeleteFile,handleDeleteFolder:i.handleDeleteFolder,handleAddFile:i.handleAddFile,handleAddFileByUrl:i.handleAddFileByUrl,handleDroppedFiles:i.handleDroppedFiles,uploadFileWithProvider:i.uploadFileWithProvider,toggleFileSelection:a.actions.toggleFileSelection,showRenameModal:s.actions.showRenameModal,handleRenameCancel:s.actions.handleRenameCancel,handleRenameOk:s.actions.handleRenameOk,showMoveModal:s.actions.showMoveModal,handleMoveCancel:s.actions.handleMoveCancel,handleMoveOk:s.actions.handleMoveOk,showCopyModal:s.actions.showCopyModal,handleCopyCancel:s.actions.handleCopyCancel,handleCopyOk:s.actions.handleCopyOk,showDeleteConfirm:s.actions.showDeleteConfirm,handleDeleteConfirmCancel:s.actions.handleDeleteConfirmCancel,handleDeleteConfirmOk:s.actions.handleDeleteConfirmOk}}})(),r=(()=>{var e,t;const{state:n,actions:r,options:i}=Rr(),{selectedFolder:a,pathHistory:s,folders:l}=n,{t:c}=hn(),{setSelectedFolder:u,setPathHistory:d}=r,h=(0,o.useCallback)(()=>{var e;return`em_fm:lastFolder:${(null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId)||"default"}`},[null===(e=null==i?void 0:i.config)||void 0===e?void 0:e.projectId]),f=(0,o.useCallback)((e,t=new Set)=>{if(t.has(e))return[];const n=(Array.isArray(l)?l:[]).find(t=>t.id===e);if(!n)return[];const r=new Set(t);return r.add(e),n.parentId?n.parentId===n.id?[{id:n.id,name:n.name+" (\u043e\u0448\u0438\u0431\u043a\u0430)"}]:[...f(n.parentId,r),{id:n.id,name:n.name}]:[{id:n.id,name:n.name}]},[l]),p=(0,o.useCallback)(e=>{var t;if("undefined"==typeof window)return;const n=!1!==(null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder),r=h();try{if(!n)return void localStorage.removeItem(r);e?localStorage.setItem(r,e):localStorage.removeItem(r)}catch(e){}},[h,null===(t=null==i?void 0:i.config)||void 0===t?void 0:t.rememberLastFolder]),g=(0,o.useCallback)(e=>{if("folders"===e){const e=[{id:"folders",name:c("Folders")}];return null==d||d(e),void(i.onPathChange&&i.onPathChange([]))}if(!(Array.isArray(l)?l:[]).find(t=>t.id===e))return;const t=f(e),n=[{id:"folders",name:c("Folders")},...t];null==d||d(n),i.onPathChange&&i.onPathChange(n.map(e=>e.name))},[l,f,d,i,c]),m=(0,o.useCallback)(e=>{const t="folders"===e?null:e;t!==a&&(null==u||u(t),p(t),g(e))},[p,a,u,g]),v=(0,o.useCallback)(e=>{if(-1===e)null==u||u(null),null==d||d([{id:"folders",name:c("Folders")}]),i.onPathChange&&i.onPathChange([]);else{const t=s.slice(0,e+1),n=t[t.length-1],r="folders"===n.id?void 0:n.id;null==u||u(r||null),null==d||d(t),i.onPathChange&&i.onPathChange(t.map(e=>e.name))}},[i,s,d,u,c]),y=(0,o.useCallback)(e=>{if(!e.isFolder)return;null==u||u(e.id);const t={id:e.id,name:e.name};if(d){const e=[...s,t];d(e)}if(i.onPathChange){const t=[...s.map(e=>e.name),e.name];i.onPathChange(t)}},[i,s,d,u]);return{state:{selectedFolder:a,pathHistory:s},actions:{handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y},selectedFolder:a,pathHistory:s,handleFolderSelect:m,handleBreadcrumbClick:v,handleItemClick:y}})(),a=(()=>{const{state:e,actions:t}=Rr(),{pagination:n}=e,{setPagination:r}=t,i=(0,o.useCallback)((e,t)=>{const i=t||n.pageSize;null==r||r({current:e,pageSize:i,total:n.total})},[n.pageSize,n.total,r]);return{state:{pagination:n},actions:{handlePaginationChange:i}}})(),s=(()=>{const[e,t]=o.useState(()=>{const e=localStorage.getItem($r);return e?Math.max(290,parseInt(e,10)):298}),[n,r]=o.useState(!1),[i,a]=o.useState(!1),[s,l]=o.useState(0),c=o.useCallback(()=>{t(298),localStorage.setItem($r,298..toString())},[]),u=o.useCallback(n=>{n.preventDefault(),n.stopPropagation(),r(!0),document.body.classList.add("resizing");const i=n.clientX,o=e;let s=o;const c=e=>{e.preventDefault();const n=Math.max(Math.min(o+e.clientX-i,600),290);s=n,t(n),l(e.clientX),a(!0)},u=()=>{r(!1),document.body.classList.remove("resizing"),a(!1),localStorage.setItem($r,s.toString()),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",u)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",u)},[e]);return o.useEffect(()=>()=>{document.body.classList.remove("resizing")},[]),{sidebarWidth:e,isResizing:n,showResizeGuide:i,resizeGuidePosition:s,handleResizeStart:u,handleDoubleClick:c}})(),l=(()=>{const[e,t]=(0,o.useState)([]),[n,r]=(0,o.useState)(!1),[i,a]=(0,o.useState)(!1),s=(0,o.useRef)(0),l=(0,o.useCallback)(()=>(s.current+=1,`upload_${s.current}_${Date.now()}`),[]),c=(0,o.useCallback)(e=>`${(e.size/1024).toFixed(2)} \u041a\u0411`,[]),u=(0,o.useCallback)(e=>{const n=e.map(e=>({id:l(),name:e.name,size:c(e),status:"uploading",progress:0}));return t(n),r(!0),a(!1),n.map(e=>e.id)},[l,c]),d=(0,o.useCallback)((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{progress:Math.min(100,Math.max(0,n))}):t))},[]),h=(0,o.useCallback)(e=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"success",progress:100}):t))},[]),f=(0,o.useCallback)((e,n)=>{t(t=>t.map(t=>t.id===e?Object.assign(Object.assign({},t),{status:"error",error:n}):t))},[]),p=(0,o.useCallback)(()=>{r(!1),a(!1),setTimeout(()=>{t([])},300)},[]),g=(0,o.useCallback)(()=>{a(e=>!e)},[]),m=(0,o.useCallback)(e=>{t(t=>{const n=t.filter(t=>t.id!==e);return 0===n.length&&setTimeout(()=>{r(!1),a(!1)},100),n})},[]),v=e.length,y=e.filter(e=>"success"===e.status||"error"===e.status).length;return{uploadFiles:e,isUploadVisible:n,isUploadMinimized:i,totalFiles:v,completedFiles:y,startUpload:u,updateProgress:d,markAsSuccess:h,markAsError:f,closeUpload:p,minimizeUpload:g,insertFile:m}})(),u=Hr(),{t:d}=hn(),h=o.useRef(null),{folders:f,loading:p}=t.state,{fetchFolders:m,fetchChildFolders:v,handleCreateFolder:y,handleModalOk:b,handleModalCancel:w,generateMenuItems:C}=t.actions,_=(e=>{var t;const{state:n,actions:r,options:i}=Rr(),{t:a}=hn(),s=zr(),{folders:l,folderToRename:c,renameFolderForm:u,isRenameFolderModalVisible:d}=n,{setFolderToRename:h,setIsRenameFolderModalVisible:f}=r,{apiEndpoints:p,dataProviders:g,config:m}=i,v=(0,o.useCallback)(e=>{null==h||h(e),null==f||f(!0);const t=null==l?void 0:l.find(t=>t.id===e);t&&u&&u.setFieldsValue({newFolderName:t.name})},[h,f,l,u]),y=(0,o.useCallback)(()=>{null==f||f(!1),null==h||h(null),null==u||u.resetFields()},[f,h,u]),b=(0,o.useCallback)(async()=>{var t,n;if(c&&u)try{const i=await u.validateFields();if(!(null==i?void 0:i.newFolderName))return void s.warning({id:"FOLDER_OPERATION_VALIDATION_FAILED",message:a("Folder name cannot be empty"),placement:"bottomRight",data:{folderId:c,folderName:null==i?void 0:i.newFolderName,reason:"emptyName"}});if(!1===(null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder))return void s.error({id:"FOLDER_RENAME_DISABLED_BY_CONFIG",message:a("Folder rename is disabled by config"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:null==i?void 0:i.newFolderName}});if(!(null==g?void 0:g.renameFolder))throw new Error("renameFolder \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0432 dataProviders");const o=await g.renameFolder(c,i.newFolderName.trim());if(!(null==o?void 0:o.id))return void s.error({id:"FOLDER_RENAME_FAILED",message:a("Unexpected response when renaming folder"),placement:"bottomRight",data:{itemId:null!=c?c:void 0,itemName:i.newFolderName,reason:"invalidResponse"}});s.success({id:"FOLDER_RENAME_SUCCESS",message:a("Folder renamed"),placement:"bottomRight",data:{itemId:o.id,itemName:o.name,folderId:null!==(n=o.parentId)&&void 0!==n?n:null}}),y(),await e(),c!==o.id&&r.setSelectedFolder&&r.setSelectedFolder(o.id)}catch(e){s.error({id:"FOLDER_RENAME_FAILED",message:a("Failed to rename folder"),placement:"bottomRight",innerException:e,data:{itemId:null!=c?c:void 0,itemName:null==u?void 0:u.getFieldValue("newFolderName"),reason:e instanceof Error?e.message:String(e)}})}},[c,u,p,y,e,a,null===(t=null==m?void 0:m.features)||void 0===t?void 0:t.enableRenameFolder,s]);return{state:{isRenamingFolder:d||!1,folderToRename:c},actions:{showRenameFolderModal:v,handleRenameFolderCancel:y,handleRenameFolderOk:b}}})(m),{files:S,selectedFiles:k,loading:A,isRenamingFile:j,fileToRename:E}=n.state,{fetchFiles:I,handleDeleteFile:T,handleDeleteFolder:O,handleAddFile:F,handleAddFileByUrl:P,uploadFileWithProvider:M,toggleFileSelection:R,showRenameModal:L,handleRenameCancel:D,handleRenameOk:N,handleDroppedFiles:z,showMoveModal:B,handleMoveCancel:V,handleMoveOk:U,handleCopyOk:W,handleCopyCancel:H,showDeleteConfirm:$,handleDeleteConfirmCancel:G,handleDeleteConfirmOk:Y}=n.actions,{selectedFolder:q,pathHistory:X}=r.state,{handleFolderSelect:K,handleBreadcrumbClick:Z,handleItemClick:J}=r.actions,{pagination:Q}=a.state,ee=Nr(I),{searchTerm:te,sortBy:ne,sortOrder:re}=ee.state,{handleSearch:ie,handleSort:oe,handlePaginationChange:ae}=ee.actions,se=(({files:e,selectedFiles:t,fetchFiles:n,selectedFolder:r})=>{const i=zr(),{options:a,actions:s,state:l}=o.useContext(Mr),{setActiveLibraryItem:c}=s,{activeLibraryItem:u}=l,[d,h]=o.useState(!1),[f,p]=o.useState(null),g=o.useCallback(e=>{var t;if(e.type&&e.type.startsWith("image/"))return!0;if(e.extension){const t=e.extension.toLowerCase();return Lt.includes(t)}const n=null===(t=e.name.split(".").pop())||void 0===t?void 0:t.toLowerCase();return!!n&&Lt.includes(n)},[]),m=o.useCallback(async e=>{var t,n,r,i;const{dataProviders:o}=a;if(!1!==(null===(n=null===(t=a.config)||void 0===t?void 0:t.features)||void 0===n?void 0:n.enableUpdateFile)&&(null==o?void 0:o.updateFile)&&e.thumbnail)try{const t=Ht(e.thumbnail,e.type),n=$t(t),r=e.name.substring(0,e.name.lastIndexOf("."))+"."+n,i=qt(e.thumbnail,t);return await o.updateFile(e.id,{name:r,type:t,data:i})}catch(e){return null}else if((null==o?void 0:o.uploadFile)&&e.thumbnail)try{const t=Ht(e.thumbnail,e.type),n=qt(e.thumbnail,t);await o.uploadFile(Object.assign(Object.assign({},e),{type:t,data:n,size:n.size||e.size||0}))}catch(e){return null}else if(!1!==(null===(i=null===(r=a.config)||void 0===r?void 0:r.features)||void 0===i?void 0:i.enableRenameFile)&&(null==o?void 0:o.renameFile))try{return await o.renameFile(e.id,e.name)}catch(e){return null}return null},[a]),v=o.useCallback(n=>{let r;if(n)r=n;else{if(1!==t.size)return;const n=Array.from(t)[0];if(r=e.find(e=>e.id===n),!r||r.isFolder||!g(r))return}c&&c(Ot),p(r),h(!0)},[t,e,g,h,c]),y=o.useCallback(()=>{c&&u===Ot&&c(jt),h(!1),p(null)},[u,c]),b=o.useCallback(async e=>{var t,o,s,l;try{const s=await m(e);if(s)return i.success({id:"IMAGE_UPDATE_SUCCESS",message:"\u0423\u0441\u043f\u0435\u0445",description:"\u0418\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043e",placement:"bottomRight",data:{itemId:null!==(t=s.id)&&void 0!==t?t:void 0,itemName:s.name,folderId:null!==(o=s.folderId)&&void 0!==o?o:null,thumbnail:s.thumbnail}}),a.onEditorOk&&a.onEditorOk(s),await n({folderId:r||""}),y(),s}catch(t){i.error({id:"IMAGE_SAVE_FAILED",message:"\u041e\u0448\u0438\u0431\u043a\u0430",description:`\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: ${t instanceof Error?t.message:"\u041d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430"}`,innerException:t,placement:"bottomRight",data:{itemId:null!==(s=e.id)&&void 0!==s?s:void 0,itemName:e.name,folderId:null!==(l=e.folderId)&&void 0!==l?l:null,thumbnail:e.thumbnail}})}},[m,a,n,r,i,y]);return{isPixieEditorVisible:d,editingFile:f,handleEdit:v,handlePixieEditorSave:b,handlePixieEditorClose:y}})({files:S||[],selectedFiles:k||new Set,fetchFiles:I,selectedFolder:q||null}),le=o.useCallback(async()=>{var e;await Y(),await m(),await(null===(e=h.current)||void 0===e?void 0:e.refreshFileCounts())},[m,Y]),ce=o.useCallback(async e=>{var t;await U(e),await(null===(t=h.current)||void 0===t?void 0:t.refreshFileCounts())},[U]),ue=o.useCallback(async e=>{var t;await W(e),await(null===(t=h.current)||void 0===t?void 0:t.refreshFileCounts())},[W]),de=o.useCallback(async()=>{let e=[],t=new Map;await F({onStartBatch:n=>{e=l.startUpload(n),t=new Map(n.map((t,n)=>[t.name,e[n]]))},onStart:n=>{0===e.length&&(e=l.startUpload([n]),t.set(n.name,e[0]))},onProgress:(e,n)=>{const r=t.get(e);r&&l.updateProgress(r,n)},onComplete:async e=>{var n;const r=t.get(e);r&&l.markAsSuccess(r),await(null===(n=h.current)||void 0===n?void 0:n.refreshFileCounts())},onError:(e,n)=>{const r=t.get(e);r&&l.markAsError(r,n)}})},[F,l]),he=o.useCallback(async(e,t)=>{var n;await P(e,t),await(null===(n=h.current)||void 0===n?void 0:n.refreshFileCounts())},[P]),fe=o.useCallback(async({file:e})=>{var t;const n=await M(e);return await(null===(t=h.current)||void 0===t?void 0:t.refreshFileCounts()),n},[M]),pe=o.useCallback(async e=>{var t;await T(e),await(null===(t=h.current)||void 0===t?void 0:t.refreshFileCounts())},[T]),ge=o.useCallback(async e=>{var t;if(z){const n=l.startUpload(e);e.forEach(async(e,t)=>{const r=n[t];if(!r)return;let i=0;const o=setInterval(()=>{i=Math.min(i+10+Math.floor(Date.now()%10),85),l.updateProgress(r,i)},200);setTimeout(()=>{clearInterval(o)},2e3)}),await z(e),n.forEach(e=>{l.updateProgress(e,100),l.markAsSuccess(e)}),await(null===(t=h.current)||void 0===t?void 0:t.refreshFileCounts())}},[z,l]),me=o.useCallback(async e=>{var t;await O(e),await m(),await(null===(t=h.current)||void 0===t?void 0:t.refreshFileCounts())},[O,m]),ve=(({files:e,selectedFiles:t,toggleFileSelection:n,showRenameModal:r,showMoveModal:i,showCopyModal:a,handleDeleteFile:s,handleDeleteFolder:l,showDeleteConfirm:c,onEdit:u})=>{const d=o.useCallback(()=>{t&&t.size>0&&t.forEach(e=>{n(e)})},[t,n]),h=o.useCallback(e=>{if(t&&1===t.size||e){const n=e||Array.from(t)[0];r(n)}},[t,r]),f=o.useCallback(n=>{if(t&&t.size>0||(null==n?void 0:n.id)){if(c)return void c();(n?[n.id]:t).forEach(t=>{const n=e.find(e=>e.id===t);n&&(n.isFolder?l(t):s(t))})}},[t,e,s,l,c]);return{handleClearSelection:d,handleRename:h,handleDeleteSelected:f,handleCopy:o.useCallback(()=>{a()},[a]),handleMove:o.useCallback(()=>{i()},[i]),handleEdit:o.useCallback(()=>{u()},[u])}})({files:S||[],selectedFiles:k||new Set,toggleFileSelection:R,showRenameModal:L,showMoveModal:B,showCopyModal:n.actions.showCopyModal||(()=>{}),handleDeleteFile:T,handleDeleteFolder:me,showDeleteConfirm:$,onEdit:se.handleEdit}),ye=p||A,{options:be}=o.useContext(Mr),we=null==be?void 0:be.config;(0,o.useEffect)(()=>{Wt(),m()},[m]),o.useEffect(()=>{if(!K||0===f.length)return;const e=!!(null==we?void 0:we.rememberLastFolder),t=`em_fm:lastFolder:${(null==we?void 0:we.projectId)||"default"}`;if(e&&"undefined"!=typeof window)try{const e=localStorage.getItem(t);if(e&&f.some(t=>t.id===e))return void K(e)}catch(e){}q||K("folders")},[q,K,f,null==we?void 0:we.rememberLastFolder,null==we?void 0:we.projectId]);const{state:xe,actions:Ce,options:_e}=o.useContext(Mr),{form:Se,urlForm:ke,renameForm:Ae,moveForm:je,renameFolderForm:Ee,copyForm:Ie,isModalVisible:Te,isUrlModalVisible:Oe,isMoveModalVisible:Fe,isRenameFolderModalVisible:Pe,isCopyModalVisible:Me,isDeleteConfirmVisible:Re,folderToRename:Le,activeLibraryItem:De}=xe,{setIsUrlModalVisible:Ne,setSortField:ze,setActiveLibraryItem:Be,setUndoDeletion:Ve}=Ce,{config:Ue}=_e,We=zr(),{handleRenameFolderCancel:He,handleRenameFolderOk:$e}=_.actions,Ge=(0,o.useCallback)(e=>{ae(e.current||Q.current,e.pageSize||Q.pageSize)},[ae,Q]),Ye=o.useCallback(e=>{const{sortBy:t,sortOrder:n}=(e=>{const[t,n]=e.split("-");return{sortBy:t,sortOrder:n}})(e);oe(t,n)},[oe]),[qe,Xe]=(0,o.useState)(VT),[Ke,Ze]=(0,o.useState)([]),Je=(0,o.useRef)(null),[Qe,et]=(0,o.useState)(Nt),[tt,nt]=(0,o.useState)([]),rt=(0,o.useRef)(null),[it,ot]=(0,o.useState)(""),[at,st]=(0,o.useState)([]),lt=o.useRef(void 0),[ct,ut]=(0,o.useState)(!1),[dt,ht]=(0,o.useState)(!1),ft=o.useRef(null),pt=o.useRef(null),gt=(0,o.useCallback)(async()=>{const e=null==Ue?void 0:Ue.fileForEdit;if(lt.current!==e){lt.current=e;try{if(De!==Ot||!e||se.editingFile)return;if("string"==typeof e){if(e.startsWith("data:"))return void(null==se||se.handleEdit({thumbnail:e}));const t=await u.handleAddFileByUrl(e,!0);if(!t)throw new Error("\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0444\u0430\u0439\u043b");lt.current===e&&(null==se||se.handleEdit(t))}}finally{lt.current===e&&(lt.current=null)}}},[null==Ue?void 0:Ue.fileForEdit,De,se,u]);(0,o.useEffect)(()=>{gt()},[gt]),(0,o.useEffect)(()=>{var e,t,n;De===jt?(Ze([]),Xe(VT),nt([]),et(Nt),st([]),ot(""),ht(!1),ut(!1)):De===Tt?null===(e=pt.current)||void 0===e||e.focus():De===Et?null===(t=Je.current)||void 0===t||t.focus():De===It&&(null===(n=rt.current)||void 0===n||n.focus())},[De]);const mt=o.useCallback(async()=>{var e;await $e(),await(null===(e=h.current)||void 0===e?void 0:e.refreshFileCounts())},[$e]),vt=k.size,yt=o.useMemo(()=>{var e;if(1!==vt)return!1;const t=Array.from(k)[0],n=S.find(e=>e.id===t);if(!n||n.isFolder)return!1;let r=!1;if(n.type&&n.type.startsWith("image/"))r=!0;else if(n.extension){const e=n.extension.toLowerCase();r=Lt.includes(e)}else{const t=null===(e=n.name.split(".").pop())||void 0===e?void 0:e.toLowerCase();r=!!t&&Lt.includes(t)}return r},[vt,k,S]);return(0,i.jsxs)(x.A,{className:"file-manager__layout",children:[s.showResizeGuide&&(0,i.jsx)("div",{className:"resize-guide",style:{left:`${s.resizeGuidePosition}px`}}),(0,i.jsxs)(x.A,{className:"file-manager__content",children:[(0,i.jsxs)(NT,{width:320,theme:"light",className:"file-manager-sider",children:[(0,i.jsx)(Li,{ref:h,selectedFolder:q||"folders",generateMenuItems:C,onFolderSelect:e=>null==K?void 0:K(e),folders:f||[],fetchFolders:m,fetchChildFolders:v,handleAddFile:de,setIsUrlModalVisible:e=>null==Ne?void 0:Ne(e),handleDeleteFolder:me,handleCreateFolder:y,activeLibraryItem:De,setActiveLibraryItem:e=>null==Be?void 0:Be(e)}),(0,i.jsx)("div",{className:"sidebar-resizer "+(s.isResizing?"resizing":""),onMouseDown:s.handleResizeStart,onDoubleClick:s.handleDoubleClick,children:(0,i.jsx)("div",{className:"sidebar-resizer-indicator"})})]}),(0,i.jsx)(x.A,{className:"file-manager__main-content",children:(0,i.jsxs)(zT,{className:"main-content",ref:ft,children:[(0,i.jsx)(hT,{activeLibraryItem:De,selectedFolder:(null===(e=null==f?void 0:f.find(e=>(null==e?void 0:e.id)===q))||void 0===e?void 0:e.name)||d("Folders")}),(0,i.jsx)(g.A,{className:"zero-divider"}),De===jt&&(0,i.jsx)(Ii,{searchTerm:te,sortField:xe.sortField||"name",setSortField:e=>null==ze?void 0:ze(e),pathHistory:X||[],handleBreadcrumbClick:e=>null==Z?void 0:Z(e),handleAddFile:de,setIsUrlModalVisible:e=>null==Ne?void 0:Ne(e),files:S||[],handleSearch:ie,handleSort:oe,sortBy:ne,sortOrder:re,handleSortOptionChange:Ye,pagination:Q,setPagination:Ge,loading:ye,handleItemClick:e=>null==J?void 0:J(e),handleDeleteFile:pe,selectedFiles:k||new Set,toggleFileSelection:e=>null==R?void 0:R(e),handleDroppedFiles:ge,fileUpload:l,onClearSelection:ve.handleClearSelection,onRename:ve.handleRename,onCopy:ve.handleCopy,onMove:ve.handleMove,onDelete:ve.handleDeleteSelected,onEdit:se.handleEdit}),De===Et&&(0,i.jsx)(jT,{imageGifList:Ke,setImageGifList:Ze,currentReqGif:qe,setCurrentReqGif:Xe,inputRef:Je,customRequest:he}),De===It&&(0,i.jsx)(TT,{imageStockList:tt,setImageStockList:nt,currentReq:Qe,setCurrentReq:et,inputRef:rt,customRequest:he}),De===Tt&&!!(null==Ue?void 0:Ue.sseQuery)&&(0,i.jsx)(DT,{imageAiList:at,setImageAiList:st,aiImageRequest:it,setAiImageRequest:ot,inputAiRef:pt,customRequest:fe,isLoadingAi:ct,setIsLoadingAi:ut,isImageUploaded:dt,setIsImageUploaded:ht,aiTabRef:ft}),De===Ot&&(0,i.jsx)(i.Fragment,{}),(0,i.jsx)("div",{children:yt&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.A,{className:"zero-divider"}),(0,i.jsx)("div",{style:{display:"flex",justifyContent:"right",padding:"17px 24px",alignItems:"center"},children:(0,i.jsx)(c.Ay,{size:"large",type:"primary",style:{height:40},onClick:()=>{if(_e.onEditorOk){const e=Array.from(k)[0],t=S.find(t=>t.id===e);t&&_e.onEditorOk(t)}},children:d("Choose")})})]})})]})})]}),(0,i.jsx)(Mi,{isModalVisible:Te,handleModalOk:b,handleModalCancel:w,form:Se,selectedFolder:q||null,folders:f||[],isUrlModalVisible:Oe,setIsUrlModalVisible:e=>null==Ne?void 0:Ne(e),handleAddFileByUrl:he,urlForm:ke,isRenameModalVisible:j,handleRenameOk:()=>null==N?void 0:N(),handleRenameCancel:()=>null==D?void 0:D(),renameForm:Ae,fileToRename:E,files:S||[],isMoveModalVisible:Fe,handleMoveOk:ce,handleMoveCancel:V,moveForm:je,selectedFiles:k||new Set,isRenameFolderModalVisible:Pe,handleRenameFolderOk:mt,handleRenameFolderCancel:He,renameFolderForm:Ee,folderToRename:Le,isCopyModalVisible:Me,handleCopyOk:ue,handleCopyCancel:H,copyForm:Ie,isDeleteConfirmVisible:Re,handleDeleteConfirmOk:le,handleDeleteConfirmCancel:()=>null==G?void 0:G(),fetchChildFolders:v}),xe.undoDeletion&&(0,i.jsx)(BT,{itemIds:xe.undoDeletion.itemIds,sourceFolderId:xe.undoDeletion.sourceFolderId||"folders",onClose:()=>null==Ve?void 0:Ve(null),onUndo:async()=>{var e,t,n,r,i,o,a,s,l,c,u,h,f;try{const o=null!==(t=null===(e=xe.undoDeletion)||void 0===e?void 0:e.itemIds)&&void 0!==t?t:[],a=(null===(n=xe.undoDeletion)||void 0===n?void 0:n.sourceFolderId)||"folders";if(null===(r=_e.dataProviders)||void 0===r?void 0:r.moveItems)await _e.dataProviders.moveItems("folders"===a?"":a,o);else if(null===(i=_e.dataProviders)||void 0===i?void 0:i.moveItem)for(const e of o){const t=e.startsWith("folder_");await _e.dataProviders.moveItem({itemId:e,targetFolderId:"folders"===a?"":a,isFolder:t})}We.success({id:"FILES_MOVE_SUCCESS",message:d("restored_items",{count:o.length}),placement:"bottomRight",data:{successCount:o.length,totalCount:o.length,itemIds:o}}),null==Ve||Ve(null),await m(),await I({folderId:q||"",page:Q.current,limit:Q.pageSize})}catch(e){We.error({id:"FILES_MOVE_ERROR",message:d("Error when moving a file"),placement:"bottomRight",data:{failCount:null!==(s=null===(a=null===(o=xe.undoDeletion)||void 0===o?void 0:o.itemIds)||void 0===a?void 0:a.length)&&void 0!==s?s:0,totalCount:null!==(u=null===(c=null===(l=xe.undoDeletion)||void 0===l?void 0:l.itemIds)||void 0===c?void 0:c.length)&&void 0!==u?u:0,itemIds:null!==(f=null===(h=xe.undoDeletion)||void 0===h?void 0:h.itemIds)&&void 0!==f?f:[]},innerException:e})}}}),(0,i.jsx)(cT,{visible:se.isPixieEditorVisible,onClose:se.handlePixieEditorClose,file:se.editingFile,onSave:se.handlePixieEditorSave})]})},WT=(0,o.memo)(({config:e={},onPathChange:t,onChangeSelection:n,onEditorOk:r,searchQuery:a="",sortBySize:s="name",apiEndpoints:c={},customIcons:u,dragDropIcon:d,dataProviders:h,handleNotify:f,handleError:g,handleSuccess:m})=>{const v=o.useMemo(()=>Object.assign({folderTreeLoading:"lazy",expandAllFoldersOnInit:!1,expandRootFolderOnInit:!1,iconStrokeWidth:1.4},e),[e]);o.useEffect(()=>{v.theme&&(e=>{if("system"===e){const t=matchMedia(Rt).matches?Pt:Ft;e=e===Mt?t:e}document.documentElement.setAttribute("data-theme",e)})(v.theme),(e=>{(null==e?void 0:e.customTheme)&&((e={})=>{const t=document.querySelector("head");if(!t)return;const n=document.createElement("style");if(n.type="text/css",n.dataset.themeVariablesFm="true",n.setAttribute("data-file-manager","true"),Object.entries(e).length){let r="";Object.entries(e).forEach(([e,t])=>{"object"!=typeof t&&(r+=`\t--${e}: ${t};\n`)}),r=`.em-filemanager {\n${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-theme-variables-fm="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}})(null==e?void 0:e.customTheme)})(v)},[v]),(0,o.useEffect)(()=>{v.locale&&v.locale!==rr.language&&rr.changeLanguage(v.locale),v.customLocale&&v.locale&&rr.addResourceBundle(v.locale,"translation",v.customLocale,!0,!0)},[v.locale,v.customLocale]);const y=(0,o.useRef)(null);return(0,i.jsx)(l.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.Ay,{getPopupContainer:()=>y.current||document.body,children:(0,i.jsx)(Lr,{options:{apiEndpoints:c,searchQuery:a,sortBySize:s,onPathChange:t,onChangeSelection:n,onEditorOk:r,config:v,customIcons:u,dragDropIcon:d,dataProviders:h,handleNotify:f,handleError:g,handleSuccess:m},children:(0,i.jsx)(UT,{})})}),(0,i.jsx)("div",{ref:y,className:"file-manager-modal-root"})]})})});WT.displayName="FileManagerApp";const HT=e=>{var t,n,r;return(0,i.jsx)(fn,{i18n:rr,children:(0,i.jsx)(Vt,{externalTheme:null!==(n=null===(t=e.config)||void 0===t?void 0:t.theme)&&void 0!==n?n:"light",customThemeToken:null===(r=e.config)||void 0===r?void 0:r.customTheme,children:(0,i.jsx)(D.A,{children:(0,i.jsx)(WT,Object.assign({},e))})})})},$T=(new Map,new Map,e=>{const{onClose:t,onSave:n,dataProviders:r,theme:a}=e,s=o.useMemo(()=>{if(e.file)return e.file;const t=e.name||"edited-image",n=e.extension||(e.type?e.type.split("/")[1]:"png"),r=e.type||`image/${n}`;return{thumbnail:e.imageDataUrl||"",name:t,id:void 0,type:r,extension:n}},[e.file,e.imageDataUrl,e.name,e.extension,e.type]),c=o.useCallback(async e=>{if((null==r?void 0:r.updateFile)&&e.thumbnail)try{const t=Ht(e.thumbnail,e.type),n=$t(t),i=e.name.substring(0,e.name.lastIndexOf("."))+"."+n,o=qt(e.thumbnail,t);return await r.updateFile(e.id,{name:i,type:t,data:o})}catch(e){return null}return null},[r]),u=o.useCallback(async e=>{if((null==r?void 0:r.updateFile)&&e.id&&e.thumbnail)try{const t=await c(e);t&&(e=t)}catch(e){}return n&&await n(e),t&&t(),e},[r,n,t,c]),d=(0,o.useRef)(null);return(0,i.jsx)(l.A,{className:"em-filemanager",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.Ay,{getPopupContainer:()=>d.current||document.body,children:(0,i.jsx)(fn,{i18n:rr,children:(0,i.jsx)(Vt,{externalTheme:null!=a?a:"light",children:(0,i.jsx)(D.A,{children:(0,i.jsx)(Lr,{options:{dataProviders:r,handleNotify:e.handleNotify,handleError:e.handleError,handleSuccess:e.handleSuccess,config:{theme:null!=a?a:"light",locale:e.locale,baseUrl:e.baseUrl,assetsUrl:e.assetsUrl,showNotifications:e.showNotifications}},children:(0,i.jsx)(cT,{visible:!0,onClose:t,file:s,onSave:u})})})})})}),(0,i.jsx)("div",{ref:d,className:"file-manager-modal-root"})]})})});class GT extends Error{constructor(e,t,n,r){super(e),this.name="FileManagerApiError",this.code=t,this.httpStatus=n,this.details=r,Error.captureStackTrace&&Error.captureStackTrace(this,GT)}}}}]);