@pqina/pintura 8.57.5

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 (258) hide show
  1. package/README.md +7 -0
  2. package/locale/de_DE/annotate/de_DE.js +5 -0
  3. package/locale/de_DE/annotate/index.js +1 -0
  4. package/locale/de_DE/core/de_DE.js +210 -0
  5. package/locale/de_DE/core/index.js +1 -0
  6. package/locale/de_DE/crop/de_DE.js +54 -0
  7. package/locale/de_DE/crop/index.js +1 -0
  8. package/locale/de_DE/decorate/de_DE.js +5 -0
  9. package/locale/de_DE/decorate/index.js +1 -0
  10. package/locale/de_DE/fill/de_DE.js +12 -0
  11. package/locale/de_DE/fill/index.js +1 -0
  12. package/locale/de_DE/filter/de_DE.js +19 -0
  13. package/locale/de_DE/filter/index.js +1 -0
  14. package/locale/de_DE/finetune/de_DE.js +14 -0
  15. package/locale/de_DE/finetune/index.js +1 -0
  16. package/locale/de_DE/frame/de_DE.js +17 -0
  17. package/locale/de_DE/frame/index.js +1 -0
  18. package/locale/de_DE/index.js +28 -0
  19. package/locale/de_DE/redact/de_DE.js +4 -0
  20. package/locale/de_DE/redact/index.js +1 -0
  21. package/locale/de_DE/resize/de_DE.js +19 -0
  22. package/locale/de_DE/resize/index.js +1 -0
  23. package/locale/de_DE/sticker/de_DE.js +5 -0
  24. package/locale/de_DE/sticker/index.js +1 -0
  25. package/locale/de_DE/trim/de_DE.js +54 -0
  26. package/locale/de_DE/trim/index.js +1 -0
  27. package/locale/en_GB/annotate/en_GB.js +5 -0
  28. package/locale/en_GB/annotate/index.js +1 -0
  29. package/locale/en_GB/core/en_GB.js +209 -0
  30. package/locale/en_GB/core/index.js +1 -0
  31. package/locale/en_GB/crop/en_GB.js +54 -0
  32. package/locale/en_GB/crop/index.js +1 -0
  33. package/locale/en_GB/decorate/en_GB.js +5 -0
  34. package/locale/en_GB/decorate/index.js +1 -0
  35. package/locale/en_GB/fill/en_GB.js +12 -0
  36. package/locale/en_GB/fill/index.js +1 -0
  37. package/locale/en_GB/filter/en_GB.js +18 -0
  38. package/locale/en_GB/filter/index.js +1 -0
  39. package/locale/en_GB/finetune/en_GB.js +14 -0
  40. package/locale/en_GB/finetune/index.js +1 -0
  41. package/locale/en_GB/frame/en_GB.js +17 -0
  42. package/locale/en_GB/frame/index.js +1 -0
  43. package/locale/en_GB/index.js +28 -0
  44. package/locale/en_GB/redact/en_GB.js +4 -0
  45. package/locale/en_GB/redact/index.js +1 -0
  46. package/locale/en_GB/resize/en_GB.js +19 -0
  47. package/locale/en_GB/resize/index.js +1 -0
  48. package/locale/en_GB/sticker/en_GB.js +5 -0
  49. package/locale/en_GB/sticker/index.js +1 -0
  50. package/locale/en_GB/trim/en_GB.js +54 -0
  51. package/locale/en_GB/trim/index.js +1 -0
  52. package/locale/es_ES/annotate/es_ES.js +5 -0
  53. package/locale/es_ES/annotate/index.js +1 -0
  54. package/locale/es_ES/core/es_ES.js +206 -0
  55. package/locale/es_ES/core/index.js +1 -0
  56. package/locale/es_ES/crop/es_ES.js +54 -0
  57. package/locale/es_ES/crop/index.js +1 -0
  58. package/locale/es_ES/decorate/es_ES.js +5 -0
  59. package/locale/es_ES/decorate/index.js +1 -0
  60. package/locale/es_ES/fill/es_ES.js +12 -0
  61. package/locale/es_ES/fill/index.js +1 -0
  62. package/locale/es_ES/filter/es_ES.js +18 -0
  63. package/locale/es_ES/filter/index.js +1 -0
  64. package/locale/es_ES/finetune/es_ES.js +14 -0
  65. package/locale/es_ES/finetune/index.js +1 -0
  66. package/locale/es_ES/frame/es_ES.js +17 -0
  67. package/locale/es_ES/frame/index.js +1 -0
  68. package/locale/es_ES/index.js +28 -0
  69. package/locale/es_ES/redact/es_ES.js +4 -0
  70. package/locale/es_ES/redact/index.js +1 -0
  71. package/locale/es_ES/resize/es_ES.js +19 -0
  72. package/locale/es_ES/resize/index.js +1 -0
  73. package/locale/es_ES/sticker/es_ES.js +5 -0
  74. package/locale/es_ES/sticker/index.js +1 -0
  75. package/locale/es_ES/trim/es_ES.js +55 -0
  76. package/locale/es_ES/trim/index.js +1 -0
  77. package/locale/fr_FR/annotate/fr_FR.js +5 -0
  78. package/locale/fr_FR/annotate/index.js +1 -0
  79. package/locale/fr_FR/core/fr_FR.js +207 -0
  80. package/locale/fr_FR/core/index.js +1 -0
  81. package/locale/fr_FR/crop/fr_FR.js +54 -0
  82. package/locale/fr_FR/crop/index.js +1 -0
  83. package/locale/fr_FR/decorate/fr_FR.js +5 -0
  84. package/locale/fr_FR/decorate/index.js +1 -0
  85. package/locale/fr_FR/fill/fr_FR.js +12 -0
  86. package/locale/fr_FR/fill/index.js +1 -0
  87. package/locale/fr_FR/filter/fr_FR.js +18 -0
  88. package/locale/fr_FR/filter/index.js +1 -0
  89. package/locale/fr_FR/finetune/fr_FR.js +14 -0
  90. package/locale/fr_FR/finetune/index.js +1 -0
  91. package/locale/fr_FR/frame/fr_FR.js +17 -0
  92. package/locale/fr_FR/frame/index.js +1 -0
  93. package/locale/fr_FR/index.js +28 -0
  94. package/locale/fr_FR/redact/fr_FR.js +4 -0
  95. package/locale/fr_FR/redact/index.js +1 -0
  96. package/locale/fr_FR/resize/fr_FR.js +19 -0
  97. package/locale/fr_FR/resize/index.js +1 -0
  98. package/locale/fr_FR/sticker/fr_FR.js +5 -0
  99. package/locale/fr_FR/sticker/index.js +1 -0
  100. package/locale/fr_FR/trim/fr_FR.js +55 -0
  101. package/locale/fr_FR/trim/index.js +1 -0
  102. package/locale/hi_IN/annotate/hi_IN.js +5 -0
  103. package/locale/hi_IN/annotate/index.js +1 -0
  104. package/locale/hi_IN/core/hi_IN.js +210 -0
  105. package/locale/hi_IN/core/index.js +1 -0
  106. package/locale/hi_IN/crop/hi_IN.js +54 -0
  107. package/locale/hi_IN/crop/index.js +1 -0
  108. package/locale/hi_IN/decorate/hi_IN.js +5 -0
  109. package/locale/hi_IN/decorate/index.js +1 -0
  110. package/locale/hi_IN/fill/hi_IN.js +12 -0
  111. package/locale/hi_IN/fill/index.js +1 -0
  112. package/locale/hi_IN/filter/hi_IN.js +18 -0
  113. package/locale/hi_IN/filter/index.js +1 -0
  114. package/locale/hi_IN/finetune/hi_IN.js +14 -0
  115. package/locale/hi_IN/finetune/index.js +1 -0
  116. package/locale/hi_IN/frame/hi_IN.js +17 -0
  117. package/locale/hi_IN/frame/index.js +1 -0
  118. package/locale/hi_IN/index.js +28 -0
  119. package/locale/hi_IN/redact/hi_IN.js +4 -0
  120. package/locale/hi_IN/redact/index.js +1 -0
  121. package/locale/hi_IN/resize/hi_IN.js +19 -0
  122. package/locale/hi_IN/resize/index.js +1 -0
  123. package/locale/hi_IN/sticker/hi_IN.js +5 -0
  124. package/locale/hi_IN/sticker/index.js +1 -0
  125. package/locale/hi_IN/trim/hi_IN.js +54 -0
  126. package/locale/hi_IN/trim/index.js +1 -0
  127. package/locale/it_IT/annotate/index.js +1 -0
  128. package/locale/it_IT/annotate/it_IT.js +5 -0
  129. package/locale/it_IT/core/index.js +1 -0
  130. package/locale/it_IT/core/it_IT.js +207 -0
  131. package/locale/it_IT/crop/index.js +1 -0
  132. package/locale/it_IT/crop/it_IT.js +54 -0
  133. package/locale/it_IT/decorate/index.js +1 -0
  134. package/locale/it_IT/decorate/it_IT.js +5 -0
  135. package/locale/it_IT/fill/index.js +1 -0
  136. package/locale/it_IT/fill/it_IT.js +12 -0
  137. package/locale/it_IT/filter/index.js +1 -0
  138. package/locale/it_IT/filter/it_IT.js +19 -0
  139. package/locale/it_IT/finetune/index.js +1 -0
  140. package/locale/it_IT/finetune/it_IT.js +14 -0
  141. package/locale/it_IT/frame/index.js +1 -0
  142. package/locale/it_IT/frame/it_IT.js +17 -0
  143. package/locale/it_IT/index.js +28 -0
  144. package/locale/it_IT/redact/index.js +1 -0
  145. package/locale/it_IT/redact/it_IT.js +4 -0
  146. package/locale/it_IT/resize/index.js +1 -0
  147. package/locale/it_IT/resize/it_IT.js +19 -0
  148. package/locale/it_IT/sticker/index.js +1 -0
  149. package/locale/it_IT/sticker/it_IT.js +5 -0
  150. package/locale/it_IT/trim/index.js +1 -0
  151. package/locale/it_IT/trim/it_IT.js +54 -0
  152. package/locale/nl_NL/annotate/index.js +1 -0
  153. package/locale/nl_NL/annotate/nl_NL.js +5 -0
  154. package/locale/nl_NL/core/index.js +1 -0
  155. package/locale/nl_NL/core/nl_NL.js +208 -0
  156. package/locale/nl_NL/crop/index.js +1 -0
  157. package/locale/nl_NL/crop/nl_NL.js +54 -0
  158. package/locale/nl_NL/decorate/index.js +1 -0
  159. package/locale/nl_NL/decorate/nl_NL.js +5 -0
  160. package/locale/nl_NL/fill/index.js +1 -0
  161. package/locale/nl_NL/fill/nl_NL.js +12 -0
  162. package/locale/nl_NL/filter/index.js +1 -0
  163. package/locale/nl_NL/filter/nl_NL.js +18 -0
  164. package/locale/nl_NL/finetune/index.js +1 -0
  165. package/locale/nl_NL/finetune/nl_NL.js +14 -0
  166. package/locale/nl_NL/frame/index.js +1 -0
  167. package/locale/nl_NL/frame/nl_NL.js +17 -0
  168. package/locale/nl_NL/index.js +28 -0
  169. package/locale/nl_NL/redact/index.js +1 -0
  170. package/locale/nl_NL/redact/nl_NL.js +4 -0
  171. package/locale/nl_NL/resize/index.js +1 -0
  172. package/locale/nl_NL/resize/nl_NL.js +19 -0
  173. package/locale/nl_NL/sticker/index.js +1 -0
  174. package/locale/nl_NL/sticker/nl_NL.js +5 -0
  175. package/locale/nl_NL/trim/index.js +1 -0
  176. package/locale/nl_NL/trim/nl_NL.js +55 -0
  177. package/locale/ru_RU/annotate/index.js +1 -0
  178. package/locale/ru_RU/annotate/ru_RU.js +5 -0
  179. package/locale/ru_RU/core/index.js +1 -0
  180. package/locale/ru_RU/core/ru_RU.js +206 -0
  181. package/locale/ru_RU/crop/index.js +1 -0
  182. package/locale/ru_RU/crop/ru_RU.js +54 -0
  183. package/locale/ru_RU/decorate/index.js +1 -0
  184. package/locale/ru_RU/decorate/ru_RU.js +5 -0
  185. package/locale/ru_RU/fill/index.js +1 -0
  186. package/locale/ru_RU/fill/ru_RU.js +12 -0
  187. package/locale/ru_RU/filter/index.js +1 -0
  188. package/locale/ru_RU/filter/ru_RU.js +18 -0
  189. package/locale/ru_RU/finetune/index.js +1 -0
  190. package/locale/ru_RU/finetune/ru_RU.js +14 -0
  191. package/locale/ru_RU/frame/index.js +1 -0
  192. package/locale/ru_RU/frame/ru_RU.js +17 -0
  193. package/locale/ru_RU/index.js +28 -0
  194. package/locale/ru_RU/redact/index.js +1 -0
  195. package/locale/ru_RU/redact/ru_RU.js +4 -0
  196. package/locale/ru_RU/resize/index.js +1 -0
  197. package/locale/ru_RU/resize/ru_RU.js +19 -0
  198. package/locale/ru_RU/sticker/index.js +1 -0
  199. package/locale/ru_RU/sticker/ru_RU.js +5 -0
  200. package/locale/ru_RU/trim/index.js +1 -0
  201. package/locale/ru_RU/trim/ru_RU.js +54 -0
  202. package/locale/sv_SE/annotate/index.js +1 -0
  203. package/locale/sv_SE/annotate/sv_SE.js +5 -0
  204. package/locale/sv_SE/core/index.js +1 -0
  205. package/locale/sv_SE/core/sv_SE.js +209 -0
  206. package/locale/sv_SE/crop/index.js +1 -0
  207. package/locale/sv_SE/crop/sv_SE.js +54 -0
  208. package/locale/sv_SE/decorate/index.js +1 -0
  209. package/locale/sv_SE/decorate/sv_SE.js +5 -0
  210. package/locale/sv_SE/fill/index.js +1 -0
  211. package/locale/sv_SE/fill/sv_SE.js +12 -0
  212. package/locale/sv_SE/filter/index.js +1 -0
  213. package/locale/sv_SE/filter/sv_SE.js +18 -0
  214. package/locale/sv_SE/finetune/index.js +1 -0
  215. package/locale/sv_SE/finetune/sv_SE.js +14 -0
  216. package/locale/sv_SE/frame/index.js +1 -0
  217. package/locale/sv_SE/frame/sv_SE.js +17 -0
  218. package/locale/sv_SE/index.js +28 -0
  219. package/locale/sv_SE/redact/index.js +1 -0
  220. package/locale/sv_SE/redact/sv_SE.js +4 -0
  221. package/locale/sv_SE/resize/index.js +1 -0
  222. package/locale/sv_SE/resize/sv_SE.js +19 -0
  223. package/locale/sv_SE/sticker/index.js +1 -0
  224. package/locale/sv_SE/sticker/sv_SE.js +5 -0
  225. package/locale/sv_SE/trim/index.js +1 -0
  226. package/locale/sv_SE/trim/sv_SE.js +54 -0
  227. package/locale/zh_CN/annotate/index.js +1 -0
  228. package/locale/zh_CN/annotate/zh_CN.js +5 -0
  229. package/locale/zh_CN/core/index.js +1 -0
  230. package/locale/zh_CN/core/zh_CN.js +206 -0
  231. package/locale/zh_CN/crop/index.js +1 -0
  232. package/locale/zh_CN/crop/zh_CN.js +54 -0
  233. package/locale/zh_CN/decorate/index.js +1 -0
  234. package/locale/zh_CN/decorate/zh_CN.js +5 -0
  235. package/locale/zh_CN/fill/index.js +1 -0
  236. package/locale/zh_CN/fill/zh_CN.js +12 -0
  237. package/locale/zh_CN/filter/index.js +1 -0
  238. package/locale/zh_CN/filter/zh_CN.js +18 -0
  239. package/locale/zh_CN/finetune/index.js +1 -0
  240. package/locale/zh_CN/finetune/zh_CN.js +14 -0
  241. package/locale/zh_CN/frame/index.js +1 -0
  242. package/locale/zh_CN/frame/zh_CN.js +17 -0
  243. package/locale/zh_CN/index.js +28 -0
  244. package/locale/zh_CN/redact/index.js +1 -0
  245. package/locale/zh_CN/redact/zh_CN.js +4 -0
  246. package/locale/zh_CN/resize/index.js +1 -0
  247. package/locale/zh_CN/resize/zh_CN.js +19 -0
  248. package/locale/zh_CN/sticker/index.js +1 -0
  249. package/locale/zh_CN/sticker/zh_CN.js +5 -0
  250. package/locale/zh_CN/trim/index.js +1 -0
  251. package/locale/zh_CN/trim/zh_CN.js +54 -0
  252. package/package.json +10 -0
  253. package/pintura-iife.js +11 -0
  254. package/pintura-umd.js +11 -0
  255. package/pintura.css +10 -0
  256. package/pintura.d.ts +1354 -0
  257. package/pintura.js +11 -0
  258. package/pintura.module.css +10 -0
@@ -0,0 +1,11 @@
1
+ /*!
2
+ * Pintura v8.57.5 - Test version
3
+ * (c) 2018-2023 PQINA Inc. - All Rights Reserved
4
+ * License: https://pqina.nl/pintura/license/
5
+ *
6
+ * This version of Pintura is for testing purposes only.
7
+ * Visit https://pqina.nl/pintura/ to obtain a commercial license.
8
+ */
9
+ /* eslint-disable */
10
+
11
+ var pintura=function(e){"use strict";const t=[{value:65504,name:"jfif"},{value:65498,name:"sos"},{value:65505,subvalue:17784,name:"exif"},{value:65505,subvalue:26740,name:"xmp"},{value:65506,subvalue:19792,name:"mpf"}];var o=e=>{if(65496!==e.getUint16(0))return;const o=e.byteLength;let i,n=2,r=void 0;for(;n<o&&255===e.getUint8(n);){i=e.getUint16(n);const o=t.find((t=>t.value===i&&(!t.subvalue||t.subvalue===e.getUint16(n+2+2))));if(o){const{name:t}=o;r||(r={}),r[t]||(r[t]={offset:n,size:e.getUint16(n+2)})}if(65498===i)break;n+=2+e.getUint16(n+2)}return r};var i=(e,t,i)=>{if(!e)return;const n=new DataView(e),r=o(n);if(!r||!r.exif)return;const a=((e,t)=>{if(65505!==e.getUint16(t))return;const o=e.getUint16(t+2);if(t+=4,1165519206!==e.getUint32(t))return;t+=6;const i=e.getUint16(t);if(18761!==i&&19789!==i)return;const n=18761===i;if(t+=2,42!==e.getUint16(t,n))return;t+=e.getUint32(t+2,n);const r=i=>{const r=[];let a=t;const s=Math.min(e.byteLength,t+o-16);for(;a<s;a+=12){const t=a;e.getUint16(t,n)===i&&r.push(t)}return r};return{read:t=>{const o=r(t);if(o.length)return e.getUint16(o[0]+8,n)},write:(t,o)=>{const i=r(t);return!!i.length&&(i.forEach((t=>e.setUint16(t+8,o,n))),!0)}}})(n,r.exif.offset);return a?void 0===i?a.read(t):a.write(t,i):void 0};const n="__pqina_webapi__";var r=e=>window[n]?window[n][e]:window[e],a=(...e)=>{};const s={ArrayBuffer:"readAsArrayBuffer"};var l=async(e,t=[0,e.size],o)=>await((e,t=a,o={})=>new Promise(((i,n)=>{const{dataFormat:a=s.ArrayBuffer}=o,l=new(r("FileReader"));l.onload=()=>i(l.result),l.onerror=n,l.onprogress=t,l[a](e)})))(e.slice(...t),o),c=async(e,t)=>{const o=await l(e,[0,262144],t);return i(o,274)||1};let d=null;var u=()=>(null===d&&(d="undefined"!=typeof window&&void 0!==window.document),d);let h=null;var p=()=>new Promise((e=>{if(null===h){const t="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";let o=u()?new Image:{};return o.onload=()=>{h=1===o.naturalWidth,o=void 0,e(h)},void(o.src=t)}return e(h)})),m=e=>e.getContext("2d").getImageData(0,0,e.width,e.height),g=(e,t,o=[])=>{const i=document.createElement(e),n=Object.getOwnPropertyDescriptors(i.__proto__);for(const e in t)"style"===e?i.style.cssText=t[e]:n[e]&&n[e].set||/textContent|innerHTML/.test(e)||"function"==typeof t[e]?i[e]=t[e]:i.setAttribute(e,t[e]);return o.forEach((e=>i.appendChild(e))),i};const $={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]};var f=e=>{e.width=1,e.height=1;const t=e.getContext("2d");t&&t.clearRect(0,0,1,1)},y=e=>"data"in e,b=e=>u()?RegExp(e).test(window.navigator.userAgent):void 0;let x=null;var v=()=>(null===x&&(x=b(/Android/)),x),w=(e,t)=>{const o=g("canvas",{width:e.width,height:e.height});return o.getContext("2d",t).drawImage(e,0,0),o},S=async(e,t=1)=>{const o=await p(),[i,n]=o||t<5?[e.width,e.height]:[e.height,e.width],r=g("canvas",{width:i,height:n}),a=r.getContext("2d",{willReadFrequently:!0});if(y(e)&&!o&&t>1){const t=g("canvas",{width:e.width,height:e.height});t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),e=t}if(!o&&t>1&&a.transform.apply(a,((e,t,o=-1)=>(-1===o&&(o=1),$[o](e,t)))(e.width,e.height,t)),y(e)){if(a.putImageData(e,0,0),v())return w(r)}else a.drawImage(e,0,0);return e instanceof HTMLCanvasElement&&f(e),r},k=async(e,t=1)=>1===t||await p()?e:m(await S(e,t)),M=e=>"object"==typeof e;const C=e=>e instanceof HTMLElement?e:M(e)?T(e):e,T=e=>{let t;return Array.isArray(e)?(t=[],e.forEach(((e,o)=>{t[o]=C(e)}))):(t={},Object.keys(e).forEach((o=>{const i=e[o];t[o]=C(i)}))),t};var P=e=>"string"==typeof e,R=e=>"function"==typeof e,I=(e,t)=>new Promise(((o,i)=>{const n=()=>o(((e,{width:t,height:o,canvasMemoryLimit:i,contextOptions:n})=>{let r=t||e.naturalWidth,a=o||e.naturalHeight;r||a||(r=300,a=150);const s=r*a;if(i&&s>i){const e=Math.sqrt(i)/Math.sqrt(s);r=Math.floor(r*e),a=Math.floor(a*e)}const l=g("canvas");return l.width=r,l.height=a,l.getContext("2d",n).drawImage(e,0,0,r,a),l})(e,t));e.complete&&e.width?n():(e.onload=n,e.onerror=i)})),A=()=>"createImageBitmap"in window,E=e=>/svg/.test(e.type),L=()=>Math.random().toString(36).substr(2,9);const F=new Map;var z=(e,t,o)=>new Promise(((i,n)=>{const r=e.toString();let a=F.get(r);if(!a){const t=(e=>`function () {self.onmessage = function (message) {(${e.toString()}).apply(null, message.data.content.concat([function (err, response) {\n response = response || {};\n const transfer = 'data' in response ? [response.data.buffer] : 'width' in response ? [response] : [];\n return self.postMessage({ id: message.data.id, content: response, error: err }, transfer);\n}]))}}`)(e),o=URL.createObjectURL((e=>new Blob(["(","function"==typeof e?e.toString():e,")()"],{type:"application/javascript"}))(t)),i=new Map,n=new Worker(o);a={url:o,worker:n,messages:i,terminationTimeout:void 0,terminate:()=>{clearTimeout(a.terminationTimeout),a.worker.terminate(),URL.revokeObjectURL(o),F.delete(r)}},n.onmessage=function(e){const{id:t,content:o,error:n}=e.data;if(clearTimeout(a.terminationTimeout),a.terminationTimeout=setTimeout((()=>{i.size>0||a.terminate()}),500),!i.has(t))return;const r=i.get(t);i.delete(t),null!=n?r.reject(n):r.resolve(o)},F.set(r,a)}const s=L();a.messages.set(s,{resolve:i,reject:n}),a.worker.postMessage({id:s,content:t},o)})),D=async(e,t)=>{const o=async()=>{const o=await(async(e,t)=>{const o=g("img",{src:URL.createObjectURL(e)}),i=await I(o,t);return URL.revokeObjectURL(o.src),i})(e,{canvasMemoryLimit:t,contextOptions:{willReadFrequently:!0}}),i=m(o);return f(o),i};if(v())return await o();let i;if(A()&&!E(e)&&"OffscreenCanvas"in window)try{i=await z(((e,t,o)=>{createImageBitmap(e).then((e=>{let i=e.width,n=e.height;const r=i*n;if(t&&r>t){const e=Math.sqrt(t)/Math.sqrt(r);i=Math.floor(i*e),n=Math.floor(n*e)}const a=new OffscreenCanvas(i,n),s=a.getContext("2d",{willReadFrequently:!0});s.drawImage(e,0,0,i,n);const l=s.getImageData(0,0,a.width,a.height);o(null,l)})).catch((e=>{o(e)}))}),[e,t])}catch(e){}return i&&i.width?i:await o()},B=(e,t,o)=>new Promise(((i,n)=>{try{e.toBlob((e=>{i(e)}),t,o)}catch(e){n(e)}})),O=async(e,t,o)=>{const i=await S(e),n=await B(i,t,o);return f(i),n};const _={matroska:"mkv"};var W=e=>{const t=(e.match(/\/([a-z0-9]+)/)||[])[1];if(/^x/.test(t)){const[,t=""]=e.split("/x-");return _[t]}return t},V=e=>e.substr(0,e.lastIndexOf("."))||e;const N=/avif|bmp|gif|jpg|jpeg|jpe|jif|jfif|png|svg|tiff|webp/;var H=e=>{return e&&(t=(o=e,o.split(".").pop()).toLowerCase(),N.test(t)?"image/"+(/jfif|jif|jpe|jpg/.test(t)?"jpeg":"svg"===t?"svg+xml":t):"");var t,o},j=(e,t,o)=>{const i=(new Date).getTime(),n=e.type.length&&!/null|text/.test(e.type),a=n?e.type:o,s=((e,t)=>{const o=H(e);if(o===t)return e;const i=W(t)||o;return`${V(e)}.${i}`})(t,a);try{return new(r("File"))([e],s,{lastModified:i,type:n?e.type:a})}catch(t){const o=n?e.slice():e.slice(0,e.size,a);return o.lastModified=i,o.name=s,o}},U=(e,t)=>e/t,Z=e=>e;const X=Math.PI,G=Math.PI/2,Y=G/2;var q=e=>{const t=Math.abs(e)%Math.PI;return t>Y&&t<Math.PI-Y};const K={Top:"t",Right:"r",Bottom:"b",Left:"l",TopLeft:"tl",TopRight:"tr",BottomRight:"br",BottomLeft:"bl"},{Top:J,Right:Q,Bottom:ee,Left:te,TopLeft:oe,TopRight:ie,BottomRight:ne,BottomLeft:re}=K;var ae={[J]:[.5,0],[Q]:[1,.5],[ee]:[.5,1],[te]:[0,.5],[oe]:[0,0],[ie]:[1,0],[ne]:[1,1],[re]:[0,1]},se=(e,t=12)=>parseFloat(e.toFixed(t));const le=(e,t,o)=>o+(e-o)*t,ce=e=>({x:e.x+.5*e.width,y:e.y+.5*e.height,rx:.5*e.width,ry:.5*e.height}),de=()=>ue(0,0),ue=(e,t)=>({x:e,y:t}),he=e=>ue(e.x,e.y),pe=e=>ue(e.pageX,e.pageY),me=e=>ue(e.x,e.y),ge=e=>(e.x=-e.x,e.y=-e.y,e),$e=(e,t,o=de())=>{const i=Math.cos(t),n=Math.sin(t),r=e.x-o.x,a=e.y-o.y;return e.x=o.x+i*r-n*a,e.y=o.y+n*r+i*a,e},fe=e=>Math.sqrt(e.x*e.x+e.y*e.y),ye=e=>{const t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?de():(e.x/=t,e.y/=t,e)},be=(e,t)=>Math.atan2(t.y-e.y,t.x-e.x),xe=(e,t)=>e.x===t.x&&e.y===t.y,ve=(e,t)=>(e.x=t(e.x),e.y=t(e.y),e),we=(e,t)=>(e.x+=t.x,e.y+=t.y,e),Se=(e,t)=>(e.x-=t.x,e.y-=t.y,e),ke=(e,t)=>(e.x/=t,e.y/=t,e),Me=(e,t)=>(e.x*=t,e.y*=t,e),Ce=(e,t)=>e.x*t.x+e.y*t.y,Te=(e,t)=>e.x*t.y-e.y*t.x,Pe=(e,t=de())=>{const o=e.x-t.x,i=e.y-t.y;return o*o+i*i},Re=(e,t=de())=>Math.sqrt(Pe(e,t)),Ie=(e,t,o)=>(e.x=le(e.x,t,o.x),e.y=le(e.y,t,o.y),e),Ae=e=>{let t=0,o=0;return e.forEach((e=>{t+=e.x,o+=e.y})),ue(t/e.length,o/e.length)},Ee=(e,t,o,i,n)=>(e.forEach((e=>{e.x=t?i-(e.x-i):e.x,e.y=o?n-(e.y-n):e.y})),e),Le=(e,t,o,i)=>{const n=Math.sin(t),r=Math.cos(t);return e.forEach((e=>{e.x-=o,e.y-=i;const t=e.x*r-e.y*n,a=e.x*n+e.y*r;e.x=o+t,e.y=i+a})),e},Fe=(e,t)=>({width:e,height:t}),ze=e=>Fe(e.width,e.height),De=e=>Fe(e.width,e.height),Be=e=>Fe(e.width,e.height),Oe=e=>Fe(e[0],e[1]),_e=e=>{return/img/i.test(e.nodeName)?Fe((t=e).naturalWidth,t.naturalHeight):De(e);var t},We=(e,t)=>Fe(e,t),Ve=(e,t,o=Z)=>o(e.width)===o(t.width)&&o(e.height)===o(t.height),Ne=(e,t)=>(e.width*=t,e.height*=t,e),He=e=>ue(.5*e.width,.5*e.height),je=(e,t)=>{const o=Math.abs(t),i=Math.cos(o),n=Math.sin(o),r=i*e.width+n*e.height,a=n*e.width+i*e.height;return e.width=r,e.height=a,e},Ue=(e,t)=>e.width>=t.width&&e.height>=t.height,Ze=(e,t)=>(e.width=t(e.width),e.height=t(e.height),e),Xe=(e,t)=>({start:e,end:t}),Ge=e=>Xe(me(e.start),me(e.end)),Ye=(e,t)=>{if(0===t)return e;const o=ue(e.start.x-e.end.x,e.start.y-e.end.y),i=ye(o),n=Me(i,t);return e.start.x+=n.x,e.start.y+=n.y,e.end.x-=n.x,e.end.y-=n.y,e},qe=[ue(-1,-1),ue(-1,1),ue(1,1),ue(1,-1)],Ke=(e,t,o,i)=>({x:e,y:t,width:o,height:i}),Je=e=>Ke(e.x,e.y,e.width,e.height),Qe=()=>Ke(0,0,0,0),et=e=>Ke(0,0,e.width,e.height),tt=e=>Ke(e.x||0,e.y||0,e.width||0,e.height||0),ot=e=>{let t=e[0].x,o=e[0].x,i=e[0].y,n=e[0].y;return e.forEach((e=>{t=Math.min(t,e.x),o=Math.max(o,e.x),i=Math.min(i,e.y),n=Math.max(n,e.y)})),Ke(t,i,o-t,n-i)},it=e=>rt(e.x-e.rx,e.y-e.ry,2*e.rx,2*e.ry),nt=(e,t)=>Ke(e.x-.5*t.width,e.y-.5*t.height,t.width,t.height),rt=(e,t,o,i)=>Ke(e,t,o,i),at=e=>ue(e.x+.5*e.width,e.y+.5*e.height),st=(e,t)=>(e.x+=t.x,e.y+=t.y,e),lt=(e,t,o)=>(o=o||at(e),e.x=t*(e.x-o.x)+o.x,e.y=t*(e.y-o.y)+o.y,e.width=t*e.width,e.height=t*e.height,e),ct=(e,t,o,i)=>{const n=(i.x-e.x)/e.width,r=(i.y-e.y)/e.height;let a=Math.max(t.width,e.width),s=Math.max(t.height,e.height);return a=Math.min(o.width,a),s=Math.min(o.height,s),e.x=i.x-n*a,e.y=i.y-r*s,e.width=a,e.height=s,e},dt=(e,t)=>{const[o,i]=ae[t],n=o*e.width,r=i*e.height;return ue(e.x+n,e.y+r)},ut=(e,t)=>(e.x*=t,e.y*=t,e.width*=t,e.height*=t,e),ht=(e,t,o=Z)=>o(e.x)===o(t.x)&&o(e.y)===o(t.y)&&o(e.width)===o(t.width)&&o(e.height)===o(t.height),pt=e=>U(e.width,e.height),mt=(e,t,o,i,n)=>(e.x=t,e.y=o,e.width=i,e.height=n,e),gt=(e,t)=>(e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e),$t=(e,t,o)=>(o||(o=at(e)),wt(e).map((e=>$e(e,t,o)))),ft=(e,t)=>Ke(.5*e.width-.5*t.width,.5*e.height-.5*t.height,t.width,t.height),yt=(e,t)=>!(t.x<e.x)&&(!(t.y<e.y)&&(!(t.x>e.x+e.width)&&!(t.y>e.y+e.height))),bt=(e,t,o=de())=>{if(0===e.width||0===e.height)return Qe();const i=pt(e);t||(t=i);let n=e.width,r=e.height;return t>i?n=r*t:r=n/t,Ke(o.x+.5*(e.width-n),o.y+.5*(e.height-r),n,r)},xt=(e,t=pt(e),o=de())=>{if(0===e.width||0===e.height)return Qe();let i=e.width,n=i/t;return n>e.height&&(n=e.height,i=n*t),Ke(o.x+.5*(e.width-i),o.y+.5*(e.height-n),i,n)},vt=e=>[Math.min(e.y,e.y+e.height),Math.max(e.x,e.x+e.width),Math.max(e.y,e.y+e.height),Math.min(e.x,e.x+e.width)],wt=e=>[ue(e.x,e.y),ue(e.x+e.width,e.y),ue(e.x+e.width,e.y+e.height),ue(e.x,e.y+e.height)],St=(e,t)=>{if(e)return e.x=t(e.x),e.y=t(e.y),e.width=t(e.width),e.height=t(e.height),e},kt=(e,t,o=at(e))=>wt(e).map(((e,i)=>{const n=qe[i];return ue(le(e.x,1+n.x*t.x,o.x),le(e.y,1+n.y*t.y,o.y))})),Mt=e=>(e.x=0,e.y=0,e),Ct=e=>{const t=e[0],o=e[e.length-1];e=xe(t,o)?e:[...e,t];const i=t.x,n=t.y;let r,a,s,l=0,c=0,d=0,u=0;const h=e.length;for(;c<h;c++)r=e[c],a=e[c+1>h-1?0:c+1],s=(r.y-n)*(a.x-i)-(a.y-n)*(r.x-i),l+=s,d+=(r.x+a.x-2*i)*s,u+=(r.y+a.y-2*n)*s;return s=3*l,ue(i+d/s,n+u/s)},Tt=(e,t)=>Pt(e.start,e.end,t.start,t.end),Pt=(e,t,o,i)=>{const n=(i.y-o.y)*(t.x-e.x)-(i.x-o.x)*(t.y-e.y);if(0===n)return;const r=((i.x-o.x)*(e.y-o.y)-(i.y-o.y)*(e.x-o.x))/n,a=((t.x-e.x)*(e.y-o.y)-(t.y-e.y)*(e.x-o.x))/n;return r<0||r>1||a<0||a>1?void 0:ue(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y))},Rt=(e,t,{ignoreIdenticalLines:o=!1,breakOnIntersection:i=!1}={})=>{const n=t.length,r=[];for(let a=0;a<n-1;a++){if(o&&(xe(e.start,t[a])||xe(e.start,t[a+1])||xe(e.end,t[a])||xe(e.end,t[a+1])))continue;const n=Pt(e.start,e.end,t[a],t[a+1]);if(n){if(i)return[n];r.push(n)}}return r.length?r:void 0},It=(e,t)=>{let o=0,i=0,n=!1;const r=t.length;for(o=0,i=r-1;o<r;i=o++)t[o].y>e.y!=t[i].y>e.y&&e.x<(t[i].x-t[o].x)*(e.y-t[o].y)/(t[i].y-t[o].y)+t[o].x&&(n=!n);return n},At=e=>{const t=[];for(let o=0;o<e.length;o++){let i=o+1;i===e.length&&(i=0),t.push(Xe(me(e[o]),me(e[i])))}return t},Et=(e,t=0)=>At(e).map((e=>Ye(e,t))),Lt=(e,t,o,i=0,n=!1,r=!1,a=12)=>{const s=[];for(let i=0;i<a;i++)s.push(ue(e.x+t*Math.cos(i*(2*Math.PI)/a),e.y+o*Math.sin(i*(2*Math.PI)/a)));return(n||r)&&Ee(s,n,r,e.x,e.y),i&&Le(s,i,e.x,e.y),s};var Ft=(e,t)=>{const o=et(e),i=at(o),n=$t(o,t,i);return Mt(ot(n))},zt=(e,t)=>e instanceof HTMLElement&&(!t||new RegExp(`^${t}$`,"i").test(e.nodeName)),Dt=e=>e instanceof File,Bt=async(e,t,o)=>{const i=await B(e,t,o);return j(i,"canvas")},Ot=e=>e.split("/").pop().split(/\?|\#/).shift();const _t=u()&&!!Node.prototype.replaceChildren?(e,t)=>e.replaceChildren(t):(e,t)=>{for(;e.lastChild;)e.removeChild(e.lastChild);void 0!==t&&e.append(t)},Wt=u()&&g("div",{class:"PinturaMeasure",style:"position:absolute;left:0;top:0;width:99999px;height:0;pointer-events:none;contain:strict;margin:0;padding:0;"});let Vt;var Nt=e=>(_t(Wt,e),Wt.parentNode||document.body.append(Wt),clearTimeout(Vt),Vt=setTimeout((()=>{Wt.remove()}),500),e);let Ht=null;var jt=()=>(null===Ht&&(Ht=u()&&/^((?!chrome|android).)*(safari|iphone|ipad)/i.test(navigator.userAgent)),Ht),Ut=e=>new Promise(((t,o)=>{let i=!1;!e.parentNode&&jt()&&(i=!0,e.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:0;top:0;width:0;height:0;",Nt(e));const n=()=>{const o=e.naturalWidth,n=e.naturalHeight;o&&n&&(i&&e.remove(),clearInterval(r),t({width:o,height:n}))};e.onerror=e=>{clearInterval(r),o(e)};const r=setInterval(n,1);n()})),Zt=e=>new Promise(((t,o)=>{const i=()=>{t({width:e.videoWidth,height:e.videoHeight})};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=o})),Xt=e=>/^image/.test(e.type),Gt=e=>new Promise((t=>{const o=P(e)?e:URL.createObjectURL(e),i=()=>{const e=new Image;e.src=o,t(e)};if(e instanceof Blob&&Xt(e))return i();const n=document.createElement("video");n.preload="metadata",n.onloadedmetadata=()=>t(n),n.onerror=i,n.src=o})),Yt=e=>"VIDEO"===e.nodeName,qt=async e=>{let t,o;t=e.src?e:await Gt(e);try{o=Yt(t)?await Zt(t):await Ut(t)}finally{Dt(e)&&URL.revokeObjectURL(t.src)}return o};var Kt=async e=>{const t=await qt(e),o=await(e=>new Promise(((t,o)=>{if(e.complete)return t(e);e.onload=()=>t(e),e.onerror=o})))(e),i=g("canvas",t);i.getContext("2d",{willReadFrequently:!0}).drawImage(o,0,0);const n=await B(i);return j(n,Ot(o.src))},Jt=(e=0,t=!0)=>new(r("ProgressEvent"))("progress",{loaded:100*e,total:100,lengthComputable:t}),Qt=(e,t,o=(e=>e))=>e.getAllResponseHeaders().indexOf(t)>=0?o(e.getResponseHeader(t)):void 0,eo=e=>{if(!e)return null;const t=e.split(/filename=|filename\*=.+''/).splice(1).map((e=>e.trim().replace(/^["']|[;"']{0,2}$/g,""))).filter((e=>e.length));return t.length?decodeURI(t[t.length-1]):null};const to="URL_REQUEST";class oo extends Error{constructor(e,t,o){super(e),this.name="EditorError",this.code=t,this.metadata=o}}var io=(e,t)=>{const{headers:o={},credentials:i}=t||{};Object.entries(o).forEach((([t,o])=>e.setRequestHeader(t,o))),i&&(e.withCredentials="omit"!==i)},no=(e,t,o)=>/^data:/.test(e)?(async(e,t="data-uri",o=a)=>{o(Jt(0));const i=await fetch(e);o(Jt(.33));const n=await i.blob();let r;Xt(n)||(r="image/"+(e.includes(",/9j/")?"jpeg":"png")),o(Jt(.66));const s=j(n,t,r);return o(Jt(1)),s})(e,void 0,t):((e,t,o)=>new Promise(((i,n)=>{const r=()=>n(new oo("Error fetching image",to,a)),a=new XMLHttpRequest;a.onprogress=t,a.onerror=r,a.onload=()=>{if(!a.response||a.status>=300||a.status<200)return r();const t=Qt(a,"Content-Type"),o=Qt(a,"Content-Disposition",eo)||Ot(e);i(j(a.response,o,t||H(o)))};const{willRequest:s}=o;Promise.resolve(s&&s(e,{resourceType:"image"})).then((t=>{if(!1===t)return n("Image load rejected");a.open("GET",e),io(a,t),a.responseType="blob",a.send()})).catch(console.error)})))(e,t,o),ro=e=>e instanceof Blob&&!(e instanceof File),ao=e=>"close"in e,so=async(e,t,o)=>{if(Dt(e)||ro(e))return e;if(P(e))return await no(e,t,o);if(zt(e,"canvas"))return await Bt(e);if(zt(e,"img"))return await Kt(e);if(y(e)||ao(e))return await Bt(await S(e));throw new oo("Invalid image source","invalid-image-source")};let lo=null;var co=()=>(null===lo&&(lo=u()&&/^mac/i.test(navigator.platform)),lo);let uo=null;var ho=()=>(null===uo&&(uo=u()&&(b(/iPhone|iPad|iPod/)||co()&&navigator.maxTouchPoints>=1)),uo),po=async(e,t=1)=>await p()||ho()||t<5?e:We(e.height,e.width),mo=e=>/jpeg/.test(e.type),go=e=>{return"object"!=typeof(t=e)||t.constructor!=Object?e:JSON.stringify(e);var t},$o=(e,t=0,o)=>(0===t||(e.translate(o.x,o.y),e.rotate(t),e.translate(-o.x,-o.y)),e),fo=async(e,t={})=>{const{flipX:o,flipY:i,rotation:n,crop:r}=t,a=De(e),s=o||i,l=!!n,c=r&&(r.x||r.y||r.width||r.height),d=c&&ht(r,et(a)),u=c&&!d;if(!s&&!l&&!u)return e;let h,p=g("canvas",{width:e.width,height:e.height});if(p.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),s){const e=g("canvas",{width:p.width,height:p.height}).getContext("2d",{willReadFrequently:!0});((e,t,o)=>{e.scale(t,o)})(e,o?-1:1,i?-1:1),e.drawImage(p,o?-p.width:0,i?-p.height:0),e.restore(),f(p),p=e.canvas}if(l){const e=Ze(Be(ot($t(tt(p),n))),Math.floor),t=g("canvas",{width:r.width,height:r.height}).getContext("2d",{willReadFrequently:!0});((e,t,o)=>{e.translate(t,o)})(t,-r.x,-r.y),$o(t,n,He(e)),t.drawImage(p,.5*(e.width-p.width),.5*(e.height-p.height)),t.restore(),f(p),p=t.canvas}else if(u){return h=p.getContext("2d",{willReadFrequently:!0}).getImageData(r.x,r.y,r.width,r.height),f(p),h}return h=p.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,p.width,p.height),f(p),h},yo=(e,t)=>{const{imageData:o,width:i,height:n}=e,r=o.width,a=o.height,s=Math.round(i),l=Math.round(n),c=o.data,d=new Uint8ClampedArray(s*l*4),u=r/s,h=a/l,p=Math.ceil(.5*u),m=Math.ceil(.5*h);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const o=4*(t+e*s);let i=0,n=0,a=0,l=0,g=0,$=0,f=0;const y=(e+.5)*h;for(let o=Math.floor(e*h);o<(e+1)*h;o++){const e=Math.abs(y-(o+.5))/m,s=(t+.5)*u,d=e*e;for(let e=Math.floor(t*u);e<(t+1)*u;e++){let t=Math.abs(s-(e+.5))/p;const u=Math.sqrt(d+t*t);if(u<-1||u>1)continue;if(i=2*u*u*u-3*u*u+1,i<=0)continue;t=4*(e+o*r);const h=c[t+3];f+=i*h,a+=i,h<255&&(i=i*h/250),l+=i*c[t],g+=i*c[t+1],$+=i*c[t+2],n+=i}}d[o]=l/n,d[o+1]=g/n,d[o+2]=$/n,d[o+3]=f/a}t(null,{data:d,width:s,height:l})},bo=e=>{if(e instanceof ImageData)return e;let t;try{t=new ImageData(e.width,e.height)}catch(o){t=g("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},xo=async(e,t={},o)=>{const{width:i,height:n,fit:r,upscale:a}=t;if(!i&&!n)return e;let s=i,l=n;if(i?n||(l=i):s=n,"force"!==r){const t=s/e.width,o=l/e.height;let i=1;if("cover"===r?i=Math.max(t,o):"contain"===r&&(i=Math.min(t,o)),i>1&&!1===a)return e;s=Math.round(e.width*i),l=Math.round(e.height*i)}return s=Math.max(s,1),l=Math.max(l,1),e.width===s&&e.height===l?e:o?o(e,s,l):(e=await z(yo,[{imageData:e,width:s,height:l}],[e.data.buffer]),bo(e))},vo=(e,t)=>{const{imageData:o,matrix:i}=e;if(!i)return t(null,o);const n=new Uint8ClampedArray(o.width*o.height*4),r=o.data,a=r.length,s=i[0],l=i[1],c=i[2],d=i[3],u=i[4],h=i[5],p=i[6],m=i[7],g=i[8],$=i[9],f=i[10],y=i[11],b=i[12],x=i[13],v=i[14],w=i[15],S=i[16],k=i[17],M=i[18],C=i[19];let T=0,P=0,R=0,I=0,A=0,E=0,L=0,F=0,z=0,D=0,B=0,O=0;for(;T<a;T+=4)P=r[T]/255,R=r[T+1]/255,I=r[T+2]/255,A=r[T+3]/255,E=P*s+R*l+I*c+A*d+u,L=P*h+R*p+I*m+A*g+$,F=P*f+R*y+I*b+A*x+v,z=P*w+R*S+I*k+A*M+C,D=Math.max(0,E*z)+(1-z),B=Math.max(0,L*z)+(1-z),O=Math.max(0,F*z)+(1-z),n[T]=255*Math.max(0,Math.min(1,D)),n[T+1]=255*Math.max(0,Math.min(1,B)),n[T+2]=255*Math.max(0,Math.min(1,O)),n[T+3]=255*A;t(null,{data:n,width:o.width,height:o.height})},wo=(e,t)=>{const{imageData:o,matrix:i}=e;if(!i)return t(null,o);let n=i.reduce(((e,t)=>e+t));n=n<=0?1:n;const r=o.width,a=o.height,s=o.data;let l=0,c=0,d=0;const u=Math.round(Math.sqrt(i.length)),h=Math.floor(u/2);let p=0,m=0,g=0,$=0,f=0,y=0,b=0,x=0,v=0,w=0;const S=new Uint8ClampedArray(r*a*4);for(d=0;d<a;d++)for(c=0;c<r;c++){for(p=0,m=0,g=0,$=0,y=0;y<u;y++)for(f=0;f<u;f++)b=d+y-h,x=c+f-h,b<0&&(b=a-1),b>=a&&(b=0),x<0&&(x=r-1),x>=r&&(x=0),v=4*(b*r+x),w=i[y*u+f],p+=s[v]*w,m+=s[v+1]*w,g+=s[v+2]*w,$+=s[v+3]*w;S[l]=p/n,S[l+1]=m/n,S[l+2]=g/n,S[l+3]=$/n,l+=4}t(null,{data:S,width:r,height:a})},So=(e,t)=>{let{imageData:o,strength:i}=e;if(!i)return t(null,o);const n=new Uint8ClampedArray(o.width*o.height*4),r=o.width,a=o.height,s=o.data,l=(e,t)=>(c=e-w,d=t-S,Math.sqrt(c*c+d*d));let c,d,u,h,p,m,g,$,f,y,b,x=0,v=0,w=.5*r,S=.5*a,k=l(0,0);for(i>0?(u=0,h=0,p=0):(i=Math.abs(i),u=1,h=1,p=1),v=0;v<a;v++)for(x=0;x<r;x++)M=4*(x+v*r),C=s,T=n,P=l(x,v)*i/k,m=C[M]/255,g=C[M+1]/255,$=C[M+2]/255,f=C[M+3]/255,y=1-P,b=y*f+P,T[M]=(y*f*m+P*u)/b*255,T[M+1]=(y*f*g+P*h)/b*255,T[M+2]=(y*f*$+P*p)/b*255,T[M+3]=255*b;var M,C,T,P;t(null,{data:n,width:o.width,height:o.height})},ko=(e,t)=>{const{imageData:o,level:i,monochrome:n=!1}=e;if(!i)return t(null,o);const r=new Uint8ClampedArray(o.width*o.height*4),a=o.data,s=a.length;let l,c,d,u=0;const h=()=>255*(2*Math.random()-1)*i,p=n?()=>{const e=h();return[e,e,e]}:()=>[h(),h(),h()];for(;u<s;u+=4)[l,c,d]=p(),r[u]=a[u]+l,r[u+1]=a[u+1]+c,r[u+2]=a[u+2]+d,r[u+3]=a[u+3];t(null,{data:r,width:o.width,height:o.height})},Mo=(e,t)=>{const{imageData:o,level:i}=e;if(!i)return t(null,o);const n=new Uint8ClampedArray(o.width*o.height*4),r=o.data,a=r.length;let s,l,c,d=0;for(;d<a;d+=4)s=r[d]/255,l=r[d+1]/255,c=r[d+2]/255,n[d]=255*Math.pow(s,i),n[d+1]=255*Math.pow(l,i),n[d+2]=255*Math.pow(c,i),n[d+3]=r[d+3];t(null,{data:n,width:o.width,height:o.height})},Co=async(e,t={})=>{const{colorMatrix:o,convolutionMatrix:i,gamma:n,noise:r,vignette:a}=t,s=[];if(i&&s.push([wo,{matrix:i.clarity}]),n>0&&s.push([Mo,{level:1/n}]),o&&!(e=>{const t=e.length;let o;const i=t>=20?6:t>=16?5:3;for(let n=0;n<t;n++){if(o=e[n],1===o&&n%i!=0)return!1;if(0!==o&&1!==o)return!1}return!0})(o)&&s.push([vo,{matrix:o}]),(r>0||r<0)&&s.push([ko,{level:r}]),(a>0||a<0)&&s.push([So,{strength:a}]),!s.length)return e;const l=(e,t)=>`(err, imageData) => {\n (${e[t][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${t}]), \n ${e[t+1]?l(e,t+1):"done"})\n }`,c=`function (options, done) {\n const filterInstructions = options.filterInstructions;\n const imageData = options.imageData;\n (${l(s,0)})(null, imageData)\n }`;return e=await z(c,[{imageData:e,filterInstructions:s.map((e=>e[1]))}],[e.data.buffer]),bo(e)},To=e=>"number"==typeof e,Po=e=>P(e)&&null!==e.match(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g),Ro=(e,t)=>e.hasOwnProperty(t),Io=e=>Array.isArray(e);let Ao=64,Eo=102,Lo=112,Fo=!1;var zo=(e,t)=>(!Fo&&u()&&(/^win/i.test(navigator.platform)&&(Eo=103),(ho()||co())&&(Ao=63.5,Eo=110,Lo=123),Fo=!0),`<svg${t?` aria-label="${t}"`:""} width="128" height="128" viewBox="0 0 128 128" preserveAspectRatio="xMinYMin meet" xmlns="http://www.w3.org/2000/svg"><text x="${Ao}" y="${Eo}" alignment-baseline="text-top" dominant-baseline="text-top" text-anchor="middle" font-size="${Lo}px">${e}</text></svg>`),Do=e=>e instanceof Blob,Bo=(e,t)=>e/t*100+"%",Oo=e=>`rgba(${Math.round(255*e[0])}, ${Math.round(255*e[1])}, ${Math.round(255*e[2])}, ${To(e[3])?e[3]:1})`,_o=e=>Object.values(e).join("_");const Wo=async(e,t=0)=>{const o=g("canvas",{width:80,height:80}).getContext("2d");return await((e=0)=>new Promise((t=>{setTimeout(t,e)})))(t),o.drawImage(e,0,0,80,80),!((e=>!new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data.buffer).some((e=>0!==e)))(o)&&t<=256)||await Wo(e,t+16)},Vo=new Map;var No=e=>new Promise(((t,o)=>{const i=new FileReader;i.onerror=o,i.onload=()=>t(i.result),i.readAsDataURL(e)})),Ho=()=>{let e=[];return{sub:(t,o)=>(e.push({event:t,callback:o}),()=>e=e.filter((e=>e.event!==t||e.callback!==o))),pub:(t,o)=>{e.filter((e=>e.event===t)).forEach((e=>e.callback(o)))}}};const jo=32,Uo=({color:e=[0,0,0],fontSize:t=16,fontFamily:o="sans-serif",fontVariant:i="normal",fontWeight:n="normal",fontStyle:r="normal",textAlign:a="left",lineHeight:s=20})=>`font-size:${t}px;font-style:${r};font-weight:${n};font-family:${o};font-variant:${i};line-height:${s}px;text-align:${a};color:${Oo(e)};`,Zo=(e,t)=>{const{width:o,height:i,disableNewline:n}=t,r=!o,a=!1===n?((e="")=>e.split("\n").length)(e):void 0,s=r?"normal":"break-word",l=r&&!a?"nowrap":"pre-line";return`max-width:none;min-width:auto;width:${r?"auto":o+"px"};height:${i?i+"px":"auto"};margin-top:0;margin-bottom:0;padding-top:${(({fontSize:e=16,lineHeight:t=20}={})=>.5*Math.max(0,e-t))(t)}px;word-break:${s};word-wrap:normal;white-space:${l};overflow:visible;`},Xo=new Map,Go=new Map,Yo=(e="",t)=>{const{width:o=0,height:i=0}=t;if(o&&i)return We(o,i);const{fontSize:n=16,fontFamily:r,lineHeight:a=20,fontWeight:s,fontStyle:l,fontVariant:c}=t,d=_o({text:e,fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,lineHeight:a,width:o});let u=Go.get(d);if(u)return u;jt()&&e.endsWith("\n")&&!e.endsWith("\n\n")&&(e+="\n");const h=Nt(g("pre",{contenteditable:"true",spellcheck:"false",style:`pointer-events:none;visibility:hidden;position:absolute;${Uo(t)};${Zo(e,t)}"`,innerHTML:e},[g("span")])).getBoundingClientRect();return u=De(h),u.height+=Math.max(0,n-a),Go.set(d,u),u},qo=new Map,Ko=(e,t)=>new Promise(((o,i)=>{let n=qo.get(e);void 0===n&&(n=((e,t)=>{const{sub:o,pub:i}=Ho();let n,r;return Promise.resolve(t&&t(e,{resourceType:"stylesheet"})).then((t=>{if(!1===t)return r="requestPrevented",i("error",r);const{headers:o,credentials:a}=t||{};fetch(e,{headers:o,credentials:a}).then((e=>e.text())).then((e=>{n=e,i("load",n)})).catch((e=>{r=e,i("error",r)}))})),{sub:(e,t)=>"load"===e&&n?t(n):"error"===e&&r?t(r):void o(e,t)}})(e,t),qo.set(e,n)),n.sub("load",o),n.sub("error",i)})),Jo=async(e,t)=>{let o;try{o=await Ko(e,t)}catch(e){return[]}const i=g("style",{innerHTML:o,id:L()});document.head.append(i);const n=Array.from(document.styleSheets).find((e=>e.ownerNode.id===i.id));return i.remove(),Array.from(n.cssRules)},Qo=new Map,ei=async(e,t)=>{if(Qo.has(e.href))return Qo.get(e.href);let o;try{o=Array.from(e.cssRules);for(const e of(e=>e.filter((e=>e instanceof CSSImportRule)))(o)){const i=e.href;if(Qo.has(i)){const e=Qo.get(i);o=[...o,...e];continue}const n=await Jo(i,t);Qo.set(i,n),o=[...o,...n]}}catch(i){const n=e.href;o=await Jo(n,t),Qo.set(n,o)}return(e=>e.filter((e=>e instanceof CSSFontFaceRule)))(o)},ti=(e,t)=>e.style.getPropertyValue(t),oi=(e,t)=>{if(!e.style)return!1;return ti(e,"font-family").replace(/^"|"$/g,"")==t},ii=async(e,t)=>{const o=((e,t)=>{const o=[];for(const i of e)oi(i,t)&&o.push(i);return o})(await(async e=>{const t=Array.from(document.styleSheets).map((t=>ei(t,e))),o=await Promise.all(t),i=[];return o.forEach((e=>i.push(...e))),i})(t),e);return o.length?o.map((e=>{const t=e.parentStyleSheet.href&&new URL(e.parentStyleSheet.href),o=t?t.origin+(e=>e.pathname.split("/").slice(0,-1).join("/"))(t)+"/":"",i=e.style.getPropertyValue("src").match(/url\("?(.*?)"?\)/)[1],n=Array.from(e.style).filter((e=>"src"!=e)).reduce(((t,o)=>t+=o+":"+ti(e,o)+";"),"");return[/^http/.test(i)?i:o+i,n]})):[]},ni=new Map,ri=new Map;var ai=async(e="",t)=>{if(!e.length)return;const{imageWidth:o=300,imageHeight:i=150,paddingLeft:n=jo,paddingRight:r=jo,fontFamily:a,pixelRatio:s=1,willRequest:l}=t,c=(o+n+r)*s,d=i*s,u=Uo(t),h=Zo(e,t),p=await(async(e,t)=>{if(ni.get(e))return;let o=ri.get(e);if(!o){const n=await ii(e,t);if(!n.length)return void ni.set(e,!0);const r=[];for(const[e,t]of n){const o=await fetch(e).then((e=>e.blob())),n=!(i=o.type)||/woff2/.test(i)?"woff2":/woff/.test(i)?"woff":/ttf|truetype/.test(i)?"truetype":/otf|opentype/.test(i)?"opentype":/svg/.test(i)?"svg":"woff2",a=await No(o);r.push(`@font-face { src:url(${a}) format('${n}');${t};font-display:block; }`)}o=r.join(""),ri.set(e,o)}var i;return o})(a,l),m=e.replace(/&/g,"&amp;").replace(/%/g,"%25").replace(/#/g,"%23").replace(/<br>/g,"___BR___").replace(/\n/g,"___BR___");return((e,{safariCacheKey:t="*"}={})=>new Promise(((o,i)=>{const n=new Image;n.onerror=i,n.onload=()=>{if(!jt()||!e.includes("@font-face")||Vo.has(t))return o(n);Wo(n).then((()=>{Vo.set(t,!0),o(n)}))},n.src="data:image/svg+xml,"+e})))(`<svg xmlns="http://www.w3.org/2000/svg" width="${c}" height="${d}" viewBox="0 0 ${c} ${d}"><foreignObject x="0" y="0" width="${c}" height="${d}"><div xmlns="http://www.w3.org/1999/xhtml" style="transform-origin:0 0;transform:scale(${s})">${p?`<style>${p}</style>`:""}<pre contenteditable="true" spellcheck="false" style="position:absolute;padding-right:${r}px;padding-left:${n}px;${u};${h}">${m.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/___BR___/g,"<br/>")}</pre></div></foreignObject></svg>`,{safariCacheKey:a})};const si=e=>{const t={...e};return T(t)},li=(e,t={})=>{const o=pt(e);let i,n;const r=t.width||t.rx,a=t.height||t.ry;if(r&&a)return ze(t);if(r||a){i=parseFloat(r||Number.MAX_SAFE_INTEGER),n=parseFloat(a||Number.MAX_SAFE_INTEGER);const e=Math.min(i,n);P(r)||P(a)?(i=e+"%",n=e*o+"%"):(i=e,n=e)}else{const e=10;i=e+"%",n=e*o+"%"}return{[(t.width?"width":t.rx?"rx":void 0)||"width"]:i,[(t.width?"height":t.rx?"ry":void 0)||"height"]:n}},ci=(e,t={})=>{return{width:void 0,height:void 0,...t,aspectRatio:1,backgroundImage:(o=zo(e),"data:image/svg+xml,"+o.replace("<","%3C").replace(">","%3E"))};var o},di=(e,t={})=>({backgroundColor:[0,0,0,0],...yi(t)?{}:{width:void 0,height:void 0,aspectRatio:void 0},...t,backgroundImage:P(e)?e:Do(e)?URL.createObjectURL(e):e}),ui=(e,t)=>{let o;if(P(e)||Do(e)){const i={...li(t),backgroundSize:"contain"};o=Po(e)?ci(e,i):di(e,i)}else if(e.src){const i=li(t,e.shape||e),n={...e.shape,...i};if(e.width&&e.height&&!Ro(n,"aspectRatio")){const e=Qi(i,"width",t),o=Qi(i,"height",t);n.aspectRatio=U(e,o)}n.backgroundSize||e.shape||e.width&&e.height||(n.backgroundSize="contain"),o=Po(e.src)?ci(e.src,n):di(e.src,n)}else e.shape&&(o=si(e.shape));return Ro(o,"backgroundImage")&&(Ro(o,"backgroundColor")||(o.backgroundColor=[0,0,0,0]),Ro(o,"disableStyle")||(o.disableStyle=["cornerRadius","backgroundColor","strokeColor","strokeWidth"])),t?Ki(o,t):o},hi=e=>ue(e.x1,e.y1),pi=e=>ue(e.x2,e.y2),mi=e=>Ro(e,"text"),gi=e=>mi(e)&&!(Pi(e)||Ro(e,"width")),$i=e=>mi(e)&&(Pi(e)||Ro(e,"width")),fi=e=>!mi(e)&&Ri(e),yi=e=>Ro(e,"rx"),bi=e=>Ro(e,"x1"),xi=e=>Ro(e,"points"),vi=e=>mi(e)&&e.isEditing,wi=e=>!Ro(e,"opacity")||e.opacity>0,Si=e=>e.isSelected,ki=e=>e.isEditing,Mi=e=>e._isDraft,Ci=e=>Ro(e,"width")&&Ro(e,"height"),Ti=e=>{const t=Ro(e,"right"),o=Ro(e,"bottom");return t||o},Pi=e=>(Ro(e,"x")||Ro(e,"left"))&&Ro(e,"right")||(Ro(e,"y")||Ro(e,"top"))&&Ro(e,"bottom"),Ri=e=>Ci(e)||Pi(e),Ii=e=>(e._isDraft=!0,e),Ai=(e,t)=>!0!==e.disableStyle&&(!Io(e.disableStyle)||!t||!e.disableStyle.includes(t)),Ei=e=>!0!==e.disableSelect,Li=e=>!0!==e.disableRemove,Fi=e=>!e.disableFlip&&(!Mi(e)&&!Ti(e)&&(e=>Ro(e,"backgroundImage")||Ro(e,"text"))(e)),zi=(e,t)=>!!mi(e)&&(!0!==e.disableInput&&(R(e.disableInput)?e.disableInput(null!=t?t:e.text):t||!0)),Di=(e,t)=>!0!==e.disableTextLayout&&(!Io(e.disableTextLayout)||!t||!e.disableTextLayout.includes(t)),Bi=e=>!0!==e.disableManipulate&&!Mi(e)&&!Ti(e),Oi=e=>Bi(e)&&!0!==e.disableMove,_i=e=>(delete e.left,delete e.right,delete e.top,delete e.bottom,e),Wi=e=>(delete e.rotation,e),Vi=e=>(e.strokeWidth=e.strokeWidth||1,e.strokeColor=e.strokeColor||[0,0,0],e),Ni=e=>(e.backgroundColor=e.backgroundColor?e.backgroundColor:e.strokeWidth||e.backgroundImage?void 0:[0,0,0],e),Hi=e=>(!1!==e.disableNewline&&(delete e.textAlign,e.text=e.text.replace(/\n/g," ")),_i(e)),ji=e=>(e.textAlign=e.textAlign||"left",e),Ui=e=>((e=>{P(e.id)||(e.id=L()),Ro(e,"rotation")||(e.rotation=0),Ro(e,"opacity")||(e.opacity=1),Ro(e,"disableErase")||(e.disableErase=!0)})(e),mi(e)?(e=>{e.fontSize=e.fontSize||"4%",e.fontFamily=e.fontFamily||"sans-serif",e.fontWeight=e.fontWeight||"normal",e.fontStyle=e.fontStyle||"normal",e.fontVariant=e.fontVariant||"normal",e.lineHeight=e.lineHeight||"120%",e.color=e.color||[0,0,0],gi(e)?Hi(e):ji(e)})(e):fi(e)?(e=>{e.cornerRadius=e.cornerRadius||0,e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],Ni(e)})(e):xi(e)?(e=>{Vi(e),Wi(e),Ro(e,"pathClose")||(e.disableResize=!0,Ro(e,"disableMove")||(e.disableMove=!0)),_i(e)})(e):bi(e)?(e=>{Vi(e),e.lineStart=e.lineStart||void 0,e.lineEnd=e.lineEnd||void 0,Wi(e),_i(e)})(e):yi(e)&&(e=>{e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],Ni(e)})(e),e),Zi=e=>mi(e)?"text":fi(e)?"rectangle":xi(e)?"path":bi(e)?"line":yi(e)?"ellipse":void 0,Xi=(e,t)=>parseFloat(e)/100*t,Gi=new RegExp(/^x|left|right|^width|rx|fontSize|cornerRadius|strokeWidth/,"i"),Yi=new RegExp(/^y|top|bottom|^height|ry/,"i"),qi=(e,t)=>{Object.entries(e).map((([o,i])=>{e[o]=((e,t,{width:o,height:i})=>{if(Array.isArray(t))return t.map((e=>(M(e)&&qi(e,{width:o,height:i}),e)));if("string"!=typeof t)return t;if(!t.endsWith("%"))return t;const n=parseFloat(t)/100;return Gi.test(e)?se(o*n,6):Yi.test(e)?se(i*n,6):t})(o,i,t)}));const o=e.lineHeight;P(o)&&(e.lineHeight=Math.round(e.fontSize*(parseFloat(o)/100)))},Ki=(e,t)=>(qi(e,t),rn(e,t),e),Ji=(e,t)=>{let o;return/^x|width|rx|fontSize|strokeWidth|cornerRadius/.test(e)?o=t.width:/^y|height|ry/.test(e)&&(o=t.height),o},Qi=(e,t,o)=>Array.isArray(e[t])?e[t].map((e=>Object.entries(e).reduce(((e,[t,i])=>(e[t]=P(i)?Xi(i,Ji(t,o)):i,e)),{}))):P(e[t])?Xi(e[t],Ji(t,o)):e[t],en=(e,t,o)=>t.reduce(((t,i)=>{const n=Qi(e,i,o);return t[i]=n,t}),{}),tn=(e,t,o)=>(Object.keys(t).forEach((i=>((e,t,o,i)=>{if(!P(e[t]))return e[t]=o,e;const n=Ji(t,i);return e[t]=void 0===n?o:Bo(o,n),e})(e,i,t[i],o))),e),on=(e,t)=>{const o=e.filter((e=>e.x<0||e.y<0||e.x1<0||e.y1<0)).reduce(((e,t)=>{const[o,i,n,r]=(e=>{const t=Qe(),o=e.strokeWidth||0;if(fi(e))t.x=e.x-.5*o,t.y=e.y-.5*o,t.width=e.width+o,t.height=e.height+o;else if(bi(e)){const{x1:i,y1:n,x2:r,y2:a}=e,s=Math.abs(Math.min(i,r)),l=Math.abs(Math.max(i,r)),c=Math.abs(Math.min(n,a)),d=Math.abs(Math.min(n,a));t.x=s+.5*o,t.y=l+.5*o,t.width=l-s+o,t.height=d-c+o}else yi(e)&&(t.x=e.x-e.rx+.5*o,t.y=e.y-e.ry+.5*o,t.width=2*e.rx+o,t.height=2*e.ry+o);return t&&Ro(e,"rotation")&&$t(t,e.rotation),vt(t)})(t);return e.top=Math.min(o,e.top),e.left=Math.min(r,e.left),e.bottom=Math.max(n,e.bottom),e.right=Math.max(i,e.right),e}),{top:0,right:0,bottom:0,left:0});return o.right>0&&(o.right-=t.width),o.bottom>0&&(o.bottom-=t.height),o},nn=(e,t,o)=>{const i=si(e);Ki(i,t);const n=o(i);return Array.isArray(n)?n:[n]},rn=(e,t)=>{if(Ro(e,"left")&&(e.x=e.left),Ro(e,"right")&&!P(e.right)){const o=t.width-e.right;Ro(e,"left")?(e.x=e.left,e.width=Math.max(0,o-e.left)):Ro(e,"width")&&(e.x=o-e.width)}if(Ro(e,"top")&&(e.y=e.top),Ro(e,"bottom")&&!P(e.bottom)){const o=t.height-e.bottom;Ro(e,"top")?(e.y=e.top,e.height=Math.max(0,o-e.top)):Ro(e,"height")&&(e.y=o-e.height)}return e},an=(e,t)=>(xi(e)&&e.points.filter((e=>To(e.x))).forEach((e=>{e.x*=t,e.y*=t})),bi(e)&&To(e.x1)&&(e.x1*=t,e.y1*=t,e.x2*=t,e.y2*=t),To(e.x)&&To(e.y)&&(e.x*=t,e.y*=t),To(e.width)&&To(e.height)&&(e.width*=t,e.height*=t),To(e.rx)&&To(e.ry)&&(e.rx*=t,e.ry*=t),(e=>To(e.strokeWidth)&&e.strokeWidth>0)(e)&&(e.strokeWidth*=t),mi(e)&&(e._scale=t,To(e.fontSize)&&(e.fontSize*=t),To(e.lineHeight)&&(e.lineHeight*=t),To(e.width)&&!To(e.height)&&(e.width*=t)),Ro(e,"cornerRadius")&&To(e.cornerRadius)&&(e.cornerRadius*=t),e),sn=e=>{if(fi(e))return ue(e.x+.5*e.width,e.y+.5*e.height);if(yi(e))return ue(e.x,e.y);if(e.text){if($i(e)){const t=e.height||Yo(e.text,e).height;return ue(e.x+.5*e.width,e.y+.5*t)}const t=Yo(e.text,e);return ue(e.x+.5*t.width,e.y+.5*t.height)}return xi(e)?Ae(e.points):bi(e)?Ae([hi(e),pi(e)]):void 0};var ln=e=>/canvas/i.test(e.nodeName),cn=(e,t)=>new Promise(((o,i)=>{let n=e,r=!1;const a=()=>{r||(r=!0,R(t)&&Promise.resolve().then((()=>t(We(n.naturalWidth,n.naturalHeight)))))};if(n.src||(n=new Image,P(e)&&new URL(e,location.href).origin!==location.origin&&(n.crossOrigin="anonymous"),n.src=P(e)?e:URL.createObjectURL(e)),n.complete)return a(),o(n);R(t)&&Ut(n).then(a).catch(i),n.onload=()=>{a(),o(n)},n.onerror=i}));const dn=new Map([]),un=(e,t={})=>new Promise(((o,i)=>{const{onMetadata:n=a,onLoad:r=o,onError:s=i,onComplete:l=a}=t;let c=dn.get(e);if(c||(c={loading:!1,complete:!1,error:!1,image:void 0,size:void 0,bus:Ho()},dn.set(e,c)),c.bus.sub("meta",n),c.bus.sub("load",r),c.bus.sub("error",s),c.bus.sub("complete",l),ln(e)){const t=e,o=t.cloneNode();c.complete=!0,c.image=o,c.size=_e(t)}if(c.complete)return c.bus.pub("meta",{size:c.size}),c.error?c.bus.pub("error",c.error):c.bus.pub("load",c.image),c.bus.pub("complete"),void(c.bus=Ho());c.loading||(c.loading=!0,cn(e,(e=>{c.size=e,c.bus.pub("meta",{size:e})})).then((e=>{c.image=e,c.bus.pub("load",e)})).catch((e=>{c.error=e,c.bus.pub("error",e)})).finally((()=>{c.complete=!0,c.loading=!1,c.bus.pub("complete"),c.bus=Ho()})))})),hn=(e,t,o,i)=>e.drawImage(t,o.x,o.x,o.width,o.height,i.x,i.y,i.width,i.height);var pn=async(e,t,o,i,n=hn)=>{e.save(),e.clip(),await n(e,t,o,i),e.restore()};const mn=(e,t,o,i,n)=>{const r=Je(e);if(i){const e=St(ot(i),se);return e.x*=o.width,e.width*=o.width,e.y*=o.height,e.height*=o.height,{srcRect:e,destRect:r}}const a=rt(0,0,o.width,o.height);if("contain"===t){const t=xt(e,pt(a));r.width=t.width,r.height=t.height,n?(r.x+=n.x,r.y+=n.y):(r.x+=t.x,r.y+=t.y)}else if("cover"===t){const e=bt(r,a.width/a.height);r.width=e.width,r.height=e.height,n?(r.x+=n.x,r.y+=n.y):(r.x+=e.x,r.y+=e.y)}else t?(r.width=t.width,r.height=t.height,n&&(r.x+=n.x,r.y+=n.y)):n&&(r.width=o.width,r.height=o.height,r.x+=n.x,r.y+=n.y);return{srcRect:a,destRect:r}},gn=(e,t)=>(t.cornerRadius>0?((e,t,o,i,n,r)=>{i<2*r&&(r=i/2),n<2*r&&(r=n/2),e.beginPath(),e.moveTo(t+r,o),e.arcTo(t+i,o,t+i,o+n,r),e.arcTo(t+i,o+n,t,o+n,r),e.arcTo(t,o+n,t,o,r),e.arcTo(t,o,t+i,o,r),e.closePath()})(e,t.x,t.y,t.width,t.height,t.cornerRadius):e.rect(t.x,t.y,t.width,t.height),e),$n=(e,t)=>(t.backgroundColor&&e.fill(),e),fn=(e,t)=>(t.strokeWidth&&e.stroke(),e);var yn=async(e,t,o={})=>{const{drawImage:i}=o;if(e.lineWidth=t.strokeWidth?t.strokeWidth:1,e.strokeStyle=t.strokeColor?Oo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Oo(t.backgroundColor):"none",e.globalAlpha=t.opacity,t.backgroundImage){let o;o=ln(t.backgroundImage)?t.backgroundImage:await un(t.backgroundImage),gn(e,t),$n(e,t);const{srcRect:n,destRect:r}=mn(t,t.backgroundSize,_e(o),t.backgroundCorners,t.backgroundPosition);return await pn(e,o,n,r,i),fn(e,t),[]}return gn(e,t),$n(e,t),fn(e,t),[]},bn=async(e,t,o={})=>new Promise((async(i,n)=>{const{drawImage:r}=o;if(e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Oo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Oo(t.backgroundColor):"none",e.globalAlpha=t.opacity,e.ellipse(t.x,t.y,t.rx,t.ry,0,0,2*Math.PI),t.backgroundColor&&e.fill(),t.backgroundImage){let o;try{o=await un(t.backgroundImage)}catch(e){n(e)}const a=rt(t.x-t.rx,t.y-t.ry,2*t.rx,2*t.ry),{srcRect:s,destRect:l}=mn(a,t.backgroundSize,_e(o),t.backgroundCorners,t.backgroundPosition);await pn(e,o,s,l,r),t.strokeWidth&&e.stroke(),i([])}else t.strokeWidth&&e.stroke(),i([])})),xn=async(e,t,o)=>{const i=t.width&&t.height?De(t):Yo(t.text,t),n={x:t.x,y:t.y,width:i.width,height:i.height};if(yn(e,{...t,...n,options:o}),!t.text.length)return[];const{willRequest:r}=o,a=await ai(t.text,{...t,...n,imageWidth:n.width,imageHeight:n.height,willRequest:r});return e.drawImage(a,t.x-jo,t.y,a.width,a.height),[]},vn=async(e,t)=>new Promise((async o=>{e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Oo(t.strokeColor):"none",e.globalAlpha=t.opacity;let i=hi(t),n=pi(t);e.moveTo(i.x,i.y),e.lineTo(n.x,n.y),t.strokeWidth&&e.stroke(),o([])})),wn=async(e,t)=>new Promise(((o,i)=>{e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?Oo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?Oo(t.backgroundColor):"none",e.globalAlpha=t.opacity;const{points:n}=t;t.pathClose&&e.beginPath(),e.moveTo(n[0].x,n[0].y);const r=n.length;for(let t=1;t<r;t++)e.lineTo(n[t].x,n[t].y);t.pathClose&&e.closePath(),t.strokeWidth&&e.stroke(),t.backgroundColor&&e.fill(),o([])}));const Sn=async(e,t,o)=>{const i=sn(t);let n;if($o(e,t.rotation,i),((e,t,o,i)=>{(t||o)&&(e.translate(i.x,i.y),e.scale(t?-1:1,o?-1:1),e.translate(-i.x,-i.y))})(e,t.flipX,t.flipY,i),fi(t)?n=yn:yi(t)?n=bn:bi(t)?n=vn:xi(t)?n=wn:mi(t)&&(n=xn),n){const i=await n(e,t,o);if(!i.length)return[];return[t,...await kn(e,i,o)]}return[]};var kn=async(e,t,o)=>{let i=[];for(const n of t)e.save(),e.beginPath(),i=[...i,...await Sn(e,n,o)],e.restore();return i},Mn=async(e,t={})=>{const{shapes:o=[],contextBounds:i=e,transform:n=a,drawImage:r,willRequest:s,canvasMemoryLimit:l,computeShape:c=Z,preprocessShape:d=Z}=t;if(!o.length)return e;const u=g("canvas");u.width=i.width,u.height=i.height;const h=u.getContext("2d",{willReadFrequently:!0});h.putImageData(e,i.x||0,i.y||0);const p=o.map(si).map(c).map(d).flat();n(h),await kn(h,p,{drawImage:r,canvasMemoryLimit:l,willRequest:s});const m=h.getImageData(0,0,u.width,u.height);return f(u),m},Cn=async(e,t={})=>{const{backgroundColor:o,backgroundImage:i}=t,n=!(!o||o&&0===o[3]);if(!i&&!n)return e;const r=g("canvas");r.width=e.width,r.height=e.height;const a=r.getContext("2d",{willReadFrequently:!0});if(a.putImageData(e,0,0),a.globalCompositeOperation="destination-over",n&&(a.fillStyle=Oo(o),a.fillRect(0,0,r.width,r.height)),i){let t;t=ln(i)?i:await un(i);const{srcRect:o,destRect:n}=mn({x:0,y:0,width:e.width,height:e.height},"cover",{width:t.width,height:t.height});a.drawImage(t,o.x,o.y,o.width,o.height,n.x,n.y,n.width,n.height)}const s=a.getImageData(0,0,r.width,r.height);return f(r),s},Tn=e=>e.length?e.reduce(((e,t)=>((e,t)=>{const o=new Array(20);return o[0]=e[0]*t[0]+e[1]*t[5]+e[2]*t[10]+e[3]*t[15],o[1]=e[0]*t[1]+e[1]*t[6]+e[2]*t[11]+e[3]*t[16],o[2]=e[0]*t[2]+e[1]*t[7]+e[2]*t[12]+e[3]*t[17],o[3]=e[0]*t[3]+e[1]*t[8]+e[2]*t[13]+e[3]*t[18],o[4]=e[0]*t[4]+e[1]*t[9]+e[2]*t[14]+e[3]*t[19]+e[4],o[5]=e[5]*t[0]+e[6]*t[5]+e[7]*t[10]+e[8]*t[15],o[6]=e[5]*t[1]+e[6]*t[6]+e[7]*t[11]+e[8]*t[16],o[7]=e[5]*t[2]+e[6]*t[7]+e[7]*t[12]+e[8]*t[17],o[8]=e[5]*t[3]+e[6]*t[8]+e[7]*t[13]+e[8]*t[18],o[9]=e[5]*t[4]+e[6]*t[9]+e[7]*t[14]+e[8]*t[19]+e[9],o[10]=e[10]*t[0]+e[11]*t[5]+e[12]*t[10]+e[13]*t[15],o[11]=e[10]*t[1]+e[11]*t[6]+e[12]*t[11]+e[13]*t[16],o[12]=e[10]*t[2]+e[11]*t[7]+e[12]*t[12]+e[13]*t[17],o[13]=e[10]*t[3]+e[11]*t[8]+e[12]*t[13]+e[13]*t[18],o[14]=e[10]*t[4]+e[11]*t[9]+e[12]*t[14]+e[13]*t[19]+e[14],o[15]=e[15]*t[0]+e[16]*t[5]+e[17]*t[10]+e[18]*t[15],o[16]=e[15]*t[1]+e[16]*t[6]+e[17]*t[11]+e[18]*t[16],o[17]=e[15]*t[2]+e[16]*t[7]+e[17]*t[12]+e[18]*t[17],o[18]=e[15]*t[3]+e[16]*t[8]+e[17]*t[13]+e[18]*t[18],o[19]=e[15]*t[4]+e[16]*t[9]+e[17]*t[14]+e[18]*t[19]+e[19],o})([...e],t)),e.shift()):[],Pn=(e,t)=>{const o=e.width*e.height,i=t.reduce(((e,t)=>(t.width>e.width&&t.height>e.height&&(e.width=t.width,e.height=t.height),e)),{width:0,height:0}),n=i.width*i.height;return((e,t=2)=>Math.round(e*t)/t)(Math.max(.5,.5+(1-n/o)/2),5)};function Rn(){}const In=e=>e;function An(e,t){for(const o in t)e[o]=t[o];return e}function En(e){return e()}function Ln(){return Object.create(null)}function Fn(e){e.forEach(En)}function zn(e){return"function"==typeof e}function Dn(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Bn(e,...t){if(null==e)return Rn;const o=e.subscribe(...t);return o.unsubscribe?()=>o.unsubscribe():o}function On(e){let t;return Bn(e,(e=>t=e))(),t}function _n(e,t,o){e.$$.on_destroy.push(Bn(t,o))}function Wn(e,t,o,i){if(e){const n=Vn(e,t,o,i);return e[0](n)}}function Vn(e,t,o,i){return e[1]&&i?An(o.ctx.slice(),e[1](i(t))):o.ctx}function Nn(e,t,o,i){if(e[2]&&i){const n=e[2](i(o));if(void 0===t.dirty)return n;if("object"==typeof n){const e=[],o=Math.max(t.dirty.length,n.length);for(let i=0;i<o;i+=1)e[i]=t.dirty[i]|n[i];return e}return t.dirty|n}return t.dirty}function Hn(e,t,o,i,n,r){if(n){const a=Vn(t,o,i,r);e.p(a,n)}}function jn(e){if(e.ctx.length>32){const t=[],o=e.ctx.length/32;for(let e=0;e<o;e++)t[e]=-1;return t}return-1}function Un(e){const t={};for(const o in e)"$"!==o[0]&&(t[o]=e[o]);return t}function Zn(e,t){const o={};t=new Set(t);for(const i in e)t.has(i)||"$"===i[0]||(o[i]=e[i]);return o}function Xn(e,t,o){return e.set(o),t}function Gn(e){return e&&zn(e.destroy)?e.destroy:Rn}const Yn="undefined"!=typeof window;let qn=Yn?()=>window.performance.now():()=>Date.now(),Kn=Yn?e=>requestAnimationFrame(e):Rn;const Jn=new Set;function Qn(e){Jn.forEach((t=>{t.c(e)||(Jn.delete(t),t.f())})),0!==Jn.size&&Kn(Qn)}function er(e){let t;return 0===Jn.size&&Kn(Qn),{promise:new Promise((o=>{Jn.add(t={c:e,f:o})})),abort(){Jn.delete(t)}}}function tr(e,t){e.appendChild(t)}function or(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function ir(e){const t=ar("style");return function(e,t){tr(e.head||e,t),t.sheet}(or(e),t),t.sheet}function nr(e,t,o){e.insertBefore(t,o||null)}function rr(e){e.parentNode.removeChild(e)}function ar(e){return document.createElement(e)}function sr(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function lr(e){return document.createTextNode(e)}function cr(){return lr(" ")}function dr(){return lr("")}function ur(e,t,o,i){return e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i)}function hr(e){return function(t){return t.preventDefault(),e.call(this,t)}}function pr(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function mr(e,t,o){null==o?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o)}function gr(e,t){const o=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)null==t[i]?e.removeAttribute(i):"style"===i?e.style.cssText=t[i]:"__value"===i?e.value=e[i]=t[i]:o[i]&&o[i].set?e[i]=t[i]:mr(e,i,t[i])}function $r(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function fr(e,t){e.value=null==t?"":t}function yr(e,t,{bubbles:o=!1,cancelable:i=!1}={}){const n=document.createEvent("CustomEvent");return n.initCustomEvent(e,o,i,t),n}class br{constructor(e=!1){this.is_svg=!1,this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,t,o=null){this.e||(this.is_svg?this.e=sr(t.nodeName):this.e=ar(t.nodeName),this.t=t,this.c(e)),this.i(o)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes)}i(e){for(let t=0;t<this.n.length;t+=1)nr(this.t,this.n[t],e)}p(e){this.d(),this.h(e),this.i(this.a)}d(){this.n.forEach(rr)}}function xr(e,t){return new e(t)}const vr=new Map;let wr,Sr=0;function kr(e,t,o,i,n,r,a,s=0){const l=16.666/i;let c="{\n";for(let e=0;e<=1;e+=l){const i=t+(o-t)*r(e);c+=100*e+`%{${a(i,1-i)}}\n`}const d=c+`100% {${a(o,1-o)}}\n}`,u=`__svelte_${function(e){let t=5381,o=e.length;for(;o--;)t=(t<<5)-t^e.charCodeAt(o);return t>>>0}(d)}_${s}`,h=or(e),{stylesheet:p,rules:m}=vr.get(h)||function(e,t){const o={stylesheet:ir(t),rules:{}};return vr.set(e,o),o}(h,e);m[u]||(m[u]=!0,p.insertRule(`@keyframes ${u} ${d}`,p.cssRules.length));const g=e.style.animation||"";return e.style.animation=`${g?g+", ":""}${u} ${i}ms linear ${n}ms 1 both`,Sr+=1,u}function Mr(e,t){const o=(e.style.animation||"").split(", "),i=o.filter(t?e=>e.indexOf(t)<0:e=>-1===e.indexOf("__svelte")),n=o.length-i.length;n&&(e.style.animation=i.join(", "),Sr-=n,Sr||Kn((()=>{Sr||(vr.forEach((e=>{const{ownerNode:t}=e.stylesheet;t&&rr(t)})),vr.clear())})))}function Cr(e){wr=e}function Tr(){if(!wr)throw new Error("Function called outside component initialization");return wr}function Pr(e){Tr().$$.on_mount.push(e)}function Rr(e){Tr().$$.after_update.push(e)}function Ir(e){Tr().$$.on_destroy.push(e)}function Ar(){const e=Tr();return(t,o,{cancelable:i=!1}={})=>{const n=e.$$.callbacks[t];if(n){const r=yr(t,o,{cancelable:i});return n.slice().forEach((t=>{t.call(e,r)})),!r.defaultPrevented}return!0}}function Er(e,t){return Tr().$$.context.set(e,t),t}function Lr(e){return Tr().$$.context.get(e)}function Fr(e,t){const o=e.$$.callbacks[t.type];o&&o.slice().forEach((e=>e.call(this,t)))}const zr=[],Dr=[],Br=[],Or=[],_r=Promise.resolve();let Wr=!1;function Vr(){Wr||(Wr=!0,_r.then(Gr))}function Nr(){return Vr(),_r}function Hr(e){Br.push(e)}function jr(e){Or.push(e)}const Ur=new Set;let Zr,Xr=0;function Gr(){const e=wr;do{for(;Xr<zr.length;){const e=zr[Xr];Xr++,Cr(e),Yr(e.$$)}for(Cr(null),zr.length=0,Xr=0;Dr.length;)Dr.pop()();for(let e=0;e<Br.length;e+=1){const t=Br[e];Ur.has(t)||(Ur.add(t),t())}Br.length=0}while(zr.length);for(;Or.length;)Or.pop()();Wr=!1,Ur.clear(),Cr(e)}function Yr(e){if(null!==e.fragment){e.update(),Fn(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Hr)}}function qr(e,t,o){e.dispatchEvent(yr(`${t?"intro":"outro"}${o}`))}const Kr=new Set;let Jr;function Qr(){Jr={r:0,c:[],p:Jr}}function ea(){Jr.r||Fn(Jr.c),Jr=Jr.p}function ta(e,t){e&&e.i&&(Kr.delete(e),e.i(t))}function oa(e,t,o,i){if(e&&e.o){if(Kr.has(e))return;Kr.add(e),Jr.c.push((()=>{Kr.delete(e),i&&(o&&e.d(1),i())})),e.o(t)}else i&&i()}const ia={duration:0};function na(e,t,o,i){let n=t(e,o),r=i?0:1,a=null,s=null,l=null;function c(){l&&Mr(e,l)}function d(e,t){const o=e.b-r;return t*=Math.abs(o),{a:r,b:e.b,d:o,duration:t,start:e.start,end:e.start+t,group:e.group}}function u(t){const{delay:o=0,duration:i=300,easing:u=In,tick:h=Rn,css:p}=n||ia,m={start:qn()+o,b:t};t||(m.group=Jr,Jr.r+=1),a||s?s=m:(p&&(c(),l=kr(e,r,t,i,o,u,p)),t&&h(0,1),a=d(m,i),Hr((()=>qr(e,t,"start"))),er((t=>{if(s&&t>s.start&&(a=d(s,i),s=null,qr(e,a.b,"start"),p&&(c(),l=kr(e,r,a.b,a.duration,0,u,n.css))),a)if(t>=a.end)h(r=a.b,1-r),qr(e,a.b,"end"),s||(a.b?c():--a.group.r||Fn(a.group.c)),a=null;else if(t>=a.start){const e=t-a.start;r=a.a+a.d*u(e/a.duration),h(r,1-r)}return!(!a&&!s)})))}return{run(e){zn(n)?(Zr||(Zr=Promise.resolve(),Zr.then((()=>{Zr=null}))),Zr).then((()=>{n=n(),u(e)})):u(e)},end(){c(),a=s=null}}}const ra="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function aa(e,t){e.d(1),t.delete(e.key)}function sa(e,t){oa(e,1,1,(()=>{t.delete(e.key)}))}function la(e,t,o,i,n,r,a,s,l,c,d,u){let h=e.length,p=r.length,m=h;const g={};for(;m--;)g[e[m].key]=m;const $=[],f=new Map,y=new Map;for(m=p;m--;){const e=u(n,r,m),s=o(e);let l=a.get(s);l?i&&l.p(e,t):(l=c(s,e),l.c()),f.set(s,$[m]=l),s in g&&y.set(s,Math.abs(m-g[s]))}const b=new Set,x=new Set;function v(e){ta(e,1),e.m(s,d),a.set(e.key,e),d=e.first,p--}for(;h&&p;){const t=$[p-1],o=e[h-1],i=t.key,n=o.key;t===o?(d=t.first,h--,p--):f.has(n)?!a.has(i)||b.has(i)?v(t):x.has(n)?h--:y.get(i)>y.get(n)?(x.add(i),v(t)):(b.add(n),h--):(l(o,a),h--)}for(;h--;){const t=e[h];f.has(t.key)||l(t,a)}for(;p;)v($[p-1]);return $}function ca(e,t){const o={},i={},n={$$scope:1};let r=e.length;for(;r--;){const a=e[r],s=t[r];if(s){for(const e in a)e in s||(i[e]=1);for(const e in s)n[e]||(o[e]=s[e],n[e]=1);e[r]=s}else for(const e in a)n[e]=1}for(const e in i)e in o||(o[e]=void 0);return o}function da(e){return"object"==typeof e&&null!==e?e:{}}function ua(e,t,o){const i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=o,o(e.$$.ctx[i]))}function ha(e){e&&e.c()}function pa(e,t,o,i){const{fragment:n,after_update:r}=e.$$;n&&n.m(t,o),i||Hr((()=>{const t=e.$$.on_mount.map(En).filter(zn);e.$$.on_destroy?e.$$.on_destroy.push(...t):Fn(t),e.$$.on_mount=[]})),r.forEach(Hr)}function ma(e,t){const o=e.$$;null!==o.fragment&&(Fn(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[])}function ga(e,t,o,i,n,r,a,s=[-1]){const l=wr;Cr(e);const c=e.$$={fragment:null,ctx:[],props:r,update:Rn,not_equal:n,bound:Ln(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Ln(),dirty:s,skip_bound:!1,root:t.target||l.$$.root};a&&a(c.root);let d=!1;if(c.ctx=o?o(e,t.props||{},((t,o,...i)=>{const r=i.length?i[0]:o;return c.ctx&&n(c.ctx[t],c.ctx[t]=r)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](r),d&&function(e,t){-1===e.$$.dirty[0]&&(zr.push(e),Vr(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),o})):[],c.update(),d=!0,Fn(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){const e=function(e){return Array.from(e.childNodes)}(t.target);c.fragment&&c.fragment.l(e),e.forEach(rr)}else c.fragment&&c.fragment.c();t.intro&&ta(e.$$.fragment),pa(e,t.target,t.anchor,t.customElement),Gr()}Cr(l)}class $a{$destroy(){ma(this,1),this.$destroy=Rn}$on(e,t){if(!zn(t))return Rn;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),()=>{const e=o.indexOf(t);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const fa=[];function ya(e,t){return{subscribe:ba(e,t).subscribe}}function ba(e,t=Rn){let o;const i=new Set;function n(t){if(Dn(e,t)&&(e=t,o)){const t=!fa.length;for(const t of i)t[1](),fa.push(t,e);if(t){for(let e=0;e<fa.length;e+=2)fa[e][0](fa[e+1]);fa.length=0}}}return{set:n,update:function(t){n(t(e))},subscribe:function(r,a=Rn){const s=[r,a];return i.add(s),1===i.size&&(o=t(n)||Rn),r(e),()=>{i.delete(s),0===i.size&&(o(),o=null)}}}}function xa(e,t,o){const i=!Array.isArray(e),n=i?[e]:e,r=t.length<2;return ya(o,(e=>{let o=!1;const a=[];let s=0,l=Rn;const c=()=>{if(s)return;l();const o=t(i?a[0]:a,e);r?e(o):l=zn(o)?o:Rn},d=n.map(((e,t)=>Bn(e,(e=>{a[t]=e,s&=~(1<<t),o&&c()}),(()=>{s|=1<<t}))));return o=!0,c(),function(){Fn(d),l()}}))}var va=e=>e.reduce(((e,t)=>Object.assign(e,t)),{});const wa=e=>({updateValue:e}),Sa=e=>({defaultValue:e}),ka=e=>({store:e}),Ma=e=>({store:(t,o)=>xa(...e(o))}),Ca=e=>({store:(t,o)=>{const[i,n,r=(()=>!1)]=e(o);let a,s=!0;return xa(i,((e,t)=>{n(e,(e=>{!s&&r(a,e)||(a=e,s=!1,t(e))}))}))}}),Ta=e=>({store:(t,o)=>{const[i,n={},r]=e(o);let a=[];const s={},l=e=>i(e,s),c=e=>{(a.length||e.length)&&(a=e,d())},d=()=>{const e=a.map(l);r&&e.sort(r),a=[...e],h(e)};Object.entries(n).map((([e,t])=>t.subscribe((t=>{s[e]=t,t&&d()}))));const{subscribe:u,set:h}=ba(t||[]);return{set:c,update:e=>c(e(a)),subscribe:u}}});var Pa=e=>{const t={},o={};return e.forEach((([e,...i])=>{const n=va(i),r=t[e]=((e,t,o)=>{const{store:i=(e=>ba(e)),defaultValue:n=a,updateValue:r}=o,s=i(n(),t,e),{subscribe:l,update:c=a}=s;let d;const u=e=>{let t=!0;d&&d(),d=l((o=>{if(t)return t=!1;e(o),d(),d=void 0}))},h=r?r(e):Z;return s.set=e=>c((t=>h(e,t,u))),s.defaultValue=n,s})(o,t,n),s={get:()=>On(r),set:r.set};Object.defineProperty(o,e,s)})),{stores:t,accessors:o}};var Ra=[["src",ka((()=>{let e;const{subscribe:t,set:o}=ba(),i=t=>{e!==t&&(e=t,o(e))};return{set:i,subscribe:t,update:t=>i(t(e))}}))],["imageReader"],["imageWriter"],["imageScrambler"],["images",Sa((()=>[]))],["shapePreprocessor"],["willRequestResource"],["willRequest"]],Ia=e=>e.charAt(0).toUpperCase()+e.slice(1),Aa=(e,t)=>{Object.keys(t).forEach((o=>{const i=R(t[o])?{value:t[o],writable:!1}:t[o];Object.defineProperty(e,o,i)}))};const Ea=(e,t)=>{let o,i,n,r,a,s,l,c,d,u;const h=t.length;for(o=0;o<h;o++)if(i=t[o],n=t[o+1>h-1?0:o+1],r=i.x-e.x,a=i.y-e.y,s=n.x-e.x,l=n.y-e.y,c=r-s,d=a-l,u=c*a-d*r,u<-1e-5)return!1;return!0},La=1e4;var Fa=(e,t)=>{const o=At(t),i=de();wt(e).forEach((e=>{we(e,i),Ea(e,t)||o.forEach((t=>{const o=Math.atan2(t.start.y-t.end.y,t.start.x-t.end.x),n=Math.sin(Math.PI-o)*La,r=Math.cos(Math.PI-o)*La,a=ue(e.x+n,e.y+r),s=Ye(Ge(t),La),l=Tt(Xe(e,a),s);l&&we(i,Se(me(l),e))}))}));const n=Je(e);we(n,i);return!!wt(n).every((e=>Ea(e,t)))&&(gt(e,n),!0)},za=(e,t)=>{const o=wt(e),i=Et(t,5),n=at(e),r=[];o.forEach((e=>{const t=((e,t)=>{if(0===t)return e;const o=ue(e.start.x-e.end.x,e.start.y-e.end.y),i=ye(o),n=Me(i,t);return e.end.x+=n.x,e.end.y+=n.y,e})(Xe(me(n),me(e)),1e6);let o=!1;i.map(Ge).forEach((e=>{const i=Tt(t,e);i&&!o&&(r.push(i),o=!0)}))}));const a=Re(r[0],r[2])<Re(r[1],r[3])?[r[0],r[2]]:[r[1],r[3]],s=ot(a);return s.width<e.width&&(gt(e,s),!0)},Da=(e,t,o={x:0,y:0})=>{const i=et(e),n=at(i),r=kt(i,o,n).map((e=>$e(e,t,n))),a=ot(r);return r.map((e=>Se(e,a)))},Ba=(e,t=0,o=pt(e))=>{let i,n;if(0!==t){const r=Math.atan2(1,o),a=Math.sign(t)*t,s=a%Math.PI,l=a%G;let c;c=s>Y&&s<G+Y?l>Y?a:G-l:l>Y?G-l:a;const d=Math.min(Math.abs(e.height/Math.sin(r+c)),Math.abs(e.width/Math.cos(r-c)));i=Math.cos(r)*d,n=i/o}else i=e.width,n=i/o,n>e.height&&(n=e.height,i=n*o);return We(i,n)},Oa=(e,t,o,i,n,r,a,s)=>{const l=ze(a),c=ze(s),d=se(Math.max(t.width/c.width,t.height/c.height)),u=se(Math.min(t.width/l.width,t.height/l.height)),h=Je(t);if(u<1||d>1){const o=at(e),i=at(t),n=u<1?u:d,r=(i.x+o.x)/2,a=(i.y+o.y)/2,s=h.width/n,l=h.height/n;mt(h,r-.5*s,a-.5*l,s,l)}return r?(((e,t,o=0,i=de(),n)=>{if(To(o)&&0!==o||i.x||i.y){const n=pt(e),r=Da(t,o,i),a=Ba(t,o,n);if(!(e.width<a.width&&e.height<a.height)){const t=.5*e.width-.5*a.width,o=.5*e.height-.5*a.height;e.width>a.width&&(e.width=a.width,e.x+=t),e.height>a.height&&(e.height=a.height,e.y+=o)}Fa(e,r),za(e,r)&&Fa(e,r)}else{const o=pt(e);e.width=Math.min(e.width,t.width),e.height=Math.min(e.height,t.height),e.x=Math.max(e.x,0),e.x+e.width>t.width&&(e.x-=e.x+e.width-t.width),e.y=Math.max(e.y,0),e.y+e.height>t.height&&(e.y-=e.y+e.height-t.height);const i=at(e),r=xt(e,o);r.width=Math.max(n.width,r.width),r.height=Math.max(n.height,r.height),r.x=i.x-.5*r.width,r.y=i.y-.5*r.height,gt(e,r)}})(h,o,i,n,l),{crop:h}):{crop:h}},_a=(e,t,o)=>{const i=et(e),n=at(i),r=$t(i,o,n),a=at(Mt(ot(r))),s=at(t),l=$e(s,-o,a),c=Se(l,a),d=ve(we(n,c),se);return rt(d.x-.5*t.width,d.y-.5*t.height,t.width,t.height)},Wa=(e,t,o)=>Math.max(t,Math.min(e,o));const Va=["cropLimitToImage","cropMinSize","cropMaxSize","cropAspectRatio","flipX","flipY","rotation","crop","colorMatrix","convolutionMatrix","gamma","vignette","redaction","annotation","decoration","frame","backgroundColor","backgroundImage","targetSize","metadata","trim","volume"],Na=e=>Io(e)?e.map(Na):ro(e)||Dt(e)?e:M(e)?{...e}:e,Ha=e=>e.map((e=>Object.entries(e).reduce(((e,[t,o])=>(t.startsWith("_")||(e[t]=o),e)),{})));var ja=(e,t)=>{if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(e[o]!==t[o])return!1;return!0};const Ua=(e,t,o)=>{const i=ve(at(e),(e=>se(e,8))),n=et(t),r=at(n),a=$t(n,o,r),s=ve(He(ot(a)),(e=>se(e,8))),l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return l<1&&c<1},Za=(e,t,o,i,n)=>{if(!n)return[-1/0,1/0];const r=Math.max(o.width/i.width,o.height/i.height),a=We(i.width*r,i.height*r),s=(l=a,Math.sqrt(l.width*l.width+l.height*l.height));var l;if(s<Math.min(e.width,e.height))return[-1/0,1/0];const c=t?e.height:e.width,d=t?e.width:e.height,u=Math.acos(a.height/s),h=u-Math.acos(d/s),p=Math.asin(c/s)-u;if(Number.isNaN(h)&&Number.isNaN(p))return[-1/0,1/0];const m=Number.isNaN(h)?p:Number.isNaN(p)?h:Math.min(h,p);return[-m,m]},Xa=(e,t)=>{const{context:o,props:i}=t;return e._isFormatted||((e=Ui(e))._isFormatted=!0,Object.assign(e,i)),e._isDraft||!Pi(e)||e._context&&ht(o,e._context)||(rn(e,o),e._context={...o}),e};var Ga=[["file"],["size"],["loadState"],["processState"],["aspectRatio",Ma((({size:e})=>[e,e=>e?pt(e):void 0]))],["perspectiveX",Sa((()=>0))],["perspectiveY",Sa((()=>0))],["perspective",Ma((({perspectiveX:e,perspectiveY:t})=>[[e,t],([e,t])=>({x:e,y:t})]))],["rotation",Sa((()=>0)),wa((e=>(t,o,i)=>{if(t===o)return t;const{loadState:n,size:r,rotationRange:a,cropMinSize:s,cropMaxSize:l,crop:c,perspective:d,cropLimitToImage:u,cropOrigin:h}=e;if(!c||!n||!n.beforeComplete)return t;const p=u&&((e,t,o)=>{const i=Ba(t,o,pt(e));return Ve(Ze(i,Math.round),Ze(ze(e),Math.round))})(c,r,o),m=u&&Ua(c,r,o),g=((e,t,o,i,n,r,a,s,l,c)=>{const d=ze(l),u=ze(c);a&&(u.width=Math.min(c.width,n.width),u.height=Math.min(c.height,n.height));let h=!1;const p=(t,o)=>{const l=_a(n,i,t),c=et(n),m=at(c),g=kt(c,r,m),$=Se(me(m),Ct(g)),f=$e(at(l),o,m),y=Se(me(m),f);g.forEach((e=>$e(e,o,m)));const b=ot(g),x=Ct(g),v=we(Se(Se(x,y),b),$),w=rt(v.x-.5*l.width,v.y-.5*l.height,l.width,l.height);if(s&&lt(w,s.width/w.width),a){const e=Da(n,o,r);za(w,e)}const S=se(Math.min(w.width/d.width,w.height/d.height),8),k=se(Math.max(w.width/u.width,w.height/u.height),8);return(S<1||k>1)&&se(Math.abs(o-t))===se(Math.PI/2)&&!h?(h=!0,p(e,e+Math.sign(o-t)*Math.PI)):{rotation:o,crop:St(w,(e=>se(e,8)))}},m=Math.sign(t)*Math.round(Math.abs(t)/G)*G,g=Wa(t,m+o[0],m+o[1]);return p(e,g)})(o,t,a,c,r,d,u,h,s,l);if(p&&m){const e=Ba(r,t,pt(g.crop));g.crop.x+=.5*g.crop.width,g.crop.y+=.5*g.crop.height,g.crop.x-=.5*e.width,g.crop.y-=.5*e.height,g.crop.width=e.width,g.crop.height=e.height}return i((()=>{e.crop=St(g.crop,(e=>se(e,8)))})),g.rotation}))],["flipX",Sa((()=>!1))],["flipY",Sa((()=>!1))],["flip",Ma((({flipX:e,flipY:t})=>[[e,t],([e,t])=>({x:e,y:t})]))],["isRotatedSideways",Ca((({rotation:e})=>[[e],([e],t)=>t(q(e)),(e,t)=>e!==t]))],["crop",wa((e=>(t,o=t)=>{const{loadState:i,size:n,cropMinSize:r,cropMaxSize:a,cropLimitToImage:s,cropAspectRatio:l,rotation:c,perspective:d}=e;if(!t&&!o||!i||!i.beforeComplete)return t;t||(t=et(Ba(n,c,l||pt(n))));const u=Oa(o,t,n,c,d,s,r,a),h=St(u.crop,(e=>se(e,8)));return ht(o,h)?o:h}))],["cropAspectRatio",wa((e=>(t,o)=>{const{loadState:i,crop:n,size:r,rotation:a,cropLimitToImage:s}=e,l=(e=>{if(e){if(/:/.test(e)){const[t,o]=e.split(":");return t/o}return parseFloat(e)}})(t);if(!l)return;if(!n||!i||!i.beforeComplete)return l;const c=o?Math.abs(t-o):1;if(Ua(n,r,a)&&s&&c>=.1){const o=((e,t)=>{const o=e.width,i=e.height;return q(t)&&(e.width=i,e.height=o),e})(ze(r),a);e.crop=St(xt(et(o),t),se)}else{const t={width:n.height*l,height:n.height},o=.5*(n.width-t.width),i=.5*(n.height-t.height);e.crop=St(rt(n.x+o,n.y+i,t.width,t.height),se)}return l}))],["cropOrigin"],["cropMinSize",Sa((()=>({width:1,height:1})))],["cropMaxSize",Sa((()=>({width:32768,height:32768})))],["cropLimitToImage",Sa((()=>!0)),wa((e=>(t,o,i)=>{const{crop:n}=e;return n?(!o&&t&&i((()=>e.crop=Je(e.crop))),t):t}))],["cropSize",Ca((({crop:e})=>[[e],([e],t)=>{e&&t(We(e.width,e.height))},(e,t)=>Ve(e,t)]))],["cropRectAspectRatio",Ma((({cropSize:e})=>[[e],([e],t)=>{e&&t(se(pt(e),5))}]))],["cropRange",Ca((({size:e,rotation:t,cropRectAspectRatio:o,cropMinSize:i,cropMaxSize:n,cropLimitToImage:r})=>[[e,t,o,i,n,r],([e,t,o,i,n,r],a)=>{if(!e)return;a(((e,t,o,i,n,r)=>{const a=ze(i),s=ze(n);return r?[a,Ze(Ba(e,t,o),Math.round)]:[a,s]})(e,t,o,i,n,r))},(e,t)=>ja(e,t)]))],["rotationRange",Ca((({size:e,isRotatedSideways:t,cropMinSize:o,cropSize:i,cropLimitToImage:n})=>[[e,t,o,i,n],([e,t,o,i,n],r)=>{if(!e||!i)return;r(Za(e,t,o,i,n))},(e,t)=>ja(e,t)]))],["backgroundColor",wa((()=>e=>((e=[0,0,0,0],t=1)=>4===e.length?e:[...e,t])(e)))],["backgroundImage"],["targetSize"],["colorMatrix"],["convolutionMatrix"],["gamma"],["noise"],["vignette"],["duration"],["trim"],["volume"],["redaction",Ta((({size:e})=>[Xa,{context:e}]))],["annotation",Ta((({size:e})=>[Xa,{context:e}]))],["decoration",Ta((({crop:e})=>[Xa,{context:e}]))],["frame",wa((()=>e=>{if(!e)return;const t={frameStyle:void 0,x:0,y:0,width:"100%",height:"100%",disableStyle:["backgroundColor","strokeColor","strokeWidth"]};return P(e)?t.frameStyle=e:Object.assign(t,e),t}))],["metadata"],["state",ka(((e,t,o)=>{const i=Va.map((e=>t[e]));let n=!1;const r=ba({}),{subscribe:a}=xa([...i,r],((e,t)=>{if(n)return;const o=Va.reduce(((t,o,i)=>(t[o]=Na(e[i]),t)),{});o.crop&&St(o.crop,Math.round),o.redaction=o.redaction&&Ha(o.redaction),o.annotation=o.annotation&&Ha(o.annotation),o.decoration=o.decoration&&Ha(o.decoration),t(o)})),s=e=>{e&&(n=!0,o.cropOrigin=void 0,Va.filter((t=>Ro(e,t))).forEach((t=>{const i=e[t];o[t]=null===i?void 0:Na(i)})),n=!1,r.set({}))};return{set:s,update:e=>s(e(null)),subscribe:a}}))]],Ya=async(e,t,o={},i)=>{const{ontaskstart:n,ontaskprogress:r,ontaskend:s,token:l}=i;let c=!1;const d={cancel:a};l.cancel=()=>{c=!0,d.cancel()};for(const[i,a]of t.entries()){if(c)return;const[t,l]=a;n(i,l);try{e=await t(e,{...o,taskCancelToken:d},(e=>r(i,l,e)))}catch(e){throw c=!0,e}s(i,l)}return e};const qa=["loadstart","loadabort","loaderror","loadprogress","load","processstart","processabort","processerror","processprogress","process"],Ka=["flip","cropOrigin","isRotatedSideways","perspective","perspectiveX","perspectiveY","cropRange"],Ja=["images"],Qa=Ga.map((([e])=>e)).filter((e=>!Ka.includes(e))),es=e=>"image"+Ia(e),ts=e=>Ro(e,"crop");var os=()=>{const{stores:e,accessors:t}=Pa(Ra),{sub:o,pub:i}=Ho(),n=()=>t.images?t.images[0]:{};let r={};const s={};Qa.forEach((e=>{Object.defineProperty(t,es(e),{get:()=>{const t=n();if(t)return t.accessors[e]},set:t=>{r[es(e)]=t,s[es(e)]=t;const o=n();o&&(o.accessors[e]=t)}})}));const l=()=>t.images&&t.images[0],c=e.src.subscribe((e=>{if(!e)return t.images=[];t.imageReader&&(t.images.length&&(r={}),u(e))})),d=e.imageReader.subscribe((e=>{e&&(t.images.length||t.src&&u(t.src))})),u=e=>{Promise.resolve().then((()=>p(e,r))).catch((()=>{}))};let h;const p=(e,o={})=>new Promise(((n,c)=>{let d=l();const u=!(!1===o.cropLimitToImage||!1===o.imageCropLimitToImage||!1===s.imageCropLmitedToImage),p=o.cropMinSize||o.imageCropMinSize||s.imageCropMinSize,m=u?p:d&&d.accessors.cropMinSize;d&&g(),d=(({minSize:e={width:1,height:1}}={})=>{const{stores:t,accessors:o}=Pa(Ga),{pub:i,sub:n}=Ho(),r=(e,t)=>{const n=()=>o[e]||{},r=t=>{o[e]={...n(),...t,timeStamp:Date.now()}},a=()=>n().error,s=e=>{a()||(r({error:e}),i(t+"error",{...n()}))};return{start(){i(t+"start")},onabort(){r({abort:!0}),i(t+"abort",{...n()})},ontaskstart(e,o){a()||(r({index:e,task:o,taskProgress:void 0,taskLengthComputable:void 0}),i(t+"taskstart",{...n()}))},ontaskprogress(e,o,s){a()||(r({index:e,task:o,taskProgress:s.loaded/s.total,taskLengthComputable:s.lengthComputable}),i(t+"taskprogress",{...n()}),i(t+"progress",{...n()}))},ontaskend(e,o){a()||(r({index:e,task:o}),i(t+"taskend",{...n()}))},ontaskerror(e){s(e)},error(e){s(e)},beforeComplete(e){a()||(r({beforeComplete:!0}),i("before"+t,e))},complete(e){a()||(r({complete:!0}),i(t,e))}}};return Aa(o,{read:(t,{reader:i},n={})=>{if(!i)return;Object.assign(o,{file:void 0,size:void 0,loadState:void 0});let s={cancel:a},l=!1;const c=r("loadState","load"),d={token:s,...c},u={src:t,size:void 0,dest:void 0,duration:void 0};return Promise.resolve().then((async()=>{try{if(c.start(),l)return c.onabort();const t=await Ya(u,i,n,d);if(l)return c.onabort();const{size:r,duration:a,dest:h}=t||{};if(!r||!r.width||!r.height)throw new oo("Image size missing","IMAGE_SIZE_MISSING",t);if(r.width<e.width||r.height<e.height)throw new oo("Image too small","IMAGE_TOO_SMALL",{...t,minWidth:e.width,minHeight:e.height});Object.assign(o,{file:h,size:r,duration:a}),c.beforeComplete(t),c.complete(t)}catch(e){c.error(e)}finally{s=void 0}})),()=>{l=!0,s&&s.cancel(),c.onabort()}},write:(e,t)=>{if(!o.loadState.complete)return;o.processState=void 0;const i=r("processState","process"),n={src:o.file,imageState:o.state,dest:void 0};if(R(e)&&(e=e(o.file,o.state)),!e)return i.start(),void i.complete(n);let s={cancel:a},l=!1;const c=t,d={token:s,...i};return Promise.resolve().then((async()=>{try{if(i.start(),l)return i.onabort();const t=await Ya(n,e,c,d);if(l)return i.onabort();i.complete(t)}catch(e){i.error(e)}finally{s=void 0}})),()=>{l=!0,s&&s.cancel()}},on:n}),{accessors:o,stores:t}})({minSize:m}),qa.map((e=>{return d.accessors.on(e,(t=e,e=>i(t,e)));var t}));const $=()=>{r={},f.forEach((e=>e()))},f=[];f.push(d.accessors.on("loaderror",(e=>{$(),c(e)}))),f.push(d.accessors.on("loadabort",(()=>{$(),c({name:"AbortError"})}))),f.push(d.accessors.on("load",(e=>{h=void 0,$(),n(e)}))),f.push(d.accessors.on("beforeload",(()=>((e,o)=>{if(ts(o))return void(t.imageState=o);if(!o.imageCrop){const t=e.accessors.size,i=o.imageRotation||0,n=je(ze(t),i),r=et(n);r.width=se(Math.abs(r.width),6),r.height=se(Math.abs(r.height),6);const a=o.imageCropAspectRatio||(o.imageCropLimitToImage?pt(t):pt(r));let s;o.imageCropLimitToImage?s=xt(r,a):(s=bt(r,a),s.x=(t.width-s.width)/2,s.y=(t.height-s.height)/2),o.imageCrop=s}const i=["imageCropLimitToImage","imageCrop","imageCropAspectRatio","imageRotation"];i.filter((e=>Ro(o,e))).forEach((e=>{t[e]=o[e],delete o[e]}));const n=Object.keys(o).filter((e=>!i.includes(e))).reduce(((e,t)=>(e[t]=o[t],e)),{});Object.assign(t,n)})(d,o)))),t.images=[d],o.imageReader&&(t.imageReader=o.imageReader),o.imageWriter&&(t.imageWriter=o.imageWriter),h=d.accessors.read(e,{reader:t.imageReader},{willRequest:t.willRequest})}));let m;const g=()=>{const e=l();e&&(h&&h(),e.accessors.loadState=void 0,t.images=[])};return Object.defineProperty(t,"stores",{get:()=>e}),Aa(t,{on:o,loadImage:p,abortLoadImage:()=>{h&&h(),t.images=[]},editImage:(e,o)=>new Promise(((i,n)=>{p(e,o).then((()=>{const{images:e}=t,o=e[0],r=()=>{a(),s()},a=o.accessors.on("processerror",(e=>{r(),n(e)})),s=o.accessors.on("process",(e=>{r(),i(e)}))})).catch(n)})),removeImage:g,processImage:(e,o)=>new Promise(((i,n)=>{try{const r=[],a=()=>{m=void 0,r.forEach((e=>e()))};(async()=>{if((e=>P(e)||Do(e)||zt(e))(e))try{await p(e,o)}catch(e){n(e)}else e&&(ts(e)?t.imageState=e:Object.assign(t,e));const s=l();if(!s)return n("no image");r.push(s.accessors.on("processerror",(e=>{a(),n(e)}))),r.push(s.accessors.on("processabort",(()=>{a(),n({name:"AbortError"})}))),r.push(s.accessors.on("process",(e=>{a(),i(e)}))),m=s.accessors.write(t.imageWriter,{shapePreprocessor:t.shapePreprocessor||Z,imageScrambler:t.imageScrambler,willRequest:t.willRequest,willRequestResource:t.willRequestResource})})()}catch(e){n(e)}})),abortProcessImage:()=>{const e=l();e&&(m&&m(),e.accessors.processState=void 0)},destroy:()=>{c&&c(),d&&d()}}),t};const is=(e,t)=>{const{processImage:o}=os();return o(e,t)};var ns=()=>{if(!jt())return 1/0;const e=/15_/.test(navigator.userAgent);return ho()?e?14745600:16777216:e?16777216:1/0},rs=(e,t)=>Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,o)=>(t[o]=e[o],t)),{}),as=e=>new Promise((t=>{if(e.duration===1/0)return e.ontimeupdate=()=>{e.ontimeupdate=void 0,t(e)},void(e.currentTime=Number.MAX_SAFE_INTEGER);t(e)}));const ss=({imageDataResizer:e,canvasMemoryLimit:t}={})=>async(o,i,n,r)=>{n.width=Math.max(n.width,1),n.height=Math.max(n.height,1),r.width=Math.max(r.width,1),r.height=Math.max(r.height,1);const{dest:a}=await is(i,{imageReader:Ds(),imageWriter:Os({format:"canvas",targetSize:{...r,upscale:!0},imageDataResizer:e,canvasMemoryLimit:t}),imageCrop:n});o.drawImage(a,r.x,r.y,r.width,r.height),f(a)},ls=(e,t=((...e)=>e),o)=>async(i,n,r)=>{r(Jt(0,!1));let a=!1;const s=await e(...t(i,n,(e=>{a=!0,r(e)})));return o&&o(i,s),a||r(Jt(1,!1)),i},cs=({willRequest:e,srcProp:t="src",destProp:o="dest"}={})=>[ls(so,((o,i,n)=>[o[t],n,{...i,willRequest:e}]),((e,t)=>e[o]=t)),"any-to-file"],ds=({srcProp:e="dest",destProp:t="dest"}={})=>[ls((async e=>{if(/octet-stream/.test(e.type)){console.warn("Pintura: Media has unknown mime type this can affect output quality",e);let t="image";const o=await Gt(e);/video/i.test(o.nodeName)&&(t="video");const i={type:t+"/unknown"};return Dt(e)?new File([e],e.name,{...i,lastModified:e.lastModified}):new Blob([e],i)}return e}),(t=>[t[e]]),((e,o)=>e[t]=o)),"any-to-file"],us=({srcProp:e="src",destProp:t="size"}={})=>[ls(qt,(t=>[t[e]]),((e,o)=>e[t]=o)),"read-image-size"],hs=async e=>{const t=await Gt(e);if(Yt(t))return await(e=>new Promise(((t,o)=>{const i=()=>{as(e).then((()=>{t(e.duration)}))};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=o})))(t)},ps=({srcProp:e="src",destProp:t="duration"}={})=>[ls(hs,(t=>[t[e]]),((e,o)=>e[t]=o)),"read-image-size"],ms=({srcSize:e="size",srcOrientation:t="orientation",destSize:o="size"}={})=>[ls(po,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"image-size-match-orientation"],gs=({srcProp:e="src",destProp:t="head"}={})=>[ls(((e,t)=>mo(e)?l(e,t):void 0),(t=>[t[e],[0,262144],onprogress]),((e,o)=>e[t]=o)),"read-image-head"],$s=({srcProp:e="head",destProp:t="orientation"}={})=>[ls(i,(t=>[t[e],274]),((e,o=1)=>e[t]=o)),"read-exif-orientation-tag"],fs=({srcProp:e="head"}={})=>[ls(i,(t=>[t[e],274,1])),"clear-exif-orientation-tag"],ys=({srcImageSize:e="size",srcCanvasSize:t="imageData",srcImageState:o="imageState",destImageSize:i="size",destScalar:n="scalar"}={})=>[ls(((e,t)=>[Math.min(t.width/e.width,t.height/e.height),De(t)]),(i=>[i[e],i[t],i[o]]),((e,[t,o])=>{e[n]=t,e[i]=o})),"calculate-canvas-scalar"],bs=({srcProp:e="src",destProp:t="imageData",canvasMemoryLimit:o}={})=>[ls(D,(t=>[t[e],o]),((e,o)=>e[t]=o)),"blob-to-image-data"],xs=({srcImageData:e="imageData",srcOrientation:t="orientation"}={})=>[ls(k,(o=>[o[e],o[t]]),((e,t)=>e.imageData=t)),"image-data-match-orientation"],vs=({srcImageData:e="imageData",srcImageState:t="imageState"}={})=>[ls(Cn,(o=>[o[e],{backgroundColor:o[t].backgroundColor,backgroundImage:o[t].backgroundImage}]),((e,t)=>e.imageData=t)),"image-data-fill"],ws=({srcImageData:e="imageData",srcImageState:t="imageState",destScalar:o="scalar"}={})=>[ls(fo,(i=>{const n=i[o];let{crop:r}=i[t];return r&&1!==n&&(r=lt(Je(r),n,de())),[i[e],{crop:r,rotation:i[t].rotation,flipX:i[t].flipX,flipY:i[t].flipY}]}),((e,t)=>e.imageData=t)),"image-data-crop"],Ss=({targetSize:e={width:void 0,height:void 0,fit:void 0,upscale:void 0},imageDataResizer:t,srcProp:o="imageData",srcImageState:i="imageState",destImageScaledSize:n="imageScaledSize"})=>[ls(xo,(n=>{const r=Math.min(e.width||Number.MAX_SAFE_INTEGER,n[i].targetSize&&n[i].targetSize.width||Number.MAX_SAFE_INTEGER),a=Math.min(e.height||Number.MAX_SAFE_INTEGER,n[i].targetSize&&n[i].targetSize.height||Number.MAX_SAFE_INTEGER);return[n[o],{width:r,height:a,fit:e.fit||"contain",upscale:(s=n[i],!!(s.targetSize&&s.targetSize.width||s.targetSize&&s.targetSize.height)||(e.upscale||!1))},t];var s}),((e,t)=>{Ve(e.imageData,t)||(e[n]=De(t)),e.imageData=t})),"image-data-resize"],ks=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData"}={})=>[ls(Co,(o=>{const{colorMatrix:i}=o[t],n=i&&Object.keys(i).map((e=>i[e])).filter(Boolean);return[o[e],{colorMatrix:n&&Tn(n),convolutionMatrix:o[t].convolutionMatrix,gamma:o[t].gamma,noise:o[t].noise,vignette:o[t].vignette}]}),((e,t)=>e[o]=t)),"image-data-filter"],Ms=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destScalar:i="scalar"}={})=>[ls((async(e,t,o,i,n)=>{if(!t)return e;let r;try{const n={dataSizeScalar:Pn(e,i)};o&&o[3]>0&&(n.backgroundColor=[...o]),r=await t(e,n)}catch(e){}const a=g("canvas");a.width=e.width,a.height=e.height;const s=a.getContext("2d",{willReadFrequently:!0});s.putImageData(e,0,0);const l=new Path2D;i.forEach((e=>{const t=rt(e.x,e.y,e.width,e.height);ut(t,n);const o=$t(Je(t),e.rotation),i=new Path2D;o.forEach(((e,t)=>{if(0===t)return i.moveTo(e.x,e.y);i.lineTo(e.x,e.y)})),l.addPath(i)})),s.clip(l,"nonzero"),s.imageSmoothingEnabled=!1,s.drawImage(r,0,0,a.width,a.height),f(r);const c=s.getImageData(0,0,a.width,a.height);return f(a),c}),((o,{imageScrambler:n})=>[o[e],n,o[t].backgroundColor,o[t].redaction,o[i]]),((e,t)=>e[o]=t)),"image-data-redact"],Cs=({srcImageData:e="imageData",srcSize:t="size",srcImageState:o="imageState",destImageData:i="imageData",destImageScaledSize:n="imageScaledSize",destScalar:r="scalar",imageDataResizer:a,canvasMemoryLimit:s}={})=>[ls(Mn,((i,{shapePreprocessor:l,willRequestResource:c,willRequest:d})=>{const{annotation:u}=i[o];if(!u.length)return[i[e]];const h=i[r],{crop:p}=i[o],m=i[t];let g=h;const $=i[n];$&&(g=Math.min($.width/p.width,$.height/p.height));const f={width:m.width/h,height:m.height/h};return[i[e],{shapes:u,computeShape:e=>(e=Ki(e,f),e=rs(e,["left","right","top","bottom"]),e=an(e,g)),transform:e=>{const a=i[t],{rotation:s=0,flipX:l,flipY:c,cropLimitToImage:d}=i[o],u=i[r],{crop:h=et(a)}=i[o],p=i[n],m=p?Math.min(p.width/h.width,p.height/h.height):1,g={width:a.width/u*m,height:a.height/u*m},$=Ft(g,s),f=$.width,y=$.height,b=.5*g.width-.5*f,x=.5*g.height-.5*y,v=He(g);e.translate(-b,-x),e.translate(-h.x*m,-h.y*m),e.translate(v.x,v.y),e.rotate(s),e.translate(-v.x,-v.y),e.scale(l?-1:1,c?-1:1),e.translate(l?-g.width:0,c?-g.height:0),d&&(e.rect(0,0,g.width,g.height),e.clip())},drawImage:ss({imageDataResizer:a,canvasMemoryLimit:s}),preprocessShape:e=>l(e,{isPreview:!1,...i[o]}),canvasMemoryLimit:s,willRequest:d||c}]}),((e,t)=>e[i]=t)),"image-data-annotate"],Ts=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:n,canvasMemoryLimit:r,destScalar:a="scalar"}={})=>[ls(Mn,((o,{shapePreprocessor:s,willRequestResource:l,willRequest:c})=>{const{decoration:d}=o[t];if((e=>{if(e&&e._y63ry6f)return;const[i]=["VW5saWNlbnNlZCBQaW50dXJhIGluc3RhbmNlIA"].map(window[[(!1+"")[1],(!0+"")[0],(1+{})[2],(1+{})[3]].join("")]),{width:n,height:r}=o[t].crop,a=r/15;d.push({x:.5*-a,y:.5*-a,width:1.5*n,height:1.25*r,text:Array(50).fill(i).join(""),fontWeight:900,lineHeight:a,fontSize:a,color:[1,1,1,.05]})})(window),!d.length)return[o[e]];let u=o[a];const{crop:h}=o[t],p=o[i];if(p){const e=Math.min(p.width/h.width,p.height/h.height);u=e}return[o[e],{shapes:d,drawImage:ss({imageDataResizer:n,canvasMemoryLimit:r}),computeShape:e=>(e=Ki(e,h),e=rs(e,["left","right","top","bottom"]),e=an(e,u)),preprocessShape:e=>s(e,{isPreview:!1,...o[t]}),canvasMemoryLimit:r,willRequest:c||l}]}),((e,t)=>e[o]=t)),"image-data-decorate"],Ps=({srcImageData:e="imageData",srcImageState:t="imageState",destImageData:o="imageData",destImageScaledSize:i="imageScaledSize",imageDataResizer:n,canvasMemoryLimit:r,destScalar:a="scalar"}={})=>[ls(Mn,((o,{shapePreprocessor:s,willRequestResource:l,willRequest:c})=>{const d=o[t].frame;if(!d)return[o[e]];const u=o[a];let{crop:h}=o[t];h&&1!==u&&(h=lt(Je(h),u,de()));const p={...h},m=on(nn(d,p,s),p);p.x=Math.abs(m.left),p.y=Math.abs(m.top),p.width+=Math.abs(m.left)+Math.abs(m.right),p.height+=Math.abs(m.top)+Math.abs(m.bottom);const g=o[i],$=g?Math.min(g.width/h.width,g.height/h.height):1;return ut(p,$),p.x=Math.floor(p.x),p.y=Math.floor(p.y),p.width=Math.floor(p.width),p.height=Math.floor(p.height),[o[e],{shapes:[d],contextBounds:p,computeShape:t=>Ki(t,o[e]),transform:e=>{e.translate(p.x,p.y)},drawImage:ss({imageDataResizer:n,canvasMemoryLimit:r}),preprocessShape:e=>s(e,{isPreview:!1,...o[t]}),canvasMemoryLimit:r,willRequest:c||l}]}),((e,t)=>e[o]=t)),"image-data-frame"],Rs=({mimeType:e,quality:t,srcImageData:o="imageData",srcFile:i="src",destBlob:n="blob"}={})=>[ls(O,(n=>[n[o],e||H(n[i].name)||n[i].type,t]),((e,t)=>e[n]=t)),"image-data-to-blob"],Is=({srcImageData:e="imageData",srcOrientation:t="orientation",destCanvas:o="dest"}={})=>[ls(S,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"image-data-to-canvas"],As=async(e,t)=>{if(!mo(e)||!t)return e;const i=new DataView(t),n=o(i);if(!n||!n.exif)return e;const r=["exif","mpf","xmp"].reduce(((e,t)=>n[t]?Math.max(e,n[t].offset+n[t].size):e),0);return((e,t,o=[0,e.size])=>t?new Blob([t,e.slice(...o)],{type:e.type}):e)(e,t.slice(0,r+2),[20])},Es=(e="blob",t="head",o="blob")=>[ls(As,(o=>[o[e],o[t]]),((e,t)=>e[o]=t)),"blob-write-image-head"],Ls=({renameFile:e,srcBlob:t="blob",srcFile:o="src",destFile:i="dest",defaultFilename:n}={})=>[ls(j,(i=>[i[t],e?e(i[o]):i[o].name||`${n}.${W(i[t].type)}`]),((e,t)=>e[i]=t)),"blob-to-file"],Fs=({url:e="./",dataset:t=(e=>[["dest",e.dest,e.dest.name],["imageState",e.imageState]]),destStore:o="store",credentials:i,headers:n={}})=>[ls((async(t,o)=>await((e,t,o)=>new Promise(((i,n)=>{const{token:r={},beforeSend:s=a,onprogress:l=a}=o;r.cancel=()=>c.abort();const c=new XMLHttpRequest;c.upload.onprogress=l,c.onload=()=>c.status>=200&&c.status<300?i(c):n(c),c.onerror=()=>n(c),c.ontimeout=()=>n(c),c.open("POST",encodeURI(e)),s(c),c.send(t instanceof FormData?t:t.reduce(((e,t)=>(e.append(...t.map(go)),e)),new FormData))})))(e,t,{onprogress:o,beforeSend:e=>io(e,{headers:n,credentials:i})})),((e,o,i)=>[t(e),i]),((e,t)=>e[o]=t)),"store"],zs=e=>[ls((t=>e&&e.length?(Object.keys(t).forEach((o=>{e.includes(o)||delete t[o]})),t):t)),"prop-filter"],Ds=(e={})=>{const{orientImage:t=!0,outputProps:o=["src","dest","size","duration"],preprocessImageFile:i,request:n={}}=e;return[cs({willRequest:()=>n}),ds(),i&&[ls(i,((e,t,o)=>[e.dest,t,o]),((e,t)=>e.dest=t)),"preprocess-image-file"],us({srcProp:"dest"}),ps({srcProp:"dest"}),t&&gs({srcProp:"dest"}),t&&$s(),t&&ms(),zs(o)].filter(Boolean)},Bs=e=>e&&(P(e)?Fs({url:e}):R(e)?[e,"store"]:Fs(e)),Os=(e={})=>(t,o,i={})=>{if(!Xt(t))return;const{canvasMemoryLimit:n=ns(),orientImage:r=!0,copyImageHead:a=!0,mimeType:s,quality:l,renameFile:c,targetSize:d,imageDataResizer:u,store:h,format:p="file",outputProps:m=["src","dest","imageState","store"],preprocessImageSource:g,preprocessImageState:$,postprocessImageData:f,postprocessImageBlob:y}={...e,...i};return[g&&[ls(g,((e,t,o)=>[e.src,t,o,e.imageState]),((e,t)=>e.src=t)),"preprocess-image-source"],(r||a)&&gs(),r&&$s(),us(),$&&[ls($,((e,t,o,i)=>[e.imageState,t,o,{size:e.size,orientation:e.orientation}]),((e,t)=>e.imageState=t)),"preprocess-image-state"],bs({canvasMemoryLimit:n}),r&&ms(),r&&xs(),ys(),Ms(),ws(),Ss({imageDataResizer:u,targetSize:d}),ks(),vs(),Cs({imageDataResizer:u,canvasMemoryLimit:n}),Ts({imageDataResizer:u,canvasMemoryLimit:n}),Ps({imageDataResizer:u,canvasMemoryLimit:n}),f&&[ls(f,((e,t,o)=>[e.imageData,t,o]),((e,t)=>e.imageData=t)),"postprocess-image-data"],"file"===p?Rs({mimeType:s,quality:l}):"canvas"===p?Is():[e=>(e.dest=e.imageData,e)],"file"===p&&r&&fs(),"file"===p&&a&&Es(),y&&[ls(y,(({blob:e,imageData:t,src:o},i,n)=>[{blob:e,imageData:t,src:o},i,n]),((e,t)=>e.blob=t)),"postprocess-image-file"],"file"===p&&Ls({defaultFilename:"image",renameFile:c}),"file"===p?Bs(h):R(h)&&[h,"store"],zs(m)].filter(Boolean)};var _s=(e,t,o,i,n,r,a,s,l,c,d)=>{if(!(e&&t&&o&&i&&s))return;s*=r;const u=Mt(Je(t)),h=at(u),p=at(e),m=et(o),g=at(m),$=_a(o,i,l),f=at($),y=Se(me(g),f),b=Se(me(p),h);y.x+=b.x,y.y+=b.y;const x=ge(me(y));x.x+=b.x,x.y+=b.y;const v=at(st(st(Je(n),a),e)),w=Se(v,p);return we(y,w),{origin:x,translation:y,rotation:{x:d?Math.PI:0,y:c?Math.PI:0,z:l},scale:s}};let Ws=null;var Vs=()=>{if(null===Ws)if("WebGL2RenderingContext"in window){let e;try{e=g("canvas"),Ws=!!e.getContext("webgl2")}catch(e){Ws=!1}e&&f(e),e=void 0}else Ws=!1;return Ws},Ns=e=>0==(e&e-1),Hs=(e,t={},o="",i="")=>Object.keys(t).filter((e=>!M(t[e]))).reduce(((e,n)=>e.replace(new RegExp(o+n+i),t[n])),e);const js={head:"#version 300 es\n\nin vec4 aPosition;uniform mat4 uMatrix;",text:"\nin vec2 aTexCoord;out vec2 vTexCoord;",matrix:"\ngl_Position=uMatrix*vec4(aPosition.x,aPosition.y,0,1);"},Us={head:"#version 300 es\nprecision highp float;\n\nout vec4 fragColor;",mask:"\nuniform float uMaskFeather[8];uniform float uMaskBounds[4];uniform float uMaskOpacity;float mask(float x,float y,float bounds[4],float opacity){return 1.0-(1.0-(smoothstep(bounds[3],bounds[3]+1.0,x)*(1.0-smoothstep(bounds[1]-1.0,bounds[1],x))*(1.0-step(bounds[0],y))*step(bounds[2],y)))*(1.0-opacity);}",init:"\nfloat a=1.0;vec4 fillColor=uColor;vec4 textureColor=texture(uTexture,vTexCoord);textureColor*=(1.0-step(1.0,vTexCoord.y))*step(0.0,vTexCoord.y)*(1.0-step(1.0,vTexCoord.x))*step(0.0,vTexCoord.x);",colorize:"\nif(uTextureColor.a!=0.0&&textureColor.a>0.0){vec3 colorFlattened=textureColor.rgb/textureColor.a;if(colorFlattened.r>=.9999&&colorFlattened.g==0.0&&colorFlattened.b>=.9999){textureColor.rgb=uTextureColor.rgb*textureColor.a;}textureColor*=uTextureColor.a;}",maskapply:"\nfloat m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);",maskfeatherapply:"\nfloat leftFeatherOpacity=step(uMaskFeather[1],gl_FragCoord.x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],gl_FragCoord.x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],gl_FragCoord.x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],gl_FragCoord.x));a*=leftFeatherOpacity*rightFeatherOpacity;",edgeaa:"\nvec2 scaledPoint=vec2(vRectCoord.x*uSize.x,vRectCoord.y*uSize.y);a*=smoothstep(0.0,1.0,uSize.x-scaledPoint.x);a*=smoothstep(0.0,1.0,uSize.y-scaledPoint.y);a*=smoothstep(0.0,1.0,scaledPoint.x);a*=smoothstep(0.0,1.0,scaledPoint.y);",cornerradius:"\nvec2 s=(uSize-2.0)*.5;vec2 r=(vRectCoord*uSize);vec2 p=r-(uSize*.5);float cornerRadius=uCornerRadius[0];bool left=r.x<s.x;bool top=r.y<s.x;if(!left&&top){cornerRadius=uCornerRadius[1];}if(!left&&!top){cornerRadius=uCornerRadius[3];}if(left&&!top){cornerRadius=uCornerRadius[2];}a*=1.0-clamp(length(max(abs(p)-(s-cornerRadius),0.0))-cornerRadius,0.0,1.0);",fragcolor:"\nif(m<=0.0)discard;fillColor.a*=a;fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);textureColor*=uTextureOpacity;textureColor.a*=a;textureColor.rgb*=m*a;textureColor.rgb+=(1.0-m)*(uCanvasColor.rgb*textureColor.a);fragColor=textureColor+(fillColor*(1.0-textureColor.a));"},Zs=(e,t,o)=>{const i=e.createShader(o),n=((e,t,o)=>(t=Hs(t,o===e.VERTEX_SHADER?js:Us,"##").trim(),Vs()?t:(t=(t=t.replace(/#version.+/gm,"").trim()).replace(/^\/\/\#/gm,"#"),o===e.VERTEX_SHADER&&(t=t.replace(/in /gm,"attribute ").replace(/out /g,"varying ")),o===e.FRAGMENT_SHADER&&(t=t.replace(/in /gm,"varying ").replace(/out.*?;/gm,"").replace(/texture\(/g,"texture2D(").replace(/fragColor/g,"gl_FragColor")),""+t)))(e,t,o);return e.shaderSource(i,n),e.compileShader(i),e.getShaderParameter(i,e.COMPILE_STATUS)||console.error(e.getShaderInfoLog(i)),i},Xs=(e,t,o,i,n)=>{const r=Zs(e,t,e.VERTEX_SHADER),a=Zs(e,o,e.FRAGMENT_SHADER),s=e.createProgram();e.attachShader(s,r),e.attachShader(s,a),e.linkProgram(s);const l={};return i.forEach((t=>{l[t]=e.getAttribLocation(s,t)})),n.forEach((t=>{l[t]=e.getUniformLocation(s,t)})),{program:s,locations:l,destroy(){e.detachShader(s,r),e.detachShader(s,a),e.deleteShader(r),e.deleteShader(a),e.deleteProgram(s)}}},Gs=e=>"VIDEO"!==e.nodeName&&(!!Vs()||Ns(e.width)&&Ns(e.height)),Ys=(e,t,o,i)=>(e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),((e,t,o)=>{e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,Gs(t)?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o.filter),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),Gs(t)&&e.generateMipmap(e.TEXTURE_2D)})(e,o,i),e.bindTexture(e.TEXTURE_2D,null),t),qs=(e,t=1)=>e?[e[0],e[1],e[2],To(e[3])?t*e[3]:t]:[0,0,0,0],Ks=()=>{const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},Js=(e,t,o,i,n,r,a)=>{const s=1/(t-o),l=1/(i-n),c=1/(r-a);e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+o)*s,e[13]=(n+i)*l,e[14]=(a+r)*c,e[15]=1},Qs=(e,t,o,i)=>{e[12]=e[0]*t+e[4]*o+e[8]*i+e[12],e[13]=e[1]*t+e[5]*o+e[9]*i+e[13],e[14]=e[2]*t+e[6]*o+e[10]*i+e[14],e[15]=e[3]*t+e[7]*o+e[11]*i+e[15]},el=(e,t)=>{e[0]*=t,e[1]*=t,e[2]*=t,e[3]*=t,e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t,e[8]*=t,e[9]*=t,e[10]*=t,e[11]*=t},tl=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),n=e[4],r=e[5],a=e[6],s=e[7],l=e[8],c=e[9],d=e[10],u=e[11];e[4]=n*i+l*o,e[5]=r*i+c*o,e[6]=a*i+d*o,e[7]=s*i+u*o,e[8]=l*i-n*o,e[9]=c*i-r*o,e[10]=d*i-a*o,e[11]=u*i-s*o},ol=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),n=e[0],r=e[1],a=e[2],s=e[3],l=e[8],c=e[9],d=e[10],u=e[11];e[0]=n*i-l*o,e[1]=r*i-c*o,e[2]=a*i-d*o,e[3]=s*i-u*o,e[8]=n*o+l*i,e[9]=r*o+c*i,e[10]=a*o+d*i,e[11]=s*o+u*i},il=(e,t)=>{const o=Math.sin(t),i=Math.cos(t),n=e[0],r=e[1],a=e[2],s=e[3],l=e[4],c=e[5],d=e[6],u=e[7];e[0]=n*i+l*o,e[1]=r*i+c*o,e[2]=a*i+d*o,e[3]=s*i+u*o,e[4]=l*i-n*o,e[5]=c*i-r*o,e[6]=d*i-a*o,e[7]=u*i-s*o};var nl=e=>e*Math.PI/180,rl=(e,t)=>Vs()?e.getContext("webgl2",t):e.getContext("webgl",t)||e.getContext("experimental-webgl",t);const al=(e,t)=>{const o=e.length;return t>=o?e[t%o]:t<0?e[t%o+o]:e[t]},sl=(e,t,o,i)=>{const n=ue(o.x-t.x,o.y-t.y),r=ue(i.x-o.x,i.y-o.y),a=ue(t.x-i.x,t.y-i.y),s=ue(e.x-t.x,e.y-t.y),l=ue(e.x-o.x,e.y-o.y),c=ue(e.x-i.x,e.y-i.y),d=Te(n,s),u=Te(r,l),h=Te(a,c);return d<=0&&u<=0&&h<=0},ll=e=>{if(e.length<3)return[];if((e=>{const t=e.length;for(let o=0;o<t;o++){const t=Xe(e[o],al(e,o+1));if(Rt(t,e,{ignoreIdenticalLines:!0,breakOnIntersection:!0}))return!0}return!1})(e))return[];(e=>{let t,o,i,n,r,a=0;const s=e.length;for(t=0;t<s;t++)o=e[t],i=e[(t+1)%s],n=i.x-o.x,r=(i.y+o.y)/2,a+=n*r;return a})(e)<0&&e.reverse();const t=e.length,o=[...Array(t).keys()],i=[];let n,r,a,s,l,c,d,u,h,p,m,g,$=128;for(;o.length>3;){if($<=0)return[];for($--,n=0;n<o.length;n++)if(a=o[n],s=al(o,n-1),l=al(o,n+1),c=e[a],d=e[s],u=e[l],h=ue(d.x-c.x,d.y-c.y),p=ue(u.x-c.x,u.y-c.y),!(Te(h,p)<0)){for(m=!0,r=0;r<t;r++)if(r!==a&&r!==s&&r!==l&&(g=e[r],sl(g,d,c,u))){m=!1;break}if(m){i.push([d,c,u]),o.splice(n,1);break}}}return i.push([e[o[0]],e[o[1]],e[o[2]]]),i},cl=(e,t,o,i,n)=>{const r=ye(ue(i.x-o.x,i.y-o.y)),a=ye(ue(n.x-i.x,n.y-i.y)),s=ye(ue(r.x+a.x,r.y+a.y)),l=ue(-s.y,s.x),c=ue(-r.y,r.x),d=Math.min(1/Ce(l,c),5);e[t]=i.x,e[t+1]=i.y,e[t+2]=l.x*d,e[t+3]=l.y*d,e[t+4]=-1,e[t+5]=i.x,e[t+6]=i.y,e[t+7]=l.x*d,e[t+8]=l.y*d,e[t+9]=1},dl=e=>{const t=new Float32Array(8);return t[0]=e[3].x,t[1]=e[3].y,t[2]=e[0].x,t[3]=e[0].y,t[4]=e[2].x,t[5]=e[2].y,t[6]=e[1].x,t[7]=e[1].y,t},ul=(e,t=0,o,i)=>{const n=wt(e),r=e.x+.5*e.width,a=e.y+.5*e.height;return(o||i)&&Ee(n,o,i,r,a),0!==t&&Le(n,t,r,a),n},hl=(e,t,o,i,n)=>{const r=Math.min(20,Math.max(4,Math.round(i/2)));let a=0,s=0,l=0,c=0,d=0;for(;d<r;d++)a=d/r,s=n*G+a*G,l=i*Math.cos(s),c=i*Math.sin(s),e.push(ue(t+l,o+c))};let pl=null;var ml=()=>{if(null!==pl)return pl;let e=g("canvas");const t=rl(e);return pl=t?t.getParameter(t.MAX_TEXTURE_SIZE):void 0,f(e),e=void 0,pl};let gl=null;var $l=()=>(null===gl&&(gl=b(/Firefox/)),gl);const fl=new Float32Array([0,1,0,0,1,1,1,0]),yl=new Float32Array([1,0,0,0,1,1,0,1]),bl=u()&&$l(),xl=[0,0,0,0,1,0,0,0,0],vl=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],wl=[0,0,0,0],Sl=[0,0,0,0],kl=(e,t,o,i,n)=>{if(!o||!i)return fl;const r=i.x/o.width,a=i.y/o.height;let s=e/o.width/n,l=t/o.height/n;s-=r,l-=a;return new Float32Array([-r,l,-r,-a,s,l,s,-a])};var Ml=(e,t={})=>{const{alpha:o=!1}=t,i={width:0,height:0},n={width:0,height:0},r=ml()||1024;let a,s,l;const c=Ks(),d=Ks();let u,h,p,m,g,$,y,b,x,v=0,w=0,S=0,k=1;const M=new Map([]),C=()=>{R.stencilOp(R.KEEP,R.KEEP,R.KEEP),R.stencilFunc(R.ALWAYS,1,255),R.stencilMask(255)},T=nl(30),P=Math.tan(T/2),R=rl(e,{alpha:o,antialias:!1,premultipliedAlpha:!0,stencil:!0});if(!R)return;R.getExtension("OES_standard_derivatives"),R.disable(R.DEPTH_TEST),R.enable(R.STENCIL_TEST),R.enable(R.BLEND),R.blendFunc(R.ONE,R.ONE_MINUS_SRC_ALPHA),R.pixelStorei(R.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!(!o&&$l())),C();const I=R.createTexture();R.bindTexture(R.TEXTURE_2D,I),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,1,1,0,R.RGBA,R.UNSIGNED_BYTE,new Uint8Array(wl)),M.set(0,I);const A=R.createTexture();M.set(2,A);const E=R.createFramebuffer(),L=R.createTexture();M.set(1,L);const F=R.createFramebuffer(),z=Xs(R,"\n##head\n##text\nvoid main(){vTexCoord=aTexCoord;gl_Position=uMatrix*aPosition;}","\n##head\nin vec2 vTexCoord;uniform sampler2D uTexture;uniform sampler2D uTextureOverlay;uniform sampler2D uTextureBlend;uniform vec2 uTextureSize;uniform float uOpacity;uniform int uAntialias;uniform vec4 uOverlayColor;uniform mat4 uColorMatrix;uniform vec4 uColorOffset;uniform float uClarityKernel[9];uniform float uClarityKernelWeight;uniform float uColorGamma;uniform float uColorVignette;uniform float uMaskClip;uniform float uMaskOpacity;uniform float uMaskBounds[4];uniform float uMaskCornerRadius[4];uniform float uMaskFeather[8];vec4 applyGamma(vec4 c,float g){c.r=pow(c.r,g);c.g=pow(c.g,g);c.b=pow(c.b,g);return c;}vec4 applyColorMatrix(vec4 c,mat4 m,vec4 o){return(c*m)+(o*c.a);}vec4 applyConvolutionMatrix(vec4 c,float k0,float k1,float k2,float k3,float k4,float k5,float k6,float k7,float k8,float w){vec2 pixel=vec2(1)/uTextureSize;vec4 colorSum=texture(uTexture,vTexCoord-pixel)*k0+texture(uTexture,vTexCoord+pixel*vec2(0.0,-1.0))*k1+texture(uTexture,vTexCoord+pixel*vec2(1.0,-1.0))*k2+texture(uTexture,vTexCoord+pixel*vec2(-1.0,0.0))*k3+texture(uTexture,vTexCoord)*k4+texture(uTexture,vTexCoord+pixel*vec2(1.0,0.0))*k5+texture(uTexture,vTexCoord+pixel*vec2(-1.0,1.0))*k6+texture(uTexture,vTexCoord+pixel*vec2(0.0,1.0))*k7+texture(uTexture,vTexCoord+pixel)*k8;vec4 color=vec4(clamp((colorSum/w),0.0,1.0).rgb,c.a);return color;}vec4 applyVignette(vec4 c,vec2 pos,vec2 center,float v){float d=distance(pos,center)/length(center);float f=1.0-(d*abs(v));if(v>0.0){c.rgb*=f;}else if(v<0.0){c.rgb+=(1.0-f)*(1.0-c.rgb);}return c;}vec4 blendPremultipliedAlpha(vec4 back,vec4 front){return front+(back*(1.0-front.a));}void main(){float x=gl_FragCoord.x;float y=gl_FragCoord.y;float a=1.0;float maskTop=uMaskBounds[0];float maskRight=uMaskBounds[1];float maskBottom=uMaskBounds[2];float maskLeft=uMaskBounds[3];float leftFeatherOpacity=step(uMaskFeather[1],x)*uMaskFeather[0]+((1.0-uMaskFeather[0])*smoothstep(uMaskFeather[1],uMaskFeather[3],x));float rightFeatherOpacity=(1.0-step(uMaskFeather[7],x))*uMaskFeather[4]+((1.0-uMaskFeather[4])*smoothstep(uMaskFeather[7],uMaskFeather[5],x));a*=leftFeatherOpacity*rightFeatherOpacity;float overlayColorAlpha=(smoothstep(maskLeft,maskLeft+1.0,x)*(1.0-smoothstep(maskRight-1.0,maskRight,x))*(1.0-step(maskTop,y))*step(maskBottom,y));if(uOverlayColor.a==0.0){a*=overlayColorAlpha;}vec2 offset=vec2(maskLeft,maskBottom);vec2 size=vec2(maskRight-maskLeft,maskTop-maskBottom)*.5;vec2 center=offset.xy+size.xy;int pixelX=int(step(center.x,x));int pixelY=int(step(y,center.y));float cornerRadius=0.0;if(pixelX==0&&pixelY==0)cornerRadius=uMaskCornerRadius[0];if(pixelX==1&&pixelY==0)cornerRadius=uMaskCornerRadius[1];if(pixelX==0&&pixelY==1)cornerRadius=uMaskCornerRadius[2];if(pixelX==1&&pixelY==1)cornerRadius=uMaskCornerRadius[3];float cornerOffset=sign(cornerRadius)*length(max(abs(gl_FragCoord.xy-size-offset)-size+cornerRadius,0.0))-cornerRadius;float cornerOpacity=1.0-smoothstep(0.0,1.0,cornerOffset);a*=cornerOpacity;if(uAntialias==1){vec2 scaledPoint=vec2(vTexCoord.x*uTextureSize.x,vTexCoord.y*uTextureSize.y);a*=smoothstep(0.0,1.0,uTextureSize.x-scaledPoint.x);a*=smoothstep(0.0,1.0,uTextureSize.y-scaledPoint.y);a*=smoothstep(0.0,1.0,scaledPoint.x);a*=smoothstep(0.0,1.0,scaledPoint.y);}vec4 color=texture(uTexture,vTexCoord);if(uClarityKernelWeight!=-1.0){color=applyConvolutionMatrix(color,uClarityKernel[0],uClarityKernel[1],uClarityKernel[2],uClarityKernel[3],uClarityKernel[4],uClarityKernel[5],uClarityKernel[6],uClarityKernel[7],uClarityKernel[8],uClarityKernelWeight);}color=blendPremultipliedAlpha(color,texture(uTextureBlend,vTexCoord));color=applyGamma(color,uColorGamma);color=applyColorMatrix(color,uColorMatrix,uColorOffset);color*=a;if(uColorVignette!=0.0){vec2 pos=gl_FragCoord.xy-offset;color=applyVignette(color,pos,center-offset,uColorVignette);}color=blendPremultipliedAlpha(color,texture(uTextureOverlay,vTexCoord));if(overlayColorAlpha<=0.0){color*=1.0-uOverlayColor.a;}color*=uOpacity;fragColor=color;}",["aPosition","aTexCoord"],["uMatrix","uTexture","uTextureBlend","uTextureOverlay","uTextureSize","uColorGamma","uColorVignette","uColorOffset","uColorMatrix","uClarityKernel","uClarityKernelWeight","uOpacity","uMaskOpacity","uMaskBounds","uMaskCornerRadius","uMaskFeather","uOverlayColor","uAntialias"]),D=R.createBuffer(),B=R.createBuffer();R.bindBuffer(R.ARRAY_BUFFER,B),R.bufferData(R.ARRAY_BUFFER,fl,R.STATIC_DRAW);const O=R.createBuffer();R.bindBuffer(R.ARRAY_BUFFER,O),R.bufferData(R.ARRAY_BUFFER,yl,R.STATIC_DRAW);const _=Xs(R,"#version 300 es\n\nin vec4 aPosition;in vec2 aNormal;in float aMiter;out vec2 vNormal;out float vMiter;out float vWidth;uniform float uWidth;uniform float uSharpness;uniform mat4 uMatrix;void main(){vMiter=aMiter;vNormal=aNormal;vWidth=(uWidth*.5)+uSharpness;gl_Position=uMatrix*vec4(aPosition.x+(aNormal.x*vWidth*aMiter),aPosition.y+(aNormal.y*vWidth*aMiter),0,1);}","\n##head\n##mask\nin vec2 vNormal;in float vMiter;in float vWidth;uniform float uWidth;uniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;float m=mask(gl_FragCoord.x,gl_FragCoord.y,uMaskBounds,uMaskOpacity);if(m<=0.0)discard;fillColor.a*=clamp(smoothstep(vWidth-.5,vWidth-1.0,abs(vMiter)*vWidth),0.0,1.0);fillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}",["aPosition","aNormal","aMiter"],["uColor","uCanvasColor","uMatrix","uWidth","uSharpness","uMaskBounds","uMaskOpacity"]),W=R.createBuffer(),V=(e,t,o,i=!1)=>{const{program:n,locations:r}=_;R.useProgram(n),R.enableVertexAttribArray(r.aPosition),R.enableVertexAttribArray(r.aNormal),R.enableVertexAttribArray(r.aMiter);const a=((e,t)=>{let o,i,n,r=0;const a=e.length,s=new Float32Array(10*(t?a+1:a)),l=e[0],c=e[a-1];for(r=0;r<a;r++)o=e[r-1],i=e[r],n=e[r+1],o||(o=t?c:ue(i.x+(i.x-n.x),i.y+(i.y-n.y))),n||(n=t?l:ue(i.x+(i.x-o.x),i.y+(i.y-o.y))),cl(s,10*r,o,i,n);return t&&cl(s,10*a,c,l,e[1]),s})(e,i),s=5*Float32Array.BYTES_PER_ELEMENT,c=2*Float32Array.BYTES_PER_ELEMENT,d=4*Float32Array.BYTES_PER_ELEMENT;R.uniform1f(r.uWidth,t),R.uniform1f(r.uSharpness,l),R.uniform4fv(r.uColor,o),R.uniformMatrix4fv(r.uMatrix,!1,u),R.uniform4f(r.uCanvasColor,v,w,S,k),R.uniform1fv(r.uMaskBounds,y),R.uniform1f(r.uMaskOpacity,$),R.bindBuffer(R.ARRAY_BUFFER,W),R.bufferData(R.ARRAY_BUFFER,a,R.STATIC_DRAW),R.vertexAttribPointer(r.aPosition,2,R.FLOAT,!1,s,0),R.vertexAttribPointer(r.aNormal,2,R.FLOAT,!1,s,c),R.vertexAttribPointer(r.aMiter,1,R.FLOAT,!1,s,d),R.drawArrays(R.TRIANGLE_STRIP,0,a.length/5),R.disableVertexAttribArray(r.aPosition),R.disableVertexAttribArray(r.aNormal),R.disableVertexAttribArray(r.aMiter)},N=Xs(R,"\n##head\nvoid main(){\n##matrix\n}","\n##head\n##mask\nuniform vec4 uColor;uniform vec4 uCanvasColor;void main(){vec4 fillColor=uColor;\n##maskapply\nfillColor.rgb*=fillColor.a;fillColor.rgb*=m;fillColor.rgb+=(1.0-m)*(uCanvasColor.rgb*fillColor.a);fragColor=fillColor;}",["aPosition"],["uColor","uCanvasColor","uMatrix","uMaskBounds","uMaskOpacity"]),H=R.createBuffer(),j=Xs(R,"\n##head\n##text\nin vec2 aRectCoord;out vec2 vRectCoord;void main(){vTexCoord=aTexCoord;vRectCoord=aRectCoord;\n##matrix\n}","\n##head\n##mask\nin vec2 vTexCoord;in vec2 vRectCoord;uniform sampler2D uTexture;uniform vec4 uTextureColor;uniform float uTextureOpacity;uniform vec4 uColor;uniform float uCornerRadius[4];uniform vec2 uSize;uniform vec2 uPosition;uniform vec4 uCanvasColor;uniform int uInverted;void main(){\n##init\n##colorize\n##edgeaa\n##cornerradius\n##maskfeatherapply\nif(uInverted==1)a=1.0-a;\n##maskapply\n##fragcolor\n}",["aPosition","aTexCoord","aRectCoord"],["uTexture","uColor","uMatrix","uCanvasColor","uTextureColor","uTextureOpacity","uPosition","uSize","uMaskBounds","uMaskOpacity","uMaskFeather","uCornerRadius","uInverted"]),Z=R.createBuffer(),X=R.createBuffer(),G=R.createBuffer(),Y=Xs(R,"\n##head\n##text\nout vec2 vTexCoordDouble;void main(){vTexCoordDouble=vec2(aTexCoord.x*2.0-1.0,aTexCoord.y*2.0-1.0);vTexCoord=aTexCoord;\n##matrix\n}","\n##head\n##mask\nin vec2 vTexCoord;in vec2 vTexCoordDouble;uniform sampler2D uTexture;uniform float uTextureOpacity;uniform vec2 uRadius;uniform vec4 uColor;uniform int uInverted;uniform vec4 uCanvasColor;void main(){\n##init\nfloat ar=uRadius.x/uRadius.y;vec2 rAA=vec2(uRadius.x-1.0,uRadius.y-(1.0/ar));vec2 scaledPointSq=vec2((vTexCoordDouble.x*uRadius.x)*(vTexCoordDouble.x*uRadius.x),(vTexCoordDouble.y*uRadius.y)*(vTexCoordDouble.y*uRadius.y));float p=(scaledPointSq.x/(uRadius.x*uRadius.x))+(scaledPointSq.y/(uRadius.y*uRadius.y));float pAA=(scaledPointSq.x/(rAA.x*rAA.x))+(scaledPointSq.y/(rAA.y*rAA.y));a=smoothstep(1.0,p/pAA,p);if(uInverted==1)a=1.0-a;\n##maskapply\n##fragcolor\n}",["aPosition","aTexCoord"],["uTexture","uTextureOpacity","uColor","uCanvasColor","uMatrix","uRadius","uInverted","uMaskBounds","uMaskOpacity"]),q=R.createBuffer(),K=R.createBuffer(),J=new Map,Q={2:{width:0,height:0},1:{width:0,height:0}},ee=(e,t,o,n=1)=>{const a=Math.min(Math.min(4096,r)/o.width,Math.min(4096,r)/o.height,n),l=Math.floor(a*o.width),c=Math.floor(a*o.height);Ve(o,Q[e])?R.bindFramebuffer(R.FRAMEBUFFER,t):(R.bindTexture(R.TEXTURE_2D,M.get(e)),R.texImage2D(R.TEXTURE_2D,0,R.RGBA,l,c,0,R.RGBA,R.UNSIGNED_BYTE,null),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_MIN_FILTER,R.LINEAR),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_S,R.CLAMP_TO_EDGE),R.texParameteri(R.TEXTURE_2D,R.TEXTURE_WRAP_T,R.CLAMP_TO_EDGE),R.bindFramebuffer(R.FRAMEBUFFER,t),R.framebufferTexture2D(R.FRAMEBUFFER,R.COLOR_ATTACHMENT0,R.TEXTURE_2D,M.get(e),0),Q[e]=o);const h=o.width*s,p=o.height*s;var m,g;Js(d,0,h,p,0,-1,1),Qs(d,0,p,0),g=1,(m=d)[0]*=g,m[1]*=g,m[2]*=g,m[3]*=g,((e,t)=>{e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t})(d,-1),u=d,R.viewport(0,0,l,c),R.colorMask(!0,!0,!0,!0),R.clearColor(0,0,0,0),R.clear(R.COLOR_BUFFER_BIT),x=[1,0,1,0,1,Math.max(i.width,o.width),1,Math.max(i.width,o.width)]},te=(e,t=!1)=>{const{src:o}=J.get(e);o instanceof HTMLCanvasElement&&(t||o.dataset.retain||f(o)),J.delete(e),R.deleteTexture(e)},oe=e=>J.get(e).isRotatedVideo;return{drawPath:(e,t=0,o=!1,i=!1,n,r,a,l,c)=>{if(e.length<2)return;const d=e.map((e=>({x:e.x*s,y:e.y*s}))),h=n*s;if(h>0&&V(d,h,qs(r,c),a),d.length<3||!l||0===l[3]||!a)return;const p=ll(d),m=new Float32Array(6*p.length);p.forEach((([e,t,o],i)=>{const n=6*i;m[n+0]=e.x,m[n+1]=e.y,m[n+2]=t.x,m[n+3]=t.y,m[n+4]=o.x,m[n+5]=o.y})),((e,t)=>{const{program:o,locations:i}=N;R.useProgram(o),R.enableVertexAttribArray(i.aPosition),R.uniform4fv(i.uColor,t),R.uniformMatrix4fv(i.uMatrix,!1,u),R.uniform1fv(i.uMaskBounds,y),R.uniform1f(i.uMaskOpacity,$),R.uniform4f(i.uCanvasColor,v,w,S,k),R.bindBuffer(R.ARRAY_BUFFER,H),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(i.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLES,0,e.length/2),R.disableVertexAttribArray(i.aPosition)})(m,qs(l,c))},drawRect:(e,t=0,o=!1,i=!1,n,r,a,l,c,d,h,p,m,g,f,b)=>{const M=ut(Je(e),s),C=n.map((t=>((e,t)=>Math.floor(Wa(e,0,Math.min(.5*(t.width-1),.5*(t.height-1)))))(t||0,e))).map((e=>e*s));if(r||a){const e=Je(M);e.x-=.5,e.y-=.5,e.width+=1,e.height+=1;const n=ul(e,t,o,i),h=dl(n);let p;f&&(p=qs(f),0===p[3]&&(p[3]=.001)),((e,t,o,i,n,r=I,a=1,l=wl,c=fl,d=x,h)=>{const{program:p,locations:m}=j;R.useProgram(p),R.enableVertexAttribArray(m.aPosition),R.enableVertexAttribArray(m.aTexCoord),R.enableVertexAttribArray(m.aRectCoord),R.uniform4fv(m.uColor,n),R.uniform2fv(m.uSize,[t,o]),R.uniform2fv(m.uPosition,[e[2],e[3]]),R.uniform1i(m.uInverted,h?1:0),R.uniform1fv(m.uCornerRadius,i),R.uniform4f(m.uCanvasColor,v,w,S,k),R.uniform1fv(m.uMaskFeather,d.map(((e,t)=>t%2==0?e:e*s))),R.uniform1fv(m.uMaskBounds,y),R.uniform1f(m.uMaskOpacity,$),R.uniformMatrix4fv(m.uMatrix,!1,u),R.uniform1i(m.uTexture,4),R.uniform4fv(m.uTextureColor,l),R.uniform1f(m.uTextureOpacity,a),R.activeTexture(R.TEXTURE0+4),R.bindTexture(R.TEXTURE_2D,r),R.bindBuffer(R.ARRAY_BUFFER,X),R.bufferData(R.ARRAY_BUFFER,c,R.STATIC_DRAW),R.vertexAttribPointer(m.aTexCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,G),R.bufferData(R.ARRAY_BUFFER,fl,R.STATIC_DRAW),R.vertexAttribPointer(m.aRectCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,Z),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(m.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLE_STRIP,0,e.length/2),R.disableVertexAttribArray(m.aPosition),R.disableVertexAttribArray(m.aTexCoord),R.disableVertexAttribArray(m.aRectCoord)})(h,e.width,e.height,C,qs(r,m),a,m,p,d?new Float32Array(d):kl(e.width,e.height,l,c,s),g,b)}h&&(h=Math.min(h,M.width,M.height),V(((e,t,o,i,n,r,a,s)=>{const l=[];if(r.every((e=>0===e)))l.push(ue(e,t),ue(e+o,t),ue(e+o,t+i),ue(e,t+i));else{const[n,a,s,c]=r,d=e,u=e+o,h=t,p=t+i;l.push(ue(d+n,h)),hl(l,u-a,h+a,a,-1),l.push(ue(u,h+a)),hl(l,u-c,p-c,c,0),l.push(ue(u-c,p)),hl(l,d+s,p-s,s,1),l.push(ue(d,p-s)),hl(l,d+n,h+n,n,2)}return(a||s)&&Ee(l,a,s,e+.5*o,t+.5*i),n&&Le(l,n,e+.5*o,t+.5*i),l})(M.x,M.y,M.width,M.height,t,C,o,i),h*s,qs(p,m),!0))},drawEllipse:(e,t,o,i,n,r,a,l,c,d,h,p,m,g,f)=>{const b=ut(rt(e.x-t,e.y-o,2*t,2*o),s);if(a||l){const e=Je(b);e.x-=.5,e.y-=.5,e.width+=1,e.height+=1;const t=ul(e,i,n,r);((e,t,o,i,n=I,r=fl,a=1,s=!1)=>{const{program:l,locations:c}=Y;R.useProgram(l),R.enableVertexAttribArray(c.aPosition),R.enableVertexAttribArray(c.aTexCoord),R.uniformMatrix4fv(c.uMatrix,!1,u),R.uniform2fv(c.uRadius,[.5*t,.5*o]),R.uniform1i(c.uInverted,s?1:0),R.uniform4fv(c.uColor,i),R.uniform4f(c.uCanvasColor,v,w,S,k),R.uniform1fv(c.uMaskBounds,y),R.uniform1f(c.uMaskOpacity,$),R.uniform1i(c.uTexture,4),R.uniform1f(c.uTextureOpacity,a),R.activeTexture(R.TEXTURE0+4),R.bindTexture(R.TEXTURE_2D,n),R.bindBuffer(R.ARRAY_BUFFER,K),R.bufferData(R.ARRAY_BUFFER,r,R.STATIC_DRAW),R.vertexAttribPointer(c.aTexCoord,2,R.FLOAT,!1,0,0),R.bindBuffer(R.ARRAY_BUFFER,q),R.bufferData(R.ARRAY_BUFFER,e,R.STATIC_DRAW),R.vertexAttribPointer(c.aPosition,2,R.FLOAT,!1,0,0),R.drawArrays(R.TRIANGLE_STRIP,0,e.length/2),R.disableVertexAttribArray(c.aPosition),R.disableVertexAttribArray(c.aTexCoord)})(dl(t),e.width,e.height,qs(a,g),l,h?new Float32Array(h):kl(e.width,e.height,c,d,s),g,f)}p&&V(((e,t,o,i,n,r,a)=>{const s=.5*Math.abs(o),l=.5*Math.abs(i),c=Math.abs(o)+Math.abs(i),d=Math.max(20,Math.round(c/6));return Lt(ue(e+s,t+l),s,l,n,r,a,d)})(b.x,b.y,b.width,b.height,i,n,r),p*s,qs(m,g),!0)},drawImage:(e,t,o,n,r,l,c,d,u,h,p=vl,m=1,g,f=1,x=0,v=b,w=Sl,S=wl,k=!1,C=!1,I=!0)=>{const A=t.width*s,E=t.height*s,L=-.5*A,F=.5*E,_=.5*A,W=-.5*E,V=new Float32Array([L,W,0,L,F,0,_,W,0,_,F,0]);R.bindBuffer(R.ARRAY_BUFFER,D),R.bufferData(R.ARRAY_BUFFER,V,R.STATIC_DRAW);const N=t.height/2/P*(i.height/t.height)*-1;r*=s,l*=s,o*=s,n*=s;const{program:H,locations:j}=z,U=Ks();((e,t,o,i,n)=>{const r=1/Math.tan(t/2),a=1/(i-n);e[0]=r/o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(n+i)*a,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*n*i*a,e[15]=0})(U,T,a,1,2*-N),Qs(U,r,-l,N),Qs(U,o,-n,0),il(U,-u),el(U,h),Qs(U,-o,n,0),ol(U,d),tl(U,c),R.useProgram(H),R.enableVertexAttribArray(j.aPosition),R.enableVertexAttribArray(j.aTexCoord),R.uniform1i(j.uTexture,3),R.uniform2f(j.uTextureSize,t.width,t.height),R.activeTexture(R.TEXTURE0+3),R.bindTexture(R.TEXTURE_2D,e);const Z=C?1:0,X=M.get(Z);R.uniform1i(j.uTextureBlend,Z),R.activeTexture(R.TEXTURE0+Z),R.bindTexture(R.TEXTURE_2D,X);const G=k?2:0,Y=M.get(G);R.uniform1i(j.uTextureOverlay,G),R.activeTexture(R.TEXTURE0+G),R.bindTexture(R.TEXTURE_2D,Y),R.bindBuffer(R.ARRAY_BUFFER,D),R.vertexAttribPointer(j.aPosition,3,R.FLOAT,!1,0,0);const q=bl&&oe(e);let K;R.bindBuffer(R.ARRAY_BUFFER,q?O:B),R.vertexAttribPointer(j.aTexCoord,2,R.FLOAT,!1,0,0),R.uniformMatrix4fv(j.uMatrix,!1,U),R.uniform4fv(j.uOverlayColor,S),!g||ja(g,xl)?(g=xl,K=-1):(K=g.reduce(((e,t)=>e+t),0),K=K<=0?1:K),R.uniform1fv(j.uClarityKernel,g),R.uniform1f(j.uClarityKernelWeight,K),R.uniform1f(j.uColorGamma,1/f),R.uniform1f(j.uColorVignette,x),R.uniform1i(j.uAntialias,I?1:0),R.uniform4f(j.uColorOffset,p[4],p[9],p[14],p[19]),R.uniformMatrix4fv(j.uColorMatrix,!1,[p[0],p[1],p[2],p[3],p[5],p[6],p[7],p[8],p[10],p[11],p[12],p[13],p[15],p[16],p[17],p[18]]),R.uniform1f(j.uOpacity,m),R.uniform1f(j.uMaskOpacity,$),R.uniform1fv(j.uMaskBounds,y),R.uniform1fv(j.uMaskCornerRadius,w.map((e=>e*s))),R.uniform1fv(j.uMaskFeather,v.map(((e,t)=>t%2==0?e:e*s))),R.drawArrays(R.TRIANGLE_STRIP,0,4),R.disableVertexAttribArray(j.aPosition),R.disableVertexAttribArray(j.aTexCoord)},textureFilterNearest:R.NEAREST,textureFilterLinear:R.LINEAR,textureCreate:()=>R.createTexture(),textureUpdate:(e,t,o)=>(J.set(e,{src:t,options:o,isRotatedVideo:"VIDEO"===t.nodeName&&(t.dataset&&90==t.dataset.rotation||270==t.dataset.rotation)}),Ys(R,e,t,o)),textureGetSize:e=>{const{src:t,options:o}=J.get(e),i=De(t);return o.scalar?Ze(i,(e=>e/o.scalar)):i},textureDelete:te,enablePreviewStencil:()=>{R.stencilOp(R.KEEP,R.KEEP,R.REPLACE),R.stencilFunc(R.ALWAYS,1,255),R.stencilMask(255)},applyPreviewStencil:()=>{R.stencilFunc(R.EQUAL,1,255),R.stencilMask(0)},disablePreviewStencil:C,setCanvasColor(e){v=e[0],w=e[1],S=e[2],k=o?e[3]:1,R.clear(R.COLOR_BUFFER_BIT)},resetCanvasMatrix:()=>{Js(c,0,i.width,i.height,0,-1,1)},updateCanvasMatrix(e,t,o,n,r){const a=e.width,l=e.height,d=i.width*(.5/s),u=i.height*(.5/s),h={x:d+(o.x+t.x),y:u+(o.y+t.y)},p={x:h.x-t.x,y:h.y-t.y},m=.5*a,g=.5*l;$e(p,r.z,h),Ie(p,n,h);Qs(c,(p.x-m)*s,(p.y-g)*s,0),Qs(c,m*s,g*s,0),il(c,r.z);const $=r.x>Math.PI/2;tl(c,$?Math.PI:0);const f=r.y>Math.PI/2;ol(c,f?Math.PI:0),el(c,n),Qs(c,-m*s,-g*s,0)},drawToCanvas(){R.bindFramebuffer(R.FRAMEBUFFER,null),u=c,R.viewport(0,0,R.drawingBufferWidth,R.drawingBufferHeight),R.colorMask(!0,!0,!0,!0),R.clearColor(v,w,S,k),R.clear(R.COLOR_BUFFER_BIT),x=[1,0,1,0,1,i.width,1,i.width]},drawToImageBlendBuffer(e,t){ee(1,F,e,t)},drawToImageOverlayBuffer(e,t){ee(2,E,e,t)},enableMask(e,t){const o=e.x*s,n=e.y*s,r=e.width*s,a=e.height*s;g=o,p=g+r,h=i.height-n,m=i.height-(n+a),$=1-t,y=[h,p,m,g]},disableMask(){g=0,p=i.width,h=i.height,m=0,$=1,y=[h,p,m,g]},resize:(t,o,r)=>{s=r,l=1===s?.75:1,n.width=t,n.height=o,i.width=t*s,i.height=o*s,a=U(i.width,i.height),e.width=i.width,e.height=i.height,Js(c,0,i.width,i.height,0,-1,1),b=[1,0,1,0,1,n.width,1,n.width]},release(){Array.from(J.keys()).forEach((e=>te(e,!0))),J.clear(),M.forEach((e=>{R.deleteTexture(e)})),M.clear(),z.destroy(),_.destroy(),N.destroy(),j.destroy(),Y.destroy(),e.width=1,e.height=1,e=void 0}}},Cl=e=>e%2==0?e:e+1;var Tl=(e,t)=>{const{imageData:o,amount:i=1}=e,n=Math.round(2*Math.max(1,i)),r=Math.round(.5*n),a=o.width,s=o.height,l=new Uint8ClampedArray(a*s*4),c=o.data;let d,u,h,p,m,g=0,$=0,f=0;const y=a*s*4-4;for(h=0;h<s;h++)for(d=crypto.getRandomValues(new Uint8ClampedArray(s)),u=0;u<a;u++)p=d[h]/255,$=0,f=0,p<.5&&($=4*(-r+Math.round(Math.random()*n))),p>.5&&(f=(-r+Math.round(Math.random()*n))*(4*a)),m=Math.min(Math.max(0,g+$+f),y),l[g]=c[m],l[g+1]=c[m+1],l[g+2]=c[m+2],l[g+3]=c[m+3],g+=4;t(null,{data:l,width:o.width,height:o.height})};const Pl=[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625];function Rl(e){return Math.sqrt(1- --e*e)}function Il(e){return"[object Date]"===Object.prototype.toString.call(e)}function Al(e,t){if(e===t||e!=e)return()=>e;const o=typeof e;if(o!==typeof t||Array.isArray(e)!==Array.isArray(t))throw new Error("Cannot interpolate values of different type");if(Array.isArray(e)){const o=t.map(((t,o)=>Al(e[o],t)));return e=>o.map((t=>t(e)))}if("object"===o){if(!e||!t)throw new Error("Object cannot be null");if(Il(e)&&Il(t)){e=e.getTime();const o=(t=t.getTime())-e;return t=>new Date(e+t*o)}const o=Object.keys(t),i={};return o.forEach((o=>{i[o]=Al(e[o],t[o])})),e=>{const t={};return o.forEach((o=>{t[o]=i[o](e)})),t}}if("number"===o){const o=t-e;return t=>e+t*o}throw new Error(`Cannot interpolate ${o} values`)}function El(e,t={}){const o=ba(e);let i,n=e;function r(r,a){if(null==e)return o.set(e=r),Promise.resolve();n=r;let s=i,l=!1,{delay:c=0,duration:d=400,easing:u=In,interpolate:h=Al}=An(An({},t),a);if(0===d)return s&&(s.abort(),s=null),o.set(e=n),Promise.resolve();const p=qn()+c;let m;return i=er((t=>{if(t<p)return!0;l||(m=h(e,r),"function"==typeof d&&(d=d(e,r)),l=!0),s&&(s.abort(),s=null);const i=t-p;return i>d?(o.set(e=r),!1):(o.set(e=m(u(i/d))),!0)})),i.promise}return{set:r,update:(t,o)=>r(t(n,e),o),subscribe:o.subscribe}}function Ll(e,t,o,i){if("number"==typeof o){const n=i-o,r=(o-t)/(e.dt||1/60),a=(r+(e.opts.stiffness*n-e.opts.damping*r)*e.inv_mass)*e.dt;return Math.abs(a)<e.opts.precision&&Math.abs(n)<e.opts.precision?i:(e.settled=!1,o+a)}if(Io(o))return o.map(((n,r)=>Ll(e,t[r],o[r],i[r])));if("object"==typeof o){const n={};for(const r in o)n[r]=Ll(e,t[r],o[r],i[r]);return n}throw new Error(`Cannot spring ${typeof o} values`)}function Fl(e,t={}){const o=ba(e),{stiffness:i=.15,damping:n=.8,precision:r=.01}=t;let a,s,l,c=e,d=e,u=1,h=0,p=!1;function m(t,i={}){d=t;const n=l={};if(null==e||i.hard||g.stiffness>=1&&g.damping>=1)return p=!0,a=null,c=t,o.set(e=d),Promise.resolve();if(i.soft){const e=!0===i.soft?.5:+i.soft;h=1/(60*e),u=0}if(!s){a=null,p=!1;const t={inv_mass:void 0,opts:g,settled:!0,dt:void 0};s=er((i=>{if(null===a&&(a=i),p)return p=!1,s=null,!1;u=Math.min(u+h,1),t.inv_mass=u,t.opts=g,t.settled=!0,t.dt=60*(i-a)/1e3;const n=Ll(t,c,e,d);return a=i,c=e,o.set(e=n),t.settled&&(s=null),!t.settled}))}return new Promise((e=>{s.promise.then((()=>{n===l&&e()}))}))}const g={set:m,update:(t,o)=>m(t(d,e),o),subscribe:o.subscribe,stiffness:i,damping:n,precision:r};return g}var zl=ya(!1,(e=>{const t=window.matchMedia("(prefers-reduced-motion:reduce)"),o=()=>e(t.matches);return o(),t.addListener(o),()=>t.removeListener(o)})),Dl=()=>"ResizeObserver"in window;const Bl=Qe(),Ol=(e,t,o,i,n)=>{e.rect||(e.rect=Qe());const r=e.rect;mt(Bl,t,o,i,n),ht(r,Bl)||(gt(r,Bl),e.dispatchEvent(new CustomEvent("measure",{detail:r})))},_l=Math.round,Wl=e=>{const t=e.getBoundingClientRect();Ul&&Ol(e,_l(t.x),_l(t.y),_l(t.width),_l(t.height))},Vl=e=>{Ul&&Ol(e,e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight)},Nl=[];let Hl,jl,Ul=void 0;function Zl(){Nl.length?(Nl.forEach((e=>e.measure(e))),Ul=requestAnimationFrame(Zl)):Ul=void 0}let Xl=0;var Gl=(e,t={})=>{const{observePosition:o=!1,observeViewRect:i=!1,once:n=!1,disabled:r=!1,isMeasureRoot:a=!1}=t;if(Dl()&&a&&!jl&&(jl=new ResizeObserver((e=>{const[t]=e,{width:o,height:i}=t.contentRect;o<=0||i<=0?(Ul&&cancelAnimationFrame(Ul),Ul=!1):!1===Ul&&Zl()})),jl.observe(e)),!r)return!Dl()||o||i?(e.measure=i?Wl:Vl,Nl.push(e),void 0===Ul&&(Ul=requestAnimationFrame(Zl)),e.measure(e),{destroy(){a&&jl&&(jl.unobserve(e),jl.disconnect(),jl=void 0);const t=Nl.indexOf(e);Nl.splice(t,1),delete e.measure}}):(Hl||(Hl=new ResizeObserver((e=>{e.forEach((e=>{Ul&&Vl(e.target)}))}))),Hl.observe(e),Vl(e),n?Hl.unobserve(e):Xl++,{destroy(){a&&jl&&(jl.unobserve(e),jl.disconnect(),jl=void 0),n||(Hl.unobserve(e),Xl--,0===Xl&&(Hl.disconnect(),Hl=void 0))}})},Yl=e=>{let t=!1;const o={pointerdown:()=>{t=!1},keydown:()=>{t=!0},keyup:()=>{t=!1},focus:e=>{t&&(e.target.dataset.focusVisible="")},blur:e=>{delete e.target.dataset.focusVisible}};return Object.keys(o).forEach((t=>e.addEventListener(t,o[t],!0))),{destroy(){Object.keys(o).forEach((t=>e.removeEventListener(t,o[t],!0)))}}};const ql=async e=>new Promise((t=>{if("file"===e.kind)return t(e.getAsFile());e.getAsString(t)}));var Kl=(e,t={})=>{const o=e=>{e.preventDefault()},i=async o=>{o.preventDefault(),o.stopPropagation();try{const i=await(e=>new Promise(((t,o)=>{const{items:i}=e.dataTransfer;if(!i)return t([]);Promise.all(Array.from(i).map(ql)).then((e=>{t(e.filter((e=>Do(e)&&Xt(e)||/^http/.test(e))))})).catch(o)})))(o);e.dispatchEvent(new CustomEvent("dropfiles",{detail:{event:o,resources:i},...t}))}catch(e){}};return e.addEventListener("drop",i),e.addEventListener("dragover",o),{destroy(){e.removeEventListener("drop",i),e.removeEventListener("dragover",o)}}};let Jl=null;var Ql=()=>{if(null===Jl)if(u()){const e=g("canvas");Jl=!rl(e,{failIfMajorPerformanceCaveat:!0}),f(e)}else Jl=!1;return Jl};function ec(e){let t,o,i,n;return{c(){t=ar("div"),o=ar("canvas"),mr(t,"class","PinturaCanvas")},m(r,a){nr(r,t,a),tr(t,o),e[31](o),i||(n=[ur(o,"measure",e[32]),Gn(Gl.call(null,o))],i=!0)},p:Rn,i:Rn,o:Rn,d(o){o&&rr(t),e[31](null),i=!1,Fn(n)}}}function tc(e,t,o){let i,n,r,s,l,c,d;const u=Ar();let h,{isAnimated:p}=t,{isTransparent:m}=t,{maskRect:$}=t,{maskOpacity:f=1}=t,{maskFrameOpacity:b=.95}=t,{maskMarkupOpacity:x=1}=t,{clipAnnotationsToImage:v=!0}=t,{pixelRatio:w=1}=t,{textPixelRatio:S=w}=t,{backgroundColor:k}=t,{willRender:M=Z}=t,{didRender:C=Z}=t,{willRequest:T}=t,{loadImageData:R=Z}=t,{images:I=[]}=t,{interfaceImages:A=[]}=t,E=null,L=null,F=null;const z=(e,t)=>e.set(t,{hard:!p}),D={precision:1e-4*.01};let B=0;const O=El(void 0,{duration:0});_n(e,O,(e=>o(29,s=e)));const _=Fl(1,D);_n(e,_,(e=>o(30,c=e)));const W=Fl(1,D);_n(e,W,(e=>o(40,r=e)));const V=ba();_n(e,V,(e=>o(42,d=e)));const N=ba();_n(e,N,(e=>o(41,l=e)));const H=()=>requestAnimationFrame((()=>{te=!0,le=0,n()})),j=new Map([]),X=new Map([]),G=(e,t)=>{if(j.has(e)){if(Yt(e)){const o=j.get(e),i="pixelated"===t?E.textureFilterNearest:E.textureFilterLinear;E.textureUpdate(o,e,{filter:i})}}else{j.set(e,e);const o="pixelated"===t?E.textureFilterNearest:E.textureFilterLinear;if(!P(e)&&(ao(e)||y(e)||ln(e)||Yt(e))){const t=E.textureCreate();E.textureUpdate(t,e,{filter:o}),j.set(e,t)}else R(e).then((t=>{if(!E||!t)return;const i=E.textureCreate();E.textureUpdate(i,t,{filter:o}),j.set(e,i),H()})).catch((e=>{console.error(e)}))}return j.get(e)},Y=e=>{if(!e.text.length)return void X.delete(e.id);let{text:t,textAlign:o,fontFamily:i,fontSize:n=16,fontWeight:r,fontVariant:a,fontStyle:s,lineHeight:l=n,width:c,height:d}=e;const{lastCharPosition:u,textSize:h}=((e="",t)=>{const{width:o=0,height:i="auto",fontSize:n,fontFamily:r,lineHeight:a,fontWeight:s,fontStyle:l,fontVariant:c}=t,d=_o({text:e,fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,lineHeight:a,width:o,height:i});let u=Xo.get(d);if(u)return u;const h=g("span"),p=Nt(g("pre",{contenteditable:"true",spellcheck:"false",style:`pointer-events:none;visibility:hidden;position:absolute;left:0;top:0;${Uo({fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,lineHeight:a})};${Zo(e,t)}"`,innerHTML:e},[h])),m=p.getBoundingClientRect(),$=h.getBoundingClientRect();return u={textSize:Ze(De(m),Math.ceil),lastCharPosition:ve(he($),Math.round)},Xo.set(d,u),p.remove(),u})(t,e),p=_o({text:t,textAlign:o,fontFamily:i,fontSize:n,fontWeight:r,fontVariant:a,fontStyle:s,lineHeight:l,height:d&&l?Math.min(u.y,Math.ceil(d/l)*l):"auto",xOffset:u.x,yOffset:u.y});if(!j.has(p)){j.set(p,t);const u=c&&Math.ceil(c),m=d&&Math.ceil(d),g=Math.ceil(h.width),$=Math.ceil(h.height/l)*l;if(0===g||0===$)return;const f=ml(),y=Math.min(1,(f-jo*S*2)/(g*S),f/($*S));ai(t,{fontSize:n,fontFamily:i,fontWeight:r,fontVariant:a,fontStyle:s,textAlign:o,lineHeight:l,width:u,height:m,imageWidth:g,imageHeight:$,pixelRatio:S*y,willRequest:T,color:[1,0,1]}).then((t=>{if(!E)return;const o=E.textureCreate();E.textureUpdate(o,t,{filter:E.textureFilterLinear,scalar:y}),j.set(p,o),X.set(e.id,o),H()})).catch(console.error)}const m=j.get(p);return q(m)?m:X.get(e.id)},q=e=>e instanceof WebGLTexture,K=({data:e,size:t,origin:o,translation:i,rotation:n,scale:r,colorMatrix:a,opacity:s,convolutionMatrix:l,gamma:c,vignette:d,maskFeather:u,maskCornerRadius:h,overlayColor:p,enableOverlay:m,enableBlend:g,enableAntialiasing:$})=>{const f=G(e);let y=0,b=0;if(1===w){const e=Math.abs(1-r)<Number.EPSILON;y=e&&L%2!=0?.5:0,b=e&&F%2!=0?.5:0}return E.drawImage(f,t,o.x,o.y,i.x+y,i.y+b,n.x,n.y,n.z,r,a,Wa(s,0,1),l,c,d,u,h,p,m,g,$),f},J=([e,t,o,i])=>[i.x,i.y,e.x,e.y,o.x,o.y,t.x,t.y],Q=de(),ee=(e=[],t)=>e.map((e=>{let t=!e._isLoading&&(e=>{let t;if(e.backgroundImage)t=G(e.backgroundImage,e.backgroundImageRendering);else if(P(e.text)){if(e.width&&e.width<1||e.height&&e.height<1)return;t=Y(e)}return t})(e),o=q(t)?t:void 0;const i=e._scale||1,n=e._translate||Q,r=e.strokeWidth&&e.strokeWidth*i;if(Io(e.points)){const t=e.points.map((e=>ue(e.x*i+n.x,e.y*i+n.y)));E.drawPath(t,e.rotation,e.flipX,e.flipY,r,e.strokeColor,e.pathClose,e.backgroundColor,e.opacity)}else if(To(e.rx)&&To(e.ry)){let t=e.x,a=e.y;t*=i,a*=i,t+=n.x,a+=n.y,E.drawEllipse(ue(t,a),e.rx*i,e.ry*i,e.rotation,e.flipX,e.flipY,e.backgroundColor,o,void 0,void 0,e.backgroundCorners&&J(e.backgroundCorners),r,e.strokeColor,e.opacity,e.inverted)}else if(P(e.text)&&o||e.width){const t=o&&E.textureGetSize(o);let a,s,l,c=void 0,d=e.backgroundColor,u=e.strokeColor,h=[e.cornerRadius,e.cornerRadius,e.cornerRadius,e.cornerRadius].map((e=>e*i));if(a=e.width?tt(e):{x:e.x,y:e.y,...t},i&&n&&(a.x*=i,a.y*=i,a.x+=n.x,a.y+=n.y,a.width*=i,a.height*=i),t)if(e.backgroundImage&&(e.backgroundSize||e.backgroundPosition)){const o=U(t.width,t.height);if("contain"===e.backgroundSize){const t=xt(a,o,a);s=Be(t),l=e.backgroundPosition?e.backgroundPosition:ue(.5*(a.width-s.width),.5*(a.height-s.height))}else if("cover"===e.backgroundSize){const t=bt(a,o,a);s=Be(t),e.backgroundPosition?l=e.backgroundPosition:(l=ue(t.x,t.y),l=ue(.5*(a.width-s.width),.5*(a.height-s.height)))}else e.backgroundSize?(s=e.backgroundSize,l=e.backgroundPosition):e.backgroundPosition&&(s={...t},l=e.backgroundPosition)}else if(e.text){const o={width:t.width/S,height:t.height/S};if(l=ue(0,0),s={width:o.width*i,height:o.height*i},e.backgroundColor||e.strokeColor){d=void 0,u=void 0;let t=(e.width||o.width-2*jo)*i,n=(e.height||o.height)*i;E.drawRect({...a,width:t,height:n},e.rotation,e.flipX,e.flipY,h,e.backgroundColor,void 0,void 0,void 0,void 0,r,e.strokeColor,e.opacity,void 0,void 0,e.inverted)}a.x-=jo*i,c=e.color||[0,0,0],e.width?(a.height=a.height||o.height*i,a.width+=2*jo*i,"center"===e.textAlign?l.x=.5*(a.width-s.width):"right"===e.textAlign&&(l.x=a.width-s.width)):(a.width=o.width*i,a.height=o.height*i),e._prerender&&(c[3]=0)}E.drawRect(a,e.rotation,e.flipX,e.flipY,h,d,o,s,l,e.backgroundCorners&&J(e.backgroundCorners),r,u,e.opacity,void 0,c,e.inverted)}return t})).filter(Boolean);let te=!1,oe=!0,ie=!1;const ne=[],re=[],ae=[],se=()=>{ae.length=0;const e=I[0],{blendShapes:t,blendShapesDirty:o,annotationShapes:i,annotationShapesDirty:n,interfaceShapes:a,decorationShapes:u,frameShapes:h}=M({opacity:e.opacity,rotation:e.rotation,scale:e.scale,images:I,size:We(L,F),backgroundColor:[...s],selectionRect:d}),p=[...s],g=d,f=Wa(c,0,1),y=l,b=Math.abs(e.rotation.x/Math.PI*2-1),w=Math.abs(e.rotation.y/Math.PI*2-1),k=b<.99||w<.99,T={...e.size},P=e.backgroundColor,R=e.backgroundImage,z=t.length>0,D=i.length>0,B=P[3]>0,O=!!v&&x>=1;if(f<1&&B){const e=p[0],t=p[1],o=p[2],i=1-f,n=P[0]*i,r=P[1]*i,a=P[2]*i,s=1-i;p[0]=n+e*s,p[1]=r+t*s,p[2]=a+o*s,p[3]=1}E.setCanvasColor(m?[0,0,0,0]:p),z&&o?(E.disableMask(),E.drawToImageBlendBuffer(T),ne.length=0,ne.push(...ee(t))):z||(ne.length=0),ae.push(...ne),oe&&(E.drawToImageOverlayBuffer(T,S),oe=!1);if(k?(D&&(n||te)||!ie?(E.disableMask(),E.drawToImageOverlayBuffer(T,S),re.length=0,re.push(...ee(i))):D||(re.length=0),ie=!0):ie=!1,E.drawToCanvas(),E.enableMask(g,f),B&&E.drawRect(g,0,!1,!1,[0,0,0,0],((e,t)=>{const[o,i,n]=e,[r,a,s,l]=t;return[r*l+o*(1-l),a*l+i*(1-l),s*l+n*(1-l),1]})(s,P)),R){E.enableMask(g,1);const e=Math.max($.width/R.width,$.height/R.height),t=R.width*e,o=R.height*e,i={x:$.x+.5*$.width-.5*t,y:$.y+.5*$.height-.5*o,width:t,height:o};E.drawRect(i,0,!1,!1,[0,0,0,0],[0,0,0,0],G(R,"linear")),E.enableMask(g,f)}if(O&&E.enablePreviewStencil(),ae.push(...[...I].reverse().map((e=>K({...e,enableOverlay:k&&D,enableBlend:z,enableAntialiasing:!0,mask:g,maskOpacity:f,overlayColor:y})))),E.enableMask(g,x),k||(O&&E.applyPreviewStencil(),E.resetCanvasMatrix(),E.updateCanvasMatrix(T,e.origin,e.translation,e.scale,e.rotation),re.length=0,re.push(...ee(i)),O&&E.disablePreviewStencil()),ae.push(...re),E.resetCanvasMatrix(),E.enableMask(g,x),ae.push(...ee(u)),h.length){E.enableMask(g,1);const e=h.filter((e=>!e.expandsCanvas)),t=h.filter((e=>e.expandsCanvas));e.length&&ae.push(...ee(e)),t.length&&(E.enableMask({x:g.x+.5,y:g.y+.5,width:g.width-1,height:g.height-1},r),ae.push(...ee(t)))}E.disableMask(),ae.push(...ee(a)),A.forEach((e=>{if(E.enableMask(e.mask,e.maskOpacity),e.backgroundColor){const t=R&&bt({...e.mask},R.width/R.height),o=R&&G(R,"linear");E.drawRect(e.mask,0,!1,!1,e.maskCornerRadius,e.backgroundColor,o,t,t,void 0,void 0,void 0,e.opacity,e.maskFeather)}K({...e,enableAntialiasing:!1,translation:{x:e.translation.x+e.offset.x-.5*L,y:e.translation.y+e.offset.y-.5*F}})})),E.disableMask(),(e=>{j.forEach(((t,o)=>{!e.find((e=>e===t))&&q(t)&&(Array.from(X.values()).includes(t)||(j.delete(o),E.textureDelete(t)))}))})(ae),C(),te=!1};let le=0;const ce=()=>{const e=Date.now();e-le<48||(le=e,se())};Rr((()=>n())),Pr((()=>o(25,E=Ml(h,{alpha:m})))),Ir((()=>{E&&(E.release(),o(25,E=void 0),o(0,h=void 0))}));return e.$$set=e=>{"isAnimated"in e&&o(9,p=e.isAnimated),"isTransparent"in e&&o(10,m=e.isTransparent),"maskRect"in e&&o(11,$=e.maskRect),"maskOpacity"in e&&o(12,f=e.maskOpacity),"maskFrameOpacity"in e&&o(13,b=e.maskFrameOpacity),"maskMarkupOpacity"in e&&o(14,x=e.maskMarkupOpacity),"clipAnnotationsToImage"in e&&o(15,v=e.clipAnnotationsToImage),"pixelRatio"in e&&o(16,w=e.pixelRatio),"textPixelRatio"in e&&o(17,S=e.textPixelRatio),"backgroundColor"in e&&o(18,k=e.backgroundColor),"willRender"in e&&o(19,M=e.willRender),"didRender"in e&&o(20,C=e.didRender),"willRequest"in e&&o(21,T=e.willRequest),"loadImageData"in e&&o(22,R=e.loadImageData),"images"in e&&o(23,I=e.images),"interfaceImages"in e&&o(24,A=e.interfaceImages)},e.$$.update=()=>{if(1&e.$$.dirty[0]&&h){const e=getComputedStyle(h).getPropertyValue("--color-transition-duration");o(26,B=(e=>{let t=parseFloat(e);return/^[0-9]+s$/.test(e)?1e3*t:t})(e))}67371520&e.$$.dirty[0]&&k&&O.set(k,{duration:p?B:0}),4096&e.$$.dirty[0]&&z(_,To(f)?f:1),8192&e.$$.dirty[0]&&z(W,To(b)?b:1),2048&e.$$.dirty[0]&&$&&V.set($),1610612736&e.$$.dirty[0]&&s&&N.set([s[0],s[1],s[2],Wa(c,0,1)]),41943046&e.$$.dirty[0]&&o(28,i=!!(E&&L&&F&&I.length)),33619974&e.$$.dirty[0]&&L&&F&&E&&(le=0,E.resize(L,F,w)),268435456&e.$$.dirty[0]&&o(27,n=i?Ql()?ce:se:a),402653184&e.$$.dirty[0]&&i&&n&&n()},[h,L,F,u,O,_,W,V,N,p,m,$,f,b,x,v,w,S,k,M,C,T,R,I,A,E,B,n,i,s,c,function(e){Dr[e?"unshift":"push"]((()=>{h=e,o(0,h)}))},e=>{o(1,L=e.detail.width),o(2,F=e.detail.height),u("measure",{width:L,height:F})}]}class oc extends $a{constructor(e){super(),ga(this,e,tc,ec,Dn,{isAnimated:9,isTransparent:10,maskRect:11,maskOpacity:12,maskFrameOpacity:13,maskMarkupOpacity:14,clipAnnotationsToImage:15,pixelRatio:16,textPixelRatio:17,backgroundColor:18,willRender:19,didRender:20,willRequest:21,loadImageData:22,images:23,interfaceImages:24},null,[-1,-1,-1])}}var ic=(e,t=Boolean,o=" ")=>e.filter(t).join(o);function nc(e,t,o){const i=e.slice();return i[17]=t[o],i}const rc=e=>({tab:4&e}),ac=e=>({tab:e[17]});function sc(e){let t,o,i,n=[],r=new Map,a=e[2];const s=e=>e[17].id;for(let t=0;t<a.length;t+=1){let o=nc(e,a,t),i=s(o);r.set(i,n[t]=lc(i,o))}return{c(){t=ar("ul");for(let e=0;e<n.length;e+=1)n[e].c();mr(t,"class",o=ic(["PinturaTabList",e[0]])),mr(t,"role","tablist"),mr(t,"data-layout",e[1])},m(o,r){nr(o,t,r);for(let e=0;e<n.length;e+=1)n[e].m(t,null);e[14](t),i=!0},p(e,l){1124&l&&(a=e[2],Qr(),n=la(n,l,s,1,e,a,r,t,sa,lc,null,nc),ea()),(!i||1&l&&o!==(o=ic(["PinturaTabList",e[0]])))&&mr(t,"class",o),(!i||2&l)&&mr(t,"data-layout",e[1])},i(e){if(!i){for(let e=0;e<a.length;e+=1)ta(n[e]);i=!0}},o(e){for(let e=0;e<n.length;e+=1)oa(n[e]);i=!1},d(o){o&&rr(t);for(let e=0;e<n.length;e+=1)n[e].d();e[14](null)}}}function lc(e,t){let o,i,n,r,a,s,l,c,d,u;const h=t[11].default,p=Wn(h,t,t[10],ac);function m(...e){return t[12](t[17],...e)}function g(...e){return t[13](t[17],...e)}return{key:e,first:null,c(){o=ar("li"),i=ar("button"),p&&p.c(),r=cr(),mr(i,"type","button"),i.disabled=n=t[17].disabled,mr(o,"role","tab"),mr(o,"aria-controls",a=t[17].href.substr(1)),mr(o,"id",s=t[17].tabId),mr(o,"aria-selected",l=t[17].selected),this.first=o},m(e,t){nr(e,o,t),tr(o,i),p&&p.m(i,null),tr(o,r),c=!0,d||(u=[ur(i,"keydown",m),ur(i,"click",g)],d=!0)},p(e,r){t=e,p&&p.p&&(!c||1028&r)&&Hn(p,h,t,t[10],c?Nn(h,t[10],r,rc):jn(t[10]),ac),(!c||4&r&&n!==(n=t[17].disabled))&&(i.disabled=n),(!c||4&r&&a!==(a=t[17].href.substr(1)))&&mr(o,"aria-controls",a),(!c||4&r&&s!==(s=t[17].tabId))&&mr(o,"id",s),(!c||4&r&&l!==(l=t[17].selected))&&mr(o,"aria-selected",l)},i(e){c||(ta(p,e),c=!0)},o(e){oa(p,e),c=!1},d(e){e&&rr(o),p&&p.d(e),d=!1,Fn(u)}}}function cc(e){let t,o,i=e[4]&&sc(e);return{c(){i&&i.c(),t=dr()},m(e,n){i&&i.m(e,n),nr(e,t,n),o=!0},p(e,[o]){e[4]?i?(i.p(e,o),16&o&&ta(i,1)):(i=sc(e),i.c(),ta(i,1),i.m(t.parentNode,t)):i&&(Qr(),oa(i,1,1,(()=>{i=null})),ea())},i(e){o||(ta(i),o=!0)},o(e){oa(i),o=!1},d(e){i&&i.d(e),e&&rr(t)}}}function dc(e,t,o){let i,n,r,{$$slots:a={},$$scope:s}=t,{class:l}=t,{name:c}=t,{selected:d}=t,{tabs:u=[]}=t,{layout:h}=t;const p=Ar(),m=e=>{const t=r.querySelectorAll('[role="tab"] button')[e];t&&t.focus()},g=(e,t)=>{e.preventDefault(),e.stopPropagation(),p("select",t)},$=({key:e},t)=>{if(!/arrow/i.test(e))return;const o=u.findIndex((e=>e.id===t));return/right|down/i.test(e)?m(o<u.length-1?o+1:0):/left|up/i.test(e)?m(o>0?o-1:u.length-1):void 0};return e.$$set=e=>{"class"in e&&o(0,l=e.class),"name"in e&&o(7,c=e.name),"selected"in e&&o(8,d=e.selected),"tabs"in e&&o(9,u=e.tabs),"layout"in e&&o(1,h=e.layout),"$$scope"in e&&o(10,s=e.$$scope)},e.$$.update=()=>{896&e.$$.dirty&&o(2,i=u.map((e=>{const t=e.id===d;return{...e,tabId:`tab-${c}-${e.id}`,href:`#panel-${c}-${e.id}`,selected:t}}))),4&e.$$.dirty&&o(4,n=i.length>1)},[l,h,i,r,n,g,$,c,d,u,s,a,(e,t)=>$(t,e.id),(e,t)=>g(t,e.id),function(e){Dr[e?"unshift":"push"]((()=>{r=e,o(3,r)}))}]}class uc extends $a{constructor(e){super(),ga(this,e,dc,cc,Dn,{class:0,name:7,selected:8,tabs:9,layout:1})}}const hc=e=>({panel:16&e}),pc=e=>({panel:e[4][0].id,panelIsActive:!0});function mc(e,t,o){const i=e.slice();return i[14]=t[o].id,i[15]=t[o].shouldDraw,i[16]=t[o].panelId,i[17]=t[o].tabindex,i[18]=t[o].labelledBy,i[19]=t[o].isActive,i[20]=t[o].hidden,i[3]=t[o].visible,i}const gc=e=>({panel:16&e,panelIsActive:16&e}),$c=e=>({panel:e[14],panelIsActive:e[19]});function fc(e){let t,o,i,n,r,a;const s=e[11].default,l=Wn(s,e,e[10],pc);return{c(){t=ar("div"),o=ar("div"),l&&l.c(),mr(o,"class",i=ic([e[1]])),mr(t,"class",e[0]),mr(t,"style",e[2])},m(i,s){nr(i,t,s),tr(t,o),l&&l.m(o,null),n=!0,r||(a=[ur(t,"measure",e[13]),Gn(Gl.call(null,t))],r=!0)},p(e,r){l&&l.p&&(!n||1040&r)&&Hn(l,s,e,e[10],n?Nn(s,e[10],r,hc):jn(e[10]),pc),(!n||2&r&&i!==(i=ic([e[1]])))&&mr(o,"class",i),(!n||1&r)&&mr(t,"class",e[0]),(!n||4&r)&&mr(t,"style",e[2])},i(e){n||(ta(l,e),n=!0)},o(e){oa(l,e),n=!1},d(e){e&&rr(t),l&&l.d(e),r=!1,Fn(a)}}}function yc(e){let t,o,i,n,r,a=[],s=new Map,l=e[4];const c=e=>e[14];for(let t=0;t<l.length;t+=1){let o=mc(e,l,t),i=c(o);s.set(i,a[t]=xc(i,o))}return{c(){t=ar("div");for(let e=0;e<a.length;e+=1)a[e].c();mr(t,"class",o=ic(["PinturaTabPanels",e[0]])),mr(t,"style",e[2])},m(o,s){nr(o,t,s);for(let e=0;e<a.length;e+=1)a[e].m(t,null);i=!0,n||(r=[ur(t,"measure",e[12]),Gn(Gl.call(null,t,{observePosition:!0}))],n=!0)},p(e,n){1042&n&&(l=e[4],Qr(),a=la(a,n,c,1,e,l,s,t,sa,xc,null,mc),ea()),(!i||1&n&&o!==(o=ic(["PinturaTabPanels",e[0]])))&&mr(t,"class",o),(!i||4&n)&&mr(t,"style",e[2])},i(e){if(!i){for(let e=0;e<l.length;e+=1)ta(a[e]);i=!0}},o(e){for(let e=0;e<a.length;e+=1)oa(a[e]);i=!1},d(e){e&&rr(t);for(let e=0;e<a.length;e+=1)a[e].d();n=!1,Fn(r)}}}function bc(e){let t;const o=e[11].default,i=Wn(o,e,e[10],$c);return{c(){i&&i.c()},m(e,o){i&&i.m(e,o),t=!0},p(e,n){i&&i.p&&(!t||1040&n)&&Hn(i,o,e,e[10],t?Nn(o,e[10],n,gc):jn(e[10]),$c)},i(e){t||(ta(i,e),t=!0)},o(e){oa(i,e),t=!1},d(e){i&&i.d(e)}}}function xc(e,t){let o,i,n,r,a,s,l,c,d,u=t[15]&&bc(t);return{key:e,first:null,c(){o=ar("div"),u&&u.c(),i=cr(),mr(o,"class",n=ic(["PinturaTabPanel",t[1]])),o.hidden=r=t[20],mr(o,"id",a=t[16]),mr(o,"tabindex",s=t[17]),mr(o,"aria-labelledby",l=t[18]),mr(o,"data-inert",c=!t[3]),this.first=o},m(e,t){nr(e,o,t),u&&u.m(o,null),tr(o,i),d=!0},p(e,h){(t=e)[15]?u?(u.p(t,h),16&h&&ta(u,1)):(u=bc(t),u.c(),ta(u,1),u.m(o,i)):u&&(Qr(),oa(u,1,1,(()=>{u=null})),ea()),(!d||2&h&&n!==(n=ic(["PinturaTabPanel",t[1]])))&&mr(o,"class",n),(!d||16&h&&r!==(r=t[20]))&&(o.hidden=r),(!d||16&h&&a!==(a=t[16]))&&mr(o,"id",a),(!d||16&h&&s!==(s=t[17]))&&mr(o,"tabindex",s),(!d||16&h&&l!==(l=t[18]))&&mr(o,"aria-labelledby",l),(!d||16&h&&c!==(c=!t[3]))&&mr(o,"data-inert",c)},i(e){d||(ta(u),d=!0)},o(e){oa(u),d=!1},d(e){e&&rr(o),u&&u.d()}}}function vc(e){let t,o,i,n;const r=[yc,fc],a=[];function s(e,t){return e[5]?0:1}return t=s(e),o=a[t]=r[t](e),{c(){o.c(),i=dr()},m(e,o){a[t].m(e,o),nr(e,i,o),n=!0},p(e,[n]){let l=t;t=s(e),t===l?a[t].p(e,n):(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea(),o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ta(o,1),o.m(i.parentNode,i))},i(e){n||(ta(o),n=!0)},o(e){oa(o),n=!1},d(e){a[t].d(e),e&&rr(i)}}}function wc(e,t,o){let i,n,{$$slots:r={},$$scope:a}=t,{class:s}=t,{name:l}=t,{selected:c}=t,{panelClass:d}=t,{panels:u=[]}=t,{visible:h}=t,{style:p}=t;const m={};return e.$$set=e=>{"class"in e&&o(0,s=e.class),"name"in e&&o(6,l=e.name),"selected"in e&&o(7,c=e.selected),"panelClass"in e&&o(1,d=e.panelClass),"panels"in e&&o(8,u=e.panels),"visible"in e&&o(3,h=e.visible),"style"in e&&o(2,p=e.style),"$$scope"in e&&o(10,a=e.$$scope)},e.$$.update=()=>{968&e.$$.dirty&&o(4,i=u.map((e=>{const t=e===c;t&&o(9,m[e]=!0,m);const i=h?-1!==h.indexOf(e):t;return{id:e,panelId:`panel-${l}-${e}`,labelledBy:`tab-${l}-${e}`,isActive:t,hidden:!t,visible:i,tabindex:t?0:-1,shouldDraw:t||m[e]}}))),16&e.$$.dirty&&o(5,n=i.length>1)},[s,d,p,h,i,n,l,c,u,m,a,r,function(t){Fr.call(this,e,t)},function(t){Fr.call(this,e,t)}]}class Sc extends $a{constructor(e){super(),ga(this,e,wc,vc,Dn,{class:0,name:6,selected:7,panelClass:1,panels:8,visible:3,style:2})}}var kc=e=>{const t=Object.getOwnPropertyDescriptors(e.prototype);return Object.keys(t).filter((e=>!!t[e].get))};function Mc(e){let t,o,i;const n=e[5].default,r=Wn(n,e,e[4],null);return{c(){t=sr("svg"),r&&r.c(),mr(t,"class",e[3]),mr(t,"style",e[2]),mr(t,"width",e[0]),mr(t,"height",e[1]),mr(t,"viewBox",o="0 0 "+e[0]+"\n "+e[1]),mr(t,"xmlns","http://www.w3.org/2000/svg"),mr(t,"aria-hidden","true"),mr(t,"focusable","false"),mr(t,"stroke-linecap","round"),mr(t,"stroke-linejoin","round")},m(e,o){nr(e,t,o),r&&r.m(t,null),i=!0},p(e,[a]){r&&r.p&&(!i||16&a)&&Hn(r,n,e,e[4],i?Nn(n,e[4],a,null):jn(e[4]),null),(!i||8&a)&&mr(t,"class",e[3]),(!i||4&a)&&mr(t,"style",e[2]),(!i||1&a)&&mr(t,"width",e[0]),(!i||2&a)&&mr(t,"height",e[1]),(!i||3&a&&o!==(o="0 0 "+e[0]+"\n "+e[1]))&&mr(t,"viewBox",o)},i(e){i||(ta(r,e),i=!0)},o(e){oa(r,e),i=!1},d(e){e&&rr(t),r&&r.d(e)}}}function Cc(e,t,o){let{$$slots:i={},$$scope:n}=t,{width:r=24}=t,{height:a=24}=t,{style:s}=t,{class:l}=t;return e.$$set=e=>{"width"in e&&o(0,r=e.width),"height"in e&&o(1,a=e.height),"style"in e&&o(2,s=e.style),"class"in e&&o(3,l=e.class),"$$scope"in e&&o(4,n=e.$$scope)},[r,a,s,l,n,i]}class Tc extends $a{constructor(e){super(),ga(this,e,Cc,Mc,Dn,{width:0,height:1,style:2,class:3})}}var Pc=(e,t={})=>{const{direction:o,shiftMultiplier:i=10,bubbles:n=!1,preventDefault:r=!1,stopKeydownPropagation:a=!0}=t,s="horizontal"===o,l="vertical"===o,c=t=>{const{key:o}=t,c=t.shiftKey,d=/up|down/i.test(o),u=/left|right/i.test(o);if(!u&&!d)return;if(s&&d)return;if(l&&u)return;const h=c?i:1;a&&t.stopPropagation(),r&&t.preventDefault(),e.dispatchEvent(new CustomEvent("nudge",{bubbles:n,detail:ue((/left/i.test(o)?-1:/right/i.test(o)?1:0)*h,(/up/i.test(o)?-1:/down/i.test(o)?1:0)*h)}))};return e.addEventListener("keydown",c),{destroy(){e.removeEventListener("keydown",c)}}},Rc=(e,t,o)=>(e-t)/(o-t);const Ic=e=>({}),Ac=e=>({});function Ec(e){let t,o,i,n,r,a,s,l;return o=new Tc({props:{$$slots:{default:[Lc]},$$scope:{ctx:e}}}),r=new Tc({props:{$$slots:{default:[Fc]},$$scope:{ctx:e}}}),{c(){t=ar("button"),ha(o.$$.fragment),i=cr(),n=ar("button"),ha(r.$$.fragment),mr(t,"type","button"),mr(t,"aria-label","Increase"),mr(n,"type","button"),mr(n,"aria-label","Decrease")},m(c,d){nr(c,t,d),pa(o,t,null),nr(c,i,d),nr(c,n,d),pa(r,n,null),a=!0,s||(l=[ur(t,"pointerdown",e[20](1)),ur(n,"pointerdown",e[20](-1))],s=!0)},p(e,t){const i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i);const n={};128&t[1]&&(n.$$scope={dirty:t,ctx:e}),r.$set(n)},i(e){a||(ta(o.$$.fragment,e),ta(r.$$.fragment,e),a=!0)},o(e){oa(o.$$.fragment,e),oa(r.$$.fragment,e),a=!1},d(e){e&&rr(t),ma(o),e&&rr(i),e&&rr(n),ma(r),s=!1,Fn(l)}}}function Lc(e){let t;return{c(){t=sr("path"),mr(t,"d","M8 12 h8 M12 8 v8")},m(e,o){nr(e,t,o)},p:Rn,d(e){e&&rr(t)}}}function Fc(e){let t;return{c(){t=sr("path"),mr(t,"d","M9 12 h6")},m(e,o){nr(e,t,o)},p:Rn,d(e){e&&rr(t)}}}function zc(e){let t,o,i,n,r,a,s,l,c,d,u,h,p,m,g,$,f;const y=e[36].default,b=Wn(y,e,e[38],null),x=e[36].knob,v=Wn(x,e,e[38],Ac);let w=e[9]&&Ec(e);return{c(){t=ar("div"),o=ar("div"),i=ar("input"),r=cr(),a=ar("div"),b&&b.c(),l=cr(),c=ar("div"),d=ar("div"),v&&v.c(),p=cr(),w&&w.c(),mr(i,"type","range"),mr(i,"id",e[3]),mr(i,"min",e[0]),mr(i,"max",e[1]),mr(i,"step",e[2]),i.value=e[14],mr(i,"style",n=e[10]?"pointer-events:none":""),mr(a,"class",s=ic(["PinturaSliderTrack",e[5]])),mr(a,"style",e[4]),mr(d,"class",u=ic(["PinturaSliderKnob",e[7]])),mr(d,"style",e[6]),mr(c,"class","PinturaSliderKnobController"),mr(c,"style",e[17]),mr(o,"class","PinturaSliderControl"),mr(o,"style",h="--slider-position:"+Math.round(e[15])),mr(t,"class",m=ic(["PinturaSlider",e[12]])),mr(t,"data-direction",e[8])},m(n,s){nr(n,t,s),tr(t,o),tr(o,i),e[37](i),tr(o,r),tr(o,a),b&&b.m(a,null),tr(o,l),tr(o,c),tr(c,d),v&&v.m(d,null),tr(t,p),w&&w.m(t,null),g=!0,$||(f=[ur(i,"input",e[18]),ur(i,"nudge",e[19]),Gn(Pc.call(null,i)),ur(o,"pointerdown",(function(){zn(e[11]&&e[13])&&(e[11]&&e[13]).apply(this,arguments)}))],$=!0)},p(r,l){e=r,(!g||8&l[0])&&mr(i,"id",e[3]),(!g||1&l[0])&&mr(i,"min",e[0]),(!g||2&l[0])&&mr(i,"max",e[1]),(!g||4&l[0])&&mr(i,"step",e[2]),(!g||16384&l[0])&&(i.value=e[14]),(!g||1024&l[0]&&n!==(n=e[10]?"pointer-events:none":""))&&mr(i,"style",n),b&&b.p&&(!g||128&l[1])&&Hn(b,y,e,e[38],g?Nn(y,e[38],l,null):jn(e[38]),null),(!g||32&l[0]&&s!==(s=ic(["PinturaSliderTrack",e[5]])))&&mr(a,"class",s),(!g||16&l[0])&&mr(a,"style",e[4]),v&&v.p&&(!g||128&l[1])&&Hn(v,x,e,e[38],g?Nn(x,e[38],l,Ic):jn(e[38]),Ac),(!g||128&l[0]&&u!==(u=ic(["PinturaSliderKnob",e[7]])))&&mr(d,"class",u),(!g||64&l[0])&&mr(d,"style",e[6]),(!g||131072&l[0])&&mr(c,"style",e[17]),(!g||32768&l[0]&&h!==(h="--slider-position:"+Math.round(e[15])))&&mr(o,"style",h),e[9]?w?(w.p(e,l),512&l[0]&&ta(w,1)):(w=Ec(e),w.c(),ta(w,1),w.m(t,null)):w&&(Qr(),oa(w,1,1,(()=>{w=null})),ea()),(!g||4096&l[0]&&m!==(m=ic(["PinturaSlider",e[12]])))&&mr(t,"class",m),(!g||256&l[0])&&mr(t,"data-direction",e[8])},i(e){g||(ta(b,e),ta(v,e),ta(w),g=!0)},o(e){oa(b,e),oa(v,e),oa(w),g=!1},d(o){o&&rr(t),e[37](null),b&&b.d(o),v&&v.d(o),w&&w.d(),$=!1,Fn(f)}}}function Dc(e,t,o){let i,n,r,s,l,c,d,u,h,p,m,g,$,f,y,{$$slots:b={},$$scope:x}=t,{min:v=0}=t,{max:w=100}=t,{step:S=1}=t,{id:k}=t,{value:M=0}=t,{valueMin:C}=t,{valueMax:T}=t,{trackStyle:R}=t,{trackClass:I}=t,{knobStyle:A}=t,{knobClass:E}=t,{ongrab:L=a}=t,{onchange:F=a}=t,{onrelease:z=a}=t,{onexceed:D=a}=t,{direction:B="x"}=t,{getValue:O=Z}=t,{setValue:_=Z}=t,{enableSpinButtons:W=!0}=t,{enableForceUseKnob:V=!1}=t,{enableStopPropagation:N=!0}=t,{enablePointerdownListener:H=!0}=t,{maxInteractionDistance:j=6}=t,{class:U}=t;const X=e=>_(((e,t)=>(t=1/t,Math.round(e*t)/t))(Wa(e,v,w),S)),G=(e,t,i={})=>{const{grabbed:r=!1,released:a=!1}=i,s=X(v+e/t*n),l=C||v,c=T||w;o(21,M=P(s)?s:Wa(s,l,c)),y!==s&&(y=s,!P(s)&&(s<l||s>c)&&D(M,s),M!==f&&(f=M,r&&L(M),F(M),a&&z(M)))};let Y;const q=e=>{const t=e[u]-$;G(g+t,m)},K=e=>{m=void 0,document.documentElement.removeEventListener("pointermove",q),document.documentElement.removeEventListener("pointerup",K),F(M),z(M)},J=()=>{o(21,M=X(i+ee*S)),F(M)};let Q,ee=1,te=!1;const oe=e=>{clearTimeout(Q),te||J(),z(M),document.removeEventListener("pointerup",oe)};return e.$$set=e=>{"min"in e&&o(0,v=e.min),"max"in e&&o(1,w=e.max),"step"in e&&o(2,S=e.step),"id"in e&&o(3,k=e.id),"value"in e&&o(21,M=e.value),"valueMin"in e&&o(22,C=e.valueMin),"valueMax"in e&&o(23,T=e.valueMax),"trackStyle"in e&&o(4,R=e.trackStyle),"trackClass"in e&&o(5,I=e.trackClass),"knobStyle"in e&&o(6,A=e.knobStyle),"knobClass"in e&&o(7,E=e.knobClass),"ongrab"in e&&o(24,L=e.ongrab),"onchange"in e&&o(25,F=e.onchange),"onrelease"in e&&o(26,z=e.onrelease),"onexceed"in e&&o(27,D=e.onexceed),"direction"in e&&o(8,B=e.direction),"getValue"in e&&o(28,O=e.getValue),"setValue"in e&&o(29,_=e.setValue),"enableSpinButtons"in e&&o(9,W=e.enableSpinButtons),"enableForceUseKnob"in e&&o(10,V=e.enableForceUseKnob),"enableStopPropagation"in e&&o(30,N=e.enableStopPropagation),"enablePointerdownListener"in e&&o(11,H=e.enablePointerdownListener),"maxInteractionDistance"in e&&o(31,j=e.maxInteractionDistance),"class"in e&&o(12,U=e.class),"$$scope"in e&&o(38,x=e.$$scope)},e.$$.update=()=>{270532608&e.$$.dirty[0]&&o(14,i=void 0!==M?O(M):0),3&e.$$.dirty[0]&&(n=w-v),16387&e.$$.dirty[0]&&o(33,r=Rc(i,v,w)),4&e.$$.dirty[1]&&o(15,s=100*r),256&e.$$.dirty[0]&&o(34,l=B.toUpperCase()),256&e.$$.dirty[0]&&o(35,c="x"===B?"Width":"Height"),16&e.$$.dirty[1]&&(d="offset"+c),e.$$.dirty[1],8&e.$$.dirty[1]&&(u="page"+l),32768&e.$$.dirty[0]|8&e.$$.dirty[1]&&o(17,h=`transform: translate${l}(${s}%)`)},[v,w,S,k,R,I,A,E,B,W,V,H,U,e=>{let t=!1;N&&e.stopPropagation(),clearTimeout(Y);const o=p.getBoundingClientRect();if(m=p[d],$=e[u],g=$-o[B],V){if(Math.abs(g-r*m)>j)return;t=!0,e.stopPropagation()}return document.activeElement!==p&&p.focus(),G(g,m,{grabbed:!0}),document.documentElement.addEventListener("pointermove",q),document.documentElement.addEventListener("pointerup",K),t},i,s,p,h,e=>{m||(o(21,M=_(parseFloat(e.target.value))),M!==f&&(f=M,F(M)))},e=>{const t=p[d];G(i/n*t+e.detail[B],t),clearTimeout(Y),Y=setTimeout((()=>{z(M)}),250)},e=>t=>{clearTimeout(Y),ee=e,te=!1,Q=setInterval((()=>{te=!0,J()}),100),document.addEventListener("pointercancel",oe),document.addEventListener("pointerup",oe)},M,C,T,L,F,z,D,O,_,N,j,e=>{const t=p.getBoundingClientRect(),o=e[u]-t[B],i=p[d];return Math.abs(o-r*i)},r,l,c,b,function(e){Dr[e?"unshift":"push"]((()=>{p=e,o(16,p)}))},x]}class Bc extends $a{constructor(e){super(),ga(this,e,Dc,zc,Dn,{min:0,max:1,step:2,id:3,value:21,valueMin:22,valueMax:23,trackStyle:4,trackClass:5,knobStyle:6,knobClass:7,ongrab:24,onchange:25,onrelease:26,onexceed:27,direction:8,getValue:28,setValue:29,enableSpinButtons:9,enableForceUseKnob:10,enableStopPropagation:30,enablePointerdownListener:11,maxInteractionDistance:31,class:12,eventDistanceToKnob:32,handlePointerDown:13},null,[-1,-1])}get eventDistanceToKnob(){return this.$$.ctx[32]}get handlePointerDown(){return this.$$.ctx[13]}}var Oc=(e,t)=>t===e.target||t.contains(e.target);function _c(e){let t,o;return t=new Tc({props:{class:"PinturaButtonIcon",$$slots:{default:[Wc]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};134217730&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Wc(e){let t;return{c(){t=sr("g")},m(o,i){nr(o,t,i),t.innerHTML=e[1]},p(e,o){2&o&&(t.innerHTML=e[1])},d(e){e&&rr(t)}}}function Vc(e){let t,o;return{c(){t=ar("span"),o=lr(e[0]),mr(t,"class",e[9])},m(e,i){nr(e,t,i),tr(t,o)},p(e,i){1&i&&$r(o,e[0]),512&i&&mr(t,"class",e[9])},d(e){e&&rr(t)}}}function Nc(e){let t,o,i,n;const r=e[25].default,a=Wn(r,e,e[27],null),s=a||function(e){let t,o,i,n=e[1]&&_c(e),r=e[0]&&Vc(e);return{c(){t=ar("span"),n&&n.c(),o=cr(),r&&r.c(),mr(t,"class",e[11])},m(e,a){nr(e,t,a),n&&n.m(t,null),tr(t,o),r&&r.m(t,null),i=!0},p(e,a){e[1]?n?(n.p(e,a),2&a&&ta(n,1)):(n=_c(e),n.c(),ta(n,1),n.m(t,o)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[0]?r?r.p(e,a):(r=Vc(e),r.c(),r.m(t,null)):r&&(r.d(1),r=null),(!i||2048&a)&&mr(t,"class",e[11])},i(e){i||(ta(n),i=!0)},o(e){oa(n),i=!1},d(e){e&&rr(t),n&&n.d(),r&&r.d()}}}(e);return{c(){t=ar("button"),s&&s.c(),mr(t,"type",e[4]),mr(t,"style",e[2]),t.disabled=e[3],mr(t,"class",e[10]),mr(t,"title",e[0])},m(r,a){nr(r,t,a),s&&s.m(t,null),e[26](t),o=!0,i||(n=[ur(t,"keydown",(function(){zn(e[6])&&e[6].apply(this,arguments)})),ur(t,"click",(function(){zn(e[5])&&e[5].apply(this,arguments)})),ur(t,"pointerdown",(function(){zn(e[12])&&e[12].apply(this,arguments)})),Gn(e[7].call(null,t))],i=!0)},p(i,[n]){e=i,a?a.p&&(!o||134217728&n)&&Hn(a,r,e,e[27],o?Nn(r,e[27],n,null):jn(e[27]),null):s&&s.p&&(!o||2563&n)&&s.p(e,o?n:-1),(!o||16&n)&&mr(t,"type",e[4]),(!o||4&n)&&mr(t,"style",e[2]),(!o||8&n)&&(t.disabled=e[3]),(!o||1024&n)&&mr(t,"class",e[10]),(!o||1&n)&&mr(t,"title",e[0])},i(e){o||(ta(s,e),o=!0)},o(e){oa(s,e),o=!1},d(o){o&&rr(t),s&&s.d(o),e[26](null),i=!1,Fn(n)}}}function Hc(e,t,o){let i,n,r,a,s,l,{$$slots:c={},$$scope:d}=t,{class:u}=t,{label:h}=t,{labelClass:p}=t,{innerClass:m}=t,{hideLabel:g=!1}=t,{icon:$}=t,{style:f}=t,{disabled:y}=t,{type:b="button"}=t,{onclick:x}=t,{onkeydown:v}=t,{onhold:w}=t,{action:S=(()=>{})}=t,{holdThreshold:k=500}=t,{holdSpeedUpFactor:M=.5}=t,{holdSpeedMin:C=20}=t;const T=e=>{o(23,l=setTimeout((()=>{w(),T(Math.max(e*M,C))}),e))};let P;return e.$$set=e=>{"class"in e&&o(13,u=e.class),"label"in e&&o(0,h=e.label),"labelClass"in e&&o(14,p=e.labelClass),"innerClass"in e&&o(15,m=e.innerClass),"hideLabel"in e&&o(16,g=e.hideLabel),"icon"in e&&o(1,$=e.icon),"style"in e&&o(2,f=e.style),"disabled"in e&&o(3,y=e.disabled),"type"in e&&o(4,b=e.type),"onclick"in e&&o(5,x=e.onclick),"onkeydown"in e&&o(6,v=e.onkeydown),"onhold"in e&&o(17,w=e.onhold),"action"in e&&o(7,S=e.action),"holdThreshold"in e&&o(18,k=e.holdThreshold),"holdSpeedUpFactor"in e&&o(19,M=e.holdSpeedUpFactor),"holdSpeedMin"in e&&o(20,C=e.holdSpeedMin),"$$scope"in e&&o(27,d=e.$$scope)},e.$$.update=()=>{25296896&e.$$.dirty&&o(24,n=w?()=>{l&&(clearTimeout(l),o(23,l=void 0),document.documentElement.removeEventListener("pointerup",n))}:Rn),17170432&e.$$.dirty&&o(12,i=w?()=>{document.documentElement.addEventListener("pointerup",n),T(k)}:Rn),32768&e.$$.dirty&&o(11,r=ic(["PinturaButtonInner",m])),73728&e.$$.dirty&&o(10,a=ic(["PinturaButton",g&&"PinturaButtonIconOnly",u])),81920&e.$$.dirty&&o(9,s=ic([g?"implicit":"PinturaButtonLabel",p]))},[h,$,f,y,b,x,v,S,P,s,a,r,i,u,p,m,g,w,k,M,C,e=>Oc(e,P),()=>P,l,n,c,function(e){Dr[e?"unshift":"push"]((()=>{P=e,o(8,P)}))},d]}class jc extends $a{constructor(e){super(),ga(this,e,Hc,Nc,Dn,{class:13,label:0,labelClass:14,innerClass:15,hideLabel:16,icon:1,style:2,disabled:3,type:4,onclick:5,onkeydown:6,onhold:17,action:7,holdThreshold:18,holdSpeedUpFactor:19,holdSpeedMin:20,isEventTarget:21,getElement:22})}get isEventTarget(){return this.$$.ctx[21]}get getElement(){return this.$$.ctx[22]}}function Uc(e){let t,o,i,n;const r=[e[4]];function a(t){e[22](t)}var s=e[10];function l(e){let t={};for(let e=0;e<r.length;e+=1)t=An(t,r[e]);return void 0!==e[2]&&(t.name=e[2]),{props:t}}return s&&(t=xr(s,l(e)),Dr.push((()=>ua(t,"name",a))),e[23](t),t.$on("measure",e[11])),{c(){t&&ha(t.$$.fragment),i=dr()},m(e,o){t&&pa(t,e,o),nr(e,i,o),n=!0},p(e,n){const c=16&n?ca(r,[da(e[4])]):{};if(!o&&4&n&&(o=!0,c.name=e[2],jr((()=>o=!1))),s!==(s=e[10])){if(t){Qr();const e=t;oa(e.$$.fragment,1,0,(()=>{ma(e,1)})),ea()}s?(t=xr(s,l(e)),Dr.push((()=>ua(t,"name",a))),e[23](t),t.$on("measure",e[11]),ha(t.$$.fragment),ta(t.$$.fragment,1),pa(t,i.parentNode,i)):t=null}else s&&t.$set(c)},i(e){n||(t&&ta(t.$$.fragment,e),n=!0)},o(e){t&&oa(t.$$.fragment,e),n=!1},d(o){e[23](null),o&&rr(i),t&&ma(t,o)}}}function Zc(e){let t,o,i,n=e[5]&&Uc(e);return{c(){t=ar("div"),n&&n.c(),mr(t,"data-util",e[2]),mr(t,"class",o=ic(["PinturaUtilPanel",e[1]])),mr(t,"style",e[6])},m(o,r){nr(o,t,r),n&&n.m(t,null),e[24](t),i=!0},p(e,[r]){e[5]?n?(n.p(e,r),32&r&&ta(n,1)):(n=Uc(e),n.c(),ta(n,1),n.m(t,null)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),(!i||4&r)&&mr(t,"data-util",e[2]),(!i||2&r&&o!==(o=ic(["PinturaUtilPanel",e[1]])))&&mr(t,"class",o),(!i||64&r)&&mr(t,"style",e[6])},i(e){i||(ta(n),i=!0)},o(e){oa(n),i=!1},d(o){o&&rr(t),n&&n.d(),e[24](null)}}}function Xc(e,t,o){let i,n,r,a,s,l;const c=Ar();let{isActive:d=!0}=t,{stores:u}=t,{content:h}=t,{component:p}=t,{locale:m}=t,{class:g}=t;const $=Lr("isAnimated");let f;_n(e,$,(e=>o(21,l=e)));const y=Fl(0),b=xa(y,(e=>Wa(e,0,1)));_n(e,b,(e=>o(20,s=e)));let x=!d;const v=ba(d);_n(e,v,(e=>o(25,a=e)));const w={isActive:xa(v,(async(e,t)=>{if(!e)return t(e);await Nr(),t(e)})),isActiveFraction:xa(b,(e=>e)),isVisible:xa(b,(e=>e>0))},S=h.view,k=kc(S),M=Object.keys(h.props||{}).reduce(((e,t)=>k.includes(t)?(e[t]=h.props[t],e):e),{}),C=Object.keys(w).reduce(((e,t)=>k.includes(t)?(e[t]=w[t],e):e),{});let T,P;const R=e=>{o(17,f={...e.detail}),I&&d&&c("measure",{...f})};let I=!1;return Pr((()=>{if(o(19,I=!0),r)return;o(0,p=new S({target:P,props:{...n}})),o(2,T=p.name);const e=p.$on("measure",R);return()=>{e(),p.$destroy()}})),e.$$set=e=>{"isActive"in e&&o(12,d=e.isActive),"stores"in e&&o(13,u=e.stores),"content"in e&&o(14,h=e.content),"component"in e&&o(0,p=e.component),"locale"in e&&o(15,m=e.locale),"class"in e&&o(1,g=e.class)},e.$$.update=()=>{135169&e.$$.dirty&&f&&d&&p&&c("measure",f),2101248&e.$$.dirty&&y.set(d?1:0,{hard:!1===l}),1310720&e.$$.dirty&&(s<=0&&!x?o(18,x=!0):s>0&&x&&o(18,x=!1)),786432&e.$$.dirty&&I&&c(x?"hide":"show"),1048576&e.$$.dirty&&c("fade",s),1048576&e.$$.dirty&&o(6,i=s<1?"opacity: "+s:void 0),4096&e.$$.dirty&&Xn(v,a=d,a),40960&e.$$.dirty&&o(4,n={...M,...C,stores:u,locale:m})},o(5,r=!k.includes("external")),[p,g,T,P,n,r,i,$,b,v,S,R,d,u,h,m,y,f,x,I,s,l,function(e){T=e,o(2,T)},function(e){Dr[e?"unshift":"push"]((()=>{p=e,o(0,p)}))},function(e){Dr[e?"unshift":"push"]((()=>{P=e,o(3,P)}))}]}class Gc extends $a{constructor(e){super(),ga(this,e,Xc,Zc,Dn,{isActive:12,stores:13,content:14,component:0,locale:15,class:1,opacity:16})}get opacity(){return this.$$.ctx[16]}}var Yc=(e,t)=>{const o=e.findIndex(t);if(o>=0)return e.splice(o,1)};const qc=80;var Kc=(e,t={})=>{const{inertia:o=!1,inertiaDurationMultiplier:i=qc,shouldStartInteraction:n=(()=>!0),pinch:r=!1,multiTouch:a,getEventPosition:s=(e=>ue(e.clientX,e.clientY))}=t;function l(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}))}function c(){v&&v(),v=void 0}const d=[],u=e=>0===e.timeStamp?Date.now():e.timeStamp,h=()=>{const e=me(d[0].position);if(d[1]){const t=.5*(d[1].position.x-e.x),o=.5*(d[1].position.y-e.y);e.x+=t,e.y+=o}return e},p=e=>{e.origin.x=e.position.x,e.origin.y=e.position.y,e.translation.x=0,e.translation.y=0},m=e=>{const t=(e=>d.findIndex((t=>t.event.pointerId===e.pointerId)))(e);if(!(t<0))return d[t]},g=()=>1===d.length,$=()=>2===d.length,f=e=>{const t=Ae(e.map((e=>e.position)));return{center:t,distance:((e,t)=>e.reduce(((e,o)=>e+Re(t,o.position)),0)/e.length)(e,t),velocity:Ae(e.map((e=>e.velocity))),translation:Ae(e.map((e=>e.translation)))}};let y,b,x,v,w,S,k,M,C=0,T=void 0;function P(t){if(!$()&&!(e=>To(e.button)&&0!==e.button)(t)&&n(t,e))if(c(),(e=>{const t=u(e),o={timeStamp:t,timeStampInitial:t,position:s(e),origin:s(e),velocity:de(),velocityHistory:[],velocityAverage:de(),translation:de(),interactionState:void 0,event:e};d.push(o),o.interactionState=f(d)})(t),g())document.documentElement.addEventListener("pointermove",I),document.documentElement.addEventListener("pointerup",A),document.documentElement.addEventListener("pointercancel",A),document.addEventListener("visibilitychange",L),M=!1,k=1,S=de(),w=void 0,l("interactionstart",{origin:me(m(t).origin)});else if(r)M=!0,w=Re(d[0].position,d[1].position),S.x+=d[0].translation.x,S.y+=d[0].translation.y,p(d[0]);else if(!1===a)return d.length=0,z(),l("interactioncancel")}e.addEventListener("pointerdown",P);let R=Date.now();function I(e){e.preventDefault(),(e=>{const t=m(e);if(!t)return;const o=u(e),i=s(e),n=Math.max(1,o-t.timeStamp);t.velocity.x=(i.x-t.position.x)/n,t.velocity.y=(i.y-t.position.y)/n,t.velocityHistory.push(me(t.velocity)),t.velocityHistory=t.velocityHistory.slice(-3),t.velocityAverage=t.velocityHistory.reduce(((e,t,o,i)=>(e.x+=t.x/i.length,e.y+=t.y/i.length,e)),de()),t.translation.x=i.x-t.origin.x,t.translation.y=i.y-t.origin.y,t.timeStamp=o,t.position.x=i.x,t.position.y=i.y,t.event=e})(e);const t=me(d[0].translation);let o=k;if(r&&$()){o*=Re(d[0].position,d[1].position)/w,we(t,d[1].translation)}we(t,S);const i=Date.now();i-R<16||(R=i,l("interactionupdate",{position:h(),translation:t,scalar:r?o:void 0,isMultiTouching:$()}))}function A(e){if(!m(e))return;const t=h(),n=(e=>{const t=Yc(d,(t=>t.event.pointerId===e.pointerId));if(t)return t[0]})(e);if(r&&g()){const e=Re(d[0].position,n.position);k*=e/w,S.x+=d[0].translation.x+n.translation.x,S.y+=d[0].translation.y+n.translation.y,p(d[0])}let a=!1,s=!1;if(!M&&n){const e=performance.now(),t=e-n.timeStampInitial,o=Pe(n.translation);a=o<64&&t<300,s=!!(T&&a&&e-C<700&&Pe(T,n.position)<128),a&&(T=me(n.position),C=e)}if(d.length>0)return;z();const c=me(n.translation),u=me(n.velocityAverage);let $=!1;l("interactionrelease",{isTap:a,isDoubleTap:s,position:t,translation:c,scalar:k,preventInertia:()=>$=!0});const f=Re(u);if($||!o||f<.25)return F(c,{isTap:a,isDoubleTap:s});b=me(t),x=me(c),y=El(me(c),{easing:Rl,duration:f*i}),y.set({x:c.x+50*u.x,y:c.y+50*u.y}).then((()=>{v&&F(On(y),{isTap:a,isDoubleTap:s})})),v=y.subscribe(E)}function E(e){e&&l("interactionupdate",{position:ue(b.x+(e.x-x.x),b.y+(e.y-x.y)),translation:e,scalar:r?k:void 0})}function L(e){if("visible"===document.visibilityState)return;const t=f(d);c(),l("interactionend",{...t}),z()}function F(e,t){c(),l("interactionend",{...t,translation:e,scalar:r?k:void 0})}function z(){document.documentElement.removeEventListener("pointermove",I),document.documentElement.removeEventListener("pointerup",A),document.documentElement.removeEventListener("pointercancel",A),document.addEventListener("visibilitychange",L)}return{destroy(){c(),e.removeEventListener("pointerdown",P)}}};function Jc(e,t){return t?t*Math.sign(e)*Math.log10(1+Math.abs(e)/t):e}const Qc=(e,t,o)=>{if(!t||!o)return{...e};const i=e.x+Jc(t.x-e.x,o),n=e.x+e.width+Jc(t.x+t.width-(e.x+e.width),o),r=e.y+Jc(t.y-e.y,o);return{x:i,y:r,width:n-i,height:e.y+e.height+Jc(t.y+t.height-(e.y+e.height),o)-r}},ed=(e,t,o)=>t&&o?ue(e.x+Jc(t.x-e.x,o),e.y+Jc(t.y-e.y,o)):{...e};var td=(e,t)=>{if(e)return/em/.test(e)?16*parseInt(e,10):/px/.test(e)?parseInt(e,10):void 0},od=e=>{let t=e.detail||0;const{deltaX:o,deltaY:i,wheelDelta:n,wheelDeltaX:r,wheelDeltaY:a}=e;return To(r)&&Math.abs(r)>Math.abs(a)?t=r/-120:To(o)&&Math.abs(o)>Math.abs(i)?t=o/20:(n||a)&&(t=(n||a)/-120),t||(t=i/20),($l()||jt())&&(t*=2),t};function id(e){let t,o,i,n,r,a,s;const l=e[36].default,c=Wn(l,e,e[35],null);return{c(){t=ar("div"),o=ar("div"),c&&c.c(),mr(o,"style",e[5]),mr(t,"class",i=ic(["PinturaScrollable",e[0]])),mr(t,"style",e[4]),mr(t,"data-direction",e[1]),mr(t,"data-state",e[6])},m(i,l){nr(i,t,l),tr(t,o),c&&c.m(o,null),e[38](t),r=!0,a||(s=[ur(o,"interactionstart",e[8]),ur(o,"interactionupdate",e[10]),ur(o,"interactionend",e[11]),ur(o,"interactionrelease",e[9]),Gn(Kc.call(null,o,{inertia:!0})),ur(o,"measure",e[37]),Gn(Gl.call(null,o)),ur(t,"wheel",e[13],{passive:!1}),ur(t,"scroll",e[15]),ur(t,"focusin",e[14]),ur(t,"nudge",e[16]),ur(t,"measure",e[12]),Gn(Gl.call(null,t,{observePosition:!0})),Gn(n=Pc.call(null,t,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1}))],a=!0)},p(e,a){c&&c.p&&(!r||16&a[1])&&Hn(c,l,e,e[35],r?Nn(l,e[35],a,null):jn(e[35]),null),(!r||32&a[0])&&mr(o,"style",e[5]),(!r||1&a[0]&&i!==(i=ic(["PinturaScrollable",e[0]])))&&mr(t,"class",i),(!r||16&a[0])&&mr(t,"style",e[4]),(!r||2&a[0])&&mr(t,"data-direction",e[1]),(!r||64&a[0])&&mr(t,"data-state",e[6]),n&&zn(n.update)&&2&a[0]&&n.update.call(null,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1})},i(e){r||(ta(c,e),r=!0)},o(e){oa(c,e),r=!1},d(o){o&&rr(t),c&&c.d(o),e[38](null),a=!1,Fn(s)}}}function nd(e,t,o){let i,n,r,s,l,c,d,u,{$$slots:h={},$$scope:p}=t;const m=Ar();let g,$,f,y,b="idle",x=Fl(0);_n(e,x,(e=>o(34,u=e)));let v,{class:w}=t,{scrollBlockInteractionDist:S=5}=t,{scrollStep:k=10}=t,{scrollFocusMargin:M=64}=t,{scrollDirection:C="x"}=t,{scrollAutoCancel:T=!1}=t,{elasticity:P=0}=t,{onscroll:R=a}=t,{maskFeatherSize:I}=t,{maskFeatherStartOpacity:A}=t,{maskFeatherEndOpacity:E}=t,{scroll:L}=t,F="",z=!0;const D=x.subscribe((e=>{const t=de();t[C]=e,R(t)})),B=e=>Math.max(Math.min(0,e),f[i]-$[i]);let O,_,W;const V=(e,t={})=>{const{elastic:i=!1,animate:n=!1,preventScrollState:r=!1}=t;Math.abs(e-g)>S&&"idle"===b&&!y&&!r&&o(27,b="scrolling");const a=B(e),s=i&&P&&!y?a+Jc(e-a,P):a;let l=!0;n?l=!1:z||(l=!y),z=!1,x.set(s,{hard:l}).then((e=>{y&&(z=!0)}))};Ir((()=>{D()}));return e.$$set=e=>{"class"in e&&o(0,w=e.class),"scrollBlockInteractionDist"in e&&o(20,S=e.scrollBlockInteractionDist),"scrollStep"in e&&o(21,k=e.scrollStep),"scrollFocusMargin"in e&&o(22,M=e.scrollFocusMargin),"scrollDirection"in e&&o(1,C=e.scrollDirection),"scrollAutoCancel"in e&&o(23,T=e.scrollAutoCancel),"elasticity"in e&&o(24,P=e.elasticity),"onscroll"in e&&o(25,R=e.onscroll),"maskFeatherSize"in e&&o(19,I=e.maskFeatherSize),"maskFeatherStartOpacity"in e&&o(17,A=e.maskFeatherStartOpacity),"maskFeatherEndOpacity"in e&&o(18,E=e.maskFeatherEndOpacity),"scroll"in e&&o(26,L=e.scroll),"$$scope"in e&&o(35,p=e.$$scope)},e.$$.update=()=>{if(2&e.$$.dirty[0]&&o(31,i="x"===C?"width":"height"),2&e.$$.dirty[0]&&o(29,n=C.toUpperCase()),8&e.$$.dirty[0]&&o(33,r=v&&getComputedStyle(v)),8&e.$$.dirty[0]|4&e.$$.dirty[1]&&o(32,s=r&&td(r.getPropertyValue("--scrollable-feather-size"))),268828676&e.$$.dirty[0]|11&e.$$.dirty[1]&&null!=u&&f&&null!=s&&$){const e=-1*u/s,t=-(f[i]-$[i]-u)/s;o(17,A=Wa(1-e,0,1)),o(18,E=Wa(1-t,0,1)),o(19,I=s),o(4,F=`--scrollable-feather-start-opacity: ${A};--scrollable-feather-end-opacity: ${E}`)}67108872&e.$$.dirty[0]&&v&&void 0!==L&&(To(L)?V(L):V(L.scrollOffset,L)),268435460&e.$$.dirty[0]|1&e.$$.dirty[1]&&o(30,l=f&&$?$[i]>f[i]:void 0),1207959552&e.$$.dirty[0]&&o(6,c=ic([b,l?"overflows":void 0])),1610612736&e.$$.dirty[0]|8&e.$$.dirty[1]&&o(5,d=l?`transform: translate${n}(${u}px)`:void 0)},[w,C,$,v,F,d,c,x,()=>{l&&(_=!1,O=!0,W=ue(0,0),y=!1,o(27,b="idle"),g=On(x))},({detail:e})=>{l&&(y=!0,o(27,b="idle"))},({detail:e})=>{l&&(_||O&&(O=!1,Pe(e.translation)<.1)||(!T||"x"!==C||(e=>{const t=ve(ue(e.x-W.x,e.y-W.y),Math.abs);W=me(e);const o=Pe(t),i=t.x-t.y;return!(o>1&&i<-.5)})(e.translation)?V(g+e.translation[C],{elastic:!0}):_=!0))},({detail:e})=>{if(!l)return;if(_)return;const t=g+e.translation[C],o=B(t);z=!1,x.set(o).then((e=>{y&&(z=!0)}))},({detail:e})=>{o(28,f=e),m("measure",{x:e.x,y:e.y,width:e.width,height:e.height})},e=>{if(!l)return;e.preventDefault(),e.stopPropagation();const t=e.shiftKey,o=od(e)*(t?-1:1),i=On(x);V(i+o*k,{animate:!0})},e=>{if(!l)return;if(!y)return;let t=e.target;e.target.classList.contains("implicit")&&(t=t.parentNode);const o=t["x"===C?"offsetLeft":"offsetTop"],n=o+t["x"===C?"offsetWidth":"offsetHeight"],r=On(x),a=M+I;r+o<a?V(-o+a):r+n>f[i]-a&&V(f[i]-n-a,{animate:!0})},()=>{o(3,v["x"===C?"scrollLeft":"scrollTop"]=0,v)},({detail:e})=>{if(v.querySelector("[data-focus-visible]"))return;const t=-2*e[C],o=On(x);V(o+t*k,{animate:!0,preventScrollState:!0})},A,E,I,S,k,M,T,P,R,L,b,f,n,l,i,s,r,u,p,h,e=>o(2,$=e.detail),function(e){Dr[e?"unshift":"push"]((()=>{v=e,o(3,v)}))}]}class rd extends $a{constructor(e){super(),ga(this,e,nd,id,Dn,{class:0,scrollBlockInteractionDist:20,scrollStep:21,scrollFocusMargin:22,scrollDirection:1,scrollAutoCancel:23,elasticity:24,onscroll:25,maskFeatherSize:19,maskFeatherStartOpacity:17,maskFeatherEndOpacity:18,scroll:26},null,[-1,-1])}}function ad(e,{delay:t=0,duration:o=400,easing:i=In}={}){const n=+getComputedStyle(e).opacity;return{delay:t,duration:o,easing:i,css:e=>"opacity: "+e*n}}function sd(e){let t,o,i,n,r;return{c(){t=ar("span"),mr(t,"class","PinturaStatusMessage")},m(o,a){nr(o,t,a),t.innerHTML=e[0],i=!0,n||(r=[ur(t,"measure",(function(){zn(e[1])&&e[1].apply(this,arguments)})),Gn(Gl.call(null,t))],n=!0)},p(o,[n]){e=o,(!i||1&n)&&(t.innerHTML=e[0])},i(e){i||(Hr((()=>{o||(o=na(t,ad,{duration:500},!0)),o.run(1)})),i=!0)},o(e){o||(o=na(t,ad,{duration:500},!1)),o.run(0),i=!1},d(e){e&&rr(t),e&&o&&o.end(),n=!1,Fn(r)}}}function ld(e,t,o){let{text:i}=t,{onmeasure:n=a}=t;return e.$$set=e=>{"text"in e&&o(0,i=e.text),"onmeasure"in e&&o(1,n=e.onmeasure)},[i,n]}class cd extends $a{constructor(e){super(),ga(this,e,ld,sd,Dn,{text:0,onmeasure:1})}}function dd(e){let t,o,i,n,r,a,s,l;return{c(){t=ar("span"),o=sr("svg"),i=sr("g"),n=sr("circle"),r=sr("circle"),a=cr(),s=ar("span"),l=lr(e[3]),mr(n,"class","PinturaProgressIndicatorBar"),mr(n,"r","8.5"),mr(n,"cx","10"),mr(n,"cy","10"),mr(n,"stroke-linecap","round"),mr(n,"opacity",".25"),mr(r,"class","PinturaProgressIndicatorFill"),mr(r,"r","8.5"),mr(r,"stroke-dasharray",e[2]),mr(r,"cx","10"),mr(r,"cy","10"),mr(r,"transform","rotate(-90) translate(-20)"),mr(i,"fill","none"),mr(i,"stroke","currentColor"),mr(i,"stroke-width","2.5"),mr(i,"stroke-linecap","round"),mr(i,"opacity",e[1]),mr(o,"width","20"),mr(o,"height","20"),mr(o,"viewBox","0 0 20 20"),mr(o,"xmlns","http://www.w3.org/2000/svg"),mr(o,"aria-hidden","true"),mr(o,"focusable","false"),mr(s,"class","implicit"),mr(t,"class","PinturaProgressIndicator"),mr(t,"data-status",e[0])},m(e,c){nr(e,t,c),tr(t,o),tr(o,i),tr(i,n),tr(i,r),tr(t,a),tr(t,s),tr(s,l)},p(e,[o]){4&o&&mr(r,"stroke-dasharray",e[2]),2&o&&mr(i,"opacity",e[1]),8&o&&$r(l,e[3]),1&o&&mr(t,"data-status",e[0])},i:Rn,o:Rn,d(e){e&&rr(t)}}}function ud(e,t,o){let i,n,r,a,s,l;const c=Ar();let{progress:d}=t,{min:u=0}=t,{max:h=100}=t,{labelBusy:p="Busy"}=t;const m=Fl(0,{precision:.01}),g=Fl(0,{precision:.01});_n(e,g,(e=>o(10,s=e)));const $=xa([m],(e=>Wa(e,u,h)));_n(e,$,(e=>o(11,l=e)));const f=$.subscribe((e=>{1===d&&Math.round(e)>=100&&c("complete")}));return Pr((()=>{g.set(1)})),Ir((()=>{f()})),e.$$set=e=>{"progress"in e&&o(6,d=e.progress),"min"in e&&o(7,u=e.min),"max"in e&&o(8,h=e.max),"labelBusy"in e&&o(9,p=e.labelBusy)},e.$$.update=()=>{64&e.$$.dirty&&d&&d!==1/0&&m.set(100*d),2624&e.$$.dirty&&o(3,i=d===1/0?p:Math.round(l)+"%"),2112&e.$$.dirty&&o(2,n=d===1/0?"26.5 53":l/100*53+" 53"),1024&e.$$.dirty&&o(1,r=s),64&e.$$.dirty&&o(0,a=d===1/0?"busy":"loading")},[a,r,n,i,g,$,d,u,h,p,s,l]}class hd extends $a{constructor(e){super(),ga(this,e,ud,dd,Dn,{progress:6,min:7,max:8,labelBusy:9})}}function pd(e){let t,o,i;const n=e[5].default,r=Wn(n,e,e[4],null);return{c(){t=ar("span"),r&&r.c(),mr(t,"class",o="PinturaStatusAside "+e[0]),mr(t,"style",e[1])},m(e,o){nr(e,t,o),r&&r.m(t,null),i=!0},p(e,[a]){r&&r.p&&(!i||16&a)&&Hn(r,n,e,e[4],i?Nn(n,e[4],a,null):jn(e[4]),null),(!i||1&a&&o!==(o="PinturaStatusAside "+e[0]))&&mr(t,"class",o),(!i||2&a)&&mr(t,"style",e[1])},i(e){i||(ta(r,e),i=!0)},o(e){oa(r,e),i=!1},d(e){e&&rr(t),r&&r.d(e)}}}function md(e,t,o){let i,{$$slots:n={},$$scope:r}=t,{offset:a=0}=t,{opacity:s=0}=t,{class:l}=t;return e.$$set=e=>{"offset"in e&&o(2,a=e.offset),"opacity"in e&&o(3,s=e.opacity),"class"in e&&o(0,l=e.class),"$$scope"in e&&o(4,r=e.$$scope)},e.$$.update=()=>{12&e.$$.dirty&&o(1,i=`transform:translateX(${a}px);opacity:${s}`)},[l,i,a,s,r,n]}class gd extends $a{constructor(e){super(),ga(this,e,md,pd,Dn,{offset:2,opacity:3,class:0})}}function $d(e){let t,o,i;const n=e[3].default,r=Wn(n,e,e[2],null);let a=[{for:o="_"},e[1]],s={};for(let e=0;e<a.length;e+=1)s=An(s,a[e]);return{c(){t=ar("label"),r&&r.c(),gr(t,s)},m(e,o){nr(e,t,o),r&&r.m(t,null),i=!0},p(e,o){r&&r.p&&(!i||4&o)&&Hn(r,n,e,e[2],i?Nn(n,e[2],o,null):jn(e[2]),null),gr(t,s=ca(a,[{for:"_"},2&o&&e[1]]))},i(e){i||(ta(r,e),i=!0)},o(e){oa(r,e),i=!1},d(e){e&&rr(t),r&&r.d(e)}}}function fd(e){let t,o;const i=e[3].default,n=Wn(i,e,e[2],null);let r=[e[1]],a={};for(let e=0;e<r.length;e+=1)a=An(a,r[e]);return{c(){t=ar("div"),n&&n.c(),gr(t,a)},m(e,i){nr(e,t,i),n&&n.m(t,null),o=!0},p(e,s){n&&n.p&&(!o||4&s)&&Hn(n,i,e,e[2],o?Nn(i,e[2],s,null):jn(e[2]),null),gr(t,a=ca(r,[2&s&&e[1]]))},i(e){o||(ta(n,e),o=!0)},o(e){oa(n,e),o=!1},d(e){e&&rr(t),n&&n.d(e)}}}function yd(e){let t,o;const i=e[3].default,n=Wn(i,e,e[2],null);let r=[e[1]],a={};for(let e=0;e<r.length;e+=1)a=An(a,r[e]);return{c(){t=ar("div"),n&&n.c(),gr(t,a)},m(e,i){nr(e,t,i),n&&n.m(t,null),o=!0},p(e,s){n&&n.p&&(!o||4&s)&&Hn(n,i,e,e[2],o?Nn(i,e[2],s,null):jn(e[2]),null),gr(t,a=ca(r,[2&s&&e[1]]))},i(e){o||(ta(n,e),o=!0)},o(e){oa(n,e),o=!1},d(e){e&&rr(t),n&&n.d(e)}}}function bd(e){let t,o,i,n;const r=[yd,fd,$d],a=[];function s(e,t){return"div"===e[0]?0:"span"===e[0]?1:"label"===e[0]?2:-1}return~(t=s(e))&&(o=a[t]=r[t](e)),{c(){o&&o.c(),i=dr()},m(e,o){~t&&a[t].m(e,o),nr(e,i,o),n=!0},p(e,[n]){let l=t;t=s(e),t===l?~t&&a[t].p(e,n):(o&&(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea()),~t?(o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ta(o,1),o.m(i.parentNode,i)):o=null)},i(e){n||(ta(o),n=!0)},o(e){oa(o),n=!1},d(e){~t&&a[t].d(e),e&&rr(i)}}}function xd(e,t,o){let{$$slots:i={},$$scope:n}=t,{name:r="div"}=t,{attributes:a={}}=t;return e.$$set=e=>{"name"in e&&o(0,r=e.name),"attributes"in e&&o(1,a=e.attributes),"$$scope"in e&&o(2,n=e.$$scope)},[r,a,n,i]}class vd extends $a{constructor(e){super(),ga(this,e,xd,bd,Dn,{name:0,attributes:1})}}var wd=()=>u()&&window.devicePixelRatio||1;let Sd=null;var kd=e=>(null===Sd&&(Sd=1===wd()?Math.round:e=>e),Sd(e)),Md=(e,t={})=>{if(e){if(t.preventScroll&&jt()){const t=document.body.scrollTop;return e.focus(),void(document.body.scrollTop=t)}e.focus(t)}};const Cd=e=>({}),Td=e=>({}),Pd=e=>({}),Rd=e=>({});function Id(e){let t,o;const i=[e[7]];let n={$$slots:{default:[Ed]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new jc({props:n}),e[40](t),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=128&o[0]?ca(i,[da(e[7])]):{};8192&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(o){e[40](null),ma(t,o)}}}function Ad(e){let t,o;const i=[e[7]];let n={};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new jc({props:n}),e[39](t),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=128&o[0]?ca(i,[da(e[7])]):{};t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(o){e[39](null),ma(t,o)}}}function Ed(e){let t;const o=e[38].label,i=Wn(o,e,e[44],Rd);return{c(){i&&i.c()},m(e,o){i&&i.m(e,o),t=!0},p(e,n){i&&i.p&&(!t||8192&n[1])&&Hn(i,o,e,e[44],t?Nn(o,e[44],n,Pd):jn(e[44]),Rd)},i(e){t||(ta(i,e),t=!0)},o(e){oa(i,e),t=!1},d(e){i&&i.d(e)}}}function Ld(e){let t,o,i,n,r,a,s;const l=e[38].details,c=Wn(l,e,e[44],Td);return{c(){t=ar("div"),c&&c.c(),o=cr(),i=ar("span"),mr(i,"class","PinturaPanelTip"),mr(i,"style",e[10]),mr(t,"class",n=ic(["PinturaPanel","pintura-editor-panel",e[2]])),mr(t,"tabindex","-1"),mr(t,"style",e[11])},m(n,l){nr(n,t,l),c&&c.m(t,null),tr(t,o),tr(t,i),e[41](t),r=!0,a||(s=[ur(t,"close",e[42]),ur(t,"keydown",e[18]),ur(t,"measure",e[43]),Gn(Gl.call(null,t))],a=!0)},p(e,o){c&&c.p&&(!r||8192&o[1])&&Hn(c,l,e,e[44],r?Nn(l,e[44],o,Cd):jn(e[44]),Td),(!r||1024&o[0])&&mr(i,"style",e[10]),(!r||4&o[0]&&n!==(n=ic(["PinturaPanel","pintura-editor-panel",e[2]])))&&mr(t,"class",n),(!r||2048&o[0])&&mr(t,"style",e[11])},i(e){r||(ta(c,e),r=!0)},o(e){oa(c,e),r=!1},d(o){o&&rr(t),c&&c.d(o),e[41](null),a=!1,Fn(s)}}}function Fd(e){let t,o,i,n,r,a,s,l,c;const d=[Ad,Id],u=[];function h(e,t){return e[1]?0:1}o=h(e),i=u[o]=d[o](e);let p=e[6]&&Ld(e);return{c(){t=cr(),i.c(),n=cr(),p&&p.c(),r=cr(),a=dr()},m(i,d){nr(i,t,d),u[o].m(i,d),nr(i,n,d),p&&p.m(i,d),nr(i,r,d),nr(i,a,d),s=!0,l||(c=[ur(document.body,"pointerdown",(function(){zn(e[9])&&e[9].apply(this,arguments)})),ur(document.body,"pointerup",(function(){zn(e[8])&&e[8].apply(this,arguments)}))],l=!0)},p(t,a){let s=o;o=h(e=t),o===s?u[o].p(e,a):(Qr(),oa(u[s],1,1,(()=>{u[s]=null})),ea(),i=u[o],i?i.p(e,a):(i=u[o]=d[o](e),i.c()),ta(i,1),i.m(n.parentNode,n)),e[6]?p?(p.p(e,a),64&a[0]&&ta(p,1)):(p=Ld(e),p.c(),ta(p,1),p.m(r.parentNode,r)):p&&(Qr(),oa(p,1,1,(()=>{p=null})),ea())},i(e){s||(ta(i),ta(p),ta(false),s=!0)},o(e){oa(i),oa(p),oa(false),s=!1},d(e){e&&rr(t),u[o].d(e),e&&rr(n),p&&p.d(e),e&&rr(r),e&&rr(a),l=!1,Fn(c)}}}let zd=12;function Dd(e,t,o){let i,n,r,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,{$$slots:w={},$$scope:S}=t,{buttonClass:k}=t,{buttonLabel:M}=t,{panelClass:C}=t,{isActive:T=!1}=t,{onshow:P=(({panel:e})=>Md(e,{preventScroll:!0}))}=t,{onhide:R=a}=t;const I=Lr("isAnimated");_n(e,I,(e=>o(37,v=e)));const A=Lr("rootPortal");_n(e,A,(e=>o(32,$=e)));const E=Lr("rootRect");let L,F,z;_n(e,E,(e=>o(36,x=e)));const D=()=>o(22,z=i&&i.getBoundingClientRect());let B=de(),O=Fl(0);_n(e,O,(e=>o(34,y=e)));let _=de();const W=ba({x:0,y:0});_n(e,W,(e=>o(33,f=e)));const V=Fl(-5,{stiffness:.1,damping:.35,precision:.001});_n(e,V,(e=>o(35,b=e)));const N=e=>Oc(e,$)||F.isEventTarget(e);let H,j,U=!1;const Z=e=>{T||D(),o(26,j=e),o(0,T=!T)},X=e=>{/down/i.test(e.key)&&(o(0,T=!0),o(26,j=e))};Ir((()=>{if(!$)return;if(!H)return;const e=H;Nr().then((()=>{e.parentNode&&e.remove()}))}));return e.$$set=e=>{"buttonClass"in e&&o(19,k=e.buttonClass),"buttonLabel"in e&&o(1,M=e.buttonLabel),"panelClass"in e&&o(2,C=e.panelClass),"isActive"in e&&o(0,T=e.isActive),"onshow"in e&&o(20,P=e.onshow),"onhide"in e&&o(21,R=e.onhide),"$$scope"in e&&o(44,S=e.$$scope)},e.$$.update=()=>{if(16&e.$$.dirty[0]&&(i=F&&F.getElement()),33554433&e.$$.dirty[0]&&o(8,m=T?e=>{U&&(o(25,U=!1),N(e)||o(0,T=!1))}:void 0),1&e.$$.dirty[0]|64&e.$$.dirty[1]&&O.set(T?1:0,{hard:!1===v}),1&e.$$.dirty[0]|64&e.$$.dirty[1]&&V.set(T?0:-5,{hard:!1===v}),16&e.$$.dirty[1]&&o(29,n=1-b/-5),1&e.$$.dirty[0]|32&e.$$.dirty[1]&&x&&T&&D(),4194313&e.$$.dirty[0]|32&e.$$.dirty[1]&&x&&L&&z&&T){let e=z.x-x.x+.5*z.width-.5*L.width,t=z.y-x.y+z.height;const i=zd,n=zd,r=x.width-zd,a=x.height-zd,s=e,l=t,c=s+L.width,d=l+L.height;if(s<i&&(o(24,_.x=s-i,_),e=i),c>r&&(o(24,_.x=c-r,_),e=r-L.width),d>a){o(23,B.y=-1,B);n<t-L.height-z.height?(o(24,_.y=0,_),t-=L.height+z.height):(o(24,_.y=t-(d-a),_),t-=d-a)}else o(23,B.y=1,B);Xn(W,f=ve(ue(e,t),kd),f)}8&e.$$.dirty[1]&&o(6,r=y>0),8&e.$$.dirty[1]&&o(31,s=y<1),8388608&e.$$.dirty[0]|20&e.$$.dirty[1]&&o(30,l=`translateX(${Math.round(f.x)+B.x*zd}px) translateY(${Math.round(f.y)+B.y*zd+B.y*b}px)`),1073741824&e.$$.dirty[0]|9&e.$$.dirty[1]&&o(11,c=s?`opacity: ${y}; pointer-events: ${y<1?"none":"all"}; transform: ${l};`:"transform: "+l),536870912&e.$$.dirty[0]&&o(27,d=.5+.5*n),536870912&e.$$.dirty[0]&&o(28,u=n),427819016&e.$$.dirty[0]|4&e.$$.dirty[1]&&o(10,h=f&&L&&`opacity:${u};transform:scaleX(${d})rotate(45deg);top:${B.y<0?_.y+L.height:0}px;left:${_.x+.5*L.width}px`),1&e.$$.dirty[0]&&o(9,p=T?e=>{N(e)||o(25,U=!0)}:void 0),96&e.$$.dirty[0]|2&e.$$.dirty[1]&&r&&$&&H&&H.parentNode!==$&&$.append(H),1&e.$$.dirty[0]&&(T||o(26,j=void 0)),68157537&e.$$.dirty[0]&&T&&r&&H&&P({e:j,panel:H}),2097217&e.$$.dirty[0]&&r&&!T&&R(),524290&e.$$.dirty[0]&&o(7,g={label:M,class:ic(["PinturaPanelButton",k]),onkeydown:X,onclick:Z})},[T,M,C,L,F,H,r,g,m,p,h,c,I,A,E,O,W,V,e=>{/esc/i.test(e.key)&&(o(0,T=!1),i.focus())},k,P,R,z,B,_,U,j,d,u,n,l,s,$,f,y,b,x,v,w,function(e){Dr[e?"unshift":"push"]((()=>{F=e,o(4,F)}))},function(e){Dr[e?"unshift":"push"]((()=>{F=e,o(4,F)}))},function(e){Dr[e?"unshift":"push"]((()=>{H=e,o(5,H)}))},e=>{e.stopPropagation(),o(0,T=!1)},e=>o(3,L=De(e.detail)),S]}class Bd extends $a{constructor(e){super(),ga(this,e,Dd,Fd,Dn,{buttonClass:19,buttonLabel:1,panelClass:2,isActive:0,onshow:20,onhide:21},null,[-1,-1])}}var Od={Up:38,Down:40,Left:37,Right:39};function _d(e){let t,o,i,n,r,a,s,l;const c=e[15].default,d=Wn(c,e,e[14],null);return{c(){t=ar("li"),o=ar("input"),i=cr(),n=ar("label"),d&&d.c(),mr(o,"type","radio"),mr(o,"class","implicit"),mr(o,"id",e[7]),mr(o,"name",e[0]),o.value=e[3],o.disabled=e[6],o.hidden=e[5],o.checked=e[4],mr(n,"for",e[7]),mr(n,"title",e[2]),mr(t,"class",r=ic(["PinturaRadioGroupOption",e[1]])),mr(t,"data-hidden",e[5]),mr(t,"data-disabled",e[6]),mr(t,"data-selected",e[4])},m(r,c){nr(r,t,c),tr(t,o),tr(t,i),tr(t,n),d&&d.m(n,null),a=!0,s||(l=[ur(o,"change",pr(e[16])),ur(o,"keydown",e[9]),ur(o,"click",e[10])],s=!0)},p(e,[i]){(!a||128&i)&&mr(o,"id",e[7]),(!a||1&i)&&mr(o,"name",e[0]),(!a||8&i)&&(o.value=e[3]),(!a||64&i)&&(o.disabled=e[6]),(!a||32&i)&&(o.hidden=e[5]),(!a||16&i)&&(o.checked=e[4]),d&&d.p&&(!a||16384&i)&&Hn(d,c,e,e[14],a?Nn(c,e[14],i,null):jn(e[14]),null),(!a||128&i)&&mr(n,"for",e[7]),(!a||4&i)&&mr(n,"title",e[2]),(!a||2&i&&r!==(r=ic(["PinturaRadioGroupOption",e[1]])))&&mr(t,"class",r),(!a||32&i)&&mr(t,"data-hidden",e[5]),(!a||64&i)&&mr(t,"data-disabled",e[6]),(!a||16&i)&&mr(t,"data-selected",e[4])},i(e){a||(ta(d,e),a=!0)},o(e){oa(d,e),a=!1},d(e){e&&rr(t),d&&d.d(e),s=!1,Fn(l)}}}function Wd(e,t,o){let i,n,{$$slots:r={},$$scope:a}=t,{name:s}=t,{class:l}=t,{label:c}=t,{id:d}=t,{value:u}=t,{checked:h}=t,{onkeydown:p}=t,{onclick:m}=t,{hidden:g=!1}=t,{disabled:$=!1}=t;const f=Object.values(Od),y=Lr("keysPressed");_n(e,y,(e=>o(17,n=e)));return e.$$set=e=>{"name"in e&&o(0,s=e.name),"class"in e&&o(1,l=e.class),"label"in e&&o(2,c=e.label),"id"in e&&o(11,d=e.id),"value"in e&&o(3,u=e.value),"checked"in e&&o(4,h=e.checked),"onkeydown"in e&&o(12,p=e.onkeydown),"onclick"in e&&o(13,m=e.onclick),"hidden"in e&&o(5,g=e.hidden),"disabled"in e&&o(6,$=e.disabled),"$$scope"in e&&o(14,a=e.$$scope)},e.$$.update=()=>{2049&e.$$.dirty&&o(7,i=`${s}-${d}`)},[s,l,c,u,h,g,$,i,y,e=>{p(e)},e=>{n.some((e=>f.includes(e)))||m(e)},d,p,m,a,r,function(t){Fr.call(this,e,t)}]}class Vd extends $a{constructor(e){super(),ga(this,e,Wd,_d,Dn,{name:0,class:1,label:2,id:11,value:3,checked:4,onkeydown:12,onclick:13,hidden:5,disabled:6})}}var Nd=(e=[])=>e.reduce(((e,t)=>(Io(t)?Io(t[1]):!!t.options)?e.concat(Io(t)?t[1]:t.options):(e.push(t),e)),[]);const Hd=(e,t,o)=>{let i;return Io(e)?i={id:t,value:e[0],label:e[1],...e[2]||{}}:(i=e,i.id=null!=i.id?i.id:t),o?o(i):i};var jd=(e,t,o)=>R(e)?e(t,o):e;const Ud=(e,t)=>e.map((([e,o,i])=>{if(Io(o))return[jd(e,t),Ud(o,t)];{const n=[e,jd(o,t)];if(i){let e={...i};i.icon&&(e.icon=jd(i.icon,t)),n.push(e)}return n}}));var Zd=(e,t)=>Ud(e,t),Xd=(e,t)=>Array.isArray(e)&&Array.isArray(t)?ja(e,t):e===t;function Gd(e,t,o){const i=e.slice();return i[27]=t[o],i}const Yd=e=>({option:1024&e[0]}),qd=e=>({option:e[27]});function Kd(e,t,o){const i=e.slice();return i[27]=t[o],i}const Jd=e=>({option:1024&e[0]}),Qd=e=>({option:e[27]}),eu=e=>({option:1024&e[0]}),tu=e=>({option:e[27]});function ou(e){let t,o,i,n,r,a=[],s=new Map,l=e[1]&&iu(e),c=e[10];const d=e=>e[27].id;for(let t=0;t<c.length;t+=1){let o=Gd(e,c,t),i=d(o);s.set(i,a[t]=gu(i,o))}return{c(){t=ar("fieldset"),l&&l.c(),o=cr(),i=ar("ul");for(let e=0;e<a.length;e+=1)a[e].c();mr(i,"class","PinturaRadioGroupOptions"),mr(t,"class",n=ic(["PinturaRadioGroup",e[3]])),mr(t,"data-layout",e[5]),mr(t,"title",e[7])},m(e,n){nr(e,t,n),l&&l.m(t,null),tr(t,o),tr(t,i);for(let e=0;e<a.length;e+=1)a[e].m(i,null);r=!0},p(e,u){e[1]?l?l.p(e,u):(l=iu(e),l.c(),l.m(t,o)):l&&(l.d(1),l=null),8419153&u[0]&&(c=e[10],Qr(),a=la(a,u,d,1,e,c,s,i,sa,gu,null,Gd),ea()),(!r||8&u[0]&&n!==(n=ic(["PinturaRadioGroup",e[3]])))&&mr(t,"class",n),(!r||32&u[0])&&mr(t,"data-layout",e[5]),(!r||128&u[0])&&mr(t,"title",e[7])},i(e){if(!r){for(let e=0;e<c.length;e+=1)ta(a[e]);r=!0}},o(e){for(let e=0;e<a.length;e+=1)oa(a[e]);r=!1},d(e){e&&rr(t),l&&l.d();for(let e=0;e<a.length;e+=1)a[e].d()}}}function iu(e){let t,o,i;return{c(){t=ar("legend"),o=lr(e[1]),mr(t,"class",i=e[2]&&"implicit")},m(e,i){nr(e,t,i),tr(t,o)},p(e,n){2&n[0]&&$r(o,e[1]),4&n[0]&&i!==(i=e[2]&&"implicit")&&mr(t,"class",i)},d(e){e&&rr(t)}}}function nu(e){let t,o;return t=new Vd({props:{name:e[4],label:e[27].label,id:e[27].id,value:e[27].value,disabled:e[27].disabled,hidden:e[27].hidden,class:e[8],checked:e[12](e[27])===e[0],onkeydown:e[13](e[27]),onclick:e[14](e[27]),$$slots:{default:[cu]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.name=e[4]),1024&o[0]&&(i.label=e[27].label),1024&o[0]&&(i.id=e[27].id),1024&o[0]&&(i.value=e[27].value),1024&o[0]&&(i.disabled=e[27].disabled),1024&o[0]&&(i.hidden=e[27].hidden),256&o[0]&&(i.class=e[8]),1025&o[0]&&(i.checked=e[12](e[27])===e[0]),1024&o[0]&&(i.onkeydown=e[13](e[27])),1024&o[0]&&(i.onclick=e[14](e[27])),8389696&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function ru(e){let t,o,i,n,r,a,s=[],l=new Map;const c=e[22].group,d=Wn(c,e,e[23],tu),u=d||function(e){let t,o,i=e[27].label+"";return{c(){t=ar("span"),o=lr(i),mr(t,"class","PinturaRadioGroupOptionGroupLabel")},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){1024&t[0]&&i!==(i=e[27].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}(e);let h=e[27].options;const p=e=>e[27].id;for(let t=0;t<h.length;t+=1){let o=Kd(e,h,t),i=p(o);l.set(i,s[t]=mu(i,o))}return{c(){t=ar("li"),u&&u.c(),o=cr(),i=ar("ul");for(let e=0;e<s.length;e+=1)s[e].c();n=cr(),mr(i,"class","PinturaRadioGroupOptions"),mr(t,"class",r=ic(["PinturaRadioGroupOptionGroup",e[9]]))},m(e,r){nr(e,t,r),u&&u.m(t,null),tr(t,o),tr(t,i);for(let e=0;e<s.length;e+=1)s[e].m(i,null);tr(t,n),a=!0},p(e,o){d?d.p&&(!a||8389632&o[0])&&Hn(d,c,e,e[23],a?Nn(c,e[23],o,eu):jn(e[23]),tu):u&&u.p&&(!a||1024&o[0])&&u.p(e,a?o:[-1,-1]),8418641&o[0]&&(h=e[27].options,Qr(),s=la(s,o,p,1,e,h,l,i,sa,mu,null,Kd),ea()),(!a||512&o[0]&&r!==(r=ic(["PinturaRadioGroupOptionGroup",e[9]])))&&mr(t,"class",r)},i(e){if(!a){ta(u,e);for(let e=0;e<h.length;e+=1)ta(s[e]);a=!0}},o(e){oa(u,e);for(let e=0;e<s.length;e+=1)oa(s[e]);a=!1},d(e){e&&rr(t),u&&u.d(e);for(let e=0;e<s.length;e+=1)s[e].d()}}}function au(e){let t,o;return t=new Tc({props:{$$slots:{default:[su]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function su(e){let t,o=e[27].icon+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function lu(e){let t,o,i=e[27].label+"";return{c(){t=ar("span"),o=lr(i),mr(t,"class",e[6])},m(e,i){nr(e,t,i),tr(t,o)},p(e,n){1024&n[0]&&i!==(i=e[27].label+"")&&$r(o,i),64&n[0]&&mr(t,"class",e[6])},d(e){e&&rr(t)}}}function cu(e){let t;const o=e[22].option,i=Wn(o,e,e[23],qd),n=i||function(e){let t,o,i,n=e[27].icon&&au(e),r=!e[27].hideLabel&&lu(e);return{c(){n&&n.c(),t=cr(),r&&r.c(),o=cr()},m(e,a){n&&n.m(e,a),nr(e,t,a),r&&r.m(e,a),nr(e,o,a),i=!0},p(e,i){e[27].icon?n?(n.p(e,i),1024&i[0]&&ta(n,1)):(n=au(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[27].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=lu(e),r.c(),r.m(o.parentNode,o))},i(e){i||(ta(n),i=!0)},o(e){oa(n),i=!1},d(e){n&&n.d(e),e&&rr(t),r&&r.d(e),e&&rr(o)}}}(e);return{c(){n&&n.c()},m(e,o){n&&n.m(e,o),t=!0},p(e,r){i?i.p&&(!t||8389632&r[0])&&Hn(i,o,e,e[23],t?Nn(o,e[23],r,Yd):jn(e[23]),qd):n&&n.p&&(!t||1088&r[0])&&n.p(e,t?r:[-1,-1])},i(e){t||(ta(n,e),t=!0)},o(e){oa(n,e),t=!1},d(e){n&&n.d(e)}}}function du(e){let t,o;return t=new Tc({props:{$$slots:{default:[uu]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function uu(e){let t,o=e[27].icon+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function hu(e){let t,o,i=e[27].label+"";return{c(){t=ar("span"),o=lr(i),mr(t,"class",e[6])},m(e,i){nr(e,t,i),tr(t,o)},p(e,n){1024&n[0]&&i!==(i=e[27].label+"")&&$r(o,i),64&n[0]&&mr(t,"class",e[6])},d(e){e&&rr(t)}}}function pu(e){let t;const o=e[22].option,i=Wn(o,e,e[23],Qd),n=i||function(e){let t,o,i,n=e[27].icon&&du(e),r=!e[27].hideLabel&&hu(e);return{c(){n&&n.c(),t=cr(),r&&r.c(),o=cr()},m(e,a){n&&n.m(e,a),nr(e,t,a),r&&r.m(e,a),nr(e,o,a),i=!0},p(e,i){e[27].icon?n?(n.p(e,i),1024&i[0]&&ta(n,1)):(n=du(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[27].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=hu(e),r.c(),r.m(o.parentNode,o))},i(e){i||(ta(n),i=!0)},o(e){oa(n),i=!1},d(e){n&&n.d(e),e&&rr(t),r&&r.d(e),e&&rr(o)}}}(e);return{c(){n&&n.c()},m(e,o){n&&n.m(e,o),t=!0},p(e,r){i?i.p&&(!t||8389632&r[0])&&Hn(i,o,e,e[23],t?Nn(o,e[23],r,Jd):jn(e[23]),Qd):n&&n.p&&(!t||1088&r[0])&&n.p(e,t?r:[-1,-1])},i(e){t||(ta(n,e),t=!0)},o(e){oa(n,e),t=!1},d(e){n&&n.d(e)}}}function mu(e,t){let o,i,n;return i=new Vd({props:{name:t[4],label:t[27].label,id:t[27].id,value:t[27].value,disabled:t[27].disabled,hidden:t[27].hidden,class:t[8],checked:t[12](t[27])===t[0],onkeydown:t[13](t[27]),onclick:t[14](t[27]),$$slots:{default:[pu]},$$scope:{ctx:t}}}),{key:e,first:null,c(){o=dr(),ha(i.$$.fragment),this.first=o},m(e,t){nr(e,o,t),pa(i,e,t),n=!0},p(e,o){t=e;const n={};16&o[0]&&(n.name=t[4]),1024&o[0]&&(n.label=t[27].label),1024&o[0]&&(n.id=t[27].id),1024&o[0]&&(n.value=t[27].value),1024&o[0]&&(n.disabled=t[27].disabled),1024&o[0]&&(n.hidden=t[27].hidden),256&o[0]&&(n.class=t[8]),1025&o[0]&&(n.checked=t[12](t[27])===t[0]),1024&o[0]&&(n.onkeydown=t[13](t[27])),1024&o[0]&&(n.onclick=t[14](t[27])),8389696&o[0]&&(n.$$scope={dirty:o,ctx:t}),i.$set(n)},i(e){n||(ta(i.$$.fragment,e),n=!0)},o(e){oa(i.$$.fragment,e),n=!1},d(e){e&&rr(o),ma(i,e)}}}function gu(e,t){let o,i,n,r,a;const s=[ru,nu],l=[];function c(e,t){return e[27].options?0:1}return i=c(t),n=l[i]=s[i](t),{key:e,first:null,c(){o=dr(),n.c(),r=dr(),this.first=o},m(e,t){nr(e,o,t),l[i].m(e,t),nr(e,r,t),a=!0},p(e,o){let a=i;i=c(t=e),i===a?l[i].p(t,o):(Qr(),oa(l[a],1,1,(()=>{l[a]=null})),ea(),n=l[i],n?n.p(t,o):(n=l[i]=s[i](t),n.c()),ta(n,1),n.m(r.parentNode,r))},i(e){a||(ta(n),a=!0)},o(e){oa(n),a=!1},d(e){e&&rr(o),l[i].d(e),e&&rr(r)}}}function $u(e){let t,o,i,n=e[11].length&&ou(e);return{c(){n&&n.c(),t=cr(),o=dr()},m(e,r){n&&n.m(e,r),nr(e,t,r),nr(e,o,r),i=!0},p(e,o){e[11].length?n?(n.p(e,o),2048&o[0]&&ta(n,1)):(n=ou(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea())},i(e){i||(ta(n),ta(false),i=!0)},o(e){oa(n),oa(false),i=!1},d(e){n&&n.d(e),e&&rr(t),e&&rr(o)}}}function fu(e,t,o){let i,n,r,{$$slots:a={},$$scope:s}=t;const l=Ar();let{label:c}=t,{hideLabel:d=!0}=t,{class:u}=t,{name:h="radio-group-"+L()}=t,{selectedIndex:p=-1}=t,{options:m=[]}=t,{onchange:g}=t,{layout:$}=t,{optionMapper:f}=t,{optionFilter:y}=t,{value:b}=t,{optionLabelClass:x}=t,{title:v}=t,{locale:w}=t,{optionClass:S}=t,{optionGroupClass:k}=t;const M=e=>r.findIndex((t=>t.id===e.id)),C=(e,t)=>{o(0,p=M(e));const i={index:p,...e};((e,...t)=>{e&&e(...t)})(g,i,t),l("change",i)};return e.$$set=e=>{"label"in e&&o(1,c=e.label),"hideLabel"in e&&o(2,d=e.hideLabel),"class"in e&&o(3,u=e.class),"name"in e&&o(4,h=e.name),"selectedIndex"in e&&o(0,p=e.selectedIndex),"options"in e&&o(15,m=e.options),"onchange"in e&&o(16,g=e.onchange),"layout"in e&&o(5,$=e.layout),"optionMapper"in e&&o(17,f=e.optionMapper),"optionFilter"in e&&o(18,y=e.optionFilter),"value"in e&&o(19,b=e.value),"optionLabelClass"in e&&o(6,x=e.optionLabelClass),"title"in e&&o(7,v=e.title),"locale"in e&&o(20,w=e.locale),"optionClass"in e&&o(8,S=e.optionClass),"optionGroupClass"in e&&o(9,k=e.optionGroupClass),"$$scope"in e&&o(23,s=e.$$scope)},e.$$.update=()=>{1343488&e.$$.dirty[0]&&o(11,i=Zd(y?m.filter(y):m,w)),133120&e.$$.dirty[0]&&o(10,n=((e=[],t)=>{let o=0;return e.map((e=>(o++,Io(e)?Io(e[1])?{id:o,label:e[0],options:e[1].map((e=>Hd(e,++o,t)))}:Hd(e,o,t):e.options?{id:e.id||o,label:e.label,options:e.options.map((e=>Hd(e,++o,t)))}:Hd(e,o,t))))})(i,f)),1024&e.$$.dirty[0]&&o(21,r=Nd(n)),2654209&e.$$.dirty[0]&&p<0&&(o(0,p=r.findIndex((e=>Xd(e.value,b)))),p<0&&o(0,p=(e=>e.findIndex((e=>void 0===e[0])))(m)))},[p,c,d,u,h,$,x,v,S,k,n,i,M,e=>t=>{var o;(o=t.key,/enter| /i.test(o))&&C(e,t)},e=>t=>{C(e,t)},m,g,f,y,b,w,r,a,s]}class yu extends $a{constructor(e){super(),ga(this,e,fu,$u,Dn,{label:1,hideLabel:2,class:3,name:4,selectedIndex:0,options:15,onchange:16,layout:5,optionMapper:17,optionFilter:18,value:19,optionLabelClass:6,title:7,locale:20,optionClass:8,optionGroupClass:9},null,[-1,-1])}}const bu=e=>({}),xu=e=>({});function vu(e){let t,o;return t=new Tc({props:{class:"PinturaButtonIcon",$$slots:{default:[wu]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};268435520&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function wu(e){let t;return{c(){t=sr("g")},m(o,i){nr(o,t,i),t.innerHTML=e[6]},p(e,o){64&o&&(t.innerHTML=e[6])},d(e){e&&rr(t)}}}function Su(e){let t,o,i,n,r,a,s,l=(e[2]||e[18])+"",c=e[6]&&vu(e);return{c(){t=ar("span"),c&&c.c(),o=cr(),i=ar("span"),mr(i,"class",n=ic(["PinturaButtonLabel",e[3],e[5]&&"implicit"])),mr(t,"slot","label"),mr(t,"title",r=jd(e[1],e[15])),mr(t,"class",a=ic(["PinturaButtonInner",e[4]]))},m(e,n){nr(e,t,n),c&&c.m(t,null),tr(t,o),tr(t,i),i.innerHTML=l,s=!0},p(e,d){e[6]?c?(c.p(e,d),64&d&&ta(c,1)):(c=vu(e),c.c(),ta(c,1),c.m(t,o)):c&&(Qr(),oa(c,1,1,(()=>{c=null})),ea()),(!s||262148&d)&&l!==(l=(e[2]||e[18])+"")&&(i.innerHTML=l),(!s||40&d&&n!==(n=ic(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&mr(i,"class",n),(!s||32770&d&&r!==(r=jd(e[1],e[15])))&&mr(t,"title",r),(!s||16&d&&a!==(a=ic(["PinturaButtonInner",e[4]])))&&mr(t,"class",a)},i(e){s||(ta(c),s=!0)},o(e){oa(c),s=!1},d(e){e&&rr(t),c&&c.d()}}}function ku(e){let t,o,i=e[30].label+"";return{c(){t=ar("span"),o=lr(i),mr(t,"slot","group")},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){1073741824&t&&i!==(i=e[30].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}function Mu(e){let t,o;return t=new Tc({props:{style:R(e[13])?e[13](e[30].value):e[13],$$slots:{default:[Cu]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};1073750016&o&&(i.style=R(e[13])?e[13](e[30].value):e[13]),1342177280&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Cu(e){let t,o=e[30].icon+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){1073741824&i&&o!==(o=e[30].icon+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function Tu(e){let t,o=e[30].sublabel+"";return{c(){t=ar("span"),mr(t,"class","PinturaDropdownOptionSublabel")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){1073741824&i&&o!==(o=e[30].sublabel+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function Pu(e){let t,o,i,n,r,a,s,l,c=e[30].label+"",d=e[30].icon&&Mu(e),u=e[30].sublabel&&Tu(e);return{c(){t=ar("span"),d&&d.c(),o=cr(),i=ar("span"),n=new br(!1),r=cr(),u&&u.c(),n.a=r,mr(i,"style",a=R(e[14])?e[14](e[30].value):e[14]),mr(i,"class",s=ic(["PinturaDropdownOptionLabel",e[10]])),mr(t,"slot","option")},m(e,a){nr(e,t,a),d&&d.m(t,null),tr(t,o),tr(t,i),n.m(c,i),tr(i,r),u&&u.m(i,null),l=!0},p(e,r){e[30].icon?d?(d.p(e,r),1073741824&r&&ta(d,1)):(d=Mu(e),d.c(),ta(d,1),d.m(t,o)):d&&(Qr(),oa(d,1,1,(()=>{d=null})),ea()),(!l||1073741824&r)&&c!==(c=e[30].label+"")&&n.p(c),e[30].sublabel?u?u.p(e,r):(u=Tu(e),u.c(),u.m(i,null)):u&&(u.d(1),u=null),(!l||1073758208&r&&a!==(a=R(e[14])?e[14](e[30].value):e[14]))&&mr(i,"style",a),(!l||1024&r&&s!==(s=ic(["PinturaDropdownOptionLabel",e[10]])))&&mr(i,"class",s)},i(e){l||(ta(d),l=!0)},o(e){oa(d),l=!1},d(e){e&&rr(t),d&&d.d(),u&&u.d()}}}function Ru(e){let t,o,i,n,r,a;const s=e[26].controls,l=Wn(s,e,e[28],xu);return i=new yu({props:{class:"PinturaOptionsList PinturaScrollableContent",name:e[7],value:e[9],selectedIndex:e[8],optionFilter:e[11],optionMapper:e[12],optionLabelClass:ic(["PinturaDropdownOptionLabel",e[10]]),optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[16],onchange:e[19],$$slots:{option:[Pu,({option:e})=>({30:e}),({option:e})=>e?1073741824:0],group:[ku,({option:e})=>({30:e}),({option:e})=>e?1073741824:0]},$$scope:{ctx:e}}}),{c(){t=ar("div"),l&&l.c(),o=cr(),ha(i.$$.fragment),mr(t,"slot","details"),mr(t,"class","PinturaOptionsListWrapper")},m(s,c){nr(s,t,c),l&&l.m(t,null),tr(t,o),pa(i,t,null),n=!0,r||(a=ur(t,"keydown",e[21]),r=!0)},p(e,t){l&&l.p&&(!n||268435456&t)&&Hn(l,s,e,e[28],n?Nn(s,e[28],t,bu):jn(e[28]),xu);const o={};128&t&&(o.name=e[7]),512&t&&(o.value=e[9]),256&t&&(o.selectedIndex=e[8]),2048&t&&(o.optionFilter=e[11]),4096&t&&(o.optionMapper=e[12]),1024&t&&(o.optionLabelClass=ic(["PinturaDropdownOptionLabel",e[10]])),65536&t&&(o.options=e[16]),1342202880&t&&(o.$$scope={dirty:t,ctx:e}),i.$set(o)},i(e){n||(ta(l,e),ta(i.$$.fragment,e),n=!0)},o(e){oa(l,e),oa(i.$$.fragment,e),n=!1},d(e){e&&rr(t),l&&l.d(e),ma(i),r=!1,a()}}}function Iu(e){let t,o,i;function n(t){e[27](t)}let r={onshow:e[20],buttonClass:ic(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"]),$$slots:{details:[Ru],label:[Su]},$$scope:{ctx:e}};return void 0!==e[17]&&(r.isActive=e[17]),t=new Bd({props:r}),Dr.push((()=>ua(t,"isActive",n))),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(e,[i]){const n={};33&i&&(n.buttonClass=ic(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"])),268828670&i&&(n.$$scope={dirty:i,ctx:e}),!o&&131072&i&&(o=!0,n.isActive=e[17],jr((()=>o=!1))),t.$set(n)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}function Au(e,t,o){let i,n,{$$slots:r={},$$scope:s}=t,{class:l}=t,{title:c}=t,{label:d}=t,{labelClass:u}=t,{innerClass:h}=t,{hideLabel:p=!1}=t,{icon:m}=t,{name:g}=t,{options:$=[]}=t,{selectedIndex:f=-1}=t,{value:y}=t,{optionLabelClass:b}=t,{optionFilter:x}=t,{optionMapper:v}=t,{optionIconStyle:w}=t,{optionLabelStyle:S}=t,{locale:k}=t,{onchange:M=a}=t,{onload:C=a}=t,{ondestroy:T=a}=t;let P;return Pr((()=>C({options:$}))),Ir((()=>T({options:$}))),e.$$set=e=>{"class"in e&&o(0,l=e.class),"title"in e&&o(1,c=e.title),"label"in e&&o(2,d=e.label),"labelClass"in e&&o(3,u=e.labelClass),"innerClass"in e&&o(4,h=e.innerClass),"hideLabel"in e&&o(5,p=e.hideLabel),"icon"in e&&o(6,m=e.icon),"name"in e&&o(7,g=e.name),"options"in e&&o(22,$=e.options),"selectedIndex"in e&&o(8,f=e.selectedIndex),"value"in e&&o(9,y=e.value),"optionLabelClass"in e&&o(10,b=e.optionLabelClass),"optionFilter"in e&&o(11,x=e.optionFilter),"optionMapper"in e&&o(12,v=e.optionMapper),"optionIconStyle"in e&&o(13,w=e.optionIconStyle),"optionLabelStyle"in e&&o(14,S=e.optionLabelStyle),"locale"in e&&o(15,k=e.locale),"onchange"in e&&o(23,M=e.onchange),"onload"in e&&o(24,C=e.onload),"ondestroy"in e&&o(25,T=e.ondestroy),"$$scope"in e&&o(28,s=e.$$scope)},e.$$.update=()=>{4227072&e.$$.dirty&&o(16,i=k?Zd($,k):$),66048&e.$$.dirty&&o(18,n=i.reduce(((e,t)=>{if(e)return e;const o=Array.isArray(t)?t:[t,t],[i,n]=o;return Xd(i,y)?n:void 0}),void 0)||(e=>{const t=e.find((e=>void 0===e[0]));if(t)return t[1]})(i)||y)},[l,c,d,u,h,p,m,g,f,y,b,x,v,w,S,k,i,P,n,e=>{o(18,n=e.value),M(e),o(17,P=!1)},({e:e,panel:t})=>{if(e&&e.key&&/up|down/i.test(e.key))return Md(t.querySelector("input:not([disabled])"));Md(t.querySelector("fieldset"))},e=>{/tab/i.test(e.key)&&e.preventDefault()},$,M,C,T,r,function(e){P=e,o(17,P)},s]}class Eu extends $a{constructor(e){super(),ga(this,e,Au,Iu,Dn,{class:0,title:1,label:2,labelClass:3,innerClass:4,hideLabel:5,icon:6,name:7,options:22,selectedIndex:8,value:9,optionLabelClass:10,optionFilter:11,optionMapper:12,optionIconStyle:13,optionLabelStyle:14,locale:15,onchange:23,onload:24,ondestroy:25})}}function Lu(e){let t;return{c(){t=ar("div"),mr(t,"slot","details")},m(o,i){nr(o,t,i),e[10](t)},p:Rn,d(o){o&&rr(t),e[10](null)}}}function Fu(e){let t,o,i;function n(t){e[11](t)}let r={buttonLabel:e[0],buttonClass:e[1],onshow:e[2],onhide:e[3],$$slots:{details:[Lu]},$$scope:{ctx:e}};return void 0!==e[5]&&(r.isActive=e[5]),t=new Bd({props:r}),Dr.push((()=>ua(t,"isActive",n))),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(e,[i]){const n={};1&i&&(n.buttonLabel=e[0]),2&i&&(n.buttonClass=e[1]),4&i&&(n.onshow=e[2]),8&i&&(n.onhide=e[3]),4112&i&&(n.$$scope={dirty:i,ctx:e}),!o&&32&i&&(o=!0,n.isActive=e[5],jr((()=>o=!1))),t.$set(n)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}function zu(e,t,o){let{buttonLabel:i}=t,{buttonClass:n}=t,{root:r}=t,{ondestroy:s=a}=t,{onshow:l=a}=t,{onhide:c=a}=t;let d,u=!1;return Ir(s),e.$$set=e=>{"buttonLabel"in e&&o(0,i=e.buttonLabel),"buttonClass"in e&&o(1,n=e.buttonClass),"root"in e&&o(6,r=e.root),"ondestroy"in e&&o(7,s=e.ondestroy),"onshow"in e&&o(2,l=e.onshow),"onhide"in e&&o(3,c=e.onhide)},e.$$.update=()=>{80&e.$$.dirty&&d&&r&&d.firstChild!==r&&(d.hasChildNodes()?d.replaceChild(r,d.firstChild):d.append(r))},[i,n,l,c,d,u,r,s,()=>o(5,u=!1),()=>o(5,u=!0),function(e){Dr[e?"unshift":"push"]((()=>{d=e,o(4,d)}))},function(e){u=e,o(5,u)}]}class Du extends $a{constructor(e){super(),ga(this,e,zu,Fu,Dn,{buttonLabel:0,buttonClass:1,root:6,ondestroy:7,onshow:2,onhide:3,hide:8,show:9})}get hide(){return this.$$.ctx[8]}get show(){return this.$$.ctx[9]}}function Bu(e){let t,o;return t=new Tc({props:{class:"PinturaButtonIcon",$$slots:{default:[Ou]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};524292&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Ou(e){let t;return{c(){t=sr("g")},m(o,i){nr(o,t,i),t.innerHTML=e[2]},p(e,o){4&o&&(t.innerHTML=e[2])},d(e){e&&rr(t)}}}function _u(e){let t,o,i,n,r,a,s,l,c=e[2]&&Bu(e);return{c(){t=ar("span"),c&&c.c(),o=cr(),i=ar("span"),n=lr(e[8]),mr(i,"class",r=ic(["PinturaButtonLabel",e[3],e[5]&&"implicit"])),mr(t,"slot","label"),mr(t,"title",a=jd(e[1],e[6])),mr(t,"class",s=ic(["PinturaButtonInner",e[4]]))},m(e,r){nr(e,t,r),c&&c.m(t,null),tr(t,o),tr(t,i),tr(i,n),l=!0},p(e,d){e[2]?c?(c.p(e,d),4&d&&ta(c,1)):(c=Bu(e),c.c(),ta(c,1),c.m(t,o)):c&&(Qr(),oa(c,1,1,(()=>{c=null})),ea()),(!l||256&d)&&$r(n,e[8]),(!l||40&d&&r!==(r=ic(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&mr(i,"class",r),(!l||66&d&&a!==(a=jd(e[1],e[6])))&&mr(t,"title",a),(!l||16&d&&s!==(s=ic(["PinturaButtonInner",e[4]])))&&mr(t,"class",s)},i(e){l||(ta(c),l=!0)},o(e){oa(c),l=!1},d(e){e&&rr(t),c&&c.d()}}}function Wu(e){let t,o,i,n,r;const a=[e[11],{value:e[7]},{onchange:e[10]}];let s={};for(let e=0;e<a.length;e+=1)s=An(s,a[e]);return o=new Bc({props:s}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"slot","details")},m(a,s){nr(a,t,s),pa(o,t,null),i=!0,n||(r=ur(t,"keydown",e[9]),n=!0)},p(e,t){const i=3200&t?ca(a,[2048&t&&da(e[11]),128&t&&{value:e[7]},1024&t&&{onchange:e[10]}]):{};o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o),n=!1,r()}}}function Vu(e){let t,o;return t=new Bd({props:{panelClass:"PinturaSliderPanel",buttonClass:ic(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"]),$$slots:{details:[Wu],label:[_u]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,[o]){const i={};33&o&&(i.buttonClass=ic(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"])),526846&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Nu(e,t,o){const i=["class","title","label","icon","labelClass","innerClass","hideLabel","locale","value","onchange"];let n=Zn(t,i),{class:r}=t,{title:s}=t,{label:l=Math.round}=t,{icon:c}=t,{labelClass:d}=t,{innerClass:u}=t,{hideLabel:h=!1}=t,{locale:p}=t,{value:m}=t,{onchange:g=a}=t;const{min:$,max:f,getValue:y=Z}=n;let b;const x=e=>o(8,b=(e=>R(l)?l(y(e),$,f):l)(e));return e.$$set=e=>{t=An(An({},t),Un(e)),o(11,n=Zn(t,i)),"class"in e&&o(0,r=e.class),"title"in e&&o(1,s=e.title),"label"in e&&o(12,l=e.label),"icon"in e&&o(2,c=e.icon),"labelClass"in e&&o(3,d=e.labelClass),"innerClass"in e&&o(4,u=e.innerClass),"hideLabel"in e&&o(5,h=e.hideLabel),"locale"in e&&o(6,p=e.locale),"value"in e&&o(7,m=e.value),"onchange"in e&&o(13,g=e.onchange)},e.$$.update=()=>{4224&e.$$.dirty&&x(m)},[r,s,c,d,u,h,p,m,b,e=>{/tab/i.test(e.key)&&e.preventDefault()},e=>{x(e),g(e)},n,l,g]}class Hu extends $a{constructor(e){super(),ga(this,e,Nu,Vu,Dn,{class:0,title:1,label:12,icon:2,labelClass:3,innerClass:4,hideLabel:5,locale:6,value:7,onchange:13})}}function ju(e,t,o){const i=e.slice();return i[9]=t[o][0],i[0]=t[o][1],i[10]=t[o][2],i[2]=t[o][3],i}function Uu(e){let t,o,i;const n=[e[10]];var r=e[3][e[9]]||e[9];function a(e){let t={};for(let e=0;e<n.length;e+=1)t=An(t,n[e]);return{props:t}}return r&&(t=xr(r,a())),{c(){t&&ha(t.$$.fragment),o=dr()},m(e,n){t&&pa(t,e,n),nr(e,o,n),i=!0},p(e,i){const s=4&i?ca(n,[da(e[10])]):{};if(r!==(r=e[3][e[9]]||e[9])){if(t){Qr();const e=t;oa(e.$$.fragment,1,0,(()=>{ma(e,1)})),ea()}r?(t=xr(r,a()),ha(t.$$.fragment),ta(t.$$.fragment,1),pa(t,o.parentNode,o)):t=null}else r&&t.$set(s)},i(e){i||(t&&ta(t.$$.fragment,e),i=!0)},o(e){t&&oa(t.$$.fragment,e),i=!1},d(e){e&&rr(o),t&&ma(t,e)}}}function Zu(e){let t,o;return t=new vd({props:{name:e[9],attributes:e[4](e[10]),$$slots:{default:[qu]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};4&o&&(i.name=e[9]),4&o&&(i.attributes=e[4](e[10])),8196&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Xu(e){let t,o,i=e[10].innerHTML+"";return{c(){t=new br(!1),o=dr(),t.a=o},m(e,n){t.m(i,e,n),nr(e,o,n)},p(e,o){4&o&&i!==(i=e[10].innerHTML+"")&&t.p(i)},i:Rn,o:Rn,d(e){e&&rr(o),e&&t.d()}}}function Gu(e){let t,o=e[10].textContent+"";return{c(){t=lr(o)},m(e,o){nr(e,t,o)},p(e,i){4&i&&o!==(o=e[10].textContent+"")&&$r(t,o)},i:Rn,o:Rn,d(e){e&&rr(t)}}}function Yu(e){let t,o;return t=new eh({props:{items:e[2],discardEmptyItems:!0}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};4&o&&(i.items=e[2]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function qu(e){let t,o,i,n;const r=[Yu,Gu,Xu],a=[];function s(e,t){return e[2]&&e[2].length?0:e[10].textContent?1:e[10].innerHTML?2:-1}return~(t=s(e))&&(o=a[t]=r[t](e)),{c(){o&&o.c(),i=cr()},m(e,o){~t&&a[t].m(e,o),nr(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?~t&&a[t].p(e,n):(o&&(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea()),~t?(o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ta(o,1),o.m(i.parentNode,i)):o=null)},i(e){n||(ta(o),n=!0)},o(e){oa(o),n=!1},d(e){~t&&a[t].d(e),e&&rr(i)}}}function Ku(e,t){let o,i,n,r,a,s;const l=[Zu,Uu],c=[];function d(e,t){return 4&t&&(i=null),null==i&&(i=!e[5](e[9])),i?0:1}return n=d(t,-1),r=c[n]=l[n](t),{key:e,first:null,c(){o=dr(),r.c(),a=dr(),this.first=o},m(e,t){nr(e,o,t),c[n].m(e,t),nr(e,a,t),s=!0},p(e,o){let i=n;n=d(t=e,o),n===i?c[n].p(t,o):(Qr(),oa(c[i],1,1,(()=>{c[i]=null})),ea(),r=c[n],r?r.p(t,o):(r=c[n]=l[n](t),r.c()),ta(r,1),r.m(a.parentNode,a))},i(e){s||(ta(r),s=!0)},o(e){oa(r),s=!1},d(e){e&&rr(o),c[n].d(e),e&&rr(a)}}}function Ju(e){let t,o,i=[],n=new Map,r=e[2];const a=e=>e[0]+e[1];for(let t=0;t<r.length;t+=1){let o=ju(e,r,t),s=a(o);n.set(s,i[t]=Ku(s,o))}return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=dr()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);nr(e,t,n),o=!0},p(e,[o]){62&o&&(r=e[2],Qr(),i=la(i,o,a,1,e,r,n,t.parentNode,sa,Ku,t,ju),ea())},i(e){if(!o){for(let e=0;e<r.length;e+=1)ta(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)oa(i[e]);o=!1},d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&rr(t)}}}function Qu(e,t,o){let i,n,{items:r}=t,{discardEmptyItems:a=!0}=t,{key:s=""}=t;const l={Button:jc,Dropdown:Eu,Panel:Du,Slider:Hu},c=e=>!P(e)||!!l[e],d=e=>{if(!e)return!1;const[t,,o,i=[]]=e;return!!c(t)||(i.some(d)||o.textContent||o.innerHTML)};return e.$$set=e=>{"items"in e&&o(6,r=e.items),"discardEmptyItems"in e&&o(7,a=e.discardEmptyItems),"key"in e&&o(0,s=e.key)},e.$$.update=()=>{1&e.$$.dirty&&o(1,i=s),192&e.$$.dirty&&o(2,n=(r&&a?r.filter(d):r)||[])},[s,i,n,l,(e={})=>{const{textContent:t,innerHTML:o,...i}=e;return i},c,r,a]}class eh extends $a{constructor(e){super(),ga(this,e,Qu,Ju,Dn,{items:6,discardEmptyItems:7,key:0})}}const th=["aspectRatio","isRotatedSideways","flip","cropSize"],oh=Ga.map((([e])=>e)).filter((e=>!th.includes(e)));var ih=(e,t)=>new CustomEvent("ping",{detail:{type:e,data:t},cancelable:!0,bubbles:!0}),nh=e=>(e=>/textarea/i.test(e.nodeName))(e)||(e=>/date|email|number|search|text|url/.test(e.type))(e)||e.isContentEditable,rh=(e,t)=>(t?Hs(e,t):e).replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase(),ah=(e,t=Z)=>{const{subscribe:o,set:i}=ba(void 0);return{subscribe:o,destroy:((e,t)=>{const o=matchMedia(e);return o.addListener(t),t(o),{get matches(){return o.matches},destroy:()=>o.removeListener(t)}})(e,(({matches:e})=>i(t(e)))).destroy}},sh=()=>u()&&!!window.chrome,lh=e=>/video/.test(e.type);var ch=(e,t,o)=>new Promise(((i,n)=>{(async()=>{lh(e)&&i(await(e=>new Promise(((t,o)=>{const i=g("video");i.onseeked=()=>{const e=g("canvas");Zt(i).then((({width:o,height:n})=>{e.width=o,e.height=n;const r=e.getContext("2d",{willReadFrequently:!0}),a=()=>{r.drawImage(i,0,0,e.width,e.height);const o=r.getImageData(0,0,e.width,e.height);f(e),t(o)};jt()?setTimeout(a,16):a()}))},i.onloadeddata=()=>{i.currentTime=0},i.onerror=e=>{console.error(e),o(e)},i.src=URL.createObjectURL(e),i.load()})))(e));const r=await t.read(e),a=e=>D(e,o).then((e=>t.apply(e,r))).then(i).catch(n);if(E(e)||!A()||jt()||ho())return a(e);let s;try{s=await z(((e,t)=>createImageBitmap(e).then((e=>t(null,e))).catch(t)),[e])}catch(e){}s&&s.width?await p()?sh()&&r>1?i(await(async e=>m(await S(e)))(s)):i(s):i(t.apply(s,r)):a(e)})()})),dh=(e,t)=>new Promise((async o=>{if(e.width<t.width&&e.height<t.height)return o(e);const i=Math.min(t.width/e.width,t.height/e.height),n=i*e.width,r=i*e.height,a=g("canvas",{width:n,height:r}),s=a.getContext("2d",{willReadFrequently:!0}),l=y(e)?await S(e):e;s.drawImage(l,0,0,n,r),o(m(a))})),uh=e=>(e=e.trim(),/^rgba/.test(e)?e.substr(5).split(",").map(parseFloat).map(((e,t)=>e/(3===t?1:255))):/^rgb/.test(e)?e.substr(4).split(",").map(parseFloat).map((e=>e/255)):/^#/.test(e)?(e=>{const[,t,o,i]=e.split("");e=4===e.length?`#${t}${t}${o}${o}${i}${i}`:e;const[,n,r,a]=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return[n,r,a].map((e=>parseInt(e,16)/255))})(e):/[0-9]{1,3}\s?,\s?[0-9]{1,3}\s?,\s?[0-9]{1,3}/.test(e)?e.split(",").map((e=>parseInt(e,10))).map((e=>e/255)):void 0);let hh=null;var ph=()=>{if(null===hh){let e=g("canvas");hh=!!rl(e),f(e),e=void 0}return hh};const mh=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],gh={precision:1e-4},$h={precision:.01*gh.precision};var fh=()=>{const e=[],t=[],o=[],i=()=>{t.forEach((e=>e(o)))},n=t=>{t.unsub=t.subscribe((n=>((t,n)=>{const r=e.indexOf(t);r<0||(o[r]=n,i())})(t,n))),i()};return{get length(){return e.length},clear:()=>{e.forEach((e=>e.unsub())),e.length=0,o.length=0},unshift:t=>{e.unshift(t),n(t)},get:t=>e[t],push:t=>{e.push(t),n(t)},remove:t=>{t.unsub();const i=e.indexOf(t);e.splice(i,1),o.splice(i,1)},forEach:t=>e.forEach(t),filter:t=>e.filter(t),subscribe:e=>(t.push(e),e(o),()=>{t.splice(t.indexOf(e),1)})}},yh=e=>e[0]<.25&&e[1]<.25&&e[2]<.25,bh=(e={})=>new Promise((t=>{const{accept:o="image/*"}=e,i=g("input",{style:"position:absolute;visibility:hidden;width:0;height:0;",type:"file",accept:o}),n=()=>{const[e]=i.files;i.parentNode&&i.remove(),i.removeEventListener("change",n),t(e)};i.addEventListener("change",n),ho()&&document.body.append(i),i.click()})),xh=e=>{try{return e()}catch(e){console.error(e)}},vh=([e,t])=>e+.5*(t-e),wh=e=>Math.round(100*e),Sh=e=>ue(e.clientX,e.clientY),kh=(e,t,o)=>{const i=Sh(e);return Se(Se(i,t),o)};function Mh(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,{root:S}=t,{locale:k}=t,{stores:M}=t,{allowPan:C=!0}=t,{allowZoom:T=!0}=t,{enablePan:P=!0}=t,{enableZoom:R=!0}=t,{enableZoomControls:I=R}=t,{enableZoomInput:A=!0}=t,{enablePanInput:E=!0}=t,{enablePanLimit:L=!0}=t,{panLimitGutterScalar:F=0}=t,{zoomOptions:z=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:D=.25}=t,{zoomAdjustFactor:B=.1}=t,{zoomAdjustWheelFactor:O=1}=t,{elasticity:_=5}=t,{imageSelectionRectCentered:W}=t,{imageSelectionRectScalar:V}=t,{zoomLevel:N=null}=t,{zoomControls:H}=t,{zoomMultiTouching:j=!1}=t;const{isAnimated:U,isInteracting:Z,rootRect:X,stageRect:G,stageScalar:Y,imageSelectionPan:q,imageSelectionZoom:K,imageSelectionStageFitScalar:J,imageSelectionRect:Q,imageSelectionStoredState:ee,imagePreviewUpscale:te}=M;_n(e,U,(e=>o(68,v=e))),_n(e,Z,(e=>o(67,b=e))),_n(e,X,(e=>o(65,f=e))),_n(e,G,(e=>o(64,$=e))),_n(e,Y,(e=>o(45,x=e))),_n(e,q,(e=>o(63,p=e))),_n(e,K,(e=>o(42,h=e))),_n(e,J,(e=>o(43,m=e))),_n(e,Q,(e=>o(66,y=e))),_n(e,ee,(e=>o(69,w=e))),_n(e,te,(e=>o(44,g=e)));let oe=!1,ie=void 0,ne=void 0,re=void 0,ae=void 0;const se=e=>{const t=S.querySelector(".PinturaMain > .PinturaUtilMain")||S.querySelector('div[tabindex="0"] .PinturaUtilMain');return!!t&&(!!t.contains(e.target)&&!nh(e.target))},le=(e={})=>{const{pan:t=p,zoom:o=h}=e;Xn(ee,w={translation:t,zoom:o},w)},ce=()=>p&&0===p.x&&0===p.y,he=()=>{Xn(K,h=void 0,h),ce()||Xn(q,p=de(),p),ge.set(void 0,{hard:!0})},pe=()=>{he(),le()},ge=Fl(void 0,{precision:.01});ge.subscribe((e=>{if(void 0===e)return Xn(K,h=void 0,h),void(ce()||Xn(q,p=de(),p));const t=h;e<=1?ce()||Xn(q,p=de(),p):e<=t&&Xn(q,p=Me(p,.8),p),Xn(K,h=e,h)}));const $e=e=>{ge.update((t=>{const o=e(t||m);return le({zoom:o}),o}))},ye=e=>{e?ge.set(e,{hard:!1===v}):(e=void 0,ge.set(void 0,{hard:!0})),Xn(K,h=e,h),le({zoom:e})},be=(e,t)=>{const o=V*t,i={...W},n=1-Wa(F,0,1);lt(i,o<n?o:n);const r={...W};lt(r,o),st(r,e);const a={...r};return r.x>i.x&&(a.x=i.x),r.y>i.y&&(a.y=i.y),r.x+r.width<i.x+i.width&&(a.x=i.x+i.width-r.width),r.y+r.height<i.y+i.height&&(a.y=i.y+i.height-r.height),Se(at(a),at(i))},xe=({translation:e,zoom:t=1,elastify:o=!0})=>{if(!ie)return;let i=e;const n=ue(ie.x+i.x,ie.y+i.y);if(!L)return n;const r=be(n,t);return o?ed(r,n,_):r};let ve,we;const Ce=()=>{we=void 0,Xn(Z,b=!0,b),o(33,oe=E),ve=!1,re=!1,ie={...p},ne=g?h||m:r?h||1:h||m},Te=e=>{const{scalar:t,translation:n,isMultiTouching:r}=e.detail;if(!ie||!r&&!E)return;r&&Me(n,.5),(E||r)&&(ve=!0),j||o(12,j=r);const a=i?Wa(ne*t,s,l):1,c=xe({translation:n,zoom:a,elastify:!0}),d=fe(c);ae=fe(p),re=d<ae,i&&K.set(a),q.set(c),we=j&&{translation:e.detail.translation,scalar:t}},Pe=e=>{Xn(Z,b=!1,b),o(33,oe=!1),o(12,j=!1),re&&ae<50&&(ie=void 0,ne=void 0,q.set(de()))},Re=e=>{Xn(Z,b=!1,b),o(33,oe=!1),o(12,j=!1),Promise.resolve().then((()=>{if(ve&&ie){const t=we||e.detail,o=i?Wa(ne*t.scalar,s,l):1,n=xe({elastify:!1,translation:t.translation,zoom:o});q.set(n)}ie=void 0,ne=void 0,E&&e.detail.isDoubleTap&&pe(),le()}))};let Ie,Ae=Date.now(),Ee=0,Le=!1,Fe=!1;const ze=e=>{if(!se(e))return;if(e.preventDefault(),e.stopPropagation(),Fe)return;clearTimeout(Ie);const t=Date.now(),o=t-Ae;Ae=t;const i=o<24;Ee=i?Ee+1:0;const n=1+-1*od(e)*O/(i?50:100),r=kh(e,f,$);De(r,n,{isZoomingFast:i})},De=(e,t,{isZoomingFast:o})=>{const i=g?h||m:r?h||1:h||m,n=i*t,a=de(),c=p,d=g?m:r?1:m,u=Math.abs(n-d),$=n<i,f=i>d&&$||i<d&&n>i,b=Ee>=5;if(o||(Le=!1),Ee>0&&!Le&&(Le=f),b&&Le)return pe(),Fe=!0,void setTimeout((()=>{Fe=!1}),100);if(b)return;!o&&f&&u<=.05&&(Ie=setTimeout((()=>{pe()}),250)),Xn(K,h=Wa(n,s,l),h);const x=Je(y);lt(x,i),st(x,c);const v=at(x),w=Je(x);lt(w,h-i+1,e);const S=at(w),k=ke(Se(S,v),i);((e,t,o)=>{e.x=t,e.y=o})(a,c.x+k.x,c.y+k.y),Xn(q,p=$&&o?Me(me(p),.85):be(a,i),p),le()},Be=e=>(e?"add":"remove")+"EventListener";let Oe,_e,We,Ve;const Ne=e=>{e.preventDefault(),_e={...p},Ve=Je(y),We=kh(e,f,$),Oe=g?h||m:r?h||1:h||m},He=e=>{e.preventDefault(),Xn(K,h=Wa(e.scale*Oe,s,l),h);const t=Je(Ve);lt(t,Oe),st(t,_e);const o=at(t),i=Je(t);lt(i,h-Oe+1,We);const n=at(i),r=ke(Se(n,o),Oe),a={x:_e.x+r.x,y:_e.y+r.y};Xn(q,p=be(a,h),p)},je=e=>{e.preventDefault()},Ue=e=>{S[Be(e)]("wheel",ze),ho()||(S[Be(e)]("gesturestart",Ne),S[Be(e)]("gesturechange",He),S[Be(e)]("gestureend",je))},Ze=e=>{const t=Be(e);S[t]("interactionstart",Ce),S[t]("interactionupdate",Te),S[t]("interactionrelease",Pe),S[t]("interactionend",Re)};let Xe;return Pr((()=>{Xe=Kc(S,{drag:!0,pinch:!0,inertia:!0,inertiaDurationMultiplier:10,shouldStartInteraction:se})})),Ir((()=>{Ue(!1),Ze(!1),Xe.destroy(),Xe=void 0})),e.$$set=e=>{"root"in e&&o(13,S=e.root),"locale"in e&&o(14,k=e.locale),"stores"in e&&o(15,M=e.stores),"allowPan"in e&&o(16,C=e.allowPan),"allowZoom"in e&&o(17,T=e.allowZoom),"enablePan"in e&&o(18,P=e.enablePan),"enableZoom"in e&&o(19,R=e.enableZoom),"enableZoomControls"in e&&o(20,I=e.enableZoomControls),"enableZoomInput"in e&&o(21,A=e.enableZoomInput),"enablePanInput"in e&&o(22,E=e.enablePanInput),"enablePanLimit"in e&&o(23,L=e.enablePanLimit),"panLimitGutterScalar"in e&&o(24,F=e.panLimitGutterScalar),"zoomOptions"in e&&o(25,z=e.zoomOptions),"zoomAdjustStep"in e&&o(26,D=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(27,B=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(28,O=e.zoomAdjustWheelFactor),"elasticity"in e&&o(29,_=e.elasticity),"imageSelectionRectCentered"in e&&o(30,W=e.imageSelectionRectCentered),"imageSelectionRectScalar"in e&&o(31,V=e.imageSelectionRectScalar),"zoomLevel"in e&&o(32,N=e.zoomLevel),"zoomControls"in e&&o(11,H=e.zoomControls),"zoomMultiTouching"in e&&o(12,j=e.zoomMultiTouching)},e.$$.update=()=>{var t,$;2752512&e.$$.dirty[0]&&o(35,i=T&&R&&A),327680&e.$$.dirty[0]&&o(34,n=C&&P),196608&e.$$.dirty[0]&&(C||T?(Xn(K,h=R?w.zoom:void 0,h),Xn(q,p=P?me(w.translation):ce()?p:de(),p),ge.set(h)):he()),16384&e.$$.dirty[1]&&(r=x>=1),33570816&e.$$.dirty[0]|28672&e.$$.dirty[1]&&o(39,a=[(g||x<1)&&[m,wh(m)+"%",{sublabel:k.labelZoomFit}],...z.map((e=>[e,wh(e)+"%"]))].filter(Boolean).map((e=>(1===e[0]&&(e[2]={sublabel:k.labelZoomActual}),e))).sort(((e,t)=>{const o=e[0]||m,i=t[0]||m;return o<i?-1:i<o?1:0}))),4352&e.$$.dirty[1]&&o(37,s=Math.min(a.reduce(((e,[t])=>t<e?t:e),Number.MAX_SAFE_INTEGER),m)),256&e.$$.dirty[1]&&o(36,l=a.reduce(((e,[t])=>t>e?t:e),Number.MIN_SAFE_INTEGER)),2&e.$$.dirty[1]&&null!==N&&ye(N),30720&e.$$.dirty[1]&&o(41,d=h||(g||x<1?m:1)),1280&e.$$.dirty[1]&&o(38,(t=a.map((([e])=>e)),$=d,c=t.findIndex((e=>e===$)))),1024&e.$$.dirty[1]&&o(40,u=wh(d)+"%"),202522624&e.$$.dirty[0]|3040&e.$$.dirty[1]&&o(11,H=(T||T)&&I?[["Button","zoom-out",{hideLabel:!0,label:k.labelZoomOut,icon:k.iconZoomOut,disabled:h===s,onclick:()=>$e((e=>Math.max(s,e-D))),onhold:()=>$e((e=>Math.max(s,e*(1-B))))}],["Dropdown","zoom-level",{label:u,labelClass:"PinturaFixedWidthCharacters",options:a,selectedIndex:c,onchange:e=>ye(e.value)}],["Button","zoom-in",{hideLabel:!0,label:k.labelZoomIn,icon:k.iconZoomIn,disabled:h===l,onclick:()=>$e((e=>Math.min(l,e+D))),onhold:()=>$e((e=>Math.min(l,e*(1+B))))}]]:[]),8192&e.$$.dirty[0]|16&e.$$.dirty[1]&&S&&Ue(i),8192&e.$$.dirty[0]|8&e.$$.dirty[1]&&S&&Ze(n),4202496&e.$$.dirty[0]|12&e.$$.dirty[1]&&S&&S.style.setProperty("--cursor",n&&E?oe?"grabbing":"grab":"")},[U,Z,X,G,Y,q,K,J,Q,ee,te,H,j,S,k,M,C,T,P,R,I,A,E,L,F,z,D,B,O,_,W,V,N,oe,n,i,l,s,c,a,u,d,h,m,g,x]}class Ch extends $a{constructor(e){super(),ga(this,e,Mh,null,Dn,{root:13,locale:14,stores:15,allowPan:16,allowZoom:17,enablePan:18,enableZoom:19,enableZoomControls:20,enableZoomInput:21,enablePanInput:22,enablePanLimit:23,panLimitGutterScalar:24,zoomOptions:25,zoomAdjustStep:26,zoomAdjustFactor:27,zoomAdjustWheelFactor:28,elasticity:29,imageSelectionRectCentered:30,imageSelectionRectScalar:31,zoomLevel:32,zoomControls:11,zoomMultiTouching:12},null,[-1,-1,-1,-1])}}const Th=e=>new Promise((t=>{const o=new FileReader;o.onload=()=>t(o.result),o.readAsArrayBuffer(e)})),Ph=(e,{limit:t=1024}={})=>{let o=0;o+=4;if(1718909296!==e.getUint32(o))return 0;o+=4;if(1836069938!==e.getUint32(o))return 0;let i=!1,n=-1;for(let r=o;r<t;r++){if(i||1953653099!==e.getUint32(r)||(i=!0,r+=4),!i)continue;if(64==e.getUint8(r)){n=r;break}}if(n<0)return 0;const r=e.getUint32(n-28),a=e.getUint32(n-20),s=e.getUint32(n-32),l=e.getUint32(n-16);return 65536===r&&4294901760===a?90:4294901760===s&&4294901760===l?180:4294901760===r&&65536===a?270:0},{window:Rh}=ra;function Ih(e){let t,o,i,n=e[40]&&Ah(e),r=e[37]&&Wh(e);return{c(){n&&n.c(),t=cr(),r&&r.c(),o=dr()},m(e,a){n&&n.m(e,a),nr(e,t,a),r&&r.m(e,a),nr(e,o,a),i=!0},p(e,i){e[40]?n?(n.p(e,i),512&i[1]&&ta(n,1)):(n=Ah(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[37]?r?(r.p(e,i),64&i[1]&&ta(r,1)):(r=Wh(e),r.c(),ta(r,1),r.m(o.parentNode,o)):r&&(Qr(),oa(r,1,1,(()=>{r=null})),ea())},i(e){i||(ta(n),ta(r),i=!0)},o(e){oa(n),oa(r),i=!1},d(e){n&&n.d(e),e&&rr(t),r&&r.d(e),e&&rr(o)}}}function Ah(e){let t,o,i,n,r,a;const s=[Lh,Eh],l=[];function c(e,t){return e[38]?0:e[33]?1:-1}return~(i=c(e))&&(n=l[i]=s[i](e)),{c(){t=ar("div"),o=ar("p"),n&&n.c(),mr(o,"style",e[67]),mr(t,"class","PinturaStatus"),mr(t,"style",r="opacity: "+e[52])},m(e,n){nr(e,t,n),tr(t,o),~i&&l[i].m(o,null),a=!0},p(e,d){let u=i;i=c(e),i===u?~i&&l[i].p(e,d):(n&&(Qr(),oa(l[u],1,1,(()=>{l[u]=null})),ea()),~i?(n=l[i],n?n.p(e,d):(n=l[i]=s[i](e),n.c()),ta(n,1),n.m(o,null)):n=null),(!a||32&d[2])&&mr(o,"style",e[67]),(!a||2097152&d[1]&&r!==(r="opacity: "+e[52]))&&mr(t,"style",r)},i(e){a||(ta(n),a=!0)},o(e){oa(n),a=!1},d(e){e&&rr(t),~i&&l[i].d()}}}function Eh(e){let t,o,i,n;t=new cd({props:{text:e[33].text||"",onmeasure:e[189]}});let r=e[33].aside&&Fh(e);return{c(){ha(t.$$.fragment),o=cr(),r&&r.c(),i=dr()},m(e,a){pa(t,e,a),nr(e,o,a),r&&r.m(e,a),nr(e,i,a),n=!0},p(e,o){const n={};4&o[1]&&(n.text=e[33].text||""),t.$set(n),e[33].aside?r?(r.p(e,o),4&o[1]&&ta(r,1)):(r=Fh(e),r.c(),ta(r,1),r.m(i.parentNode,i)):r&&(Qr(),oa(r,1,1,(()=>{r=null})),ea())},i(e){n||(ta(t.$$.fragment,e),ta(r),n=!0)},o(e){oa(t.$$.fragment,e),oa(r),n=!1},d(e){ma(t,e),e&&rr(o),r&&r.d(e),e&&rr(i)}}}function Lh(e){let t,o,i,n;return t=new cd({props:{text:e[38],onmeasure:e[189]}}),i=new gd({props:{class:"PinturaStatusIcon",offset:e[77],opacity:e[78],$$slots:{default:[_h]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment),o=cr(),ha(i.$$.fragment)},m(e,r){pa(t,e,r),nr(e,o,r),pa(i,e,r),n=!0},p(e,o){const n={};128&o[1]&&(n.text=e[38]),t.$set(n);const r={};32768&o[2]&&(r.offset=e[77]),65536&o[2]&&(r.opacity=e[78]),8&o[0]|1048576&o[16]&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(e){n||(ta(t.$$.fragment,e),ta(i.$$.fragment,e),n=!0)},o(e){oa(t.$$.fragment,e),oa(i.$$.fragment,e),n=!1},d(e){ma(t,e),e&&rr(o),ma(i,e)}}}function Fh(e){let t,o;return t=new gd({props:{class:"PinturaStatusButton",offset:e[77],opacity:e[78],$$slots:{default:[Bh]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};32768&o[2]&&(i.offset=e[77]),65536&o[2]&&(i.opacity=e[78]),4&o[1]|1048576&o[16]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function zh(e){let t,o;return t=new hd({props:{progress:e[33].progressIndicator.progress}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};4&o[1]&&(i.progress=e[33].progressIndicator.progress),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Dh(e){let t,o;const i=[e[33].closeButton,{hideLabel:!0}];let n={};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new jc({props:n}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=4&o[1]?ca(i,[da(e[33].closeButton),i[1]]):{};t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Bh(e){let t,o,i,n=e[33].progressIndicator.visible&&zh(e),r=e[33].closeButton&&e[33].text&&Dh(e);return{c(){n&&n.c(),t=cr(),r&&r.c(),o=dr()},m(e,a){n&&n.m(e,a),nr(e,t,a),r&&r.m(e,a),nr(e,o,a),i=!0},p(e,i){e[33].progressIndicator.visible?n?(n.p(e,i),4&i[1]&&ta(n,1)):(n=zh(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[33].closeButton&&e[33].text?r?(r.p(e,i),4&i[1]&&ta(r,1)):(r=Dh(e),r.c(),ta(r,1),r.m(o.parentNode,o)):r&&(Qr(),oa(r,1,1,(()=>{r=null})),ea())},i(e){i||(ta(n),ta(r),i=!0)},o(e){oa(n),oa(r),i=!1},d(e){n&&n.d(e),e&&rr(t),r&&r.d(e),e&&rr(o)}}}function Oh(e){let t,o=e[3].iconSupportError+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){8&i[0]&&o!==(o=e[3].iconSupportError+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function _h(e){let t,o;return t=new Tc({props:{$$slots:{default:[Oh]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};8&o[0]|1048576&o[16]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Wh(e){let t,o,i,n,r,a,s,l,c,d,u,h,p,m,g=e[10]&&Vh(e),$=e[44]&&e[43]&&Nh(e);const f=[Xh,Zh],y=[];function b(e,t){return e[44]?0:1}function x(t){e[375](t)}function v(t){e[376](t)}function w(t){e[377](t)}i=b(e),n=y[i]=f[i](e),a=new oc({props:{isAnimated:e[51],isTransparent:e[18],pixelRatio:e[55],textPixelRatio:e[6],backgroundColor:e[54],maskRect:e[56],maskOpacity:e[68]?e[68].maskOpacity:1,maskMarkupOpacity:e[7],maskFrameOpacity:e[5],clipAnnotationsToImage:e[80],images:e[53],interfaceImages:e[81],loadImageData:e[26],willRequest:e[76]||e[82],willRender:e[372],didRender:e[373]}});let S={root:e[2],locale:e[3],stores:e[179],allowPan:e[84],enablePan:e[15],enablePanLimit:e[19],panLimitGutterScalar:e[20],enablePanInput:e[85],allowZoom:e[86],enableZoom:e[16],enableZoomInput:void 0!==e[17]?e[17]:e[87],enableZoomControls:e[88],zoomOptions:e[11]||e[21],zoomAdjustStep:e[12]||e[22],zoomAdjustFactor:e[13]||e[23],zoomAdjustWheelFactor:e[14]||e[24],imageSelectionRectCentered:e[89],imageSelectionRectScalar:e[90],elasticity:Kh*e[8]};return void 0!==e[0]&&(S.zoomLevel=e[0]),void 0!==e[31]&&(S.zoomControls=e[31]),void 0!==e[32]&&(S.zoomMultiTouching=e[32]),d=new Ch({props:S}),Dr.push((()=>ua(d,"zoomLevel",x))),Dr.push((()=>ua(d,"zoomControls",v))),Dr.push((()=>ua(d,"zoomMultiTouching",w))),{c(){g&&g.c(),t=cr(),$&&$.c(),o=cr(),n.c(),r=cr(),ha(a.$$.fragment),s=cr(),l=ar("div"),c=cr(),ha(d.$$.fragment),mr(l,"class","PinturaRootPortal")},m(n,u){g&&g.m(n,u),nr(n,t,u),$&&$.m(n,u),nr(n,o,u),y[i].m(n,u),nr(n,r,u),pa(a,n,u),nr(n,s,u),nr(n,l,u),e[374](l),nr(n,c,u),pa(d,n,u),m=!0},p(e,s){e[10]?g?(g.p(e,s),1024&s[0]&&ta(g,1)):(g=Vh(e),g.c(),ta(g,1),g.m(t.parentNode,t)):g&&(Qr(),oa(g,1,1,(()=>{g=null})),ea()),e[44]&&e[43]?$?($.p(e,s),12288&s[1]&&ta($,1)):($=Nh(e),$.c(),ta($,1),$.m(o.parentNode,o)):$&&(Qr(),oa($,1,1,(()=>{$=null})),ea());let l=i;i=b(e),i===l?y[i].p(e,s):(Qr(),oa(y[l],1,1,(()=>{y[l]=null})),ea(),n=y[i],n?n.p(e,s):(n=y[i]=f[i](e),n.c()),ta(n,1),n.m(r.parentNode,r));const c={};1048576&s[1]&&(c.isAnimated=e[51]),262144&s[0]&&(c.isTransparent=e[18]),16777216&s[1]&&(c.pixelRatio=e[55]),64&s[0]&&(c.textPixelRatio=e[6]),8388608&s[1]&&(c.backgroundColor=e[54]),33554432&s[1]&&(c.maskRect=e[56]),64&s[2]&&(c.maskOpacity=e[68]?e[68].maskOpacity:1),128&s[0]&&(c.maskMarkupOpacity=e[7]),32&s[0]&&(c.maskFrameOpacity=e[5]),262144&s[2]&&(c.clipAnnotationsToImage=e[80]),4194304&s[1]&&(c.images=e[53]),524288&s[2]&&(c.interfaceImages=e[81]),67108864&s[0]&&(c.loadImageData=e[26]),1064960&s[2]&&(c.willRequest=e[76]||e[82]),512&s[0]|753672&s[1]|2097152&s[2]&&(c.willRender=e[372]),2013265920&s[1]|1&s[2]&&(c.didRender=e[373]),a.$set(c);const m={};4&s[0]&&(m.root=e[2]),8&s[0]&&(m.locale=e[3]),4194304&s[2]&&(m.allowPan=e[84]),32768&s[0]&&(m.enablePan=e[15]),524288&s[0]&&(m.enablePanLimit=e[19]),1048576&s[0]&&(m.panLimitGutterScalar=e[20]),8388608&s[2]&&(m.enablePanInput=e[85]),16777216&s[2]&&(m.allowZoom=e[86]),65536&s[0]&&(m.enableZoom=e[16]),131072&s[0]|33554432&s[2]&&(m.enableZoomInput=void 0!==e[17]?e[17]:e[87]),67108864&s[2]&&(m.enableZoomControls=e[88]),2099200&s[0]&&(m.zoomOptions=e[11]||e[21]),4198400&s[0]&&(m.zoomAdjustStep=e[12]||e[22]),8396800&s[0]&&(m.zoomAdjustFactor=e[13]||e[23]),16793600&s[0]&&(m.zoomAdjustWheelFactor=e[14]||e[24]),134217728&s[2]&&(m.imageSelectionRectCentered=e[89]),268435456&s[2]&&(m.imageSelectionRectScalar=e[90]),256&s[0]&&(m.elasticity=Kh*e[8]),!u&&1&s[0]&&(u=!0,m.zoomLevel=e[0],jr((()=>u=!1))),!h&&1&s[1]&&(h=!0,m.zoomControls=e[31],jr((()=>h=!1))),!p&&2&s[1]&&(p=!0,m.zoomMultiTouching=e[32],jr((()=>p=!1))),d.$set(m)},i(e){m||(ta(g),ta($),ta(n),ta(a.$$.fragment,e),ta(d.$$.fragment,e),m=!0)},o(e){oa(g),oa($),oa(n),oa(a.$$.fragment,e),oa(d.$$.fragment,e),m=!1},d(n){g&&g.d(n),n&&rr(t),$&&$.d(n),n&&rr(o),y[i].d(n),n&&rr(r),ma(a,n),n&&rr(s),n&&rr(l),e[374](null),n&&rr(c),ma(d,n)}}}function Vh(e){let t,o,i,n,r;return o=new eh({props:{items:e[64]}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaNav PinturaNavTools")},m(a,s){nr(a,t,s),pa(o,t,null),i=!0,n||(r=[ur(t,"measure",e[359]),Gn(Gl.call(null,t))],n=!0)},p(e,t){const i={};4&t[2]&&(i.items=e[64]),o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o),n=!1,Fn(r)}}}function Nh(e){let t,o,i;return o=new rd({props:{elasticity:e[8]*Qh,scrollDirection:e[70]?"y":"x",$$slots:{default:[Uh]},$$scope:{ctx:e}}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaNav PinturaNavMain")},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,t){const i={};256&t[0]&&(i.elasticity=e[8]*Qh),256&t[2]&&(i.scrollDirection=e[70]?"y":"x"),2048&t[1]|6144&t[2]|1048576&t[16]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function Hh(e){let t,o=e[515].icon+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){524288&i[16]&&o!==(o=e[515].icon+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function jh(e){let t,o,i,n,r,a=e[515].label+"";return t=new Tc({props:{$$slots:{default:[Hh]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment),o=cr(),i=ar("span"),n=lr(a)},m(e,a){pa(t,e,a),nr(e,o,a),nr(e,i,a),tr(i,n),r=!0},p(e,o){const i={};1572864&o[16]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i),(!r||524288&o[16])&&a!==(a=e[515].label+"")&&$r(n,a)},i(e){r||(ta(t.$$.fragment,e),r=!0)},o(e){oa(t.$$.fragment,e),r=!1},d(e){ma(t,e),e&&rr(o),e&&rr(i)}}}function Uh(e){let t,o;const i=[e[74],{tabs:e[73]}];let n={$$slots:{default:[jh,({tab:e})=>({515:e}),({tab:e})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e?524288:0]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new uc({props:n}),t.$on("select",e[360]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=6144&o[2]?ca(i,[4096&o[2]&&da(e[74]),2048&o[2]&&{tabs:e[73]}]):{};1572864&o[16]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Zh(e){let t,o,i;function n(t){e[368](t)}let r={class:"PinturaMain",content:{...e[45].find(e[367]),props:e[25][e[42]]},locale:e[3],stores:e[179]};return void 0!==e[1][e[42]]&&(r.component=e[1][e[42]]),t=new Gc({props:r}),Dr.push((()=>ua(t,"component",n))),t.$on("measure",e[201]),t.$on("show",e[369]),t.$on("hide",e[370]),t.$on("fade",e[371]),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(e,i){const n={};33554432&i[0]|18432&i[1]&&(n.content={...e[45].find(e[367]),props:e[25][e[42]]}),8&i[0]&&(n.locale=e[3]),!o&&2&i[0]|2048&i[1]&&(o=!0,n.component=e[1][e[42]],jr((()=>o=!1))),t.$set(n)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}function Xh(e){let t,o;const i=[{class:"PinturaMain"},{visible:e[57]},e[74],{panels:e[72]}];let n={$$slots:{default:[Gh,({panel:e,panelIsActive:t})=>({513:e,514:t}),({panel:e,panelIsActive:t})=>[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e?131072:0)|(t?262144:0)]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new Sc({props:n}),t.$on("measure",e[366]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=67108864&o[1]|5120&o[2]?ca(i,[i[0],67108864&o[1]&&{visible:e[57]},4096&o[2]&&da(e[74]),1024&o[2]&&{panels:e[72]}]):{};33554442&o[0]|67125280&o[1]|1441792&o[16]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Gh(e){let t,o,i;function n(...t){return e[361](e[513],...t)}function r(t){e[362](t,e[513])}let a={content:{...e[45].find(n),props:e[25][e[513]]},locale:e[3],isActive:e[514],stores:e[179]};return void 0!==e[1][e[513]]&&(a.component=e[1][e[513]]),t=new Gc({props:a}),Dr.push((()=>ua(t,"component",r))),t.$on("measure",e[201]),t.$on("show",(function(){return e[363](e[513])})),t.$on("hide",(function(){return e[364](e[513])})),t.$on("fade",(function(...t){return e[365](e[513],...t)})),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(i,r){e=i;const a={};33554432&r[0]|16384&r[1]|131072&r[16]&&(a.content={...e[45].find(n),props:e[25][e[513]]}),8&r[0]&&(a.locale=e[3]),262144&r[16]&&(a.isActive=e[514]),!o&&2&r[0]|131072&r[16]&&(o=!0,a.component=e[1][e[513]],jr((()=>o=!1))),t.$set(a)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}function Yh(e){let t,o;return{c(){t=ar("span"),mr(t,"class","PinturaEditorOverlay"),mr(t,"style",o="opacity:"+e[91])},m(e,o){nr(e,t,o)},p(e,i){536870912&i[2]&&o!==(o="opacity:"+e[91])&&mr(t,"style",o)},d(e){e&&rr(t)}}}function qh(e){let t,o,i,n,r;Hr(e[358]);let s=e[39]&&Ih(e),l=e[91]>0&&Yh(e);return{c(){t=ar("div"),s&&s.c(),o=cr(),l&&l.c(),mr(t,"id",e[4]),mr(t,"class",e[71]),mr(t,"data-env",e[69])},m(c,d){nr(c,t,d),s&&s.m(t,null),tr(t,o),l&&l.m(t,null),e[378](t),i=!0,n||(r=[ur(Rh,"keydown",e[192]),ur(Rh,"keyup",e[193]),ur(Rh,"blur",e[194]),ur(Rh,"paste",e[198]),ur(Rh,"resize",e[358]),ur(t,"ping",(function(){zn(e[63])&&e[63].apply(this,arguments)})),ur(t,"contextmenu",e[195]),ur(t,"touchstart",e[190],{passive:!1}),ur(t,"touchmove",(function(){zn(e[66])&&e[66].apply(this,arguments)})),ur(t,"pointermove",(function(){zn(e[65])&&e[65].apply(this,arguments)})),ur(t,"transitionend",e[180]),ur(t,"dropfiles",e[196]),ur(t,"measure",e[379]),ur(t,"click",(function(){zn(e[41]?e[197]:a)&&(e[41]?e[197]:a).apply(this,arguments)})),Gn(Gl.call(null,t,{observeViewRect:!0,isMeasureRoot:!0})),Gn(Yl.call(null,t)),Gn(Kl.call(null,t))],n=!0)},p(n,r){(e=n)[39]?s?(s.p(e,r),256&r[1]&&ta(s,1)):(s=Ih(e),s.c(),ta(s,1),s.m(t,o)):s&&(Qr(),oa(s,1,1,(()=>{s=null})),ea()),e[91]>0?l?l.p(e,r):(l=Yh(e),l.c(),l.m(t,null)):l&&(l.d(1),l=null),(!i||16&r[0])&&mr(t,"id",e[4]),(!i||512&r[2])&&mr(t,"class",e[71]),(!i||128&r[2])&&mr(t,"data-env",e[69])},i(e){i||(ta(s),i=!0)},o(e){oa(s),i=!1},d(o){o&&rr(t),s&&s.d(),l&&l.d(),e[378](null),n=!1,Fn(r)}}}const Kh=1,Jh="stage-overlay",Qh=10;function ep(e,t,o){let i,n,r,s,l,c,d,u,h,p,g,$,y,b,x,S,k,M,C,T,R,I,A,E,F,z,D,B,O,_,W,V,N,H,j,U,X,G,Y,q,K,J,Q,ee,te,oe,ie,ne,re,ae,le,ce,pe,me,ge,$e,fe,ye,be,xe,we,Se,ke,Me,Ce,Te,Pe,Re,Ie,Ae,Ee,Le,Fe,ze,De,Be,Oe,_e,Ve,Ne,He,je,Ue,Ze,Xe,Ge,Ye,qe,Ke,tt,it,nt,at,ct,dt,mt,gt,yt,bt,wt,kt,Ct,Tt,Pt,Rt,It,At,Et,Lt,Ft,Bt,Ot,_t,Wt,Vt,Nt,Ht,jt,Ut,Zt,Xt,Gt,Yt,qt,Kt,Jt,Qt,eo,to,oo,io,no,ao,so,lo,co,uo,po,mo,go,$o,fo,yo,bo,xo,vo,wo,So,ko,Mo,Co,Po,Ro,Io,Ao,Eo,Lo,Fo,zo,Bo,Oo,_o,Wo,Vo,No,jo,Uo,Zo,Xo,Go,Yo,qo,Ko,Jo,Qo,ei,ti,oi,ii,ni,ri,ai,li,ci,di=Rn,ui=Rn;_n(e,zl,(e=>o(354,Bo=e))),e.$$.on_destroy.push((()=>di())),e.$$.on_destroy.push((()=>ui()));const hi=Ho(),pi=Ar();let{class:$i}=t,{layout:fi}=t,{stores:yi}=t,{locale:xi}=t,{id:vi}=t,{util:Si}=t,{utils:ki}=t,{animations:Mi="auto"}=t,{disabled:Ci=!1}=t,{status:Ti}=t,{previewUpscale:Pi=!1}=t,{previewPad:Ri=!1}=t,{previewMaskOpacity:Ii=.95}=t,{previewImageDataMaxSize:Ai}=t,{previewImageTextPixelRatio:Ei}=t,{markupMaskOpacity:Li=1}=t,{zoomMaskOpacity:Fi=.85}=t,{elasticityMultiplier:zi=10}=t,{willRevert:Di=(()=>Promise.resolve(!0))}=t,{willProcessImage:Bi=(()=>Promise.resolve(!0))}=t,{willRenderCanvas:Oi=Z}=t,{willRenderToolbar:_i=Z}=t,{willSetHistoryInitialState:Wi=Z}=t,{enableButtonExport:Vi=!0}=t,{enableButtonRevert:Ni=!0}=t,{enableNavigateHistory:Hi=!0}=t,{enableToolbar:ji=!0}=t,{enableUtils:Ui=!0}=t,{enableButtonClose:Zi=!1}=t,{enableDropImage:Xi=!1}=t,{enablePasteImage:Gi=!1}=t,{enableBrowseImage:Yi=!1}=t,{layoutDirectionPreference:qi="auto"}=t,{layoutHorizontalUtilsPreference:Ji="left"}=t,{layoutVerticalUtilsPreference:Qi="bottom"}=t,{layoutVerticalToolbarPreference:en="top"}=t,{layoutVerticalControlGroupsPreference:tn="bottom"}=t,{layoutVerticalControlTabsPreference:rn="bottom"}=t,{markupEditorZoomLevel:an=null}=t,{markupEditorZoomLevels:sn}=t,{markupEditorZoomAdjustStep:cn}=t,{markupEditorZoomAdjustFactor:dn}=t,{markupEditorZoomAdjustWheelFactor:un}=t,{markupEditorInteractionMode:hn=!1}=t,{muteAudio:pn=!0}=t,{willSetMediaInitialTimeOffset:mn=((e,t)=>e*vh(t[0]))}=t,{enablePan:gn=!0}=t,{enableZoom:$n=!0}=t,{enableZoomControls:fn=!0}=t,{enableZoomInput:yn}=t,{enablePanInput:bn}=t,{enableCanvasAlpha:xn=!1}=t,{enablePanLimit:vn}=t,{panLimitGutterScalar:wn}=t,{zoomPresetOptions:Sn=[.25,.5,1,1.25,1.5,2,3,4,6,8,16]}=t,{zoomAdjustStep:kn=.25}=t,{zoomAdjustFactor:Mn=.1}=t,{zoomAdjustWheelFactor:Cn=1}=t,{zoomLevel:In=null}=t,{imagePreviewSrc:An}=t,{imageOrienter:En={read:()=>1,apply:e=>e}}=t,{pluginComponents:Ln}=t,{pluginOptions:Fn={}}=t;const zn=hi.sub,Dn={};let{root:Wn}=t;const Vn=ba(pn);_n(e,Vn,(e=>o(340,no=e)));const Nn=ba({});_n(e,Nn,(e=>o(50,At=e))),Er("redrawTrigger",Nn);const Hn=ba(zi);_n(e,Hn,(e=>o(419,Xo=e))),Er("elasticityMultiplier",Hn);let jn=[];const Un=Fl();_n(e,Un,(e=>o(91,ci=e)));const Zn=ml()||1024,Gn=We(Zn,Zn),Yn=ns(),qn=e=>Promise.resolve(Zo&&Zo(e,{resourceType:"image"})).then((t=>{if(!1===t)return;const{headers:o,credentials:i}=t||{};return fetch(e,{headers:o,credentials:i}).then((e=>{if(200!==e.status)throw`${e.status} (${e.statusText})`;return e.blob()})).then((e=>ch(e,En,Yn))).then((e=>dh(e,r)))}));let{imageSourceToImageData:Kn=(e=>P(e)?qn(e):zt(e)?new Promise((t=>t(m(e)))):ro(e)||Dt(e)?ch(e,En,Yn).then((e=>dh(e,r))):void 0)}=t;const Jn=(()=>{let e,t;const o=oh.reduce(((e,o)=>(e[o]=function(e,t,o){let i=[];return{set:t,update:o,publish:e=>{i.forEach((t=>t(e)))},subscribe:t=>(i.push(t),e(t),()=>{i=i.filter((e=>e!==t))})}}((e=>{if(!t)return e();t.stores[o].subscribe(e)()}),(e=>{t&&t.stores[o].set(e)}),(e=>{t&&t.stores[o].update(e)})),e)),{});return{update:i=>{if(t=i,e&&(e.forEach((e=>e())),e=void 0),!i)return o.file.publish(void 0),void o.loadState.publish(void 0);e=oh.map((e=>i.stores[e].subscribe((t=>{o[e].publish(t)}))))},stores:o,destroy:()=>{e&&e.forEach((e=>e()))}}})(),{file:Qn,size:er,duration:tr,trim:or,loadState:ir,processState:nr,cropAspectRatio:rr,cropLimitToImage:ar,crop:sr,cropMinSize:lr,cropMaxSize:cr,cropRange:dr,cropOrigin:ur,cropRectAspectRatio:hr,rotation:pr,rotationRange:mr,targetSize:gr,flipX:$r,flipY:fr,backgroundColor:yr,backgroundImage:br,colorMatrix:xr,convolutionMatrix:vr,gamma:wr,vignette:Sr,noise:kr,decoration:Mr,annotation:Cr,redaction:Tr,frame:Pr,state:Rr}=Jn.stores;_n(e,Qn,(e=>o(341,ao=e))),_n(e,er,(e=>o(310,Ke=e))),_n(e,tr,(e=>o(337,Qt=e))),_n(e,or,(e=>o(418,Uo=e))),_n(e,ir,(e=>o(329,Ht=e))),_n(e,nr,(e=>o(328,Nt=e))),_n(e,rr,(e=>o(415,Oo=e))),_n(e,ar,(e=>o(80,Ko=e))),_n(e,sr,(e=>o(350,wo=e))),_n(e,pr,(e=>o(313,nt=e))),_n(e,$r,(e=>o(312,it=e))),_n(e,fr,(e=>o(311,tt=e))),_n(e,yr,(e=>o(319,Ct=e))),_n(e,Mr,(e=>o(47,qe=e))),_n(e,Cr,(e=>o(48,at=e))),_n(e,Tr,(e=>o(318,kt=e))),_n(e,Pr,(e=>o(46,Ye=e))),_n(e,Rr,(e=>o(403,oo=e)));const Lr=(e,t,o=0)=>new Promise(((i,n)=>{if(lh(e)){return void($l()?(async e=>{const t=await Th(e),o=new DataView(t);return Ph(o)})(e):Promise.resolve()).then((t=>{const o=document.createElement("video");o.onerror=()=>console.error(o.error),o.playsInline=!0,o.preload="auto",o.onloadeddata=()=>{o.onloadeddata=void 0,o.dataset.rotation=t,as(o).then((()=>{o.currentTime=mn(o.duration,Uo||[[0,1]]),i(o)}))},o.src=URL.createObjectURL(e),o.load()}))}let r,a=!1;t.cancel=()=>a=!0;const s=Date.now();Kn(e).then((e=>{const t=Date.now()-s;clearTimeout(r),r=setTimeout((()=>{a||i(e)}),Math.max(0,o-t))})).catch(n)})),{images:Fr,shapePreprocessor:zr,imageScrambler:Br,willRequest:Or,willRequestResource:_r}=yi;let Wr;_n(e,Fr,(e=>o(357,jo=e))),_n(e,zr,(e=>o(356,No=e))),_n(e,Br,(e=>o(320,Tt=e))),_n(e,Or,(e=>o(76,Zo=e))),_n(e,_r,(e=>o(82,Qo=e)));const Vr=xa(br,((e,t)=>{if(!e)return t(void 0);Wr&&(Wr.cancel(),Wr=void 0),Wr={cancel:a},Lr(e,Wr).then(t).catch((e=>{}))})),Nr=Rr.subscribe((e=>hi.pub("update",e))),Hr=ba();Er("ui",ba({}));const jr=ba(!0);_n(e,jr,(e=>o(84,ti=e)));const Ur=ba(!0);_n(e,Ur,(e=>o(86,ii=e)));const Zr=ba(!0);_n(e,Zr,(e=>o(355,Vo=e)));const Xr=ba(!0);_n(e,Xr,(e=>o(416,_o=e)));const Gr=ba(!0);_n(e,Gr,(e=>o(87,ni=e)));const Yr=ba();_n(e,Yr,(e=>o(88,ri=e)));const qr=ba();_n(e,qr,(e=>o(417,Wo=e)));const Kr=xa([qr,Xr],(()=>void 0!==Wo?Wo:_o));_n(e,Kr,(e=>o(85,oi=e)));const Jr=ba([0,0,0]);_n(e,Jr,(e=>o(54,uo=e)));const Qr=ba([1,1,1]);_n(e,Qr,(e=>o(400,bt=e)));const ea=Fl([1,1,1]);_n(e,ea,(e=>o(399,yt=e)));const ta=ba(),oa=ba();_n(e,oa,(e=>o(49,Rt=e)));const ia=ba();_n(e,ia,(e=>o(315,dt=e)));const na=ba(Qe());_n(e,na,(e=>o(75,io=e)));const ra=ba(Qe());_n(e,ra,(e=>o(79,qo=e)));const aa=ba();_n(e,aa,(e=>o(397,Ge=e)));const sa=ah("(pointer: fine)",(e=>e?"pointer-fine":"pointer-coarse"));_n(e,sa,(e=>o(335,Kt=e)));const la=ah("(hover: hover)",(e=>e?"pointer-hover":"pointer-no-hover"));_n(e,la,(e=>o(334,qt=e)));const ca=ba(!1),da=ba(!1);_n(e,da,(e=>o(316,gt=e)));const ua=ya(void 0,(e=>{const t=Fl(0),o=[da.subscribe((e=>{t.set(e?1:0)})),t.subscribe(e)];return()=>o.forEach((e=>e()))}));_n(e,ua,(e=>o(398,mt=e)));const ha=ba();_n(e,ha,(e=>o(402,Xt=e)));const pa=ba();let ma;_n(e,pa,(e=>o(51,Lt=e))),Er("isAnimated",pa);const ga=ba(Pi);_n(e,ga,(e=>o(338,eo=e)));const $a=ba(!1);_n(e,$a,(e=>o(408,Co=e))),Er("imageIsStatic",$a);const fa=ba();_n(e,fa,(e=>o(409,Po=e)));const va=ba();_n(e,va,(e=>o(406,ko=e)));const wa=ya(void 0,(e=>{const t=ba(void 0),o=[sr.subscribe((()=>{if(!wo)return;if(Co)return t.set(Je(wo));const e=Qc(wo,ko,5*zi);t.set(e)})),t.subscribe(e)];return()=>o.forEach((e=>e()))})),Sa=ba();_n(e,Sa,(e=>o(405,vo=e)));const ka=ba();_n(e,ka,(e=>o(407,Mo=e)));const Ma=ba(void 0);_n(e,Ma,(e=>o(413,Lo=e)));const Ca=ba(de());_n(e,Ca,(e=>o(414,Fo=e)));const Ta=(e,t)=>{if(!t||!e)return{top:0,right:0,bottom:0,left:0};const o=nn(t,e,s),i=on(o,e);return{top:Math.abs(i.top),right:Math.abs(i.right),bottom:Math.abs(i.bottom),left:Math.abs(i.left)}},Pa=ba({}),Ra=xa([aa,na,ra,Pa],(([e,t,o,n],r)=>{if(!e)return r(void 0);let a=0;1!==C.length||i||"bottom"===en||(a=o.y+o.height),r(rt(e.x+t.x,e.y+t.y+a,e.width,e.height))}));let Ia={left:0,right:0,top:0,bottom:0};const Aa=ba(!1),Ea=xa([Aa,Pr,Ra,da],(([e,t,o,i],n)=>{if(!o)return n({left:0,right:0,top:0,bottom:0});if(!e)return;const r=Math.min(o.width,o.height),a=Ta({width:r,height:r},t);se(Ia.top,4)===se(a.top,4)&&se(Ia.bottom,4)===se(a.bottom,4)&&se(Ia.right,4)===se(a.right,4)&&se(Ia.left,4)===se(a.left,4)||(Ia=a,n(a))}));_n(e,Ea,(e=>o(348,yo=e)));const La=xa([Aa,Ea],(([e,t],o)=>{if(!e)return o(!1);o(Object.values(t).some((e=>e>0)))}));_n(e,La,(e=>o(349,bo=e)));const Fa=xa([Aa,aa,La,Ea],(([e,t,o,i],n)=>{if(t)return e&&o?void n(rt(t.x+i.left,t.y+i.top,t.width-i.left-i.right,t.height-i.top-i.bottom)):n({...t})})),za=xa([Ra,La,Ea],(([e,t,o],i)=>e?t?void i(rt(e.x+o.left,e.y+o.top,e.width-o.left-o.right,e.height-o.top-o.bottom)):i(e):i(void 0)));_n(e,za,(e=>o(314,ct=e)));const Da=xa([$a,er,pr],(([e,t,o],i)=>{if(!e||!t)return i(void 0);const n=et(t);i($t(n,o))})),Ba=xa([Da],(([e],t)=>{if(!e)return t(void 0);const o=ot(e);t(Mt(o))}));_n(e,Ba,(e=>o(351,So=e)));const Oa=xa([za,sr,Ba,ga],(([e,t,o,i],n)=>{if(!e||!t||!(!Po&&!ko))return;const{width:r,height:a}=o||t,s=Math.min(e.width/r,e.height/a);n(i?s:Math.min(1,s))}));_n(e,Oa,(e=>o(411,Io=e)));Er("imageStaticVisualCorners",xa([$a,er,pr,za,aa,Oa],(([e,t,o,i,n,r],a)=>{if(!(e&&i&&n&&t))return a(void 0);const s=et(t),l=Mt(lt(s,r)),c=ft(i,l);l.x=c.x,l.y=c.y;a($t(l,o))})));const _a=ba(void 0);_n(e,_a,(e=>o(353,zo=e)));const Va=xa([sr,za],(([e,t])=>{if(t&&e)return Math.min(t.width/e.width,t.height/e.height)})),Na=xa([sr,Sa],(([e,t])=>e&&t?Math.min(e.width/t.width,e.height/t.height):1));_n(e,Na,(e=>o(90,li=e)));const Ha=xa([_a,Na],(([e,t])=>e&&t?t*e:1));_n(e,Ha,(e=>o(412,Ao=e)));const ja=ba(de());_n(e,ja,(e=>o(352,Eo=e)));const Ua=ba({scalar:Ao,translation:Eo}),Za=()=>{Ua.set({scalar:void 0,translation:de()})},Xa=ya(void 0,(e=>{const t=Fl(void 0,{precision:1e-4}),o=1===wd()?e=>St(e,Math.round):Z,i=()=>{if(!vo)return;const e=gt||!Xt;if(Co){const o=Je(vo);return st(o,Fo),st(o,ct),t.set(o,{hard:e})}const i=Qc(vo,Lo,Kh*zi);i.width<0&&(i.width=0,i.x=vo.x),i.height<0&&(i.height=0,i.y=vo.y),st(i,ct),st(i,Eo),lt(i,Ao),!e&&o(i),t.set(i,{hard:e})},n=[za.subscribe(i),Sa.subscribe(i),Ha.subscribe(i),ja.subscribe(i),Pr.subscribe(i),t.subscribe(e)];return()=>n.forEach((e=>e()))}));_n(e,Xa,(e=>o(56,fo=e)));const Ga=ba(1);_n(e,Ga,(e=>o(404,xo=e)));const Ya=()=>{if(!wo||!ct)return;let e=ut(Je(wo),Io||1);const t=ft(ct,ut(Je(So),Io));st(e,t);const o=Ge.width/e.width,i=Ge.height/e.height,n=Math.min(1,o,i);Ga.set(n),lt(e,n),((e,t)=>{const[o,i,n,r]=vt(e);o<t.y&&(e.y=Math.max(t.y,e.y)),i>t.width&&(e.x=t.width-e.width),n>t.height&&(e.y=t.height-e.height),r<t.x&&(e.x=Math.max(t.x,e.x))})(e,{...Ge,x:0,y:0}),Sa.set(e)},qa=xa([za,Oa,sr,er],(([e,t,o,i],n)=>{e&&(o||i)&&n(Ka(e,t||1,o||i))}));_n(e,qa,(e=>o(89,ai=e)));const Ka=(e,t,o)=>o.width<=e.width&&o.height<=e.height?ft(e,ut(Je(o),t)):xt(e,pt(o));let Ja,Qa;const es=e=>{if(i&&Ja&&ht(Ja,e)&&Qa===Io)return;if(Co)return Ya();Ja=e,Qa=Io;const t=Ka(e,Io,wo||Ke);Sa.set(t)};let ts=!1;const os=Oa.subscribe((e=>{!ts&&void 0!==e&&wo&&(es(ct),ts=!0)})),is=za.subscribe((e=>{e&&void 0!==Io&&wo&&es(e)})),rs=$a.subscribe((e=>{!e&&ct&&es(ct)}));let ss;const ls=ka.subscribe((e=>{if(!e)return ss=void 0,void Xn(fa,Po=void 0,Po);ss=Ro;const t=Je(wo);fa.set(t)})),cs=Sa.subscribe((e=>{if(!e||!Mo)return;const t=(o=Je(e),i=Mo,o.x-=i.x,o.y-=i.y,o.width-=i.width,o.height-=i.height,o);var o,i;((e,t)=>{e.x/=t,e.y/=t,e.width/=t,e.height/=t})(t,ss);const n=((e,t)=>(e.x+=t.x,e.y+=t.y,e.width+=t.width,e.height+=t.height,e))(Je(Po),t);sr.set(n)})),ds=sr.subscribe((e=>{if(!e||!vo)return;if(Co)return void(Mo||Ya());if(gt||Mo||ko)return;const t=pt(vo),o=pt(e);if(se(t,6)===se(o,6))return;const{width:i,height:n}=So||wo,r=Math.min(ct.width/i,ct.height/n),a=We(e.width*r,e.height*r),s=.5*(vo.width-a.width),l=.5*(vo.height-a.height),c=rt(vo.x+s,vo.y+l,a.width,a.height);Sa.set(c)})),us=xa([Oa,sr,Sa,$a],(([e,t,o,i],n)=>{if(!e||!t||!o)return;if(i)return n(xo);const r=o.width/t.width,a=o.height/t.height;n(Math.max(r,a)/e)})),hs=xa([Oa,us],(([e,t],o)=>{if(!t)return;o(e*t)}));_n(e,hs,(e=>o(410,Ro=e)));let ps={left:0,right:0,top:0,bottom:0};const ms=xa([Pr,Sa],(([e,t],o)=>{if(!t)return o(ps);const i=Ta(t,e);se(ps.top,4)===se(i.top,4)&&se(ps.bottom,4)===se(i.bottom,4)&&se(ps.right,4)===se(i.right,4)&&se(ps.left,4)===se(i.left,4)||(ps=i,o(i))})),gs=xa([ms],(([e],t)=>{t(Object.values(e).some((e=>e>0)))})),$s=Fl(.075,{stiffness:.03,damping:.4,precision:.001}),fs=xa([ea,Jr,$s,Xa,Ha,Pr,gs,ms,La],(([e,t,o,n,r,a,s,l,c],d)=>{if(!n||i)return d([]);let{x:u,y:h,width:p,height:m}=n;u+=.5,h+=.5,p-=.5,m-=.5;const g=[];if(a){if(s){let{left:e,right:o,top:i,bottom:n}=l;e*=r,o*=r,i*=r,n*=r;const a=yh(t)?[1,1,1,.125]:[0,0,0,.075];g.push({x:u-e-.5,y:h-i-.5,width:p+e+o+1,height:m+i+n+1,strokeWidth:1,strokeColor:a,opacity:c?1:.5})}const i=yh(e);a&&a.frameColor&&yh(a.frameColor)||i||(g.push({x:u-1,y:h-1,width:p+2,height:m+2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}),g.push({x:u+1,y:h+1,width:p-2,height:m-2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}))}d([...g,{x:u,y:h,width:p,height:m,strokeWidth:1,strokeColor:e,opacity:o}])})),ys=ba([]);_n(e,ys,(e=>o(342,so=e)));const bs=xa([fs,ys],(([e,t],o)=>{o([...e,...t])}));_n(e,bs,(e=>o(83,ei=e)));const xs=Fl(0,{precision:.001});_n(e,xs,(e=>o(344,co=e)));const vs=Fl();_n(e,vs,(e=>o(347,go=e)));const ws=Fl();_n(e,ws,(e=>o(346,mo=e)));const Ss=Fl();_n(e,Ss,(e=>o(345,po=e)));const ks=Fl();_n(e,ks,(e=>o(343,lo=e)));const Ms=ba(!1);_n(e,Ms,(e=>o(327,Vt=e)));const Cs=ba();let Ts;_n(e,Cs,(e=>o(330,jt=e)));const Ps=xa([Ms,Cs],(([e,t],i)=>{if(!e||!t)return void i(void 0);if(Ts&&(Ts.cancel(),o(245,Ts=void 0)),ln(t))return i(w(t));const n=qs.length?0:Lt?250:0;o(245,Ts={cancel:a}),Lr(t,Ts,n).then(i).catch((e=>{Xn(ir,Ht.error=e,Ht)})).finally((()=>{o(245,Ts=void 0)}))}));di(),di=Bn(Ps,(e=>o(317,wt=e)));const Rs=e=>{Qt&&wt&&(e&&wt.paused?wt.play().catch((()=>{})):e||wt.paused||wt.pause())};let{imagePreviewCurrent:Is}=t;const As=ba({});_n(e,As,(e=>o(332,Gt=e)));const Es=ba([]);_n(e,Es,(e=>o(81,Jo=e)));const Ls=xa([za,ia,er,wa,Sa,hs,pr,$r,fr,Ha,ja,ca],(([e,t,o,i,n,r,a,s,l,c,d,u],h)=>{if(!e||!n)return;const p=_s(e,t,o,i,n,c,d,r,a,s,l);!u&&S(p),h(p)}));_n(e,Ls,(e=>o(333,Yt=e)));const Fs=xa([xr,vr,wr,Sr,kr],(([e,t,o,i,n],r)=>{const a=e&&Object.keys(e).map((t=>e[t])).filter(Boolean);r({gamma:o||void 0,vignette:i||void 0,noise:n||void 0,convolutionMatrix:t||void 0,colorMatrix:a&&a.length&&Tn(a)})}));let zs,Ds;const Bs=(()=>{if(!ho())return!1;const e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/i)||[],[,t,o]=e.map((e=>parseInt(e,10)||0));return t>13||13===t&&o>=4})(),Os=ba({});_n(e,Os,(e=>o(321,It=e)));const Ws=wd(),Vs=ya(Ws,(e=>{const t=()=>e(wd()),o=matchMedia(`(resolution: ${Ws}dppx)`);return o.addListener(t),()=>o.removeListener(t)}));_n(e,Vs,(e=>o(55,$o=e)));const Ns=((e,t)=>{const{sub:o,pub:i}=Ho(),n=[],r=ba(0),a=[],s=()=>a.forEach((e=>e({index:On(r),length:n.length}))),l={get index(){return On(r)},set index(e){e=Number.isInteger(e)?e:0,e=Wa(e,0,n.length-1),r.set(e),t(n[l.index]),s()},get state(){return n[n.length-1]},length:()=>n.length,undo(){const e=l.index--;return i("undo",e),e},redo(){const e=l.index++;return i("redo",l.index),e},revert(){n.length=1,l.index=0,i("revert")},write(o){o&&t({...e(),...o});const a=e(),c=n[n.length-1];JSON.stringify(a)!==JSON.stringify(c)&&(n.length=l.index+1,n.push(a),r.set(n.length-1),s(),i("writehistory"))},set(e={}){n.length=0,l.index=0;const t=Array.isArray(e)?e:[e];n.push(...t),l.index=n.length-1},get:()=>[...n],subscribe:e=>(a.push(e),e({index:l.index,length:n.length}),()=>a.splice(a.indexOf(e),1)),on:o};return l})((()=>oo),(e=>{Xn(Rr,oo=e,oo),na.set(io)}));ui(),ui=Bn(Ns,(e=>o(339,to=e)));const js=()=>{const e={x:0,y:0,...Ke},t=St(xt(e,oo.cropAspectRatio),Math.round),o=Wi({...oo,rotation:0,crop:t},oo),i=[o];JSON.stringify(o)!==JSON.stringify(oo)&&i.push({...oo}),Ns.set(i)},Us=ir.subscribe((e=>{e&&e.complete&&js()})),Zs=()=>Di().then((e=>e&&Ns.revert())),Xs=ba(!1);_n(e,Xs,(e=>o(322,Et=e)));const Gs=()=>{Xn(Xs,Et=!0,Et),Bi().then((e=>{if(!e)return void Xn(Xs,Et=!1,Et);let t;t=gl.subscribe((e=>{1===e&&(t&&t(),pi("processImage"))}))}))},Ys=nr.subscribe((e=>{if(!e)return void Xn(Xs,Et=!1,Et);Xn(Xs,Et=!0,Et);const{complete:t,abort:o}=e;(t||o)&&Xn(Xs,Et=!1,Et)})),qs=fh();_n(e,qs,(e=>o(53,Ut=e)));const Ks=xa([qs],(([e],t)=>{if(!e.length)return t();const{origin:o,translation:i,rotation:n,scale:r}=e[0];t({origin:o,translation:i,rotation:n,scale:r})})),Js=ba();_n(e,Js,(e=>o(336,Jt=e)));let Qs,el=[];const tl=ba(),ol=ba(),il=xa([_a,ol,Oa,Va],(([e,t,o,i])=>e||(t||o<1?i:1))),nl={...yi,imageFile:Qn,imageSize:er,mediaDuration:tr,mediaTrim:or,imageBackgroundColor:yr,imageBackgroundImage:br,imageCropAspectRatio:rr,imageCropMinSize:lr,imageCropMaxSize:cr,imageCropLimitToImage:ar,imageCropRect:sr,imageCropRectOrigin:ur,imageCropRectSnapshot:fa,imageCropRectAspectRatio:hr,imageCropRange:dr,imageRotation:pr,imageRotationRange:mr,imageFlipX:$r,imageFlipY:fr,imageOutputSize:gr,imageColorMatrix:xr,imageConvolutionMatrix:vr,imageGamma:wr,imageVignette:Sr,imageNoise:kr,imageDecoration:Mr,imageAnnotation:Cr,imageRedaction:Tr,imageFrame:Pr,imagePreview:Ps,imagePreviewSource:Cs,imageTransforms:Ls,imagePreviewModifiers:As,history:Ns,animation:ha,pixelRatio:Vs,elasticityMultiplier:zi,scrollElasticity:Qh,rangeInputElasticity:5,redrawTrigger:Nn,pointerAccuracy:sa,pointerHoverable:la,env:Os,rootRect:ia,stageRect:za,stageRectBase:Ra,stageRecenter:Pa,stageScalar:Oa,stagePadding:Ea,stagePadded:La,presentationScalar:hs,imagePreviewUpscale:ol,utilRect:aa,utilRectPadded:Fa,allowPan:jr,allowZoom:Ur,allowZoomControls:Zr,enableZoomInput:Gr,enablePanInput:Xr,enablePanInputStatus:Kr,imageSelectionMultiTouching:tl,rootBackgroundColor:Jr,rootForegroundColor:Qr,rootLineColor:ea,rootColorSecondary:ta,imageOutlineOpacity:$s,utilTools:Js,imageSelectionPan:ja,imageSelectionZoom:_a,imageSelectionZoomCurrent:il,imageSelectionStageFitScalar:Va,imageSelectionStoredState:Ua,muteAudioStore:Vn,imageOverlayMarkup:ys,interfaceImages:Es,isInteracting:da,isTransformingImage:ca,isInteractingFraction:ua,imageCropRectIntent:va,imageCropRectPresentation:wa,imageSelectionRect:Sa,imageSelectionRectIntent:Ma,imageSelectionRectPresentation:Xa,imageSelectionRectSnapshot:ka,imageScalar:us,imageTransformsInterpolated:Ks,imageEffects:Fs};delete nl.image;const rl="util-"+L();let al=[],sl=ho();const ll=(e,t)=>{const o=(e=>{const t=ae.getPropertyValue(e);return uh(t)})(e);o&&0!==o[3]&&(o.length=3,t.set(o,{hard:!Lt}))},cl=()=>{ll("color",Qr),ll(xn?"--color-background":"background-color",Jr),ll("outline-color",ea),ll("--color-secondary",ta)},dl=xa([Ls,Fs,yr,Vr],(([e,t,o,i])=>e&&{...e,...t,backgroundColor:o,backgroundImage:i}));_n(e,dl,(e=>o(331,Zt=e)));const ul=()=>{const e=qs.length?void 0:{resize:1.05},t=((e,t,o={})=>{const{resize:i=1,opacity:n=0}=o,r={opacity:[Fl(n,{...gh,stiffness:.1}),Z],resize:[Fl(i,{...gh,stiffness:.1}),Z],translation:[Fl(void 0,gh),Z],rotation:[Fl(void 0,$h),Z],origin:[Fl(void 0,gh),Z],scale:[Fl(void 0,$h),Z],gamma:[Fl(void 0,$h),e=>e||1],vignette:[Fl(void 0,$h),e=>e||0],colorMatrix:[Fl([...mh],gh),e=>e||[...mh]],convolutionMatrix:[ba(void 0),e=>e&&e.clarity||void 0],backgroundColor:[Fl(void 0,gh),(e,t,o)=>{if(Array.isArray(e)){if(Array.isArray(t)){const i=[...e];0===t[3]?(i[3]=0,o(i)):0===i[3]&&((e=[...t])[3]=0)}return e}}],backgroundImage:[ba(void 0),Z]},a=Object.entries(r).map((([e,t])=>[e,t[0]])),s=a.map((([,e])=>e)),l=Object.entries(r).reduce(((e,[t,o])=>{const[i,n]=o;return e[t]=(e,o)=>i.set(n(e,c[t],(e=>{i.set(e,{hard:!0})})),o),e}),{});let c;const d=xa(s,(o=>(c=o.reduce(((e,t,o)=>(e[a[o][0]]=t,e)),{}),c.data=e,c.size=t,c.scale*=o[1],c)));return d.get=()=>c,d.set=(e,t)=>{const o={hard:!t};Object.entries(e).forEach((([e,t])=>{l[e]&&l[e](t,o)}))},d})(wt,Ke,e);qs.unshift(t),hl(Zt)},hl=e=>{qs.forEach(((t,o)=>{const i=0===o?1:0;t.set({...e,opacity:i,resize:1},Xt)}))};let pl;const gl=El(void 0,{duration:500});let fl;_n(e,gl,(e=>o(52,_t=e)));const yl=ba(!1);let bl;_n(e,yl,(e=>o(326,Wt=e)));const xl=Fl(void 0,{stiffness:.1,damping:.7,precision:.25});_n(e,xl,(e=>o(77,Go=e)));const vl=Fl(0,{stiffness:.1,precision:.05});_n(e,vl,(e=>o(78,Yo=e)));const wl=Fl(0,{stiffness:.02,damping:.5,precision:.25});_n(e,wl,(e=>o(324,Bt=e)));const Sl=Fl(void 0,{stiffness:.02,damping:.5,precision:.25});_n(e,Sl,(e=>o(325,Ot=e)));const kl=Fl(void 0,{stiffness:.02,damping:.5,precision:.25});let Ml;_n(e,kl,(e=>o(323,Ft=e)));const Cl=()=>{pi("abortLoadImage")},Tl=()=>{pi("abortProcessImage"),Xn(Xs,Et=!1,Et)},Pl=e=>e.preventDefault(),Rl=Bs?e=>{const t=e.touches?e.touches[0]:e;t.pageX>20&&t.pageX<window.innerWidth-20||Pl(e)}:a,Il=ba([]);_n(e,Il,(e=>o(401,Pt=e))),Er("keysPressed",Il);const Al=e=>{!e||Do(e)&&!(e=>/^image/.test(e.type)&&!/svg/.test(e.type))(e)||!Do(e)&&!/^http/.test(e)||pi("loadImage",e)},Ll=e=>{e&&Al(e)};let Dl=void 0;let Bl,Ol=[];const _l=ba();Er("rootPortal",_l),Er("rootRect",ia);const Wl=()=>({foregroundColor:[...bt],lineColor:[...yt],utilVisibility:{...E},isInteracting:gt,isInteractingFraction:mt,rootRect:Je(dt),stageRect:Je(ct),annotationShapesDirty:ec,decorationShapesDirty:oc,frameShapesDirty:nc,blendShapesDirty:rc}),Vl=(e,t,o)=>Ki(e,We(t.width/o,t.height/o)),Nl=(e,t,o)=>(e._translate=he(t),e._scale=o,e),Hl=e=>{const t=[];return e.forEach((e=>t.push(jl(e)))),t.filter(Boolean)},jl=e=>bi(e)?(e.points=[ue(e.x1,e.y1),ue(e.x2,e.y2)],e):(!(e=>mi(e)&&!e.text.length)(e)||e.backgroundColor&&0!==e.backgroundColor[3]||(gi(e)&&(e.width=5,e.height=e.lineHeight),e.strokeWidth=1,e.strokeColor=[1,1,1,.5],e.backgroundColor=[0,0,0,.1]),e);let Ul,Zl=[],Xl=[],Gl=[],Yl=[],ql=[],Kl={};const Jl=(e,t,o,i,n,r)=>{const{annotationShapesDirty:a,decorationShapesDirty:l,frameShapesDirty:c,blendShapesDirty:d,selectionRect:u,scale:h}=e,p=Ul!==h,m=p||!ht(Kl,u);m&&(Ul=h,Kl=u),(a||o!==at)&&(Zl=o.filter(wi).map(si).sort(((e,t)=>e.alwaysOnTop?1:t.alwaysOnTop?-1:0)).map((e=>Ki(e,Ke)))),(p||tc||a||o!==at)&&(Xl=Hl(Zl.map((e=>s(e,{flipX:it,flipY:tt,rotation:nt,scale:h,context:et(Ke)}))).flat())),d&&(Gl=t.filter(wi).map((e=>Ki(e,Ke)))),(l||i!==qe||m)&&(Yl=Hl(i.filter(wi).map(si).sort(((e,t)=>e.alwaysOnTop?1:t.alwaysOnTop?-1:0)).map((e=>Vl(e,u,h))).map((e=>s(e,{context:u}))).flat().map((e=>Nl(e,u,h))))),(c||r!==Ye||m)&&(ql=r?Hl([r].map(si).map((e=>Vl(e,u,h))).map(s).flat().map((e=>Nl(e,u,h)))):[]);let g=Hl(n.filter(wi));return(e=>{if(e&&e._y63ry6f)return;const[t]=["VW5saWNlbnNlZCBQaW50dXJhIGluc3RhbmNl"].map(window[[(!1+"")[1],(!0+"")[0],(1+{})[2],(1+{})[3]].join("")]);g=[...g,{x:u.x+.5*u.width-82,y:u.y+u.height-16-12,width:164,height:16,text:t,fontWeight:900,fontSize:12,color:[1,1,1,.25]}]})(window),{blendShapesDirty:d,blendShapes:Gl,annotationShapesDirty:a,annotationShapes:Xl,decorationShapesDirty:l,decorationShapes:Yl,frameShapesDirty:c,frameShapes:ql,interfaceShapes:g}};let ec=!0;let tc=!0;let oc=!0;let nc=!0;let rc=!0;Ir((()=>{Rs(!1),Nr(),is(),os(),rs(),ls(),cs(),ds(),Us(),Ys(),sa.destroy(),la.destroy(),Jn.destroy(),qs.clear(),Zl.length=0,Xl.length=0,Gl.length=0,Yl.length=0,ql.length=0;try{o(203,Is=void 0),o(246,pl=void 0)}catch(e){}}));return e.$$set=e=>{"class"in e&&o(204,$i=e.class),"layout"in e&&o(205,fi=e.layout),"stores"in e&&o(206,yi=e.stores),"locale"in e&&o(3,xi=e.locale),"id"in e&&o(4,vi=e.id),"util"in e&&o(207,Si=e.util),"utils"in e&&o(208,ki=e.utils),"animations"in e&&o(209,Mi=e.animations),"disabled"in e&&o(210,Ci=e.disabled),"status"in e&&o(202,Ti=e.status),"previewUpscale"in e&&o(211,Pi=e.previewUpscale),"previewPad"in e&&o(212,Ri=e.previewPad),"previewMaskOpacity"in e&&o(5,Ii=e.previewMaskOpacity),"previewImageDataMaxSize"in e&&o(213,Ai=e.previewImageDataMaxSize),"previewImageTextPixelRatio"in e&&o(6,Ei=e.previewImageTextPixelRatio),"markupMaskOpacity"in e&&o(7,Li=e.markupMaskOpacity),"zoomMaskOpacity"in e&&o(214,Fi=e.zoomMaskOpacity),"elasticityMultiplier"in e&&o(8,zi=e.elasticityMultiplier),"willRevert"in e&&o(215,Di=e.willRevert),"willProcessImage"in e&&o(216,Bi=e.willProcessImage),"willRenderCanvas"in e&&o(9,Oi=e.willRenderCanvas),"willRenderToolbar"in e&&o(217,_i=e.willRenderToolbar),"willSetHistoryInitialState"in e&&o(218,Wi=e.willSetHistoryInitialState),"enableButtonExport"in e&&o(219,Vi=e.enableButtonExport),"enableButtonRevert"in e&&o(220,Ni=e.enableButtonRevert),"enableNavigateHistory"in e&&o(221,Hi=e.enableNavigateHistory),"enableToolbar"in e&&o(10,ji=e.enableToolbar),"enableUtils"in e&&o(222,Ui=e.enableUtils),"enableButtonClose"in e&&o(223,Zi=e.enableButtonClose),"enableDropImage"in e&&o(224,Xi=e.enableDropImage),"enablePasteImage"in e&&o(225,Gi=e.enablePasteImage),"enableBrowseImage"in e&&o(226,Yi=e.enableBrowseImage),"layoutDirectionPreference"in e&&o(227,qi=e.layoutDirectionPreference),"layoutHorizontalUtilsPreference"in e&&o(228,Ji=e.layoutHorizontalUtilsPreference),"layoutVerticalUtilsPreference"in e&&o(229,Qi=e.layoutVerticalUtilsPreference),"layoutVerticalToolbarPreference"in e&&o(230,en=e.layoutVerticalToolbarPreference),"layoutVerticalControlGroupsPreference"in e&&o(231,tn=e.layoutVerticalControlGroupsPreference),"layoutVerticalControlTabsPreference"in e&&o(232,rn=e.layoutVerticalControlTabsPreference),"markupEditorZoomLevel"in e&&o(233,an=e.markupEditorZoomLevel),"markupEditorZoomLevels"in e&&o(11,sn=e.markupEditorZoomLevels),"markupEditorZoomAdjustStep"in e&&o(12,cn=e.markupEditorZoomAdjustStep),"markupEditorZoomAdjustFactor"in e&&o(13,dn=e.markupEditorZoomAdjustFactor),"markupEditorZoomAdjustWheelFactor"in e&&o(14,un=e.markupEditorZoomAdjustWheelFactor),"markupEditorInteractionMode"in e&&o(234,hn=e.markupEditorInteractionMode),"muteAudio"in e&&o(235,pn=e.muteAudio),"willSetMediaInitialTimeOffset"in e&&o(236,mn=e.willSetMediaInitialTimeOffset),"enablePan"in e&&o(15,gn=e.enablePan),"enableZoom"in e&&o(16,$n=e.enableZoom),"enableZoomControls"in e&&o(237,fn=e.enableZoomControls),"enableZoomInput"in e&&o(17,yn=e.enableZoomInput),"enablePanInput"in e&&o(238,bn=e.enablePanInput),"enableCanvasAlpha"in e&&o(18,xn=e.enableCanvasAlpha),"enablePanLimit"in e&&o(19,vn=e.enablePanLimit),"panLimitGutterScalar"in e&&o(20,wn=e.panLimitGutterScalar),"zoomPresetOptions"in e&&o(21,Sn=e.zoomPresetOptions),"zoomAdjustStep"in e&&o(22,kn=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(23,Mn=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(24,Cn=e.zoomAdjustWheelFactor),"zoomLevel"in e&&o(0,In=e.zoomLevel),"imagePreviewSrc"in e&&o(239,An=e.imagePreviewSrc),"imageOrienter"in e&&o(240,En=e.imageOrienter),"pluginComponents"in e&&o(241,Ln=e.pluginComponents),"pluginOptions"in e&&o(25,Fn=e.pluginOptions),"root"in e&&o(2,Wn=e.root),"imageSourceToImageData"in e&&o(26,Kn=e.imageSourceToImageData),"imagePreviewCurrent"in e&&o(203,Is=e.imagePreviewCurrent)},e.$$.update=()=>{if(1&e.$$.dirty[0]|65536&e.$$.dirty[7]&&o(0,In=null===In?an:In),262144&e.$$.dirty[7]&&Vn.set(pn),256&e.$$.dirty[0]&&Xn(Hn,Xo=zi,Xo),524288&e.$$.dirty[6]&&o(306,i="overlay"===fi),32&e.$$.dirty[7]|134217728&e.$$.dirty[9]&&o(43,n=Ui&&!i),33554434&e.$$.dirty[0]&&Fn&&Object.entries(Fn).forEach((([e,t])=>{Object.entries(t).forEach((([t,i])=>{Dn[e]&&o(1,Dn[e][t]=i,Dn)}))})),2&e.$$.dirty[0]|16777216&e.$$.dirty[7]){let e=!1;Ln.forEach((([t])=>{Dn[t]||(o(1,Dn[t]={},Dn),e=!0)})),e&&o(243,jn=[...Ln])}var t,m,v,w;if(16777216&e.$$.dirty[6]&&Un.set(Ci?1:0),134217728&e.$$.dirty[6]&&(r=Ai?(t=Ai,m=Gn,We(Math.min(t.width,m.width),Math.min(t.height,m.height))):Gn),65536&e.$$.dirty[11]&&Jn.update(jo[0]),32768&e.$$.dirty[11]&&(s=No?(e,t)=>No(e,{flipX:void 0,flipY:void 0,rotation:void 0,...t,isPreview:!0}):Z),1048576&e.$$.dirty[7]|16384&e.$$.dirty[11]&&Yr.set(Vo&&fn),2228224&e.$$.dirty[7]&&qr.set("pan"===hn||bn),262144&e.$$.dirty[1]&&Rt&&ia.set(rt(Rt.x,Rt.y,Rt.width,Rt.height)),134217728&e.$$.dirty[9]|524320&e.$$.dirty[10]&&dt&&i&&Ht&&Ht.complete&&(()=>{const e=Oo,t=pt(dt);e&&e===t||(rr.set(pt(dt)),js())})(),8&e.$$.dirty[0]|4194304&e.$$.dirty[6]|67108864&e.$$.dirty[7]&&o(296,C=xi&&jn.length?ki||jn.map((([e])=>e)):[]),131072&e.$$.dirty[9]&&o(44,B=C.length>1),8192&e.$$.dirty[1]&&(B||na.set(Qe())),1024&e.$$.dirty[0]&&(ji||ra.set(Qe())),536870912&e.$$.dirty[9]|64&e.$$.dirty[10]&&o(309,c=!gt&&l),8192&e.$$.dirty[11]&&o(307,d=!Bo),262144&e.$$.dirty[1]&&o(253,Ne=Rt&&Rt.width>0&&Rt.height>0),67108864&e.$$.dirty[7]|131072&e.$$.dirty[9]|134217728&e.$$.dirty[10]&&o(297,T=jn.filter((([e])=>C.includes(e))).filter((([,{isSupported:e}])=>e({duration:Qt}))).map((([e,t])=>[e,t.Component]))),262144&e.$$.dirty[9]&&o(252,R=T.length),8&e.$$.dirty[0]|48&e.$$.dirty[8]&&o(39,He=Ne&&xi&&R),256&e.$$.dirty[1]&&setTimeout((()=>o(244,ma=He)),1),8388608&e.$$.dirty[6]|134217728&e.$$.dirty[7]|1342177280&e.$$.dirty[9]&&Xn(ha,Xt="always"===Mi?c:"never"!==Mi&&(c&&ma&&d),Xt),8388608&e.$$.dirty[6]|805306368&e.$$.dirty[9]&&Xn(pa,Lt="always"===Mi?l:"never"!==Mi&&(l&&d),Lt),33554432&e.$$.dirty[6]|134217728&e.$$.dirty[9]&&ga.set(Pi||i),67108864&e.$$.dirty[6]&&Aa.set(Ri),4&e.$$.dirty[0]|4096&e.$$.dirty[11]&&Wn&&(Wn.dispatchEvent(ih("markupzoom",zo)),Wn.dispatchEvent(ih("zoom",zo))),4&e.$$.dirty[0]|2048&e.$$.dirty[11]&&Wn&&(Wn.dispatchEvent(ih("markuppan",Eo)),Wn.dispatchEvent(ih("pan",Eo))),512&e.$$.dirty[11]&&wo&&Za(),1024&e.$$.dirty[11]&&So&&Ya(),2097152&e.$$.dirty[6]|16&e.$$.dirty[8]|262144&e.$$.dirty[9]&&o(42,A=Si&&"string"==typeof Si&&T.find((([e])=>e===Si))?Si:R>0?T[0][0]:void 0),1050624&e.$$.dirty[1]&&A&&$s.set(.075,{hard:!Lt}),268435456&e.$$.dirty[6]&&o(304,u=Fi),384&e.$$.dirty[11]&&o(305,h=bo?-Math.max(...Object.values(yo)):0),34603008&e.$$.dirty[1]|100663296&e.$$.dirty[9]|16&e.$$.dirty[10]&&fo){let e=fo.x-ct.x,t=ct.x+ct.width-(fo.x+fo.width),o=fo.y-ct.y,i=ct.y+ct.height-(fo.y+fo.height),n=Math.min(e,o,t,i);xs.set(n>h?0:Math.min(u,Math.abs(n/64)),{hard:!Lt})}if(16777216&e.$$.dirty[1]&&o(303,p=.55/$o),1048576&e.$$.dirty[1]|16777216&e.$$.dirty[9]|16&e.$$.dirty[10]&&ct&&vs.set({x:0,y:ct.y,width:ct.x<64?0:ct.x,height:ct.height+p},{hard:!Lt}),1048576&e.$$.dirty[1]|16777216&e.$$.dirty[9]|48&e.$$.dirty[10]&&ct&&ws.set({x:0,y:0,width:dt.width,height:ct.y+p},{hard:!Lt}),1048576&e.$$.dirty[1]|16777216&e.$$.dirty[9]|48&e.$$.dirty[10]&&ct){let e=ct.x+ct.width,t=dt.width-(ct.x+ct.width);t<64&&(e+=t,t=0),Ss.set({x:e,y:ct.y,width:t,height:ct.height+p},{hard:!Lt})}if(1048576&e.$$.dirty[1]|48&e.$$.dirty[10]&&ct&&ks.set({x:0,y:ct.y+ct.height,width:dt.width,height:dt.height-(ct.y+ct.height)},{hard:!Lt}),8388608&e.$$.dirty[1]|72&e.$$.dirty[11]&&o(299,g=go&&{id:Jh,backgroundColor:uo,opacity:co,...go}),8388608&e.$$.dirty[1]|40&e.$$.dirty[11]&&o(302,$=mo&&{id:Jh,backgroundColor:uo,opacity:co,...mo}),8388608&e.$$.dirty[1]|24&e.$$.dirty[11]&&o(301,y=po&&{id:Jh,backgroundColor:uo,opacity:co,...po}),8388608&e.$$.dirty[1]|12&e.$$.dirty[11]&&o(300,b=lo&&{id:Jh,backgroundColor:uo,opacity:co,...lo}),15728640&e.$$.dirty[9]&&o(298,x=[$,y,b,g].filter(Boolean)),524288&e.$$.dirty[9]|2&e.$$.dirty[11]&&x&&so){const e=so.filter((e=>e.id!==Jh));ys.set([...e,...x])}if(4194304&e.$$.dirty[7]|1&e.$$.dirty[11]&&Cs.set(An||(ao||void 0)),1073741952&e.$$.dirty[10]&&wt&&(e=>{if(!Qt||!wt)return;wt.muted=e})(no),4&e.$$.dirty[0]|131072&e.$$.dirty[6]|128&e.$$.dirty[10]&&(o(203,Is=wt),wt&&Wn.dispatchEvent(ih("loadpreview",Is))),1048576&e.$$.dirty[10]&&jt&&(ja.set(de()),_a.set(void 0),Za(),Es.set([])),536870912&e.$$.dirty[10]&&o(257,k=to.index>0),536870912&e.$$.dirty[10]&&o(256,M=to.index<to.length-1),2&e.$$.dirty[1]&&tl.set(Qs),268435456&e.$$.dirty[10]&&ol.set(eo),8&e.$$.dirty[0]|393216&e.$$.dirty[9]&&o(45,I=C.map((e=>{const t=T.find((([t])=>e===t));if(t)return{id:e,view:t[1],tabIcon:xi[e+"Icon"],tabLabel:xi[e+"Label"]}})).filter(Boolean)||[]),2048&e.$$.dirty[1]&&Hr.set(A),16416&e.$$.dirty[1]&&o(36,E=I.reduce(((e,t)=>(e[t.id]=E&&E[t.id]||0,e)),{})),2048&e.$$.dirty[1]&&o(74,F={name:rl,selected:A}),16384&e.$$.dirty[1]&&o(73,z=I.map((e=>({id:e.id,icon:e.tabIcon,label:e.tabLabel})))),16384&e.$$.dirty[1]&&o(72,D=I.map((e=>e.id))),262144&e.$$.dirty[6]&&o(71,O=ic(["PinturaRoot","PinturaRootComponent",$i])),32&e.$$.dirty[10]&&o(292,_=dt&&(dt.width>1e3?"wide":dt.width<600?"narrow":void 0)),32&e.$$.dirty[10]&&o(279,W=dt&&(dt.width<=320||dt.height<=460)),32&e.$$.dirty[10]&&o(291,V=dt&&(dt.height>1e3?"tall":dt.height<600?"short":void 0)),4&e.$$.dirty[0]&&o(259,N=Wn&&Wn.parentNode&&Wn.parentNode.classList.contains("PinturaModal")),536870912&e.$$.dirty[0]|2048&e.$$.dirty[8]|32&e.$$.dirty[10]&&o(284,H=N&&dt&&zs>dt.width),1073741824&e.$$.dirty[0]|2048&e.$$.dirty[8]|32&e.$$.dirty[10]&&o(283,j=N&&dt&&Ds>dt.height),48&e.$$.dirty[9]&&o(285,U=H&&j),262144&e.$$.dirty[0]&&o(282,X=xn),8192&e.$$.dirty[9]&&o(254,G="narrow"===_),1024&e.$$.dirty[7]|32&e.$$.dirty[10]&&o(293,(v=dt,w=qi,Y=dt?"auto"===w?v.width>v.height?"landscape":"portrait":"horizontal"===w?v.width<500?"portrait":"landscape":"vertical"===w?v.height<400?"landscape":"portrait":void 0:"landscape")),16384&e.$$.dirty[9]&&o(70,q="landscape"===Y),64&e.$$.dirty[8]|4096&e.$$.dirty[9]&&o(281,K=G||"short"===V),536870912&e.$$.dirty[0]|32&e.$$.dirty[10]&&o(280,J=sl&&dt&&zs===dt.width&&!Bs),1&e.$$.dirty[1]|67108864&e.$$.dirty[10]&&o(255,Q=[...Jt||[],...el].filter(Boolean)),2048&e.$$.dirty[7]&&o(290,ee="has-navigation-preference-"+Ji),4096&e.$$.dirty[7]&&o(289,te="has-navigation-preference-"+Qi),8192&e.$$.dirty[7]&&o(286,oe="has-toolbar-preference-"+en),16384&e.$$.dirty[7]&&o(288,ie="has-controlgroups-preference-"+tn),32768&e.$$.dirty[7]&&o(287,ne="has-controltabs-preference-"+rn),32&e.$$.dirty[10]&&o(295,re=void 0!==dt&&dt.width>0&&dt.height>0),4&e.$$.dirty[0]|65536&e.$$.dirty[9]&&o(294,ae=re&&Wn&&getComputedStyle(Wn)),32768&e.$$.dirty[9]&&ae&&cl(),1024&e.$$.dirty[0]|1060864&e.$$.dirty[1]|17301504&e.$$.dirty[6]|2048&e.$$.dirty[8]|32767&e.$$.dirty[9]|50333696&e.$$.dirty[10]&&Os.set({...It,layoutMode:fi,orientation:Y,horizontalSpace:_,verticalSpace:V,navigationHorizontalPreference:ee,navigationVerticalPreference:te,controlGroupsVerticalPreference:ie,controlTabsVerticalpreference:ne,toolbarVerticalPreference:oe,isModal:N,isDisabled:Ci,isCentered:U,isCenteredHorizontally:H,isCenteredVertically:j,isAnimated:Lt,isTransparent:X,pointerAccuracy:Kt,pointerHoverable:qt,isCompact:K,hasSwipeNavigation:J,hasLimitedSpace:W,hasToolbar:ji,hasNavigation:B&&n,isIOS:sl,browserVersion:sh()?"chrome-"+(navigator.userAgent.match(/Chrome\/([0-9]+)/)||[])[1]:void 0}),2048&e.$$.dirty[10]&&o(69,le=Object.entries(It).map((([e,t])=>/^is|has/.test(e)?t?rh(e):void 0:t)).filter(Boolean).join(" ")),2048&e.$$.dirty[1]&&A&&Js.set([]),12582912&e.$$.dirty[10]&&o(68,ce=Yt&&Object.entries(Gt).filter((([,e])=>null!=e)).reduce(((e,[,t])=>e={...e,...t}),{})),524288&e.$$.dirty[10]&&o(276,$e=Ht&&"any-to-file"===Ht.task),268435456&e.$$.dirty[8]&&$e&&qs&&qs.clear(),2097152&e.$$.dirty[10]&&o(278,pe=!!Zt&&!!Zt.translation),536870912&e.$$.dirty[7]|1073741824&e.$$.dirty[8]|128&e.$$.dirty[10]&&pe&&wt&&wt!==pl&&(o(246,pl=wt),ul()),1073741824&e.$$.dirty[8]|2097152&e.$$.dirty[10]&&pe&&hl(Zt),4194304&e.$$.dirty[1]&&Ut&&Ut.length>1){let e=[];qs.forEach(((t,o)=>{0!==o&&t.get().opacity<=0&&e.push(t)})),e.forEach((e=>qs.remove(e)))}if(8&e.$$.dirty[0]|536870912&e.$$.dirty[8]&&o(38,ge=xi&&me.length&&xi.labelSupportError(me)),524288&e.$$.dirty[10]&&o(268,fe=Ht&&!!Ht.error),524288&e.$$.dirty[10]&&o(41,ye=!Ht||!Ht.complete&&void 0===Ht.task),524288&e.$$.dirty[10]&&o(269,be=Ht&&(Ht.taskLengthComputable?Ht.taskProgress:1/0)),268435456&e.$$.dirty[8]&&$e&&Xn(Ms,Vt=!1,Vt),1048576&e.$$.dirty[1]|1073741824&e.$$.dirty[7]|524288&e.$$.dirty[10]&&Ht&&Ht.complete){const e=Lt?250:0;clearTimeout(fl),o(247,fl=setTimeout((()=>{Xn(Ms,Vt=!0,Vt)}),e))}if(1024&e.$$.dirty[1]|1048576&e.$$.dirty[8]|655360&e.$$.dirty[10]&&o(273,xe=Ht&&!fe&&!ye&&!Vt),268435456&e.$$.dirty[7]|1048704&e.$$.dirty[10]&&o(272,we=!(!jt||wt&&!Ts)),266240&e.$$.dirty[10]&&o(267,Se=!!(Et||Nt&&void 0!==Nt.progress&&!Nt.complete)),524288&e.$$.dirty[8]&&Se&&Rs(!1),1024&e.$$.dirty[1]|524288&e.$$.dirty[10]&&o(270,ke=Ht&&!(Ht.error||ye)),8&e.$$.dirty[0]|524288&e.$$.dirty[10]&&o(271,Me=xi&&(Ht?!Ht.complete||Ht.error?Hs(xi.statusLabelLoadImage(Ht),Ht.error&&Ht.error.metadata,"{","}"):xi.statusLabelLoadImage({progress:1/0,task:"blob-to-bitmap"}):xi.statusLabelLoadImage(Ht))),8&e.$$.dirty[0]|262144&e.$$.dirty[10]&&o(266,Ce=Nt&&xi&&xi.statusLabelProcessImage(Nt)),262144&e.$$.dirty[10]&&o(264,Te=Nt&&(Nt.taskLengthComputable?Nt.taskProgress:1/0)),262144&e.$$.dirty[10]&&o(265,Pe=Nt&&!Nt.error),262144&e.$$.dirty[10]&&o(263,Re=!(!Nt||!Nt.error)),8&e.$$.dirty[0]|1024&e.$$.dirty[1]|65536&e.$$.dirty[6]|67076096&e.$$.dirty[8])if(Ti){let e,t,i,n,r;P(Ti)&&(e=Ti),To(Ti)?t=Ti:Array.isArray(Ti)&&([e,t,r]=Ti,!1===t&&(n=!0),To(t)&&(i=!0)),o(33,bl=(e||t)&&{text:e,aside:n||i,progressIndicator:{visible:i,progress:t},closeButton:n&&{label:xi.statusLabelButtonClose,icon:xi.statusIconButtonClose,onclick:r||(()=>o(202,Ti=void 0))}})}else o(33,bl=xi&&ye||fe||xe||we?{text:Me,aside:fe||ke,progressIndicator:{visible:ke,progress:be},closeButton:fe&&{label:xi.statusLabelButtonClose,icon:xi.statusIconButtonClose,onclick:Cl}}:xi&&Se&&Ce?{text:Ce,aside:Re||Pe,progressIndicator:{visible:Pe,progress:Te},closeButton:Re&&{label:xi.statusLabelButtonClose,icon:xi.statusIconButtonClose,onclick:Tl}}:void 0);if(65536&e.$$.dirty[6]&&o(275,Ie=void 0!==Ti),1048576&e.$$.dirty[1]|2048&e.$$.dirty[8]|262144&e.$$.dirty[10]&&N&&Nt&&Nt.complete&&(yl.set(!0),setTimeout((()=>yl.set(!1)),Lt?100:0)),4&e.$$.dirty[0]|2048&e.$$.dirty[1]|131072&e.$$.dirty[10]&&Vt&&Wn&&Wn.dispatchEvent(ih("selectutil",A)),1152&e.$$.dirty[1]|186122240&e.$$.dirty[8]|65536&e.$$.dirty[10]&&o(274,Ae=Wt||ge||ye||fe||xe||we||Se||Ie),67108864&e.$$.dirty[8]&&Xn(gl,_t=Ae?1:0,_t),1048576&e.$$.dirty[1]|67108864&e.$$.dirty[8]&&gl.set(Ae?1:0,{duration:Lt?500:1}),2097152&e.$$.dirty[1]&&o(40,Ee=_t>0),4&e.$$.dirty[1]&&o(262,Le=!(!bl||!bl.aside)),1049092&e.$$.dirty[1]|16385&e.$$.dirty[8]|32768&e.$$.dirty[10]&&Ee&&bl){clearTimeout(Ml);const e={hard:!1===Lt};if(Le){const t=!!bl.error||!Lt;vl.set(1,e),xl.set(Ot,{hard:t}),o(248,Ml=setTimeout((()=>{wl.set(16,e)}),1))}else vl.set(0,e),o(248,Ml=setTimeout((()=>{wl.set(0,e)}),1))}if(512&e.$$.dirty[1]&&(Ee||(kl.set(void 0,{hard:!0}),xl.set(void 0,{hard:!0}),wl.set(0,{hard:!0}))),16384&e.$$.dirty[10]&&o(261,Fe=.5*Bt),8192&e.$$.dirty[8]|8192&e.$$.dirty[10]&&o(67,ze=`transform: translateX(${Ft-Fe}px)`),128&e.$$.dirty[1]|128&e.$$.dirty[10]&&o(37,Xe=wt&&!ge),64&e.$$.dirty[1]|6144&e.$$.dirty[8]&&o(258,Be=De&&(Xe||N)?Pl:a),1024&e.$$.dirty[8]&&o(66,Oe=Be),1024&e.$$.dirty[8]&&o(65,_e=Be),8&e.$$.dirty[0]|524288&e.$$.dirty[1]|93&e.$$.dirty[7]|960&e.$$.dirty[8]|2048&e.$$.dirty[10]&&o(64,Ve=xi&&At&&xh((()=>_i([["div","alpha",{class:"PinturaNavGroup"},[["div","alpha-set",{class:"PinturaNavSet"},[Zi&&["Button","close",{label:xi.labelClose,icon:xi.iconButtonClose,onclick:()=>pi("close"),hideLabel:!0}],Ni&&["Button","revert",{label:xi.labelButtonRevert,icon:xi.iconButtonRevert,disabled:!k,onclick:Zs,hideLabel:!0}]]]]],["div","beta",{class:"PinturaNavGroup PinturaNavGroupFloat"},[Hi&&["div","history",{class:"PinturaNavSet"},[["Button","undo",{label:xi.labelButtonUndo,icon:xi.iconButtonUndo,disabled:!k,onclick:Ns.undo,hideLabel:!0}],["Button","redo",{label:xi.labelButtonRedo,icon:xi.iconButtonRedo,disabled:!M,onclick:Ns.redo,hideLabel:!0}]]],Q.length&&["div","plugin-tools",{class:"PinturaNavSet"},Q.filter(Boolean).map((([e,t,o])=>[e,t,{...o}]))]]],["div","gamma",{class:"PinturaNavGroup"},[Vi&&["Button","export",{label:xi.labelButtonExport,icon:G&&xi.iconButtonExport,class:"PinturaButtonExport",onclick:Gs,hideLabel:G}]]]],{...It},(()=>Nn.set({})))))),256&e.$$.dirty[10]&&o(251,je=kt&&!!kt.length),8&e.$$.dirty[8]|257&e.$$.dirty[10]&&o(250,Ue=je&&Pn(Ke,kt)),12&e.$$.dirty[8]|1664&e.$$.dirty[10]&&je&&((e,t,i,n)=>{if(!t)return;const r={dataSizeScalar:i};n&&n[3]>0&&(r.backgroundColor=[...n]),t(e,r).then((e=>{Dl&&f(Dl),o(249,Dl=e)}))})(wt,Tt,Ue,Ct),2&e.$$.dirty[8]|257&e.$$.dirty[10]&&kt&&Dl&&Ke){const{width:e,height:t}=Ke;o(34,Ol=kt.map((o=>{const i=rt(o.x,o.y,o.width,o.height),n=$t(Je(i),o.rotation).map((o=>ue(o.x/e,o.y/t)));return{...o,id:"redaction",flipX:!1,flipY:!1,cornerRadius:0,strokeWidth:0,strokeColor:void 0,backgroundColor:[0,0,0],backgroundImage:Dl,backgroundImageRendering:"pixelated",backgroundCorners:n}})))}16&e.$$.dirty[1]&&Bl&&_l.set(Bl),4&e.$$.dirty[0]|64&e.$$.dirty[1]&&Xe&&Wn.dispatchEvent(ih("ready")),131072&e.$$.dirty[1]&&o(58,ec=!0),15&e.$$.dirty[10]&&o(59,tc=!0),65536&e.$$.dirty[1]&&o(60,oc=!0),32768&e.$$.dirty[1]&&o(61,nc=!0),8&e.$$.dirty[1]&&o(62,rc=!0)},o(308,l=!Ql()),S=1===wd()?e=>{e&&(ve(e.origin,Math.round),ve(e.translation,Math.round))}:Z,o(277,me=[!ph()&&"WebGL"].filter(Boolean)),o(260,De=ho()||v()&&$l()),o(63,Ze=((e,t=!0)=>o=>{"ping"===o.type&&(t&&o.stopPropagation(),e(o.detail.type,o.detail.data))})(hi.pub)),[In,Dn,Wn,xi,vi,Ii,Ei,Li,zi,Oi,ji,sn,cn,dn,un,gn,$n,yn,xn,vn,wn,Sn,kn,Mn,Cn,Fn,Kn,Ps,Ns,zs,Ds,el,Qs,bl,Ol,Bl,E,Xe,ge,He,Ee,ye,A,n,B,I,Ye,qe,at,Rt,At,Lt,_t,Ut,uo,$o,fo,al,ec,tc,oc,nc,rc,Ze,Ve,_e,Oe,ze,ce,le,q,O,D,z,F,io,Zo,Go,Yo,qo,Ko,Jo,Qo,ei,ti,oi,ii,ni,ri,ai,li,ci,Vn,Nn,Hn,Un,Qn,er,tr,or,ir,nr,rr,ar,sr,pr,$r,fr,yr,Mr,Cr,Tr,Pr,Rr,Fr,zr,Br,Or,_r,jr,Ur,Zr,Xr,Gr,Yr,qr,Kr,Jr,Qr,ea,oa,ia,na,ra,aa,sa,la,da,ua,ha,pa,ga,$a,fa,va,Sa,ka,Ma,Ca,Ea,La,za,Ba,Oa,_a,Na,Ha,ja,Xa,Ga,qa,hs,ys,bs,xs,vs,ws,Ss,ks,Ms,Cs,As,Es,Ls,Os,Vs,Xs,qs,Js,nl,({target:e,propertyName:t})=>{e===Wn&&/background|outline/.test(t)&&ae&&cl()},dl,gl,yl,xl,vl,wl,Sl,kl,e=>{const t=!(!bl||!bl.closeButton)||!Lt;Sl.set(e.detail.width,{hard:t}),kl.set(Math.round(.5*-e.detail.width),{hard:t})},Rl,Il,e=>{const{keyCode:t,metaKey:o,ctrlKey:i,shiftKey:n}=e;if(9===t&&Ci)return void e.preventDefault();if(e.target&&32===t&&Wn.contains(e.target)&&!nh(e.target)&&e.preventDefault(),90===t&&(o||i))return void(n&&o?Ns.redo():Ns.undo());if(89===t&&i)return void Ns.redo();if(229===t)return;if(o||i)return;const r=new Set([...Pt,t]);Il.set(Array.from(r))},({key:e,keyCode:t})=>{if("Meta"===e)return Il.set([]);Il.set(Pt.filter((e=>e!==t)))},()=>{Il.set([])},e=>{nh(e.target)||e.preventDefault()},e=>{Xi&&Al(e.detail.resources[0])},()=>{Yi&&bh().then(Ll)},e=>{if(!Gi)return;const t=Wa((window.innerWidth-Math.abs(dt.x))/dt.width,0,1),o=Wa((window.innerHeight-Math.abs(dt.y))/dt.height,0,1);t<.75&&o<.75||Al((e.clipboardData||window.clipboardData).files[0])},Wl,Jl,e=>{Ge&&ht(e.detail,Ge)||Xn(aa,Ge=e.detail,Ge)},Ti,Is,$i,fi,yi,Si,ki,Mi,Ci,Pi,Ri,Ai,Fi,Di,Bi,_i,Wi,Vi,Ni,Hi,Ui,Zi,Xi,Gi,Yi,qi,Ji,Qi,en,tn,rn,an,hn,pn,mn,fn,bn,An,En,Ln,zn,jn,ma,Ts,pl,fl,Ml,Dl,Ue,je,R,Ne,G,Q,M,k,Be,N,De,Fe,Le,Re,Te,Pe,Ce,Se,fe,be,ke,Me,we,xe,Ae,Ie,$e,me,pe,W,J,K,X,j,H,U,oe,ne,ie,te,ee,V,_,Y,ae,re,C,T,x,g,b,y,$,p,u,h,i,d,l,c,Ke,tt,it,nt,ct,dt,gt,wt,kt,Ct,Tt,It,Et,Ft,Bt,Ot,Wt,Vt,Nt,Ht,jt,Zt,Gt,Yt,qt,Kt,Jt,Qt,eo,to,no,ao,so,lo,co,po,mo,go,yo,bo,wo,So,Eo,zo,Bo,Vo,No,jo,function(){o(29,zs=Rh.innerWidth),o(30,Ds=Rh.innerHeight)},e=>Xn(ra,qo=e.detail,qo),({detail:e})=>o(42,A=e),(e,t)=>t.id===e,function(t,i){e.$$.not_equal(Dn[i],t)&&(Dn[i]=t,o(1,Dn),o(25,Fn),o(241,Ln))},e=>o(57,al=al.concat(e)),e=>o(57,al=al.filter((t=>t!==e))),(e,{detail:t})=>o(36,E[e]=t,E),e=>Xn(na,io=e.detail,io),e=>e.id===A,function(t){e.$$.not_equal(Dn[A],t)&&(Dn[A]=t,o(1,Dn),o(25,Fn),o(241,Ln))},()=>o(57,al=al.concat(A)),()=>o(57,al=al.filter((e=>e!==A))),({detail:e})=>o(36,E[A]=e,E),e=>{const t={...e,...Wl()},{annotationShapes:o,decorationShapes:i,interfaceShapes:n,frameShapes:r}=Oi({annotationShapes:at,decorationShapes:qe,interfaceShapes:ei,frameShapes:Ye},t);return Jl(t,Ol,o,i,n,r)},()=>{o(58,ec=!1),o(59,tc=!1),o(60,oc=!1),o(61,nc=!1),o(62,rc=!1)},function(e){Dr[e?"unshift":"push"]((()=>{Bl=e,o(35,Bl)}))},function(e){In=e,o(0,In),o(233,an)},function(e){el=e,o(31,el)},function(e){Qs=e,o(32,Qs)},function(e){Dr[e?"unshift":"push"]((()=>{Wn=e,o(2,Wn)}))},e=>Xn(oa,Rt=e.detail,Rt)]}class tp extends $a{constructor(e){super(),ga(this,e,ep,qh,Dn,{class:204,layout:205,stores:206,locale:3,id:4,util:207,utils:208,animations:209,disabled:210,status:202,previewUpscale:211,previewPad:212,previewMaskOpacity:5,previewImageDataMaxSize:213,previewImageTextPixelRatio:6,markupMaskOpacity:7,zoomMaskOpacity:214,elasticityMultiplier:8,willRevert:215,willProcessImage:216,willRenderCanvas:9,willRenderToolbar:217,willSetHistoryInitialState:218,enableButtonExport:219,enableButtonRevert:220,enableNavigateHistory:221,enableToolbar:10,enableUtils:222,enableButtonClose:223,enableDropImage:224,enablePasteImage:225,enableBrowseImage:226,layoutDirectionPreference:227,layoutHorizontalUtilsPreference:228,layoutVerticalUtilsPreference:229,layoutVerticalToolbarPreference:230,layoutVerticalControlGroupsPreference:231,layoutVerticalControlTabsPreference:232,markupEditorZoomLevel:233,markupEditorZoomLevels:11,markupEditorZoomAdjustStep:12,markupEditorZoomAdjustFactor:13,markupEditorZoomAdjustWheelFactor:14,markupEditorInteractionMode:234,muteAudio:235,willSetMediaInitialTimeOffset:236,enablePan:15,enableZoom:16,enableZoomControls:237,enableZoomInput:17,enablePanInput:238,enableCanvasAlpha:18,enablePanLimit:19,panLimitGutterScalar:20,zoomPresetOptions:21,zoomAdjustStep:22,zoomAdjustFactor:23,zoomAdjustWheelFactor:24,zoomLevel:0,imagePreviewSrc:239,imageOrienter:240,pluginComponents:241,pluginOptions:25,sub:242,pluginInterface:1,root:2,imageSourceToImageData:26,imagePreview:27,imagePreviewCurrent:203,history:28},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1])}get class(){return this.$$.ctx[204]}set class(e){this.$$set({class:e}),Gr()}get layout(){return this.$$.ctx[205]}set layout(e){this.$$set({layout:e}),Gr()}get stores(){return this.$$.ctx[206]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[3]}set locale(e){this.$$set({locale:e}),Gr()}get id(){return this.$$.ctx[4]}set id(e){this.$$set({id:e}),Gr()}get util(){return this.$$.ctx[207]}set util(e){this.$$set({util:e}),Gr()}get utils(){return this.$$.ctx[208]}set utils(e){this.$$set({utils:e}),Gr()}get animations(){return this.$$.ctx[209]}set animations(e){this.$$set({animations:e}),Gr()}get disabled(){return this.$$.ctx[210]}set disabled(e){this.$$set({disabled:e}),Gr()}get status(){return this.$$.ctx[202]}set status(e){this.$$set({status:e}),Gr()}get previewUpscale(){return this.$$.ctx[211]}set previewUpscale(e){this.$$set({previewUpscale:e}),Gr()}get previewPad(){return this.$$.ctx[212]}set previewPad(e){this.$$set({previewPad:e}),Gr()}get previewMaskOpacity(){return this.$$.ctx[5]}set previewMaskOpacity(e){this.$$set({previewMaskOpacity:e}),Gr()}get previewImageDataMaxSize(){return this.$$.ctx[213]}set previewImageDataMaxSize(e){this.$$set({previewImageDataMaxSize:e}),Gr()}get previewImageTextPixelRatio(){return this.$$.ctx[6]}set previewImageTextPixelRatio(e){this.$$set({previewImageTextPixelRatio:e}),Gr()}get markupMaskOpacity(){return this.$$.ctx[7]}set markupMaskOpacity(e){this.$$set({markupMaskOpacity:e}),Gr()}get zoomMaskOpacity(){return this.$$.ctx[214]}set zoomMaskOpacity(e){this.$$set({zoomMaskOpacity:e}),Gr()}get elasticityMultiplier(){return this.$$.ctx[8]}set elasticityMultiplier(e){this.$$set({elasticityMultiplier:e}),Gr()}get willRevert(){return this.$$.ctx[215]}set willRevert(e){this.$$set({willRevert:e}),Gr()}get willProcessImage(){return this.$$.ctx[216]}set willProcessImage(e){this.$$set({willProcessImage:e}),Gr()}get willRenderCanvas(){return this.$$.ctx[9]}set willRenderCanvas(e){this.$$set({willRenderCanvas:e}),Gr()}get willRenderToolbar(){return this.$$.ctx[217]}set willRenderToolbar(e){this.$$set({willRenderToolbar:e}),Gr()}get willSetHistoryInitialState(){return this.$$.ctx[218]}set willSetHistoryInitialState(e){this.$$set({willSetHistoryInitialState:e}),Gr()}get enableButtonExport(){return this.$$.ctx[219]}set enableButtonExport(e){this.$$set({enableButtonExport:e}),Gr()}get enableButtonRevert(){return this.$$.ctx[220]}set enableButtonRevert(e){this.$$set({enableButtonRevert:e}),Gr()}get enableNavigateHistory(){return this.$$.ctx[221]}set enableNavigateHistory(e){this.$$set({enableNavigateHistory:e}),Gr()}get enableToolbar(){return this.$$.ctx[10]}set enableToolbar(e){this.$$set({enableToolbar:e}),Gr()}get enableUtils(){return this.$$.ctx[222]}set enableUtils(e){this.$$set({enableUtils:e}),Gr()}get enableButtonClose(){return this.$$.ctx[223]}set enableButtonClose(e){this.$$set({enableButtonClose:e}),Gr()}get enableDropImage(){return this.$$.ctx[224]}set enableDropImage(e){this.$$set({enableDropImage:e}),Gr()}get enablePasteImage(){return this.$$.ctx[225]}set enablePasteImage(e){this.$$set({enablePasteImage:e}),Gr()}get enableBrowseImage(){return this.$$.ctx[226]}set enableBrowseImage(e){this.$$set({enableBrowseImage:e}),Gr()}get layoutDirectionPreference(){return this.$$.ctx[227]}set layoutDirectionPreference(e){this.$$set({layoutDirectionPreference:e}),Gr()}get layoutHorizontalUtilsPreference(){return this.$$.ctx[228]}set layoutHorizontalUtilsPreference(e){this.$$set({layoutHorizontalUtilsPreference:e}),Gr()}get layoutVerticalUtilsPreference(){return this.$$.ctx[229]}set layoutVerticalUtilsPreference(e){this.$$set({layoutVerticalUtilsPreference:e}),Gr()}get layoutVerticalToolbarPreference(){return this.$$.ctx[230]}set layoutVerticalToolbarPreference(e){this.$$set({layoutVerticalToolbarPreference:e}),Gr()}get layoutVerticalControlGroupsPreference(){return this.$$.ctx[231]}set layoutVerticalControlGroupsPreference(e){this.$$set({layoutVerticalControlGroupsPreference:e}),Gr()}get layoutVerticalControlTabsPreference(){return this.$$.ctx[232]}set layoutVerticalControlTabsPreference(e){this.$$set({layoutVerticalControlTabsPreference:e}),Gr()}get markupEditorZoomLevel(){return this.$$.ctx[233]}set markupEditorZoomLevel(e){this.$$set({markupEditorZoomLevel:e}),Gr()}get markupEditorZoomLevels(){return this.$$.ctx[11]}set markupEditorZoomLevels(e){this.$$set({markupEditorZoomLevels:e}),Gr()}get markupEditorZoomAdjustStep(){return this.$$.ctx[12]}set markupEditorZoomAdjustStep(e){this.$$set({markupEditorZoomAdjustStep:e}),Gr()}get markupEditorZoomAdjustFactor(){return this.$$.ctx[13]}set markupEditorZoomAdjustFactor(e){this.$$set({markupEditorZoomAdjustFactor:e}),Gr()}get markupEditorZoomAdjustWheelFactor(){return this.$$.ctx[14]}set markupEditorZoomAdjustWheelFactor(e){this.$$set({markupEditorZoomAdjustWheelFactor:e}),Gr()}get markupEditorInteractionMode(){return this.$$.ctx[234]}set markupEditorInteractionMode(e){this.$$set({markupEditorInteractionMode:e}),Gr()}get muteAudio(){return this.$$.ctx[235]}set muteAudio(e){this.$$set({muteAudio:e}),Gr()}get willSetMediaInitialTimeOffset(){return this.$$.ctx[236]}set willSetMediaInitialTimeOffset(e){this.$$set({willSetMediaInitialTimeOffset:e}),Gr()}get enablePan(){return this.$$.ctx[15]}set enablePan(e){this.$$set({enablePan:e}),Gr()}get enableZoom(){return this.$$.ctx[16]}set enableZoom(e){this.$$set({enableZoom:e}),Gr()}get enableZoomControls(){return this.$$.ctx[237]}set enableZoomControls(e){this.$$set({enableZoomControls:e}),Gr()}get enableZoomInput(){return this.$$.ctx[17]}set enableZoomInput(e){this.$$set({enableZoomInput:e}),Gr()}get enablePanInput(){return this.$$.ctx[238]}set enablePanInput(e){this.$$set({enablePanInput:e}),Gr()}get enableCanvasAlpha(){return this.$$.ctx[18]}set enableCanvasAlpha(e){this.$$set({enableCanvasAlpha:e}),Gr()}get enablePanLimit(){return this.$$.ctx[19]}set enablePanLimit(e){this.$$set({enablePanLimit:e}),Gr()}get panLimitGutterScalar(){return this.$$.ctx[20]}set panLimitGutterScalar(e){this.$$set({panLimitGutterScalar:e}),Gr()}get zoomPresetOptions(){return this.$$.ctx[21]}set zoomPresetOptions(e){this.$$set({zoomPresetOptions:e}),Gr()}get zoomAdjustStep(){return this.$$.ctx[22]}set zoomAdjustStep(e){this.$$set({zoomAdjustStep:e}),Gr()}get zoomAdjustFactor(){return this.$$.ctx[23]}set zoomAdjustFactor(e){this.$$set({zoomAdjustFactor:e}),Gr()}get zoomAdjustWheelFactor(){return this.$$.ctx[24]}set zoomAdjustWheelFactor(e){this.$$set({zoomAdjustWheelFactor:e}),Gr()}get zoomLevel(){return this.$$.ctx[0]}set zoomLevel(e){this.$$set({zoomLevel:e}),Gr()}get imagePreviewSrc(){return this.$$.ctx[239]}set imagePreviewSrc(e){this.$$set({imagePreviewSrc:e}),Gr()}get imageOrienter(){return this.$$.ctx[240]}set imageOrienter(e){this.$$set({imageOrienter:e}),Gr()}get pluginComponents(){return this.$$.ctx[241]}set pluginComponents(e){this.$$set({pluginComponents:e}),Gr()}get pluginOptions(){return this.$$.ctx[25]}set pluginOptions(e){this.$$set({pluginOptions:e}),Gr()}get sub(){return this.$$.ctx[242]}get pluginInterface(){return this.$$.ctx[1]}get root(){return this.$$.ctx[2]}set root(e){this.$$set({root:e}),Gr()}get imageSourceToImageData(){return this.$$.ctx[26]}set imageSourceToImageData(e){this.$$set({imageSourceToImageData:e}),Gr()}get imagePreview(){return this.$$.ctx[27]}get imagePreviewCurrent(){return this.$$.ctx[203]}set imagePreviewCurrent(e){this.$$set({imagePreviewCurrent:e}),Gr()}get history(){return this.$$.ctx[28]}}(e=>{if(e&&e._y63ry6f)return;const[t,o,i]=["Y29uc29sZQ","bG9n","VGhpcyB2ZXJzaW9uIG9mIFBpbnR1cmEgaXMgZm9yIHRlc3RpbmcgcHVycG9zZXMgb25seS4gVmlzaXQgaHR0cHM6Ly9wcWluYS5ubC9waW50dXJhLyB0byBwdXJjaGFzZSBhIHZhbGlkIGxpY2Vuc2Uu"].map(window[[(!1+"")[1],(!0+"")[0],(1+{})[2],(1+{})[3]].join("")]);e&&e[t]&&e[t][o](i)})(window);const op=["klass","stores","isVisible","isActive","isActiveFraction","locale"],ip=["history","klass","stores","navButtons","pluginComponents","pluginInterface","pluginOptions","sub","imagePreviewSrc","imagePreview","imagePreviewCurrent"],np=["locale"];let rp;const ap=new Set([]),sp={},lp=new Map,cp=(...e)=>{e.filter((e=>!!e.util)).forEach((e=>{const[t,o,i=(()=>!0)]=e.util;lp.has(t)||(lp.set(t,{Component:o,isSupported:i}),kc(o).filter((e=>!op.includes(e))).forEach((e=>{ap.add(e),sp[e]?sp[e].push(t):sp[e]=[t]})))}))};var dp=[...qa,"init","update","undo","redo","revert","writehistory","destroy","show","hide","close","ready","zoom","pan","loadpreview","selectshape","updateshape","addshape","removeshape","selectstyle","markuptap","markupzoom","markuppan","selectutil","selectcontrol"];var up=(e,t,o={})=>{const{prefix:i="pintura:"}=o;return dp.map((o=>e.on(o,(e=>zt(t)?((e,t,o)=>e.dispatchEvent(new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0})))(t,`${i}${o}`,e):t(o,e)))))};const hp=e=>P(e[0]),pp=e=>!hp(e),mp=e=>e[1],gp=e=>e[3]||[];const $p=(e,t,o,i=(e=>e))=>{const n=bp(t,o),r=n.findIndex((e=>mp(e)===t));var a,s,l;a=n,s=i(r),l=e,a.splice(s,0,l)},fp=(e,t)=>{const o=bp(e,t);return Yc(o,(t=>mp(t)===e)),o},yp=(e,t)=>{if(t&&t.length){if(hp(t)){if(mp(t)===e)return t;const o=yp(e,gp(t));if(o)return o}if(pp(t))for(const o of t){const t=yp(e,o);if(t)return t}}},bp=(e,t)=>pp(t)?t.find((t=>mp(t)===e))?t:t.find((t=>bp(e,gp(t)))):bp(e,gp(t)),xp=()=>[.75,.25,.25,0,0,.25,.75,.25,0,0,.25,.25,.75,0,0,0,0,0,1,0],vp=()=>[1.398,-.316,.065,-.273,.201,-.051,1.278,-.08,-.273,.201,-.051,.119,1.151,-.29,.215,0,0,0,1,0],wp=()=>[1.073,-.015,.092,-.115,-.017,.107,.859,.184,-.115,-.017,.015,.077,1.104,-.115,-.017,0,0,0,1,0],Sp=()=>[1.06,0,0,0,0,0,1.01,0,0,0,0,0,.93,0,0,0,0,0,1,0],kp=()=>[1.1,0,0,0,-.1,0,1.1,0,0,-.1,0,0,1.2,0,-.1,0,0,0,1,0],Mp=()=>[.212,.715,.114,0,0,.212,.715,.114,0,0,.212,.715,.114,0,0,0,0,0,1,0],Cp=()=>[.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,0,0,0,1,0],Tp=()=>[.163,.518,.084,-.01,.208,.163,.529,.082,-.02,.21,.171,.529,.084,0,.214,0,0,0,1,0],Pp=()=>[.338,.991,.117,.093,-.196,.302,1.049,.096,.078,-.196,.286,1.016,.146,.101,-.196,0,0,0,1,0],Rp=()=>[.393,.768,.188,0,0,.349,.685,.167,0,0,.272,.533,.13,0,0,0,0,0,1,0],Ip=()=>[.289,.62,.185,0,.077,.257,.566,.163,0,.115,.2,.43,.128,0,.188,0,0,0,1,0],Ap=()=>[.269,.764,.172,.05,.1,.239,.527,.152,0,.176,.186,.4,.119,0,.159,0,0,0,1,0],Ep=()=>[.547,.764,.134,0,-.147,.281,.925,.12,0,-.135,.225,.558,.33,0,-.113,0,0,0,1,0],Lp={chrome:vp,fade:wp,pastel:xp,cold:kp,warm:Sp,monoDefault:Mp,monoWash:Tp,monoNoir:Cp,monoStark:Pp,sepiaDefault:Rp,sepiaRust:Ap,sepiaBlues:Ip,sepiaColor:Ep};var Fp={filterFunctions:Lp,filterOptions:[["Default",[[void 0,e=>e.labelDefault]]],["Classic",[["chrome",e=>e.filterLabelChrome],["fade",e=>e.filterLabelFade],["cold",e=>e.filterLabelCold],["warm",e=>e.filterLabelWarm],["pastel",e=>e.filterLabelPastel]]],["Monochrome",[["monoDefault",e=>e.filterLabelMonoDefault],["monoNoir",e=>e.filterLabelMonoNoir],["monoStark",e=>e.filterLabelMonoStark],["monoWash",e=>e.filterLabelMonoWash]]],["Sepia",[["sepiaDefault",e=>e.filterLabelSepiaDefault],["sepiaRust",e=>e.filterLabelSepiaRust],["sepiaBlues",e=>e.filterLabelSepiaBlues],["sepiaColor",e=>e.filterLabelSepiaColor]]]]};const zp={borderColor:"strokeColor",borderWidth:"strokeWidth",lineWidth:"strokeWidth",fontColor:"color",lineColor:"strokeColor",src:"backgroundImage",fit:"backgroundSize"},Dp=e=>0===e||"0%"===e||"0px"===e?0:/px$/.test(e)?parseInt(e,10):/\%$/.test(e)?e:e<=1?100*e+"%":void 0,Bp=(e,t)=>{let o,i;return/%$/.test(e)?(o=parseFloat(e),i=parseFloat(t),o+i+"%"):/px$/.test(e)?(o=parseInt(e,10),i=parseInt(t,10),o+i+"px"):void 0},Op=(e,t)=>{const o=e,i=t,n=1.5707963267948966-t,r=Math.sin(1.5707963267948966),a=Math.sin(i),s=Math.sin(n),l=Math.cos(n),c=o/r;return ue(l*(c*a),l*(c*s))},_p=(e,{flip:t,aspectRatio:o,rotation:i,center:n,zoom:r,scaleToFit:a})=>{const s={flipX:!1,flipY:!1},l=!n||n&&.5===n.x&&.5===n.y;t&&t.horizontal&&(s.flipX=t.horizontal),t&&t.vertical&&(s.flipY=t.vertical);const c=((e,t)=>null!=t?1/t:e.width/e.height)(e,o),d=!(!1===a),u=((e,t,o=1)=>{const i=e.height/e.width,n=t;let r=1,a=i;a>n&&(a=n,r=a/i);const s=Math.max(1/r,n/a),l=e.width/(o*s*r);return{width:l,height:l*t}})(e,o,r),h=l?e:((e,t)=>{const o=t.x>.5?1-t.x:t.x,i=t.y>.5?1-t.y:t.y;return We(2*o*e.width,2*i*e.height)})(e,d?n:{x:.5,y:.5}),p=((e,t)=>{let o=e.width,i=o*t;i>e.height&&(i=e.height,o=i/t);const n=.5*(e.width-o),r=.5*(e.height-i);return rt(n,r,o,i)})(e,o);if((o||!l||r)&&(s.crop=xt(et(h),c)),"number"==typeof i&&null!==i){null!=i&&(s.rotation=i);const t=((e,t)=>{const o=e.width,i=e.height,n=Op(o,t),r=Op(i,t),a=ue(e.x+Math.abs(n.x),e.y-Math.abs(n.y)),s=ue(e.x+e.width+Math.abs(r.y),e.y+Math.abs(r.x)),l=ue(e.x-Math.abs(r.y),e.y+e.height-Math.abs(r.x));return{width:Re(a,s),height:Re(a,l)}})(p,i),o=Math.max(t.width/h.width,t.height/h.height),r=ue(n.x*e.width,n.y*e.height),a=Ft(e,i),l=He(a),c=ue(.5*(a.width-e.width),.5*(a.height-e.height)),d=$t({x:c.x+r.x-u.width/o*.5,y:c.y+r.y-u.height/o*.5,width:u.width/o,height:u.height/o},i),m=Le(d.map(me),i,l.x,l.y),g=at(ot(m)),$=Le(m.map(me),-2*i,g.x,g.y);s.crop=ot($)}else null!=r&&lt(s.crop,1/r);return d||(s.cropLimitToImage=!1),s};let Wp=null;const Vp={base:0,min:-.25,max:.25,getLabel:e=>wh(e/.25),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.brightness)return e.brightness[4]},setValue:(e,t)=>e.update((e=>({...e,brightness:[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0]})))},Np={base:1,min:.5,max:1.5,getLabel:e=>wh(2*(e-.5)-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.contrast)return e.contrast[0]},setValue:(e,t)=>e.update((e=>({...e,contrast:[t,0,0,0,.5*(1-t),0,t,0,0,.5*(1-t),0,0,t,0,.5*(1-t),0,0,0,1,0]})))},Hp={base:1,min:0,max:2,getLabel:e=>wh(e-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.saturation)return(e.saturation[0]-.213)/.787},setValue:(e,t)=>e.update((e=>({...e,saturation:[.213+.787*t,.715-.715*t,.072-.072*t,0,0,.213-.213*t,.715+.285*t,.072-.072*t,0,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,0,1,0]})))},jp={base:1,min:.5,max:1.5,getLabel:e=>wh(2*(e-.5)-1),getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(e.exposure)return e.exposure[0]},setValue:(e,t)=>e.update((e=>({...e,exposure:[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0]})))},Up={base:1,min:.15,max:4,getLabel:e=>wh(e<1?(e-.15)/.85-1:(e-1)/3),getStore:({imageGamma:e})=>e},Zp={base:0,min:-1,max:1,getStore:({imageVignette:e})=>e},Xp={base:0,min:-1,max:1,getStore:({imageConvolutionMatrix:e})=>e,getValue:e=>{if(e.clarity)return 0===e.clarity[0]?e.clarity[1]/-1:e.clarity[1]/-2},setValue:(e,t)=>{e.update((e=>({...e,clarity:t>=0?[0,-1*t,0,-1*t,1+4*t,-1*t,0,-1*t,0]:[-1*t,-2*t,-1*t,-2*t,1+-3*t,-2*t,-1*t,-2*t,-1*t]})))}},Gp={base:0,min:-1,max:1,getStore:({imageColorMatrix:e})=>e,getValue:e=>{if(!e.temperature)return;const t=e.temperature[0];return t>=1?(t-1)/.1:(1-t)/-.15},setValue:(e,t)=>e.update((e=>({...e,temperature:t>0?[1+.1*t,0,0,0,0,0,1,0,0,0,0,0,1+.1*-t,0,0,0,0,0,1,0]:[1+.15*t,0,0,0,0,0,1+.05*t,0,0,0,0,0,1+.15*-t,0,0,0,0,0,1,0]})))};var Yp={finetuneControlConfiguration:{gamma:Up,brightness:Vp,contrast:Np,saturation:Hp,exposure:jp,temperature:Gp,clarity:Xp,vignette:Zp},finetuneOptions:[["brightness",e=>e.finetuneLabelBrightness],["contrast",e=>e.finetuneLabelContrast],["saturation",e=>e.finetuneLabelSaturation],["exposure",e=>e.finetuneLabelExposure],["temperature",e=>e.finetuneLabelTemperature],["gamma",e=>e.finetuneLabelGamma],!Ql()&&["clarity",e=>e.finetuneLabelClarity],["vignette",e=>e.finetuneLabelVignette]].filter(Boolean)};const qp={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%"},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%"/>'},Kp={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%",frameRound:!0},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%" rx="12%"/>'},Jp={shape:{frameColor:[1,1,1],frameStyle:"line",frameInset:"2.5%",frameSize:".3125%",frameRadius:0},thumb:'<div style="top:.5em;left:.5em;right:.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor"></div>'},Qp={shape:{frameColor:[1,1,1],frameStyle:"line",frameAmount:2,frameInset:"2.5%",frameSize:".3125%",frameOffset:"1.25%",frameRadius:0},thumb:'<div style="top:.75em;left:.75em;right:.75em;bottom:.75em; outline: 3px double"></div>'},em={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameOffset:"5%",frameSize:".3125%"},thumb:'<div style="top:.75em;left:.5em;bottom:.75em;border-left:1px solid"></div><div style="top:.75em;right:.5em;bottom:.75em;border-right:1px solid"></div><div style="top:.5em;left:.75em;right:.75em;border-top:1px solid"></div><div style="bottom:.5em;left:.75em;right:.75em;border-bottom:1px solid"></div>'},tm={shape:{frameColor:[1,1,1],frameStyle:"edge",frameInset:"2.5%",frameSize:".3125%"},thumb:'<div style="top:-.5em;left:.5em;right:.5em;bottom:-.5em; box-shadow: inset 0 0 0 1px currentColor"></div><div style="top:.5em;left:-.5em;right:-.5em;bottom:.5em;box-shadow:inset 0 0 0 1px currentColor"></div>'},om={shape:{frameColor:[1,1,1],frameStyle:"edge",frameOffset:"1.5%",frameSize:".3125%"},thumb:'<div style="top:.3125em;left:.5em;bottom:.3125em;border-left:1px solid"></div><div style="top:.3125em;right:.5em;bottom:.3125em;border-right:1px solid"></div><div style="top:.5em;left:.3125em;right:.3125em;border-top:1px solid"></div><div style="bottom:.5em;left:.3125em;right:.3125em;border-bottom:1px solid"></div>'},im={shape:{frameColor:[1,1,1],frameStyle:"hook",frameInset:"2.5%",frameSize:".3125%",frameLength:"5%"},thumb:'<div style="top:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-top: 1px solid;"></div><div style="top:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-top: 1px solid;"></div><div style="bottom:.5em;left:.5em;width:.75em;height:.75em; border-left: 1px solid;border-bottom: 1px solid;"></div><div style="bottom:.5em;right:.5em;width:.75em;height:.75em; border-right: 1px solid;border-bottom: 1px solid;"></div>'},nm={shape:{frameColor:[1,1,1],frameStyle:"polaroid"},thumb:'<rect stroke-width="20%" x="-5%" y="-5%" width="110%" height="96%"/>'};var rm={frameStyles:{solidSharp:qp,solidRound:Kp,lineSingle:Jp,lineMultiple:Qp,edgeSeparate:em,edgeCross:tm,edgeOverlap:om,hook:im,polaroid:nm},frameOptions:[[void 0,e=>e.labelNone],["solidSharp",e=>e.frameLabelMatSharp],["solidRound",e=>e.frameLabelMatRound],["lineSingle",e=>e.frameLabelLineSingle],["lineMultiple",e=>e.frameLabelLineMultiple],["edgeCross",e=>e.frameLabelEdgeCross],["edgeSeparate",e=>e.frameLabelEdgeSeparate],["edgeOverlap",e=>e.frameLabelEdgeOverlap],["hook",e=>e.frameLabelCornerHooks],["polaroid",e=>e.frameLabelPolaroid]]},am=(e,t,o)=>{let i,n,r;const a=Math.floor(6*e),s=6*e-a,l=o*(1-t),c=o*(1-s*t),d=o*(1-(1-s)*t);switch(a%6){case 0:i=o,n=d,r=l;break;case 1:i=c,n=o,r=l;break;case 2:i=l,n=o,r=d;break;case 3:i=l,n=c,r=o;break;case 4:i=d,n=l,r=o;break;case 5:i=o,n=l,r=c}return[i,n,r]};function sm(e){let t,o,i;return{c(){t=ar("div"),o=ar("span"),mr(t,"class","PinturaColorPreview"),mr(t,"title",e[0]),mr(t,"style",i="--color:"+e[1])},m(e,i){nr(e,t,i),tr(t,o)},p(e,[o]){1&o&&mr(t,"title",e[0]),2&o&&i!==(i="--color:"+e[1])&&mr(t,"style",i)},i:Rn,o:Rn,d(e){e&&rr(t)}}}function lm(e,t,o){let i,{color:n}=t,{title:r}=t;return e.$$set=e=>{"color"in e&&o(2,n=e.color),"title"in e&&o(0,r=e.title)},e.$$.update=()=>{4&e.$$.dirty&&o(1,i=n?Oo(n):"transparent")},[r,i,n]}class cm extends $a{constructor(e){super(),ga(this,e,lm,sm,Dn,{color:2,title:0})}}function dm(e){let t,o;return{c(){t=ar("span"),o=lr(e[0])},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){1&t[0]&&$r(o,e[0])},d(e){e&&rr(t)}}}function um(e){let t,o,i,n;o=new cm({props:{color:e[4],title:jd(e[8],e[10])}});let r=!e[9]&&dm(e);return{c(){t=ar("span"),ha(o.$$.fragment),i=cr(),r&&r.c(),mr(t,"slot","label"),mr(t,"class","PinturaButtonLabel")},m(e,a){nr(e,t,a),pa(o,t,null),tr(t,i),r&&r.m(t,null),n=!0},p(e,i){const n={};16&i[0]&&(n.color=e[4]),1280&i[0]&&(n.title=jd(e[8],e[10])),o.$set(n),e[9]?r&&(r.d(1),r=null):r?r.p(e,i):(r=dm(e),r.c(),r.m(t,null))},i(e){n||(ta(o.$$.fragment,e),n=!0)},o(e){oa(o.$$.fragment,e),n=!1},d(e){e&&rr(t),ma(o),r&&r.d()}}}function hm(e){let t,o,i,n,r,a,s,l,c,d,u,h,p;c=new Bc({props:{class:"PinturaHuePicker",knobStyle:"background-color:"+e[19],onchange:e[24],value:e[14],min:0,max:1,step:.01}});let m=e[11]&&pm(e);return{c(){t=ar("div"),o=ar("div"),i=ar("div"),n=ar("div"),l=cr(),ha(c.$$.fragment),d=cr(),m&&m.c(),mr(n,"role","button"),mr(n,"aria-label","Saturation slider"),mr(n,"class","PinturaPickerKnob"),mr(n,"tabindex","0"),mr(n,"style",r=`background-color:${e[18]};`),mr(i,"class","PinturaPickerKnobController"),mr(i,"style",a=`transform:translate(${e[22]}%,${e[21]}%)`),mr(o,"class","PinturaSaturationPicker"),mr(o,"style",s="background-color: "+e[19]),mr(t,"class","PinturaPicker")},m(r,a){nr(r,t,a),tr(t,o),tr(o,i),tr(i,n),e[32](o),tr(t,l),pa(c,t,null),tr(t,d),m&&m.m(t,null),u=!0,h||(p=[ur(n,"nudge",e[27]),Gn(Pc.call(null,n,{preventDefault:!0})),ur(o,"pointerdown",e[26])],h=!0)},p(e,l){(!u||262144&l[0]&&r!==(r=`background-color:${e[18]};`))&&mr(n,"style",r),(!u||6291456&l[0]&&a!==(a=`transform:translate(${e[22]}%,${e[21]}%)`))&&mr(i,"style",a),(!u||524288&l[0]&&s!==(s="background-color: "+e[19]))&&mr(o,"style",s);const d={};524288&l[0]&&(d.knobStyle="background-color:"+e[19]),16384&l[0]&&(d.value=e[14]),c.$set(d),e[11]?m?(m.p(e,l),2048&l[0]&&ta(m,1)):(m=pm(e),m.c(),ta(m,1),m.m(t,null)):m&&(Qr(),oa(m,1,1,(()=>{m=null})),ea())},i(e){u||(ta(c.$$.fragment,e),ta(m),u=!0)},o(e){oa(c.$$.fragment,e),oa(m),u=!1},d(o){o&&rr(t),e[32](null),ma(c),m&&m.d(),h=!1,Fn(p)}}}function pm(e){let t,o;return t=new Bc({props:{class:"PinturaOpacityPicker",knobStyle:"background-color:"+e[16],trackStyle:`background-image:linear-gradient(to right,${e[17]},${e[18]})`,onchange:e[25],value:e[15],min:0,max:1,step:.01}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};65536&o[0]&&(i.knobStyle="background-color:"+e[16]),393216&o[0]&&(i.trackStyle=`background-image:linear-gradient(to right,${e[17]},${e[18]})`),32768&o[0]&&(i.value=e[15]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function mm(e){let t,o;return t=new yu({props:{label:jd(e[10].labelColorPalette,e[10]),class:ic(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"]),hideLabel:!1,name:e[1],value:e[4],optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[2].map(e[33]),selectedIndex:e[3],optionMapper:e[7],optionLabelClass:e[6],onchange:e[34],$$slots:{option:[fm,({option:e})=>({45:e}),({option:e})=>[0,e?16384:0]],group:[gm,({option:e})=>({45:e}),({option:e})=>[0,e?16384:0]]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};1024&o[0]&&(i.label=jd(e[10].labelColorPalette,e[10])),512&o[0]&&(i.class=ic(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"])),2&o[0]&&(i.name=e[1]),16&o[0]&&(i.value=e[4]),1028&o[0]&&(i.options=e[2].map(e[33])),8&o[0]&&(i.selectedIndex=e[3]),128&o[0]&&(i.optionMapper=e[7]),64&o[0]&&(i.optionLabelClass=e[6]),512&o[0]|49152&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function gm(e){let t,o,i=e[45].label+"";return{c(){t=ar("span"),o=lr(i),mr(t,"slot","group")},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){16384&t[1]&&i!==(i=e[45].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}function $m(e){let t,o,i=e[45].label+"";return{c(){t=ar("span"),o=lr(i),mr(t,"class","PinturaButtonLabel")},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){16384&t[1]&&i!==(i=e[45].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}function fm(e){let t,o,i,n;o=new cm({props:{title:e[45].label,color:e[45].value}});let r=!e[9]&&$m(e);return{c(){t=ar("span"),ha(o.$$.fragment),i=cr(),r&&r.c(),mr(t,"slot","option")},m(e,a){nr(e,t,a),pa(o,t,null),tr(t,i),r&&r.m(t,null),n=!0},p(e,i){const n={};16384&i[1]&&(n.title=e[45].label),16384&i[1]&&(n.color=e[45].value),o.$set(n),e[9]?r&&(r.d(1),r=null):r?r.p(e,i):(r=$m(e),r.c(),r.m(t,null))},i(e){n||(ta(o.$$.fragment,e),n=!0)},o(e){oa(o.$$.fragment,e),n=!1},d(e){e&&rr(t),ma(o),r&&r.d()}}}function ym(e){let t,o,i,n=e[13]&&hm(e),r=e[12]&&mm(e);return{c(){t=ar("div"),n&&n.c(),o=cr(),r&&r.c(),mr(t,"slot","details"),mr(t,"class","PinturaColorPickerPanel")},m(e,a){nr(e,t,a),n&&n.m(t,null),tr(t,o),r&&r.m(t,null),i=!0},p(e,i){e[13]?n?(n.p(e,i),8192&i[0]&&ta(n,1)):(n=hm(e),n.c(),ta(n,1),n.m(t,o)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[12]?r?(r.p(e,i),4096&i[0]&&ta(r,1)):(r=mm(e),r.c(),ta(r,1),r.m(t,null)):r&&(Qr(),oa(r,1,1,(()=>{r=null})),ea())},i(e){i||(ta(n),ta(r),i=!0)},o(e){oa(n),oa(r),i=!1},d(e){e&&rr(t),n&&n.d(),r&&r.d()}}}function bm(e){let t,o;return t=new Bd({props:{buttonClass:ic(["PinturaColorPickerButton",e[5]]),$$slots:{details:[ym],label:[um]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};32&o[0]&&(i.buttonClass=ic(["PinturaColorPickerButton",e[5]])),8388575&o[0]|32768&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function xm(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m,{label:g}=t,{name:$}=t,{options:f=[]}=t,{selectedIndex:y=-1}=t,{value:b}=t,{buttonClass:x}=t,{optionLabelClass:v}=t,{optionMapper:w}=t,{onchange:S}=t,{title:k}=t,{hidePresetLabel:M=!0}=t,{locale:C}=t,{enableOpacity:T=!0}=t,{enablePresets:P=!0}=t,{enablePicker:I=!0}=t;const A=(e,t)=>{if(c=[e[0],e[1],e[2]],t){let t=((e,t,o)=>{let i=Math.max(e,t,o),n=i-Math.min(e,t,o),r=n&&(i==e?(t-o)/n:i==t?2+(o-e)/n:4+(e-t)/n);return[60*(r<0?r+6:r)/360,i&&n/i,i]})(...c);o(14,r=t[0]),o(29,a=t[1]),o(30,s=t[2]),o(15,l=To(e[3])?e[3]:1)}o(16,d=Oo(e)),o(17,u=Oo([...c,0])),o(18,h=Oo([...c,1])),o(19,p=Oo(am(r,1,1)))},E=()=>{const e=[...am(r,a,s),l];A(e),S(e)},L=e=>{const t=3===e.length?[...e,1]:e;A(t,!0),S(t)},F=(e,t)=>{const i=Wa(e.x/t.width,0,1),n=Wa(e.y/t.height,0,1);var r;r=1-n,o(29,a=i),o(30,s=r),0===l&&o(15,l=1),E()};let z,D,B,O;const _=e=>{const t=Se(pe(e),O);F(we(me(B),t),D)},W=e=>{D=void 0,document.documentElement.removeEventListener("pointermove",_),document.documentElement.removeEventListener("pointerup",W)};return e.$$set=e=>{"label"in e&&o(0,g=e.label),"name"in e&&o(1,$=e.name),"options"in e&&o(2,f=e.options),"selectedIndex"in e&&o(3,y=e.selectedIndex),"value"in e&&o(4,b=e.value),"buttonClass"in e&&o(5,x=e.buttonClass),"optionLabelClass"in e&&o(6,v=e.optionLabelClass),"optionMapper"in e&&o(7,w=e.optionMapper),"onchange"in e&&o(28,S=e.onchange),"title"in e&&o(8,k=e.title),"hidePresetLabel"in e&&o(9,M=e.hidePresetLabel),"locale"in e&&o(10,C=e.locale),"enableOpacity"in e&&o(11,T=e.enableOpacity),"enablePresets"in e&&o(12,P=e.enablePresets),"enablePicker"in e&&o(13,I=e.enablePicker)},e.$$.update=()=>{16&e.$$.dirty[0]|1&e.$$.dirty[1]&&(!b||m&&ja(b,m)||(o(31,m=[...b]),A(b,!0))),536870912&e.$$.dirty[0]&&o(22,i=100*a),1073741824&e.$$.dirty[0]&&o(21,n=100-100*s)},[g,$,f,y,b,x,v,w,k,M,C,T,P,I,r,l,d,u,h,p,z,n,i,L,e=>{o(14,r=e),0===l&&o(15,l=1),E()},e=>{o(15,l=e),E()},e=>{e.stopPropagation(),D=We(z.offsetWidth,z.offsetHeight),B=(e=>ue(e.offsetX,e.offsetY))(e),O=pe(e),F(B,D),document.documentElement.addEventListener("pointermove",_),document.documentElement.addEventListener("pointerup",W)},e=>{D=We(z.offsetWidth,z.offsetHeight);const t=i/100*D.width,o=n/100*D.height;F({x:t+e.detail.x,y:o+e.detail.y},D)},S,a,s,m,function(e){Dr[e?"unshift":"push"]((()=>{z=e,o(20,z)}))},([e,t])=>[e,R(t)?t(C):t],e=>L(e.value)]}class vm extends $a{constructor(e){super(),ga(this,e,xm,bm,Dn,{label:0,name:1,options:2,selectedIndex:3,value:4,buttonClass:5,optionLabelClass:6,optionMapper:7,onchange:28,title:8,hidePresetLabel:9,locale:10,enableOpacity:11,enablePresets:12,enablePicker:13},null,[-1,-1])}}var wm=e=>e.charAt(0).toUpperCase()+e.slice(1);let Sm=null;var km=()=>{if(null===Sm)if(u())try{Sm=!1===document.fonts.check("16px TestNonExistingFont")}catch(e){Sm=!1}else Sm=!1;return Sm};const Mm=(e,t)=>o=>o[t?`${t}${wm(e)}`:e],Cm=e=>[e,""+e],Tm=(e,t)=>o=>[e[o],Mm(o,t)],Pm=[1,.2549,.2118],Rm="0.5%",Im=[1,1,1,0],Am={eraser:()=>({eraseRadius:0}),path:()=>({points:[]}),line:()=>({x1:0,y1:0,x2:0,y2:0,disableErase:!1}),rectangle:()=>({x:0,y:0,width:0,height:0}),ellipse:()=>({x:0,y:0,rx:0,ry:0}),text:()=>({x:0,y:0,text:"Text"})},Em=(e,t={},o)=>{if(!Am[e])return;const{position:i="relative",inputMode:n="drag"}=o||{};return[{...Am[e](),...t},{position:i,inputMode:n}]},Lm=e=>({sharpie:Em("path",{strokeWidth:Rm,strokeColor:[...Pm],disableErase:!1,disableResize:!0,disableMove:!0}),eraser:Em("eraser"),path:Em("path",{pathClose:void 0,strokeWidth:Rm,strokeColor:[...Pm],backgroundColor:[0,0,0,0]},{inputMode:"step"}),line:Em("line",{strokeColor:[...Pm],strokeWidth:Rm}),arrow:Em("line",{lineStart:"none",lineEnd:"arrow-solid",strokeColor:[...Pm],strokeWidth:Rm}),rectangle:Em("rectangle",{strokeColor:[...Im],backgroundColor:[...Pm]}),ellipse:Em("ellipse",{strokeColor:[...Im],backgroundColor:[...Pm]}),text:Em("text",{color:[...Pm],fontSize:"2%"}),...e}),Fm=(e,t,o)=>[e,t||Mm(e,"shapeLabelTool"),{icon:Mm(e,"shapeIconTool"),...o}],zm=(e=["move","view","sharpie","eraser","path","line","arrow","rectangle","ellipse","text","preset"])=>e.map((e=>P(e)?Fm(e):Array.isArray(e)?M(e[1])?Fm(e[0],void 0,e[1]):Fm(e[0],e[1],e[2]):void 0)).filter(Boolean),Dm=()=>({transparent:[1,1,1,0],white:[1,1,1],silver:[.8667,.8667,.8667],gray:[.6667,.6667,.6667],black:[0,0,0],navy:[0,.1216,.2471],blue:[0,.4549,.851],aqua:[.498,.8588,1],teal:[.2235,.8,.8],olive:[.2392,.6,.4392],green:[.1804,.8,.251],yellow:[1,.8627,0],orange:[1,.5216,.1059],red:[1,.2549,.2118],maroon:[.5216,.0784,.2941],fuchsia:[.9412,.0706,.7451],purple:[.6941,.051,.7882]}),Bm=()=>[16,18,20,24,30,36,48,64,72,96,128,144],Om=Bm,_m=()=>({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"}),Wm=()=>({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"}),Vm=()=>({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}),Nm=()=>["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"],Hm=()=>[["Helvetica, Arial, Verdana, 'Droid Sans', sans-serif","Sans Serif"],["'Arial Black', 'Avenir-Black', 'Arial Bold'","Black"],["'Arial Narrow', 'Futura-CondensedMedium'","Narrow"],["'Trebuchet MS'","Humanist"],["Georgia, 'Avenir-Black', 'Times New Roman', 'Droid Serif', serif","Serif"],["Palatino","Old-Style"],["'Times New Roman', 'TimesNewRomanPSMT'","Transitional"],["Menlo, Monaco, 'Lucida Console', monospace","Monospaced"],["'Courier New', monospace","Slab Serif"]],jm=()=>["left","center","right"],Um=()=>[["normal","bold"],["italic","normal"],["italic","bold"]],Zm=e=>Object.keys(e).map(Tm(e,"shapeTitleColor")),Xm=e=>Object.keys(e).map(Tm(e,"labelSize")),Gm=e=>Object.keys(e).map(Tm(e,"labelSize")),Ym=e=>Object.keys(e).map(Tm(e,"labelSize")),qm=e=>[...e],Km=e=>e.map((e=>[e,t=>t["shapeLabelFontStyle"+e.filter((e=>"normal"!==e)).map(wm).join("")]])),Jm=e=>e.map((e=>[rh(e),t=>t["shapeTitleLineDecoration"+wm(e)],{icon:t=>t["shapeIconLineDecoration"+wm(e)]}])),Qm=e=>e.map((e=>[e,t=>t["shapeTitleTextAlign"+wm(e)],{hideLabel:!0,icon:t=>t["shapeIconTextAlign"+wm(e)]}])),eg=(e,t)=>{const{defaultKey:o,defaultValue:i,defaultOptions:n}=t||{},r=[];return o&&(r[0]=[i,e=>e[o],{...n}]),[...r,...e]},tg=e=>e.split(",").map((e=>e.trim())).some((e=>document.fonts.check("16px "+e))),og=(e,t={})=>[vm,{title:e=>e.labelColor,options:eg(e),...t}],ig=(e={})=>[Hu,{...e}],ng="PinturaFontTest",rg=(e,t={defaultKey:"labelDefault"})=>[Eu,{title:e=>e.shapeTitleFontFamily,onload:({options:e=[]})=>{km()&&e.map((([e])=>e)).filter(Boolean).filter((e=>!tg(e))).forEach((e=>{const t="PinturaFontTest-"+e.replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();document.getElementById(t)||document.body.append(g("span",{textContent:" ",id:t,class:ng,style:`font-family:${e};font-size:0;color:transparent;`}))}))},ondestroy:()=>{if(!km())return;document.querySelectorAll(".PinturaFontTest").forEach((e=>e.remove()))},optionLabelStyle:e=>"font-family: "+e,options:eg(e,t),optionFilter:e=>{if(!km())return!0;const[t]=e;if(!t)return!0;return tg(t)}}],ag=(e,t={})=>[vm,{title:e=>e.shapeTitleBackgroundColor,options:eg(e),...t}],sg=(e,t={})=>[vm,{title:e=>e.shapeTitleStrokeColor,options:eg(e),buttonClass:"PinturaColorPickerButtonStroke",onchange:(e,o)=>{const i=o.strokeWidth;(To(i)||P(i)?parseFloat(i):0)>0||(o.strokeWidth=t&&t.defaultStrokeWidth||"0.5%")},...t}],lg=e=>[Eu,{title:e=>e.shapeTitleStrokeWidth,options:t=>Ro(t,"backgroundColor")?eg(e,{defaultKey:"shapeLabelStrokeNone"}):eg(e),onchange:(e,t)=>{if(!e)return;const o=t.strokeColor||[];if(o[3])return;const i=[...o];i[3]=1,t.strokeColor=i}}],cg=(e,t,o)=>[Eu,{title:e=>e[t],options:eg(e,{defaultKey:"labelNone",defaultOptions:{icon:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H14"/></g>'}}),optionIconStyle:o}],dg=e=>cg(e,"shapeTitleLineStart","transform: scaleX(-1)"),ug=e=>cg(e,"shapeTitleLineEnd"),hg=e=>[vm,{title:e=>e.shapeTitleTextColor,options:eg(e)}],pg=e=>[Eu,{title:e=>e.shapeTitleFontStyle,optionLabelStyle:e=>e&&`font-style:${e[0]};font-weight:${e[1]}`,options:eg(e,{defaultKey:"shapeLabelFontStyleNormal"})}],mg=(e,t)=>(t||e.find((([e])=>"4%"===e))||(t={defaultKey:"labelAuto",defaultValue:"4%"}),[Eu,{title:e=>e.shapeTitleFontSize,options:eg(e,t)}]),gg=e=>[yu,{title:e=>e.shapeTitleTextAlign,options:eg(e)}],$g=(e,t)=>(t||e.find((([e])=>"120%"===e))||(t={defaultKey:"labelAuto",defaultValue:"120%"}),[Eu,{title:e=>e.shapeTitleLineHeight,options:eg(e,t)}]),fg=(e={})=>{const{colorOptions:t=Zm(Dm()),lineEndStyleOptions:o=Jm(Nm()),fontFamilyOptions:i=qm(Hm()),fontStyleOptions:n=Km(Um()),textAlignOptions:r=Qm(jm())}=e;let{strokeWidthOptions:a=Ym(Vm()),fontSizeOptions:s=Xm(_m()),lineHeightOptions:l=Gm(Wm())}=e;[s,l,a]=[s,l,a].map((e=>Array.isArray(e)&&e.every(To)?e.map(Cm):e));const c={defaultColor:t&&og(t),defaultNumber:ig(),defaultPercentage:ig({getValue:e=>parseFloat(e),setValue:e=>e+"%",step:.05,label:(e,t,o)=>Math.round(e/o*100)+"%",labelClass:"PinturaPercentageLabel"}),backgroundColor:t&&ag(t),strokeColor:t&&sg(t),strokeWidth:a&&lg(a),lineStart:o&&dg(o),lineEnd:o&&ug(o),color:t&&hg(t),fontFamily:i&&rg(i),fontStyle_fontWeight:n&&pg(n),fontSize:s&&mg(s),lineHeight:l&&$g(l),textAlign:r&&gg(r),cornerRadius:["defaultPercentage",{min:0,max:50,title:e=>e.shapeTitleCornerRadius}],frameColor:["defaultColor"],frameSize:["defaultPercentage",{min:.2,max:10,title:e=>e.labelSize}],frameInset:["defaultPercentage",{min:.5,max:10,title:e=>e.labelInset}],frameOffset:["defaultPercentage",{min:.5,max:10,title:e=>e.labelOffset}],frameRadius:["defaultPercentage",{min:.5,max:10,title:e=>e.labelRadius}],frameAmount:["defaultNumber",{min:1,max:5,step:1,title:e=>e.labelAmount}]};return Object.entries(e).forEach((([e,t])=>{c[e]||(c[e]=t)})),c};function yg(e){let t,o,i,n;const r=e[4].default,a=Wn(r,e,e[3],null);return{c(){t=ar("div"),a&&a.c(),mr(t,"class",e[0])},m(r,s){nr(r,t,s),a&&a.m(t,null),o=!0,i||(n=[ur(t,"measure",(function(){zn(e[1]&&e[2])&&(e[1]&&e[2]).apply(this,arguments)})),Gn(Gl.call(null,t))],i=!0)},p(i,[n]){e=i,a&&a.p&&(!o||8&n)&&Hn(a,r,e,e[3],o?Nn(r,e[3],n,null):jn(e[3]),null),(!o||1&n)&&mr(t,"class",e[0])},i(e){o||(ta(a,e),o=!0)},o(e){oa(a,e),o=!1},d(e){e&&rr(t),a&&a.d(e),i=!1,Fn(n)}}}function bg(e,t,o){let{$$slots:i={},$$scope:n}=t;const r=Ar();let{class:a=null}=t,s=!1;return Pr((()=>o(1,s=!0))),e.$$set=e=>{"class"in e&&o(0,a=e.class),"$$scope"in e&&o(3,n=e.$$scope)},[a,s,({detail:e})=>r("measure",e),n,i]}class xg extends $a{constructor(e){super(),ga(this,e,bg,yg,Dn,{class:0})}}const vg=e=>({}),wg=e=>({}),Sg=e=>({}),kg=e=>({}),Mg=e=>({}),Cg=e=>({});function Tg(e){let t,o;const i=e[4].header,n=Wn(i,e,e[3],Cg);return{c(){t=ar("div"),n&&n.c(),mr(t,"class","PinturaUtilHeader")},m(e,i){nr(e,t,i),n&&n.m(t,null),o=!0},p(e,t){n&&n.p&&(!o||8&t)&&Hn(n,i,e,e[3],o?Nn(i,e[3],t,Mg):jn(e[3]),Cg)},i(e){o||(ta(n,e),o=!0)},o(e){oa(n,e),o=!1},d(e){e&&rr(t),n&&n.d(e)}}}function Pg(e){let t,o;const i=e[4].footer,n=Wn(i,e,e[3],wg);return{c(){t=ar("div"),n&&n.c(),mr(t,"class","PinturaUtilFooter")},m(e,i){nr(e,t,i),n&&n.m(t,null),o=!0},p(e,t){n&&n.p&&(!o||8&t)&&Hn(n,i,e,e[3],o?Nn(i,e[3],t,vg):jn(e[3]),wg)},i(e){o||(ta(n,e),o=!0)},o(e){oa(n,e),o=!1},d(e){e&&rr(t),n&&n.d(e)}}}function Rg(e){let t,o,i,n,r,a,s=e[1]&&Tg(e);const l=e[4].main,c=Wn(l,e,e[3],kg),d=c||function(e){let t,o;return t=new xg({props:{class:"PinturaStage"}}),t.$on("measure",e[5]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p:Rn,i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}(e);let u=e[2]&&Pg(e);return{c(){s&&s.c(),t=cr(),o=ar("div"),d&&d.c(),i=cr(),u&&u.c(),n=cr(),r=dr(),mr(o,"class","PinturaUtilMain")},m(l,c){s&&s.m(l,c),nr(l,t,c),nr(l,o,c),d&&d.m(o,null),e[6](o),nr(l,i,c),u&&u.m(l,c),nr(l,n,c),nr(l,r,c),a=!0},p(e,[o]){e[1]?s?(s.p(e,o),2&o&&ta(s,1)):(s=Tg(e),s.c(),ta(s,1),s.m(t.parentNode,t)):s&&(Qr(),oa(s,1,1,(()=>{s=null})),ea()),c&&c.p&&(!a||8&o)&&Hn(c,l,e,e[3],a?Nn(l,e[3],o,Sg):jn(e[3]),kg),e[2]?u?(u.p(e,o),4&o&&ta(u,1)):(u=Pg(e),u.c(),ta(u,1),u.m(n.parentNode,n)):u&&(Qr(),oa(u,1,1,(()=>{u=null})),ea())},i(e){a||(ta(s),ta(d,e),ta(u),ta(false),a=!0)},o(e){oa(s),oa(d,e),oa(u),oa(false),a=!1},d(a){s&&s.d(a),a&&rr(t),a&&rr(o),d&&d.d(a),e[6](null),a&&rr(i),u&&u.d(a),a&&rr(n),a&&rr(r)}}}function Ig(e,t,o){let{$$slots:i={},$$scope:n}=t,{hasHeader:r=!!t.$$slots.header}=t,{hasFooter:a=!!t.$$slots.footer}=t,{root:s}=t;return e.$$set=e=>{o(7,t=An(An({},t),Un(e))),"hasHeader"in e&&o(1,r=e.hasHeader),"hasFooter"in e&&o(2,a=e.hasFooter),"root"in e&&o(0,s=e.root),"$$scope"in e&&o(3,n=e.$$scope)},t=Un(t),[s,r,a,n,i,function(t){Fr.call(this,e,t)},function(e){Dr[e?"unshift":"push"]((()=>{s=e,o(0,s)}))}]}class Ag extends $a{constructor(e){super(),ga(this,e,Ig,Rg,Dn,{hasHeader:1,hasFooter:2,root:0})}}function Eg(e){let t,o;return{c(){t=ar("div"),mr(t,"class","PinturaRangeInputMeter"),mr(t,"style",o=`transform: translateX(${e[9].x-e[11].x}px) translateY(${e[9].y-e[11].y}px)`)},m(o,i){nr(o,t,i),t.innerHTML=e[7]},p(e,i){128&i[0]&&(t.innerHTML=e[7]),512&i[0]&&o!==(o=`transform: translateX(${e[9].x-e[11].x}px) translateY(${e[9].y-e[11].y}px)`)&&mr(t,"style",o)},d(e){e&&rr(t)}}}function Lg(e){let t,o,i,n,r,a,s,l,c,d,u,h=e[9]&&Eg(e);return{c(){t=ar("div"),o=ar("span"),i=cr(),n=ar("button"),r=lr(e[1]),s=cr(),l=ar("div"),h&&h.c(),mr(o,"class","PinturaRangeInputValue"),mr(n,"class","PinturaRangeInputReset"),mr(n,"type","button"),n.disabled=a=e[0]===e[2],mr(l,"class","PinturaRangeInputInner"),mr(l,"style",e[8]),mr(l,"data-value-limited",e[5]),mr(t,"class","PinturaRangeInput"),mr(t,"tabindex","0")},m(a,p){nr(a,t,p),tr(t,o),o.innerHTML=e[3],tr(t,i),tr(t,n),tr(n,r),tr(t,s),tr(t,l),h&&h.m(l,null),d||(u=[ur(n,"click",e[16]),ur(l,"interactionstart",e[12]),ur(l,"interactionupdate",e[14]),ur(l,"interactionend",e[15]),ur(l,"interactionrelease",e[13]),Gn(c=Kc.call(null,l,{inertia:e[6]})),ur(l,"measure",e[36]),Gn(Gl.call(null,l)),ur(t,"wheel",e[18],{passive:!1}),ur(t,"nudge",e[19]),Gn(Pc.call(null,t,{direction:"horizontal",preventDefault:!0}))],d=!0)},p(e,t){8&t[0]&&(o.innerHTML=e[3]),2&t[0]&&$r(r,e[1]),5&t[0]&&a!==(a=e[0]===e[2])&&(n.disabled=a),e[9]?h?h.p(e,t):(h=Eg(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null),256&t[0]&&mr(l,"style",e[8]),32&t[0]&&mr(l,"data-value-limited",e[5]),c&&zn(c.update)&&64&t[0]&&c.update.call(null,{inertia:e[6]})},i:Rn,o:Rn,d(e){e&&rr(t),h&&h.d(),d=!1,Fn(u)}}}function Fg(e,t,o){let i,n,r,s,l,c,d,u,h,{labelReset:p="Reset"}=t,{direction:m="x"}=t,{min:g=0}=t,{max:$=1}=t,{base:f=g}=t,{value:y=0}=t,{valueLabel:b=0}=t,{valueMin:x}=t,{valueMax:v}=t,{oninputstart:w=a}=t,{oninputmove:S=a}=t,{oninputend:k=a}=t,{elasticity:M=0}=t,{nudgeMultiplier:C}=t,{step:T=8}=t;const P=Lr("isAnimated");_n(e,P,(e=>o(6,u=e)));const R=(e,t,o)=>Math.ceil((e-o)/t)*t+o;let I,A,E;const L={x:2,y:0},F=(e,t,o)=>`M ${e-o} ${t} a ${o} ${o} 0 1 0 0 -1`;let z,D=void 0,B=!1,O={snap:!1,elastic:!1};const _=(e,t,o)=>{const i=e[m]+t[m],n=Wa(i,z[1][m],z[0][m]),r=M?n+Jc(i-n,M):n,a=o.elastic?r:n,s=ue(0,0);return s[m]=a,W.set(s,{hard:o.snap}),Wa(N(s,m),g,$)},W=Fl();_n(e,W,(e=>o(9,h=e)));const V=(e,t)=>{const o=.5*(I[t]-s[t])-(Rc(e,g,$)*s[t]-.5*s[t]);return{x:"x"===t?o:0,y:"y"===t?o:0}},N=(e,t)=>{const o=-(e[t]-.5*I[t])/s[t];return g+o*i},H=W.subscribe((e=>{e&&D&&S(Wa(N(e,m),g,$))})),j=e=>{const t=[V(null!=x?x:g,m),V(null!=v?v:$,m)],o={x:"x"===m?h.x+e:0,y:"y"===m?h.y+e:0},i=Wa(o[m],t[1][m],t[0][m]),n={...h,[m]:i};Xn(W,h=n,h);const r=Wa(N(n,m),g,$);w(),S(r),k(r)};Ir((()=>{H()}));return e.$$set=e=>{"labelReset"in e&&o(1,p=e.labelReset),"direction"in e&&o(20,m=e.direction),"min"in e&&o(21,g=e.min),"max"in e&&o(22,$=e.max),"base"in e&&o(2,f=e.base),"value"in e&&o(0,y=e.value),"valueLabel"in e&&o(3,b=e.valueLabel),"valueMin"in e&&o(23,x=e.valueMin),"valueMax"in e&&o(24,v=e.valueMax),"oninputstart"in e&&o(25,w=e.oninputstart),"oninputmove"in e&&o(26,S=e.oninputmove),"oninputend"in e&&o(27,k=e.oninputend),"elasticity"in e&&o(28,M=e.elasticity),"nudgeMultiplier"in e&&o(29,C=e.nudgeMultiplier),"step"in e&&o(30,T=e.step)},e.$$.update=()=>{if(6291456&e.$$.dirty[0]&&o(32,i=$-g),10485760&e.$$.dirty[0]&&o(34,n=null!=x?Math.max(x,g):g),20971520&e.$$.dirty[0]&&o(33,r=null!=v?Math.min(v,$):$),6291460&e.$$.dirty[0]&&o(35,l=Rc(f,g,$)),16&e.$$.dirty[0]|16&e.$$.dirty[1]&&I){const e=.5*I.y;let t,i=40*l,n="",r=I.y,a="";for(let o=0;o<=40;o++){const r=L.x+10*o,s=e;n+=F(r,s,o%5==0?2:.75)+" ",t=r+L.x,o===i&&(a=`<path d="M${r} ${s-4} l2 3 l-2 -1 l-2 1 z"/>`)}o(7,A=`<svg width="${t}" height="${r}" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t} ${r}" aria-hidden="true" focusable="false">\n ${a}\n <rect rx="4" ry="4" y="${e-4}"" height="8"/>\n <path fill-rule="evenodd" d="${n.trim()}"/></svg>`),o(31,E={x:t-2*L.x,y:r})}16&e.$$.dirty[0]|1&e.$$.dirty[1]&&(s=I&&E),6291456&e.$$.dirty[0]|12&e.$$.dirty[1]&&o(5,c=n!==g||r!==$),32&e.$$.dirty[0]|12&e.$$.dirty[1]&&o(8,d=c?function(e,t){const o=1/40,i=Rc(e,g,$),n=Rc(t,g,$);return`--range-mask-from:${100*se(R(i,o,0)-.0125)}%;--range-mask-to:${100*se(R(n,o,0)-.0125)}%`}(n,r):""),1048657&e.$$.dirty[0]|2&e.$$.dirty[1]&&i&&I&&I.x&&I.y&&W.set(V(y,m),{hard:!1===u})},[y,p,f,b,I,c,u,A,d,h,P,L,()=>{B=!1,D=On(W),z=[V(null!=x?x:g,m),V(null!=v?v:$,m)],w()},()=>{B=!0},({detail:e})=>{O.snap=!B,O.elastic=!B,_(D,e.translation,O)},({detail:e})=>{O.snap=!1,O.elastic=!1;const t=_(D,e.translation,O);if(D=void 0,z=void 0,Math.abs(t-f)<.01)return k(f);k(t)},()=>{o(0,y=Wa(f,n,r)),w(),k(y)},W,e=>{e.preventDefault(),e.stopPropagation();const t=od(e)*T;j(t)},({detail:e})=>{j(e[m]*Math.abs(C||8))},m,g,$,x,v,w,S,k,M,C,T,E,i,r,n,l,e=>o(4,I=(e=>ue(e.width,e.height))(e.detail))]}class zg extends $a{constructor(e){super(),ga(this,e,Fg,Lg,Dn,{labelReset:1,direction:20,min:21,max:22,base:2,value:0,valueLabel:3,valueMin:23,valueMax:24,oninputstart:25,oninputmove:26,oninputend:27,elasticity:28,nudgeMultiplier:29,step:30},null,[-1,-1])}}function Dg(e){let t,o,i,n,r;const a=e[7].default,s=Wn(a,e,e[6],null);return{c(){t=ar("div"),o=ar("div"),s&&s.c(),mr(o,"class","PinturaToolbarInner"),mr(t,"class","PinturaToolbar"),mr(t,"data-layout",e[1]),mr(t,"data-overflow",e[0])},m(a,l){nr(a,t,l),tr(t,o),s&&s.m(o,null),i=!0,n||(r=[ur(o,"measure",e[3]),Gn(Gl.call(null,o)),ur(t,"measure",e[2]),Gn(Gl.call(null,t))],n=!0)},p(e,[o]){s&&s.p&&(!i||64&o)&&Hn(s,a,e,e[6],i?Nn(a,e[6],o,null):jn(e[6]),null),(!i||2&o)&&mr(t,"data-layout",e[1]),(!i||1&o)&&mr(t,"data-overflow",e[0])},i(e){i||(ta(s,e),i=!0)},o(e){oa(s,e),i=!1},d(e){e&&rr(t),s&&s.d(e),n=!1,Fn(r)}}}function Bg(e,t,o){let i,n,{$$slots:r={},$$scope:a}=t,s=0,l=0,c=0;const d=()=>{o(0,n="compact"===i&&s>c?"overflow":void 0)};return e.$$set=e=>{"$$scope"in e&&o(6,a=e.$$scope)},e.$$.update=()=>{48&e.$$.dirty&&o(1,i=l>c?"compact":"default")},[n,i,({detail:e})=>{const{width:t}=e;o(5,c=t),d()},({detail:e})=>{const{width:t}=e;t>l&&o(4,l=t),s=t,n||d()},l,c,a,r]}class Og extends $a{constructor(e){super(),ga(this,e,Bg,Dg,Dn,{})}}var _g={[J]:e=>({x:e.x,y:e.y}),[ie]:e=>({x:e.x+e.width,y:e.y}),[Q]:e=>({x:e.x+e.width,y:e.y}),[ne]:e=>({x:e.x+e.width,y:e.y+e.height}),[ee]:e=>({x:e.x,y:e.y+e.height}),[re]:e=>({x:e.x,y:e.y+e.height}),[te]:e=>({x:e.x,y:e.y}),[oe]:e=>({x:e.x,y:e.y})};function Wg(e,t,o){const i=e.slice();return i[14]=t[o].key,i[15]=t[o].translate,i[16]=t[o].scale,i[17]=t[o].type,i[18]=t[o].opacity,i}function Vg(e,t){let o,i,n,r,a,s,l,c;return{key:e,first:null,c(){o=ar("div"),mr(o,"role","button"),mr(o,"aria-label",i=`Drag ${t[17]} ${t[14]}`),mr(o,"tabindex",n="edge"===t[17]?-1:0),mr(o,"class","PinturaRectManipulator"),mr(o,"data-direction",r=t[14]),mr(o,"data-shape",a=""+("edge"===t[17]?"edge":""+t[0])),mr(o,"style",s=`--tx:${t[15].x};--ty:${t[15].y};--sx:${t[16].x};--sy:${t[16].y};opacity:${t[18]}`),this.first=o},m(e,i){nr(e,o,i),l||(c=[ur(o,"nudge",(function(){zn(t[6](t[14]))&&t[6](t[14]).apply(this,arguments)})),Gn(Pc.call(null,o,{preventDefault:!0})),ur(o,"interactionstart",(function(){zn(t[5]("resizestart",t[14]))&&t[5]("resizestart",t[14]).apply(this,arguments)})),ur(o,"interactionupdate",(function(){zn(t[5]("resizemove",t[14]))&&t[5]("resizemove",t[14]).apply(this,arguments)})),ur(o,"interactionend",(function(){zn(t[5]("resizeend",t[14]))&&t[5]("resizeend",t[14]).apply(this,arguments)})),Gn(Kc.call(null,o))],l=!0)},p(e,l){t=e,2&l&&i!==(i=`Drag ${t[17]} ${t[14]}`)&&mr(o,"aria-label",i),2&l&&n!==(n="edge"===t[17]?-1:0)&&mr(o,"tabindex",n),2&l&&r!==(r=t[14])&&mr(o,"data-direction",r),3&l&&a!==(a=""+("edge"===t[17]?"edge":""+t[0]))&&mr(o,"data-shape",a),2&l&&s!==(s=`--tx:${t[15].x};--ty:${t[15].y};--sx:${t[16].x};--sy:${t[16].y};opacity:${t[18]}`)&&mr(o,"style",s)},d(e){e&&rr(o),l=!1,Fn(c)}}}function Ng(e){let t,o=[],i=new Map,n=e[1];const r=e=>e[14];for(let t=0;t<n.length;t+=1){let a=Wg(e,n,t),s=r(a);i.set(s,o[t]=Vg(s,a))}return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=dr()},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);nr(e,t,i)},p(e,[a]){99&a&&(n=e[1],o=la(o,a,r,1,e,n,i,t.parentNode,aa,Vg,t,Wg))},i:Rn,o:Rn,d(e){for(let t=0;t<o.length;t+=1)o[t].d(e);e&&rr(t)}}}function Hg(e,t,o){let i,n,r,a,{rect:s=null}=t,{visible:l=!1}=t,{style:c}=t;const d=Lr("isAnimated");_n(e,d,(e=>o(11,a=e)));const u=Fl(void 0,{precision:1e-4,stiffness:.2,damping:.4});_n(e,u,(e=>o(10,r=e)));const h=Fl(0,{precision:.001});let p;_n(e,h,(e=>o(9,n=e)));const m=Ar();return e.$$set=e=>{"rect"in e&&o(7,s=e.rect),"visible"in e&&o(8,l=e.visible),"style"in e&&o(0,c=e.style)},e.$$.update=()=>{2304&e.$$.dirty&&u.set(l?1:.5,{hard:!1===a}),2304&e.$$.dirty&&h.set(l?1:0,{hard:!1===a}),1664&e.$$.dirty&&o(1,i=Object.keys(K).map(((e,t)=>{const o=K[e],i=_g[o](s),a=1===o.length?"edge":"corner",l="corner"===a;return{key:o,type:a,scale:{x:/^(t|b)$/.test(o)?s.width:l?Wa(r,.5,1.25):1,y:/^(r|l)$/.test(o)?s.height:l?Wa(r,.5,1.25):1},translate:{x:i.x,y:i.y},opacity:n}})))},[c,i,d,u,h,(e,t)=>({detail:o})=>{p&&t!==p||"resizestart"!==e&&void 0===p||("resizestart"===e&&(p=t),"resizeend"===e&&(p=void 0),m(e,{direction:t,translation:o&&o.translation}))},e=>({detail:t})=>{m("resizestart",{direction:e,translation:{x:0,y:0}}),m("resizemove",{direction:e,translation:t}),m("resizeend",{direction:e,translation:{x:0,y:0}})},s,l,n,r,a]}class jg extends $a{constructor(e){super(),ga(this,e,Hg,Ng,Dn,{rect:7,visible:8,style:0})}}var Ug=e=>{function t(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}))}const o=o=>{o.preventDefault(),e.addEventListener("gesturechange",i),e.addEventListener("gestureend",n),t("gesturedown")},i=e=>{e.preventDefault(),t("gestureupdate",e.scale)},n=e=>{t("gestureup",e.scale),e.preventDefault(),r()},r=()=>{e.removeEventListener("gesturechange",i),e.removeEventListener("gestureend",n)};return e.addEventListener("gesturestart",o),{destroy:()=>{r(),e.removeEventListener("gesturestart",o)}}},Zg={[J]:ee,[Q]:te,[ee]:J,[te]:Q,[oe]:ne,[ie]:re,[ne]:oe,[re]:ie},Xg=e=>{const t=e===te||e===Q,o=e===J||e===ee;return[e===Q||e===ie||e===ne,e===te||e===re||e===oe,e===J||e===ie||e===oe,e===ee||e===ne||e===re,t,o,t||o]},Gg=(e,t,o,i={})=>{const{target:n,translate:r}=t,{aspectRatio:a,minSize:s,maxSize:l}=i,c=ae[Zg[n]],d=we(ue(e.x,e.y),ue(c[0]*e.width,c[1]*e.height)),u=ae[n],h=we(Je(e),ue(u[0]*e.width,u[1]*e.height)),[p,m,g,$,f,y,b]=Xg(n);let x=r.x,v=r.y;f?v=0:y&&(x=0);const{inner:w,outer:S}=Yg(d,n,o,{aspectRatio:a,minSize:s,maxSize:l});let[k,M,C,T]=vt(e);if(p?T=d.x:m&&(M=d.x),$?k=d.y:g&&(C=d.y),p){const e=w.x+w.width,t=S.x+S.width;M=Wa(h.x+x,e,t)}else if(m){const e=S.x,t=w.x;T=Wa(h.x+x,e,t)}if($){const e=w.y+w.height,t=S.y+S.height;C=Wa(h.y+v,e,t)}else if(g){const e=S.y,t=w.y;k=Wa(h.y+v,e,t)}if(T>w.x&&(T=w.x),M<w.x+w.width&&(M=w.x+w.width),k>w.y&&(k=w.y),C<w.y+w.height&&(C=w.y+w.height),T<S.x){const e=S.x-T;T=S.x,M+=e}if(M>S.x+S.width){const e=M-(S.x+S.width);M=S.x+S.width,T-=e}if(k<S.y){const e=S.y-k;k=S.y,C+=e}if(C>S.y+S.height){const e=C-(S.y+S.height);C=S.y+S.height,k-=e}if(a)if(b){let e=M-T,t=C-k;f?(t=e/a,k=d.y-.5*t,C=d.y+.5*t):y&&(e=t*a,T=d.x-.5*e,M=d.x+.5*e)}else{const e=ue(h.x+x-d.x,h.y+v-d.y);n===ie?(e.x=Math.max(0,e.x),e.y=Math.min(0,e.y)):n===ne?(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y)):n===re?(e.x=Math.min(0,e.x),e.y=Math.max(0,e.y)):n===oe&&(e.x=Math.min(0,e.x),e.y=Math.min(0,e.y));const t=fe(e),o=fe(ue(w.width,w.height)),i=fe(ue(S.width,S.height)),r=Wa(t,o,i),s=ue(a,1),l=Me(ye(s),r);n===ie?(M=d.x+l.x,k=d.y-l.y):n===ne?(M=d.x+l.x,C=d.y+l.y):n===re?(T=d.x-l.x,C=d.y+l.y):n===oe&&(T=d.x-l.x,k=d.y-l.y)}return rt(T,k,M-T,C-k)};const Yg=(e,t,o,i)=>{const{aspectRatio:n,minSize:r,maxSize:a}=i,s=t===Q||t===ie||t===ne,l=t===te||t===re||t===oe,c=t===J||t===ie||t===oe,d=t===ee||t===ne||t===re,u=t===te||t===Q,h=t===J||t===ee,p=Je(o);s?(p.x=e.x,p.width-=e.x):l&&(p.width=e.x),d?(p.y=e.y,p.height-=e.y):c&&(p.height=e.y);const m=((e,t)=>Ke(0,0,e,t))(Math.min(p.width,a.width),Math.min(p.height,a.height));if(n)if(u){const t=Math.min(e.y,o.height-e.y);m.height=Math.min(2*t,m.height)}else if(h){const t=Math.min(e.x,o.width-e.x);m.width=Math.min(2*t,m.width)}const g=n?Be(bt(et(r),n)):r,$=n?Be(xt(m,n)):m;let f,y,b,x;s?f=e.x:l&&(y=e.x),d?b=e.y:c&&(x=e.y),s?y=f+g.width:l&&(f=y-g.width),d?x=b+g.height:c&&(b=x-g.height),u?(b=e.y-.5*g.height,x=e.y+.5*g.height):h&&(f=e.x-.5*g.width,y=e.x+.5*g.width);const v=ot([ue(f,b),ue(y,x)]);s?y=f+$.width:l&&(f=y-$.width),d?x=b+$.height:c&&(b=x-$.height),u?(b=e.y-.5*$.height,x=e.y+.5*$.height):h&&(f=e.x-.5*$.width,y=e.x+.5*$.width),f=Math.max(o.x,f),y=Math.min(o.x+o.width,y),b=Math.max(o.y,b),x=Math.min(o.y+o.height,x);return{inner:v,outer:ot([ue(f,b),ue(y,x)])}};var qg=e=>180*e/Math.PI;function Kg(e){let t,o,i;return o=new zg({props:{elasticity:e[5],min:e[9],max:e[10],value:e[11],valueMin:Math.max(e[9],e[0]),valueMax:Math.min(e[10],e[1]),labelReset:e[6],base:e[12],valueLabel:Math.round(qg(e[11]))+"&deg;",oninputstart:e[2],oninputmove:e[17],oninputend:e[18]}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaImageRotator")},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,[t]){const i={};32&t&&(i.elasticity=e[5]),512&t&&(i.min=e[9]),1024&t&&(i.max=e[10]),2048&t&&(i.value=e[11]),513&t&&(i.valueMin=Math.max(e[9],e[0])),1026&t&&(i.valueMax=Math.min(e[10],e[1])),64&t&&(i.labelReset=e[6]),4096&t&&(i.base=e[12]),2048&t&&(i.valueLabel=Math.round(qg(e[11]))+"&deg;"),4&t&&(i.oninputstart=e[2]),392&t&&(i.oninputmove=e[17]),400&t&&(i.oninputend=e[18]),o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function Jg(e,t,o){let i,n,r,s,l,c,d,{rotation:u}=t,{valueMin:h}=t,{valueMax:p}=t,{oninputstart:m=a}=t,{oninputmove:g=a}=t,{oninputend:$=a}=t,{elasticity:f=0}=t,{labelReset:y}=t,{rotationMin:b}=t,{rotationMax:x}=t;return e.$$set=e=>{"rotation"in e&&o(13,u=e.rotation),"valueMin"in e&&o(0,h=e.valueMin),"valueMax"in e&&o(1,p=e.valueMax),"oninputstart"in e&&o(2,m=e.oninputstart),"oninputmove"in e&&o(3,g=e.oninputmove),"oninputend"in e&&o(4,$=e.oninputend),"elasticity"in e&&o(5,f=e.elasticity),"labelReset"in e&&o(6,y=e.labelReset),"rotationMin"in e&&o(14,b=e.rotationMin),"rotationMax"in e&&o(15,x=e.rotationMax)},e.$$.update=()=>{16384&e.$$.dirty&&o(9,i=b+1e-9),32768&e.$$.dirty&&o(10,n=x-1e-9),1536&e.$$.dirty&&o(12,r=i+.5*(n-i)),32768&e.$$.dirty&&o(16,s=2*x),8192&e.$$.dirty&&o(8,l=Math.sign(u)),73728&e.$$.dirty&&o(7,c=Math.round(Math.abs(u)/s)*s),8576&e.$$.dirty&&o(11,d=u-l*c)},[h,p,m,g,$,f,y,c,l,i,n,d,r,u,b,x,s,e=>g(l*c+e),e=>$(l*c+e)]}class Qg extends $a{constructor(e){super(),ga(this,e,Jg,Kg,Dn,{rotation:13,valueMin:0,valueMax:1,oninputstart:2,oninputmove:3,oninputend:4,elasticity:5,labelReset:6,rotationMin:14,rotationMax:15})}}function e$(e){let t,o,i,n,r;return{c(){t=ar("div"),o=ar("p"),i=lr(e[0]),n=lr(" × "),r=lr(e[1]),mr(t,"class","PinturaImageInfo")},m(e,a){nr(e,t,a),tr(t,o),tr(o,i),tr(o,n),tr(o,r)},p(e,[t]){1&t&&$r(i,e[0]),2&t&&$r(r,e[1])},i:Rn,o:Rn,d(e){e&&rr(t)}}}function t$(e,t,o){let{width:i}=t,{height:n}=t;return e.$$set=e=>{"width"in e&&o(0,i=e.width),"height"in e&&o(1,n=e.height)},[i,n]}class o$ extends $a{constructor(e){super(),ga(this,e,t$,e$,Dn,{width:0,height:1})}}function i$(e){let t,o;return t=new yu({props:{class:"PinturaPresetListFilter",layout:"row",options:e[8],selectedIndex:e[7],onchange:e[10]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};256&o&&(i.options=e[8]),128&o&&(i.selectedIndex=e[7]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function n$(e){let t,o;return t=new Eu({props:{icon:e[0],label:e[1],labelClass:e[2],hideLabel:e[3],options:e[9],selectedIndex:e[4],onchange:e[5],optionMapper:e[6],$$slots:{controls:[i$]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,[o]){const i={};1&o&&(i.icon=e[0]),2&o&&(i.label=e[1]),4&o&&(i.labelClass=e[2]),8&o&&(i.hideLabel=e[3]),512&o&&(i.options=e[9]),16&o&&(i.selectedIndex=e[4]),32&o&&(i.onchange=e[5]),64&o&&(i.optionMapper=e[6]),262528&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}const r$='fill="none" stroke="currentColor"';function a$(e,t,o){let i,n,r,{icon:s}=t,{label:l}=t,{labelClass:c}=t,{hideLabel:d}=t,{options:u}=t,{selectedIndex:h}=t,{onchange:p}=t,{optionMapper:m}=t,{filter:g="landscape"}=t,{onfilterchange:$=a}=t;const f=(e,t,o,i,n)=>`\n <rect ${r$} x="${e}" y="${t}" width="${o}" height="${i}" rx="${n}"/>`,y=(e,t)=>`<path ${r$} d="M${e} ${t} l2 2 l3 -4"/>`;return e.$$set=e=>{"icon"in e&&o(0,s=e.icon),"label"in e&&o(1,l=e.label),"labelClass"in e&&o(2,c=e.labelClass),"hideLabel"in e&&o(3,d=e.hideLabel),"options"in e&&o(12,u=e.options),"selectedIndex"in e&&o(4,h=e.selectedIndex),"onchange"in e&&o(5,p=e.onchange),"optionMapper"in e&&o(6,m=e.optionMapper),"filter"in e&&o(11,g=e.filter),"onfilterchange"in e&&o(13,$=e.onfilterchange)},e.$$.update=()=>{6144&e.$$.dirty&&o(9,i=((e,t)=>(e||[]).map((e=>P(e[0])?(e[1]=e[1].map(t),e):t(e))))(u,(e=>t=>{const[o,i,n={}]=t;return To(o)&&(n.hidden="landscape"===e?o<1:o>1),[o,i,n]})(g))),2048&e.$$.dirty&&o(7,n="landscape"===g?0:1),128&e.$$.dirty&&o(8,r=[["landscape","Landscape",{hideLabel:!0,icon:f(2,6,19,12,2)+(0===n?y(9,12):"")}],["portrait","Portrait",{hideLabel:!0,icon:f(5,3,13,18,2)+(1===n?y(9,12):"")}]])},[s,l,c,d,h,p,m,n,r,i,e=>{o(11,g=e.value),$(e.value)},g,u,$]}class s$ extends $a{constructor(e){super(),ga(this,e,a$,n$,Dn,{icon:0,label:1,labelClass:2,hideLabel:3,options:12,selectedIndex:4,onchange:5,optionMapper:6,filter:11,onfilterchange:13})}}const l$=e=>ve(e,(e=>se(e,6))),c$=e=>St(e,(e=>se(e,6))),d$=(e,t,o=1e-4)=>Math.abs(e-t)<o;var u$=(e,t,o,i,n={})=>{const{aspectRatio:r}=n;e=c$(e),i=i.map(l$);const a=dt(e,Zg[o.target]),s=ve(a,(e=>se(e,6))),l=r?bt(n.minSize,r):n.minSize,c=r?xt(n.maxSize,r):n.maxSize,d=dt(t,o.target);if(Re(d,a)<1){t=Je(e);const o=Math.min(l.width/e.width,l.height/e.height);lt(t,o,a)}t=ct(Je(t),l,c,a);let u=Je(t);t=c$(t);const h=Et(i,1),p=wt(e),m=wt(t),g=p.findIndex((e=>xe(ve(e,(e=>se(e,6))),s))),$=e=>h.map((t=>Tt(t,e))).filter(Boolean).pop();if(r){const t=m.map(((e,t)=>{if(t===g)return;const o=ue(a.x-e.x,a.y-e.y);ye(o),Me(o,.5);const i=ue(a.x-o.x,a.y-o.y),n=Xe(i,l$(e)),r=$(n);if(!r)return;const s=p[t];return{intersection:r,cornerDist:Re(a,s),intersectionDist:Re(a,r)}})).filter(Boolean);if(t.length){const o=t.reduce(((e,t)=>{const o=t.intersectionDist/t.cornerDist;return o<e?o:e}),Number.MAX_SAFE_INTEGER);u=Je(e),lt(u,o,a)}}else{const e=1===o.target.length,n=!(i[0].y===i[1].y||i[0].x===i[1].x),r=p.map(((t,o)=>{if(o===g)return;const i=m[o],r=!d$(i.x,s.x)&&!d$(i.y,s.y);if(!e&&!n&&r)return;if(e&&(d$(i.x,s.x)||d$(i.y,s.y)))return;const l=me(e?t:a),c=Se(me(l),i);ye(c),Me(c,.5),e?we(l,c):Se(l,c);const d=Xe(l,i),u=$(d);return u||void 0})).filter(Boolean);if(r.length){const[e,i,n,l]=Xg(o.target);let[c,d,h,p]=vt(t);r.forEach((({x:t,y:o})=>{const r=se(t,6),a=se(o,6);n&&!d$(a,s.y)&&(c=Math.max(c,o)),e&&!d$(r,s.x)&&(d=Math.min(d,t)),l&&!d$(a,s.y)&&(h=Math.min(h,o)),i&&!d$(r,s.x)&&(p=Math.max(p,t))})),u=Ke((f=[c,d,h,p])[3],f[0],f[1]-f[3],f[2]-f[0]),lt(u,.9999,a)}}var f;return ct(u,l,c,a),u};function h$(e){let t,o;return t=new eh({props:{items:e[11]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};2048&o[0]&&(i.items=e[11]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function p$(e){let t,o,i;return o=new Og({props:{$$slots:{default:[h$]},$$scope:{ctx:e}}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"slot","header")},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,t){const i={};2048&t[0]|2&t[7]&&(i.$$scope={dirty:t,ctx:e}),o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function m$(e){let t,o;return t=new jc({props:{onclick:e[88],label:e[4].cropLabelButtonRecenter,icon:e[4].cropIconButtonRecenter,class:"PinturaButtonCenter",disabled:!e[9],hideLabel:!0,style:`opacity: ${e[29]}; transform: translate3d(${e[30].x}px, ${e[30].y}px, 0)`}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.label=e[4].cropLabelButtonRecenter),16&o[0]&&(i.icon=e[4].cropIconButtonRecenter),512&o[0]&&(i.disabled=!e[9]),1610612736&o[0]&&(i.style=`opacity: ${e[29]}; transform: translate3d(${e[30].x}px, ${e[30].y}px, 0)`),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function g$(e){let t,o;return t=new jg({props:{rect:e[8],visible:e[12],style:e[1]}}),t.$on("resizestart",e[68]),t.$on("resizemove",e[69]),t.$on("resizeend",e[70]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};256&o[0]&&(i.rect=e[8]),4096&o[0]&&(i.visible=e[12]),2&o[0]&&(i.style=e[1]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function $$(e){let t,o;return t=new o$({props:{width:Math.round(e[13].width),height:Math.round(e[13].height)}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};8192&o[0]&&(i.width=Math.round(e[13].width)),8192&o[0]&&(i.height=Math.round(e[13].height)),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function f$(e){let t,o,i,n,r,a,s,l,c=e[21]&&e[10]&&m$(e),d=e[21]&&g$(e),u=e[22]&&$$(e);return{c(){t=ar("div"),o=ar("div"),c&&c.c(),i=cr(),d&&d.c(),r=cr(),u&&u.c(),mr(o,"class","PinturaStage"),mr(t,"slot","main")},m(h,p){nr(h,t,p),tr(t,o),c&&c.m(o,null),tr(o,i),d&&d.m(o,null),e[162](o),tr(t,r),u&&u.m(t,null),a=!0,s||(l=[Gn(Gl.call(null,o)),ur(o,"measure",e[160]),ur(o,"wheel",(function(){zn(e[2]&&e[87])&&(e[2]&&e[87]).apply(this,arguments)}),{passive:!1}),ur(o,"interactionstart",e[74]),ur(o,"interactionupdate",e[75]),ur(o,"interactionrelease",e[77]),ur(o,"interactionend",e[76]),Gn(n=Kc.call(null,o,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:T$,getEventPosition:e[163]})),ur(o,"gesturedown",e[84]),ur(o,"gestureupdate",e[85]),ur(o,"gestureup",e[86]),Gn(Ug.call(null,o))],s=!0)},p(r,a){(e=r)[21]&&e[10]?c?(c.p(e,a),2098176&a[0]&&ta(c,1)):(c=m$(e),c.c(),ta(c,1),c.m(o,i)):c&&(Qr(),oa(c,1,1,(()=>{c=null})),ea()),e[21]?d?(d.p(e,a),2097152&a[0]&&ta(d,1)):(d=g$(e),d.c(),ta(d,1),d.m(o,null)):d&&(Qr(),oa(d,1,1,(()=>{d=null})),ea()),n&&zn(n.update)&&16777220&a[0]&&n.update.call(null,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:T$,getEventPosition:e[163]}),e[22]?u?(u.p(e,a),4194304&a[0]&&ta(u,1)):(u=$$(e),u.c(),ta(u,1),u.m(t,null)):u&&(Qr(),oa(u,1,1,(()=>{u=null})),ea())},i(e){a||(ta(c),ta(d),ta(u),a=!0)},o(e){oa(c),oa(d),oa(u),a=!1},d(o){o&&rr(t),c&&c.d(),d&&d.d(),e[162](null),u&&u.d(),s=!1,Fn(l)}}}function y$(e){let t,o,i,n;const r=[{class:"PinturaControlList"},{tabs:e[7]},e[18]];let a={$$slots:{default:[b$,({tab:e})=>({217:e}),({tab:e})=>[0,0,0,0,0,0,0,e?1:0]]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)a=An(a,r[e]);t=new uc({props:a}),t.$on("select",e[161]);const s=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[17]},e[18]];let l={$$slots:{default:[w$,({panel:e})=>({216:e}),({panel:e})=>[0,0,0,0,0,0,e?1073741824:0]]},$$scope:{ctx:e}};for(let e=0;e<s.length;e+=1)l=An(l,s[e]);return i=new Sc({props:l}),{c(){ha(t.$$.fragment),o=cr(),ha(i.$$.fragment)},m(e,r){pa(t,e,r),nr(e,o,r),pa(i,e,r),n=!0},p(e,o){const n=262272&o[0]?ca(r,[r[0],128&o[0]&&{tabs:e[7]},262144&o[0]&&da(e[18])]):{};3&o[7]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);const a=393216&o[0]?ca(s,[s[0],s[1],131072&o[0]&&{panels:e[17]},262144&o[0]&&da(e[18])]):{};511721496&o[0]|1073741824&o[6]|2&o[7]&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(e){n||(ta(t.$$.fragment,e),ta(i.$$.fragment,e),n=!0)},o(e){oa(t.$$.fragment,e),oa(i.$$.fragment,e),n=!1},d(e){ma(t,e),e&&rr(o),ma(i,e)}}}function b$(e){let t,o,i=e[217].label+"";return{c(){t=ar("span"),o=lr(i)},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){1&t[7]&&i!==(i=e[217].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}function x$(e){let t,o;return t=new zg({props:{elasticity:e[25]*e[43],base:C$,min:e[23],max:M$,valueMin:e[27][0],valueMax:e[27][1],value:e[28],labelReset:e[4].labelReset,valueLabel:Math.round(100*e[28])+"%",oninputstart:e[81],oninputmove:e[82],oninputend:e[83]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};33554432&o[0]&&(i.elasticity=e[25]*e[43]),8388608&o[0]&&(i.min=e[23]),134217728&o[0]&&(i.valueMin=e[27][0]),134217728&o[0]&&(i.valueMax=e[27][1]),268435456&o[0]&&(i.value=e[28]),16&o[0]&&(i.labelReset=e[4].labelReset),268435456&o[0]&&(i.valueLabel=Math.round(100*e[28])+"%"),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function v$(e){let t,o;return t=new Qg({props:{elasticity:e[25]*e[43],rotation:e[14],labelReset:e[4].labelReset,valueMin:e[26][0],valueMax:e[26][1],rotationMin:-e[3],rotationMax:e[3],oninputstart:e[71],oninputmove:e[72],oninputend:e[73]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};33554432&o[0]&&(i.elasticity=e[25]*e[43]),16384&o[0]&&(i.rotation=e[14]),16&o[0]&&(i.labelReset=e[4].labelReset),67108864&o[0]&&(i.valueMin=e[26][0]),67108864&o[0]&&(i.valueMax=e[26][1]),8&o[0]&&(i.rotationMin=-e[3]),8&o[0]&&(i.rotationMax=e[3]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function w$(e){let t,o,i,n;const r=[v$,x$],a=[];function s(e,t){return e[216]===e[93]+"-rotation"?0:e[216]===e[93]+"-zoom"?1:-1}return~(t=s(e))&&(o=a[t]=r[t](e)),{c(){o&&o.c(),i=dr()},m(e,o){~t&&a[t].m(e,o),nr(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?~t&&a[t].p(e,n):(o&&(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea()),~t?(o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ta(o,1),o.m(i.parentNode,i)):o=null)},i(e){n||(ta(o),n=!0)},o(e){oa(o),n=!1},d(e){~t&&a[t].d(e),e&&rr(i)}}}function S$(e){let t,o,i=e[19]&&y$(e);return{c(){t=ar("div"),i&&i.c(),mr(t,"slot","footer"),mr(t,"style",e[16])},m(e,n){nr(e,t,n),i&&i.m(t,null),o=!0},p(e,n){e[19]?i?(i.p(e,n),524288&n[0]&&ta(i,1)):(i=y$(e),i.c(),ta(i,1),i.m(t,null)):i&&(Qr(),oa(i,1,1,(()=>{i=null})),ea()),(!o||65536&n[0])&&mr(t,"style",e[16])},i(e){o||(ta(i),o=!0)},o(e){oa(i),o=!1},d(e){e&&rr(t),i&&i.d()}}}function k$(e){let t,o,i;function n(t){e[164](t)}let r={hasHeader:e[20],$$slots:{footer:[S$],main:[f$],header:[p$]},$$scope:{ctx:e}};return void 0!==e[15]&&(r.root=e[15]),t=new Ag({props:r}),Dr.push((()=>ua(t,"root",n))),t.$on("measure",e[165]),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(e,i){const n={};1048576&i[0]&&(n.hasHeader=e[20]),2146402302&i[0]|2&i[7]&&(n.$$scope={dirty:i,ctx:e}),!o&&32768&i[0]&&(o=!0,n.root=e[15],jr((()=>o=!1))),t.$set(n)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}const M$=1,C$=0,T$=(e,t)=>e.target===t;function P$(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,S,k,M,C,T,P,R,I,A,E,F,z,D,B,O,_,W,V,N,H,j,X,G,K,J,Q,ee,te,le,ce,de,he,pe,$e,be,ve,ke,Ce,Te,Pe,Re,Ie,Ae,Ee,Le,Fe,De,_e,Ve,Xe,Ge,Ye,qe=Rn,Ke=()=>(qe(),qe=Bn(Qe,(e=>o(12,A=e))),Qe);e.$$.on_destroy.push((()=>qe()));let{isActive:Qe}=t;Ke();let{stores:tt}=t,{cropImageSelectionCornerStyle:ot="circle"}=t,{cropWillRenderImageSelectionGuides:it=((e,t)=>{const o="rotate"==e;return{rows:o?5:3,cols:o?5:3,opacity:.25*t}})}=t,{cropAutoCenterImageSelectionTimeout:ct}=t,{cropEnableZoomMatchImageAspectRatio:dt=!0}=t,{cropEnableRotateMatchImageAspectRatio:mt="never"}=t,{cropEnableRotationInput:gt=!0}=t,{cropEnableZoom:$t=!0}=t,{cropEnableZoomInput:wt=!0}=t,{cropEnableZoomAutoHide:kt=!0}=t,{cropEnableImageSelection:Mt=!0}=t,{cropEnableInfoIndicator:Ct=!1}=t,{cropEnableZoomTowardsWheelPosition:Tt=!0}=t,{cropEnableLimitWheelInputToCropSelection:Pt=!0}=t,{cropEnableCenterImageSelection:Rt=!0}=t,{cropEnableButtonRotateLeft:It=!0}=t,{cropEnableButtonRotateRight:At=!1}=t,{cropEnableButtonFlipHorizontal:Et=!0}=t,{cropEnableButtonFlipVertical:Lt=!1}=t,{cropSelectPresetOptions:Ft}=t,{cropEnableSelectPreset:zt=!0}=t,{cropEnableFilterMatchAspectRatio:Dt=!0}=t,{cropSelectPresetFilter:Bt=!1}=t,{cropEnableButtonToggleCropLimit:Ot=!1}=t,{cropWillRenderTools:_t=Z}=t,{cropActiveTransformTool:Wt="rotation"}=t,{cropMinimizeToolbar:Vt="auto"}=t,{cropInteractionFocus:Nt="image"}=t,{cropRotationRange:Ht=Y}=t,{cropMaskOpacity:jt=.85}=t,{locale:Ut={}}=t;const Zt=Lr("isAnimated");_n(e,Zt,(e=>o(139,E=e)));const Xt=Lr("elasticityMultiplier");_n(e,Xt,(e=>o(25,De=e)));const Gt=Lr("redrawTrigger");_n(e,Gt,(e=>o(159,Fe=e)));const Yt=Lr("imageIsStatic");_n(e,Yt,(e=>o(145,V=e)));const qt=Lr("imageStaticVisualCorners");_n(e,qt,(e=>o(181,Ce=e)));let Kt="idle";const Jt=ba();_n(e,Jt,(e=>o(156,Ae=e)));const Qt=()=>void 0===ve,eo=e=>1/e,to=e=>{Dt&&Bt!==e&&(o(95,Bt=e),ve&&1!==ve&&oo()&&Xn(Wo,ve=eo(ve),ve))},oo=()=>{if(1===ve||!i)return!1;const e=eo(ve);return!!Nd(Ae).find((([t])=>t===e))},io=(e,t,o)=>q(o)?t.width===Math.round(e.height)||t.height===Math.round(e.width):t.width===Math.round(e.width)||t.height===Math.round(e.height),no=()=>(Qt()||"always"===mt&&oo())&&((e,t,o)=>{const i=Ze(je(ze(t),o),(e=>Math.abs(Math.round(e)))),n=He(i),r=at(e);return xe(n,r)})(N,te,le)&&io(N,te,le),ro=e=>{if("never"!==mt&&no()){Xn(Co,le+=e,le);const t=q(le),o=t?te.height:te.width,i=t?te.width:te.height;Xn(Do,N=rt(0,0,o,i),N),Qt()||Xn(Wo,ve=U(o,i),ve)}else Xn(Co,le+=e,le)},{history:ao,env:so,isInteracting:lo,isInteractingFraction:co,isTransformingImage:uo,rootRect:ho,stageRect:po,utilRect:mo,utilRectPadded:go,rootLineColor:$o,allowPan:fo,allowZoom:yo,rangeInputElasticity:bo,presentationScalar:xo,utilTools:vo,imagePreviewModifiers:wo,imageOutlineOpacity:So,imageFlipX:ko,imageFlipY:Mo,imageRotation:Co,imageRotationRange:To,imageOutputSize:Po,imageSelectionRect:Ro,imageSelectionRectSnapshot:Ao,imageSelectionRectIntent:Eo,imageSelectionRectPresentation:Lo,imageCropRectIntent:Fo,imageCropRectOrigin:zo,imageCropRect:Do,imageCropMinSize:Bo,imageCropMaxSize:Oo,imageCropRange:_o,imageCropAspectRatio:Wo,imageCropLimitToImage:Vo,imageSize:No,imageScalar:Ho,imageOverlayMarkup:jo,stagePadded:Uo,stageRecenter:Zo}=tt;let Xo;_n(e,so,(e=>o(140,F=e))),_n(e,lo,(e=>o(144,W=e))),_n(e,uo,(e=>o(174,Q=e))),_n(e,ho,(e=>o(24,he=e))),_n(e,po,(e=>o(151,J=e))),_n(e,go,(e=>o(148,X=e))),_n(e,xo,(e=>o(147,j=e))),_n(e,vo,(e=>o(183,Pe=e))),_n(e,wo,(e=>o(173,O=e))),_n(e,ko,(e=>o(158,Le=e))),_n(e,Mo,(e=>o(157,Ee=e))),_n(e,Co,(e=>o(14,le=e))),_n(e,To,(e=>o(26,_e=e))),_n(e,Po,(e=>o(184,Re=e))),_n(e,Ro,(e=>o(150,K=e))),_n(e,Ao,(e=>o(149,G=e))),_n(e,Eo,(e=>o(182,Te=e))),_n(e,Lo,(e=>o(143,_=e))),_n(e,Fo,(e=>o(176,pe=e))),_n(e,zo,(e=>o(178,be=e))),_n(e,Do,(e=>o(13,N=e))),_n(e,Bo,(e=>o(154,de=e))),_n(e,Oo,(e=>o(180,ke=e))),_n(e,_o,(e=>o(177,$e=e))),_n(e,Wo,(e=>o(179,ve=e))),_n(e,Vo,(e=>o(153,ce=e))),_n(e,No,(e=>o(152,te=e))),_n(e,Ho,(e=>o(146,H=e))),_n(e,jo,(e=>o(172,D=e))),_n(e,Uo,(e=>o(142,B=e)));const Go=(e,t)=>{const o={target:e,translate:t},i=Ne(ze(de),j),n=Ne(ze(ke),j);let r=Gg(G,o,{...X,x:0,y:0},{aspectRatio:ve,minSize:i,maxSize:n});if(r=((e,t,o)=>{const[i,n,r,a]=vt(e),s={...e};if(i<t.y&&(e.height=e.height-(t.y-i),e.y=t.y),n>t.x+t.width&&(e.width=t.x+t.width-e.x),r>t.y+t.height&&(e.height=t.y+t.height-e.y),a<t.x&&(e.width=e.width-(t.x-a),e.x=t.x),o){const t=Math.min(1,s.width/e.width,s.height/e.height);return ut(s,t)}return e})(r,{...X,x:0,y:0},ve),!ce)return{boundsLimited:r,boundsIntent:r};let a=u$(G,r,o,Ce,{aspectRatio:ve,minSize:i,maxSize:n});return{boundsLimited:a,boundsIntent:a}},Yo=(e,t)=>{const o={target:e,translate:t},i=Ne(ze(de),j),n=Ne(ze(ke),j),r=((e,t,o={})=>{const{target:i,translate:n}=t,{aspectRatio:r,minSize:a}=o,s=ae[Zg[i]],l=we(Je(e),ue(s[0]*e.width,s[1]*e.height)),c=ae[i],d=we(Je(e),ue(c[0]*e.width,c[1]*e.height)),[u,h,p,m,g,$,f]=Xg(i);let y=n.x,b=n.y;g?b=0:$&&(y=0);let[x,v,w,S]=vt(e);if(u?S=l.x:h&&(v=l.x),m?x=l.y:p&&(w=l.y),u?v=d.x+y:h&&(S=d.x+y),m?w=d.y+b:p&&(x=d.y+b),a&&g&&w-x<a.height){const e=a.height-(w-x);x-=.5*e,w+=.5*e}if(a&&$&&v-S<a.width){const e=a.width-(v-S);S-=.5*e,v+=.5*e}if(r)if(f){let e=v-S,t=w-x;g?(t=e/r,x=l.y-.5*t,w=l.y+.5*t):$&&(e=t*r,S=l.x-.5*e,v=l.x+.5*e)}else{const e=ue(d.x+y-l.x,d.y+b-l.y);i===ie?(e.x=Math.max(0,e.x),e.y=Math.min(0,e.y)):i===ne?(e.x=Math.max(0,e.x),e.y=Math.max(0,e.y)):i===re?(e.x=Math.min(0,e.x),e.y=Math.max(0,e.y)):i===oe&&(e.x=Math.min(0,e.x),e.y=Math.min(0,e.y));const t=fe(e),o=ue(r,1),n=Me(ye(o),t);i===ie?(v=l.x+n.x,x=l.y-n.y):i===ne?(v=l.x+n.x,w=l.y+n.y):i===re?(S=l.x-n.x,w=l.y+n.y):i===oe&&(S=l.x-n.x,x=l.y-n.y)}return rt(S,x,v-S,w-x)})(G,o,{aspectRatio:ve,minSize:i});return{boundsLimited:Gg(G,o,{...X,x:0,y:0},{aspectRatio:ve,minSize:i,maxSize:n}),boundsIntent:r}};let qo=void 0,Ko=void 0;const Jo=({translation:e,scalar:t})=>{V&&(t=1,e=ge(me(e)));const o=Math.min(K.width/N.width,K.height/N.height),i=Me(me(e),1/o);let n;if(Ko){const t=Se(me(Ko),e);Ko=e,n=st(Je(N),t)}else n=st(Je(qo),ge(me(i))),void 0!==t&&lt(n,1/t);Xn(Fo,pe=n,pe),Xn(Do,N=n,N)},Qo=xa([_o,Do],(([e,t],o)=>{if(!t)return;const[i,n]=e,r=pt(t);o([Be(St(bt(i,r),se)),Be(St(xt(n,r),se))])}));_n(e,Qo,(e=>o(175,ee=e)));const ei=xa([No,Vo,Bo,Oo,_o,Co],(([e,t,o,i,n,r],a)=>{if(!e)return;const s=n[0],l=n[1];let c,d;t?(c=((e,t,o)=>q(o)?1-1/Math.min(e.height/t.width,e.width/t.height):1-1/Math.min(e.width/t.width,e.height/t.height))(e,l,r),d=Math.min(s.width/o.width,s.height/o.height)):(c=-1,d=1);a([c,d].map((e=>se(e))))}));_n(e,ei,(e=>o(27,Ve=e)));const ti=xa([No,Do,_o,Co],(([e,t,o,i],n)=>{if(!e||!t)return n(0);let r;const a=o[0],s=o[1],l=t.width,c=t.height,d=pt(t),u=q(i)?We(e.height,e.width):e,h=xt(u,d);if(l<=h.width||c<=h.height){const e=h.width-a.width,t=h.height-a.height;r=0===e||0===t?1:1-Math.min((l-a.width)/e,(c-a.height)/t)}else{const e=s.width-h.width,t=s.height-h.height,o=xt({width:e,height:t},d);r=-Math.min((l-h.width)/o.width,(c-h.height)/o.height)}n(r)}));_n(e,ti,(e=>o(28,Xe=e)));const oi=e=>{const t=pt(qo);let o,i,n;const r=q(le)?We(te.height,te.width):te,a=xt(r,t);if(e>=0){const r=a.width-$e[0].width,s=a.height-$e[0].height;o=a.width-r*e,i=a.height-s*e,n=bt({width:o,height:i},t)}else{const r=$e[1].width-a.width,s=$e[1].height-a.height;o=a.width+r*-e,i=a.height+s*-e,n=xt({width:o,height:i},t)}o=n.width,i=n.height;const s=qo.x+.5*qo.width-.5*o,l=qo.y+.5*qo.height-.5*i;Xn(Do,N={x:s,y:l,width:o,height:i},N)};let ii;const ni=e=>{const t=lt(Je(ii),1/e);Xn(Fo,pe=t,pe),Xn(Do,N=t,N)};let ri;Ar();const ai=()=>{Zo.set({})};let si;const li=Fl(0,{precision:1e-4});_n(e,li,(e=>o(29,Ge=e)));const ci=Fl();_n(e,ci,(e=>o(30,Ye=e)));const di=xa([Wo,Po,Jt],(([e,t,o],n)=>{if(!i)return;const r=Nd(o),a=[...r].map((e=>e[0])).sort(((e,t)=>Io(e[0])&&!Io(t[0])?1:-1)).find((o=>{if(Io(o)&&t){const[i,n]=o,r=t.width===i&&t.height===n,a=e===U(i,n);return r&&a}return o===e}));if(!a)return n(void 0);n(r.map((e=>e[0])).findIndex((e=>Io(e)?ja(e,a):e===a)))}));_n(e,di,(e=>o(155,Ie=e)));const ui=(e,t)=>{if(!i||-1===e||void 0===e)return;const o=Nd(t)[e][0];return o?Io(o)?U(o[0],o[1]):o:void 0},hi=xa([$o,Lo,co],(([e,t,o],i)=>{const{rows:n,cols:r,opacity:a}=it(Kt,o);if(!t||a<=0)return i([]);const{x:s,y:l,width:c,height:d}=t,u=c/r,h=d/n,p=[];for(let t=1;t<=n-1;t++){const o=l+h*t;p.push({id:"image-selection-guide-row-"+t,points:[ue(s,o),ue(s+c,o)],opacity:a,strokeWidth:1,strokeColor:e})}for(let t=1;t<=r-1;t++){const o=s+u*t;p.push({id:"image-selection-guide-col-"+t,points:[ue(o,l),ue(o,l+d)],opacity:a,strokeWidth:1,strokeColor:e})}i(p)}));_n(e,hi,(e=>o(141,z=e)));const pi="crop-"+L();let mi,gi=pi+"-"+(gt?Wt:"zoom"),$i=gi,fi=void 0;const yi=Fl(E?20:0);_n(e,yi,(e=>o(138,I=e)));return e.$$set=e=>{"isActive"in e&&Ke(o(0,Qe=e.isActive)),"stores"in e&&o(97,tt=e.stores),"cropImageSelectionCornerStyle"in e&&o(1,ot=e.cropImageSelectionCornerStyle),"cropWillRenderImageSelectionGuides"in e&&o(98,it=e.cropWillRenderImageSelectionGuides),"cropAutoCenterImageSelectionTimeout"in e&&o(99,ct=e.cropAutoCenterImageSelectionTimeout),"cropEnableZoomMatchImageAspectRatio"in e&&o(100,dt=e.cropEnableZoomMatchImageAspectRatio),"cropEnableRotateMatchImageAspectRatio"in e&&o(101,mt=e.cropEnableRotateMatchImageAspectRatio),"cropEnableRotationInput"in e&&o(102,gt=e.cropEnableRotationInput),"cropEnableZoom"in e&&o(2,$t=e.cropEnableZoom),"cropEnableZoomInput"in e&&o(103,wt=e.cropEnableZoomInput),"cropEnableZoomAutoHide"in e&&o(104,kt=e.cropEnableZoomAutoHide),"cropEnableImageSelection"in e&&o(105,Mt=e.cropEnableImageSelection),"cropEnableInfoIndicator"in e&&o(106,Ct=e.cropEnableInfoIndicator),"cropEnableZoomTowardsWheelPosition"in e&&o(107,Tt=e.cropEnableZoomTowardsWheelPosition),"cropEnableLimitWheelInputToCropSelection"in e&&o(108,Pt=e.cropEnableLimitWheelInputToCropSelection),"cropEnableCenterImageSelection"in e&&o(109,Rt=e.cropEnableCenterImageSelection),"cropEnableButtonRotateLeft"in e&&o(110,It=e.cropEnableButtonRotateLeft),"cropEnableButtonRotateRight"in e&&o(111,At=e.cropEnableButtonRotateRight),"cropEnableButtonFlipHorizontal"in e&&o(112,Et=e.cropEnableButtonFlipHorizontal),"cropEnableButtonFlipVertical"in e&&o(113,Lt=e.cropEnableButtonFlipVertical),"cropSelectPresetOptions"in e&&o(114,Ft=e.cropSelectPresetOptions),"cropEnableSelectPreset"in e&&o(115,zt=e.cropEnableSelectPreset),"cropEnableFilterMatchAspectRatio"in e&&o(116,Dt=e.cropEnableFilterMatchAspectRatio),"cropSelectPresetFilter"in e&&o(95,Bt=e.cropSelectPresetFilter),"cropEnableButtonToggleCropLimit"in e&&o(117,Ot=e.cropEnableButtonToggleCropLimit),"cropWillRenderTools"in e&&o(118,_t=e.cropWillRenderTools),"cropActiveTransformTool"in e&&o(119,Wt=e.cropActiveTransformTool),"cropMinimizeToolbar"in e&&o(120,Vt=e.cropMinimizeToolbar),"cropInteractionFocus"in e&&o(121,Nt=e.cropInteractionFocus),"cropRotationRange"in e&&o(3,Ht=e.cropRotationRange),"cropMaskOpacity"in e&&o(122,jt=e.cropMaskOpacity),"locale"in e&&o(4,Ut=e.locale)},e.$$.update=()=>{4096&e.$$.dirty[0]|268435456&e.$$.dirty[3]&&Yt.set("selection"===Nt&&A),2097152&e.$$.dirty[3]&&o(129,i=Ft&&Array.isArray(Ft)&&Ft.length),2097152&e.$$.dirty[3]|32&e.$$.dirty[4]&&Jt.set(i?Ft:[]),4096&e.$$.dirty[0]&&A&&So.set(1),4096&e.$$.dirty[0]&&fo.set(!A),4096&e.$$.dirty[0]&&yo.set(!A),65536&e.$$.dirty[4]&&o(124,p="overlay"===F.layoutMode),4194304&e.$$.dirty[3]|1&e.$$.dirty[4]&&o(128,v=zt&&!p),83886080&e.$$.dirty[4]&&o(137,l=X&&K&&ft(X,K)),67117056&e.$$.dirty[4]&&o(135,c=!(!K||!l)),67119104&e.$$.dirty[4]&&o(133,d=c&&ht(K,l,(e=>se(e,5)))),16400&e.$$.dirty[0]|52297732&e.$$.dirty[3]|1879114288&e.$$.dirty[4]|31&e.$$.dirty[5]&&o(11,n=Fe&&_t([It&&["Button","rotate-left",{label:Ut.cropLabelButtonRotateLeft,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonRotateLeft,onclick:()=>{ro(-Math.PI/2),ao.write()}}],At&&["Button","rotate-right",{label:Ut.cropLabelButtonRotateRight,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonRotateRight,onclick:()=>{ro(Math.PI/2),ao.write()}}],Et&&["Button","flip-horizontal",{label:Ut.cropLabelButtonFlipHorizontal,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonFlipHorizontal,onclick:()=>{q(le)?Xn(Mo,Ee=!Ee,Ee):Xn(ko,Le=!Le,Le),ao.write()}}],Lt&&["Button","flip-vertical",{label:Ut.cropLabelButtonFlipVertical,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonFlipVertical,onclick:()=>{q(le)?Xn(ko,Le=!Le,Le):Xn(Mo,Ee=!Ee,Ee),ao.write()}}],v&&i&&[!1===Bt?"Dropdown":s$,"select-preset",{icon:jd(Ut.cropIconSelectPreset,Ut,ui(Ie,Ae)),label:jd(Ut.cropLabelSelectPreset,Ut,ui(Ie,Ae)),labelClass:"PinturaToolbarContentWide",options:Ae,filter:Bt,onfilterchange:to,selectedIndex:Ie,onchange:({value:e})=>{Io(e)?(Xn(Wo,ve=U(e[0],e[1]),ve),Xn(Po,Re=Oe(e),Re)):Xn(Wo,ve=e,ve),d&&ai(),ao.write()},optionMapper:e=>{let t=!1;const o=Io(e.value)?e.value[0]/e.value[1]:e.value;if(o){const e=Ba(te,le,o);t=e.width<de.width||e.height<de.height}return e.icon=((e,t={})=>{const{width:o=24,height:i=24,bounds:n=16,radius:r=3}=t;let a,s,l,c,d=Io(e)?U(e[0],e[1]):e,u=!!d;return d=u?d:1,l=d>1?n:d*n,c=l/d,a=Math.round(.5*(o-l)),s=Math.round(.5*(i-c)),`<rect fill="${u?"currentColor":"none"}" stroke="${u?"none":"currentColor"}" stroke-width="${o/16}" stroke-dasharray="${[o/12,o/6].join(" ")}" x="${a}" y="${s}" width="${l}" height="${c}" rx="${r}"/>`})(e.value,{bounds:14}),{...e,disabled:t}}}],Ot&&["Dropdown","select-crop-limit",{icon:jd(Ut.cropIconCropBoundary,Ut,ce),label:Ut.cropLabelCropBoundary,labelClass:"PinturaToolbarContentWide",onchange:({value:e})=>{Xn(Vo,ce=e,ce),ao.write()},options:[[!0,Ut.cropLabelCropBoundaryEdge,{icon:jd(Ut.cropIconCropBoundary,Ut,!0)}],[!1,Ut.cropLabelCropBoundaryNone,{icon:jd(Ut.cropIconCropBoundary,Ut,!1)}]]}]].filter(Boolean),F,(()=>Gt.set({}))).filter(Boolean)),6144&e.$$.dirty[0]|134217728&e.$$.dirty[3]|65537&e.$$.dirty[4]&&Xn(vo,Pe=A&&"never"!==Vt&&("always"===Vt||"short"===F.verticalSpace||p)?n.map((([e,t,o])=>Array.isArray(o)?[e,t,o]:[e,t,{...o,hideLabel:!0}])):[],Pe),536870912&e.$$.dirty[4]&&o(23,r=ce?0:-1),150994944&e.$$.dirty[4]&&o(130,a=X&&ue(-(J.x-X.x),-(J.y-X.y))),524352&e.$$.dirty[4]&&o(131,s=_&&ue(kd(_.x+.5*_.width+a.x),kd(_.y+.5*_.height+a.y))),33554432&e.$$.dirty[4]&&o(134,u=null!=G),16785408&e.$$.dirty[4]&&o(136,h=X&&l&&(l.height===X.height||l.width===X.width)),12587008&e.$$.dirty[4]&&o(132,m=!h&&j<1&&H<1),3840&e.$$.dirty[4]&&o(9,g=c&&!u&&(!d||m)),8192&e.$$.dirty[0]|8192&e.$$.dirty[3]|1&e.$$.dirty[4]&&o(22,$=Ct&&!!N&&!p),524352&e.$$.dirty[4]&&o(8,b=_&&a&&{x:_.x+a.x,y:_.y+a.y,width:_.width,height:_.height}),256&e.$$.dirty[0]|4096&e.$$.dirty[3]|1&e.$$.dirty[4]&&o(21,f=Mt&&!!b&&!p),65600&e.$$.dirty[3]|2097280&e.$$.dirty[4]&&o(10,y=Rt&&!!s&&!ct&&!V),512&e.$$.dirty[0]|1073741888&e.$$.dirty[3]|1048576&e.$$.dirty[4]&&g&&ct&&!W&&(clearTimeout(si),o(123,si=setTimeout(ai,ct))),1073741824&e.$$.dirty[3]|1048576&e.$$.dirty[4]&&W&&clearTimeout(si),1536&e.$$.dirty[0]|32768&e.$$.dirty[4]&&li.set(y&&g?1:0,{hard:!1===E}),32896&e.$$.dirty[4]&&ci.set(s,{hard:!1===E}),4096&e.$$.dirty[0]|262144&e.$$.dirty[4]&&(A&&!B?(Xn(wo,O.crop={maskOpacity:jt,maskMarkupOpacity:jt},O),wo.set(O)):(delete O.crop,wo.set(O))),131072&e.$$.dirty[4]&&z&&(()=>{const e=D.filter((e=>!/^image\-selection\-guide/.test(e.id)));Xn(jo,D=A?[...e,...z]:e,D)})(),65536&e.$$.dirty[4]&&o(127,x="short"!==F.verticalSpace),134217728&e.$$.dirty[3]|9&e.$$.dirty[4]&&o(20,w="never"===Vt&&!p||x&&"always"!==Vt),4&e.$$.dirty[0]|1024&e.$$.dirty[3]&&o(126,S=$t&&wt),2048&e.$$.dirty[3]|12&e.$$.dirty[4]&&o(125,k=kt?x&&S:S),512&e.$$.dirty[3]|2&e.$$.dirty[4]&&o(19,M=gt||k),2&e.$$.dirty[4]&&(k||o(5,$i=gi)),32&e.$$.dirty[0]&&o(18,C={name:pi,selected:$i}),16&e.$$.dirty[0]|512&e.$$.dirty[3]|2&e.$$.dirty[4]&&o(7,T=[gt&&{id:pi+"-rotation",label:Ut.cropLabelTabRotation},k&&{id:pi+"-zoom",label:Ut.cropLabelTabZoom}].filter(Boolean)),128&e.$$.dirty[0]&&o(17,P=T.map((e=>e.id))),64&e.$$.dirty[0]|1&e.$$.dirty[4]&&mi&&!mi.children.length&&p&&mi.dispatchEvent(new CustomEvent("measure",{detail:mi.rect})),4096&e.$$.dirty[0]|32768&e.$$.dirty[4]&&E&&yi.set(A?0:20),16384&e.$$.dirty[4]&&o(16,R=I?`transform: translateY(${I}px)`:void 0)},[Qe,ot,$t,Ht,Ut,$i,mi,T,b,g,y,n,A,N,le,fi,R,P,C,M,w,f,$,r,he,De,_e,Ve,Xe,Ge,Ye,Zt,Xt,Gt,Yt,qt,Jt,so,lo,uo,ho,po,go,bo,xo,vo,wo,ko,Mo,Co,To,Po,Ro,Ao,Eo,Lo,Fo,zo,Do,Bo,Oo,_o,Wo,Vo,No,Ho,jo,Uo,()=>{Kt="select",Xn(lo,W=!0,W),Xn(Ao,G=Je(K),G),Xo=V?Go:Yo},({detail:e})=>{const{boundsLimited:t,boundsIntent:o}=Xo(e.direction,e.translation);Xn(uo,Q=!0,Q),Xn(Eo,Te=o,Te),Xn(Ro,K=t,K)},({detail:e})=>{const{boundsLimited:t}=Xo(e.direction,e.translation);Xn(uo,Q=!1,Q),Xn(lo,W=!1,W),Xn(Eo,Te=void 0,Te),fe(e.translation)&&(Xn(Ro,K=t,K),ao.write()),Xn(Ao,G=void 0,G),Kt=void 0},()=>{Kt="rotate",Xn(lo,W=!0,W),Xn(zo,be=Je(N),be)},e=>{Xn(uo,Q=!0,Q),Xn(Co,le=e,le)},e=>{Xn(uo,Q=!1,Q),Xn(lo,W=!1,W),Xn(Co,le=e,le),ao.write(),Xn(zo,be=void 0,be)},()=>{Kt="pan",Ko=void 0,Xn(lo,W=!0,W),qo=Je(N)},({detail:e})=>{Xn(uo,Q=!0,Q),Jo(e)},({detail:e})=>{Xn(uo,Q=!1,Q),Xn(lo,W=!1,W),(fe(e.translation)>0||0!==e.scalar)&&(Jo(e),ao.write()),Xn(Fo,pe=void 0,pe),qo=void 0},({detail:{translation:e}})=>{V&&(e=ge(me(e))),Ko=e,Xn(lo,W=!1,W)},Qo,ei,ti,()=>{Kt="zoom",Xn(lo,W=!0,W),qo=Je(N)},e=>{Xn(uo,Q=!1,Q),oi(e)},e=>{oi(e),ao.write(),Xn(uo,Q=!1,Q),Xn(lo,W=!1,W),qo=void 0},()=>{Kt="zoom",qo||(ii=Je(N),Xn(lo,W=!0,W))},({detail:e})=>{ii&&(Xn(uo,Q=!0,Q),ni(e))},({detail:e})=>{ii&&(Xn(uo,Q=!1,Q),Xn(lo,W=!1,W),ni(e),Xn(Fo,pe=void 0,pe),ii=void 0,ao.write())},e=>{const t=kh(e,he,J);if(Pt&&!yt(K,t))return;Kt="zoom",Xn(lo,W=!0,W),Xn(uo,Q=!0,Q),e.preventDefault(),e.stopPropagation();const o=od(e),i=1+o/100,n=Je(N),r=1===Math.min(N.width/de.width,N.height/de.height);if(dt&&ce){const e=io(N,te,le);if(Qt()&&e&&o>0&&d){Xn(lo,W=!1,W),Xn(uo,Q=!1,Q);const e=q(le)?et({height:te.width,width:te.height}):et(te);if(ht(n,e))return;if(clearTimeout(ri),ht(ao.state.crop,e))return;return Xn(Do,N=e,N),void ao.write()}}let a=at(N);if(Tt&&"selection"!==Nt&&o<0&&!r){const e=Se(me(t),K),o=Math.min(K.width/N.width,K.height/N.height),i=lt(Je(K),1.1);a=yt(i,t)?we(Je(N),Me(e,1/o)):a}let s=lt(Je(N),i,a);if(Ue(ee[1],s)||(s=nt(at(s),ee[1])),Ue(s,ee[0])||(s=nt(at(s),ee[0])),ht(n,s,se))return Xn(lo,W=!1,W),void Xn(uo,Q=!1,Q);Xn(Do,N=St(s,(e=>se(e,5))),N),Xn(lo,W=!1,W),Xn(uo,Q=!1,Q),clearTimeout(ri),ri=setTimeout((()=>{ao.write()}),500)},ai,li,ci,di,hi,pi,yi,Bt,"crop",tt,it,ct,dt,mt,gt,wt,kt,Mt,Ct,Tt,Pt,Rt,It,At,Et,Lt,Ft,zt,Dt,Ot,_t,Wt,Vt,Nt,jt,si,p,k,S,x,v,i,a,s,m,d,u,c,h,l,I,E,F,z,B,_,W,V,H,j,X,G,K,J,te,ce,de,Ie,Ae,Ee,Le,Fe,function(t){Fr.call(this,e,t)},({detail:e})=>o(5,$i=e),function(e){Dr[e?"unshift":"push"]((()=>{mi=e,o(6,mi)}))},e=>Sh(e),function(e){fi=e,o(15,fi)},function(t){Fr.call(this,e,t)}]}var R$={util:["crop",class extends $a{constructor(e){super(),ga(this,e,P$,k$,Dn,{name:96,isActive:0,stores:97,cropImageSelectionCornerStyle:1,cropWillRenderImageSelectionGuides:98,cropAutoCenterImageSelectionTimeout:99,cropEnableZoomMatchImageAspectRatio:100,cropEnableRotateMatchImageAspectRatio:101,cropEnableRotationInput:102,cropEnableZoom:2,cropEnableZoomInput:103,cropEnableZoomAutoHide:104,cropEnableImageSelection:105,cropEnableInfoIndicator:106,cropEnableZoomTowardsWheelPosition:107,cropEnableLimitWheelInputToCropSelection:108,cropEnableCenterImageSelection:109,cropEnableButtonRotateLeft:110,cropEnableButtonRotateRight:111,cropEnableButtonFlipHorizontal:112,cropEnableButtonFlipVertical:113,cropSelectPresetOptions:114,cropEnableSelectPreset:115,cropEnableFilterMatchAspectRatio:116,cropSelectPresetFilter:95,cropEnableButtonToggleCropLimit:117,cropWillRenderTools:118,cropActiveTransformTool:119,cropMinimizeToolbar:120,cropInteractionFocus:121,cropRotationRange:3,cropMaskOpacity:122,locale:4},null,[-1,-1,-1,-1,-1,-1,-1,-1])}get name(){return this.$$.ctx[96]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get stores(){return this.$$.ctx[97]}set stores(e){this.$$set({stores:e}),Gr()}get cropImageSelectionCornerStyle(){return this.$$.ctx[1]}set cropImageSelectionCornerStyle(e){this.$$set({cropImageSelectionCornerStyle:e}),Gr()}get cropWillRenderImageSelectionGuides(){return this.$$.ctx[98]}set cropWillRenderImageSelectionGuides(e){this.$$set({cropWillRenderImageSelectionGuides:e}),Gr()}get cropAutoCenterImageSelectionTimeout(){return this.$$.ctx[99]}set cropAutoCenterImageSelectionTimeout(e){this.$$set({cropAutoCenterImageSelectionTimeout:e}),Gr()}get cropEnableZoomMatchImageAspectRatio(){return this.$$.ctx[100]}set cropEnableZoomMatchImageAspectRatio(e){this.$$set({cropEnableZoomMatchImageAspectRatio:e}),Gr()}get cropEnableRotateMatchImageAspectRatio(){return this.$$.ctx[101]}set cropEnableRotateMatchImageAspectRatio(e){this.$$set({cropEnableRotateMatchImageAspectRatio:e}),Gr()}get cropEnableRotationInput(){return this.$$.ctx[102]}set cropEnableRotationInput(e){this.$$set({cropEnableRotationInput:e}),Gr()}get cropEnableZoom(){return this.$$.ctx[2]}set cropEnableZoom(e){this.$$set({cropEnableZoom:e}),Gr()}get cropEnableZoomInput(){return this.$$.ctx[103]}set cropEnableZoomInput(e){this.$$set({cropEnableZoomInput:e}),Gr()}get cropEnableZoomAutoHide(){return this.$$.ctx[104]}set cropEnableZoomAutoHide(e){this.$$set({cropEnableZoomAutoHide:e}),Gr()}get cropEnableImageSelection(){return this.$$.ctx[105]}set cropEnableImageSelection(e){this.$$set({cropEnableImageSelection:e}),Gr()}get cropEnableInfoIndicator(){return this.$$.ctx[106]}set cropEnableInfoIndicator(e){this.$$set({cropEnableInfoIndicator:e}),Gr()}get cropEnableZoomTowardsWheelPosition(){return this.$$.ctx[107]}set cropEnableZoomTowardsWheelPosition(e){this.$$set({cropEnableZoomTowardsWheelPosition:e}),Gr()}get cropEnableLimitWheelInputToCropSelection(){return this.$$.ctx[108]}set cropEnableLimitWheelInputToCropSelection(e){this.$$set({cropEnableLimitWheelInputToCropSelection:e}),Gr()}get cropEnableCenterImageSelection(){return this.$$.ctx[109]}set cropEnableCenterImageSelection(e){this.$$set({cropEnableCenterImageSelection:e}),Gr()}get cropEnableButtonRotateLeft(){return this.$$.ctx[110]}set cropEnableButtonRotateLeft(e){this.$$set({cropEnableButtonRotateLeft:e}),Gr()}get cropEnableButtonRotateRight(){return this.$$.ctx[111]}set cropEnableButtonRotateRight(e){this.$$set({cropEnableButtonRotateRight:e}),Gr()}get cropEnableButtonFlipHorizontal(){return this.$$.ctx[112]}set cropEnableButtonFlipHorizontal(e){this.$$set({cropEnableButtonFlipHorizontal:e}),Gr()}get cropEnableButtonFlipVertical(){return this.$$.ctx[113]}set cropEnableButtonFlipVertical(e){this.$$set({cropEnableButtonFlipVertical:e}),Gr()}get cropSelectPresetOptions(){return this.$$.ctx[114]}set cropSelectPresetOptions(e){this.$$set({cropSelectPresetOptions:e}),Gr()}get cropEnableSelectPreset(){return this.$$.ctx[115]}set cropEnableSelectPreset(e){this.$$set({cropEnableSelectPreset:e}),Gr()}get cropEnableFilterMatchAspectRatio(){return this.$$.ctx[116]}set cropEnableFilterMatchAspectRatio(e){this.$$set({cropEnableFilterMatchAspectRatio:e}),Gr()}get cropSelectPresetFilter(){return this.$$.ctx[95]}set cropSelectPresetFilter(e){this.$$set({cropSelectPresetFilter:e}),Gr()}get cropEnableButtonToggleCropLimit(){return this.$$.ctx[117]}set cropEnableButtonToggleCropLimit(e){this.$$set({cropEnableButtonToggleCropLimit:e}),Gr()}get cropWillRenderTools(){return this.$$.ctx[118]}set cropWillRenderTools(e){this.$$set({cropWillRenderTools:e}),Gr()}get cropActiveTransformTool(){return this.$$.ctx[119]}set cropActiveTransformTool(e){this.$$set({cropActiveTransformTool:e}),Gr()}get cropMinimizeToolbar(){return this.$$.ctx[120]}set cropMinimizeToolbar(e){this.$$set({cropMinimizeToolbar:e}),Gr()}get cropInteractionFocus(){return this.$$.ctx[121]}set cropInteractionFocus(e){this.$$set({cropInteractionFocus:e}),Gr()}get cropRotationRange(){return this.$$.ctx[3]}set cropRotationRange(e){this.$$set({cropRotationRange:e}),Gr()}get cropMaskOpacity(){return this.$$.ctx[122]}set cropMaskOpacity(e){this.$$set({cropMaskOpacity:e}),Gr()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),Gr()}}]};function I$(e){let t,o,i,n,r,a,s,l=e[76],c=(R(e[76].label)?e[76].label(e[2]):e[76].label)+"";function d(...t){return e[51](e[76],...t)}const u=()=>e[52](o,l),h=()=>e[52](null,l);return{c(){t=ar("div"),o=ar("div"),i=cr(),n=ar("span"),r=lr(c),mr(o,"class",F$),mr(t,"slot","option"),mr(t,"class","PinturaFilterOption")},m(e,l){nr(e,t,l),tr(t,o),u(),tr(t,i),tr(t,n),tr(n,r),a||(s=[ur(o,"measure",d),Gn(Gl.call(null,o))],a=!0)},p(t,o){l!==(e=t)[76]&&(h(),l=e[76],u()),4&o[0]|16384&o[2]&&c!==(c=(R(e[76].label)?e[76].label(e[2]):e[76].label)+"")&&$r(r,c)},d(e){e&&rr(t),h(),a=!1,Fn(s)}}}function A$(e){let t,o;return t=new yu({props:{locale:e[2],layout:"row",options:e[3],selectedIndex:e[12],onchange:e[32],$$slots:{option:[I$,({option:e})=>({76:e}),({option:e})=>[0,0,e?16384:0]]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};4&o[0]&&(i.locale=e[2]),8&o[0]&&(i.options=e[3]),4096&o[0]&&(i.selectedIndex=e[12]),1028&o[0]|49152&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function E$(e){let t,o,i,n,r,a,s,l;function c(t){e[54](t)}function d(t){e[55](t)}function u(t){e[56](t)}let h={elasticity:e[13]*e[19],onscroll:e[53],$$slots:{default:[A$]},$$scope:{ctx:e}};return void 0!==e[4]&&(h.maskFeatherStartOpacity=e[4]),void 0!==e[5]&&(h.maskFeatherEndOpacity=e[5]),void 0!==e[6]&&(h.maskFeatherSize=e[6]),o=new rd({props:h}),Dr.push((()=>ua(o,"maskFeatherStartOpacity",c))),Dr.push((()=>ua(o,"maskFeatherEndOpacity",d))),Dr.push((()=>ua(o,"maskFeatherSize",u))),o.$on("measure",e[57]),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"slot","footer"),mr(t,"style",e[11])},m(i,n){nr(i,t,n),pa(o,t,null),a=!0,s||(l=[ur(t,"transitionend",e[30]),ur(t,"measure",e[58]),Gn(Gl.call(null,t,{observePosition:!0}))],s=!0)},p(e,s){const l={};8192&s[0]&&(l.elasticity=e[13]*e[19]),128&s[0]&&(l.onscroll=e[53]),5132&s[0]|32768&s[2]&&(l.$$scope={dirty:s,ctx:e}),!i&&16&s[0]&&(i=!0,l.maskFeatherStartOpacity=e[4],jr((()=>i=!1))),!n&&32&s[0]&&(n=!0,l.maskFeatherEndOpacity=e[5],jr((()=>n=!1))),!r&&64&s[0]&&(r=!0,l.maskFeatherSize=e[6],jr((()=>r=!1))),o.$set(l),(!a||2048&s[0])&&mr(t,"style",e[11])},i(e){a||(ta(o.$$.fragment,e),a=!0)},o(e){oa(o.$$.fragment,e),a=!1},d(e){e&&rr(t),ma(o),s=!1,Fn(l)}}}function L$(e){let t,o;return t=new Ag({props:{$$slots:{footer:[E$]},$$scope:{ctx:e}}}),t.$on("measure",e[59]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};16380&o[0]|32768&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}let F$="PinturaFilterPreview";function z$(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,S=Rn,k=()=>(S(),S=Bn(P,(e=>o(43,d=e))),P),M=Rn,C=()=>(M(),M=Bn(T,(e=>o(49,b=e))),T);e.$$.on_destroy.push((()=>S())),e.$$.on_destroy.push((()=>M()));let{isActive:T}=t;C();let{isActiveFraction:P}=t;k();let{stores:I}=t,{locale:A}=t,{filterFunctions:E}=t,{filterOptions:L}=t;const F=Lr("elasticityMultiplier");_n(e,F,(e=>o(13,w=e)));const{history:z,interfaceImages:D,stageRectBase:B,utilRect:O,animation:_,scrollElasticity:W,imageSize:V,imagePreview:N,imageCropRect:H,imageRotation:j,imageFlipX:U,imageFlipY:Z,imageBackgroundColor:X,imageGamma:G,imageColorMatrix:Y,allowPan:q,allowZoom:K,allowZoomControls:J}=I;_n(e,D,(e=>o(60,u=e))),_n(e,B,(e=>o(48,y=e))),_n(e,O,(e=>o(47,f=e))),_n(e,_,(e=>o(50,x=e))),_n(e,V,(e=>o(62,p=e))),_n(e,N,(e=>o(42,c=e))),_n(e,X,(e=>o(61,h=e))),_n(e,G,(e=>o(44,m=e))),_n(e,Y,(e=>o(40,s=e)));const Q=ba({});_n(e,Q,(e=>o(46,$=e)));const ee=(e,t)=>Xn(Q,$[e.value]=t,$),te=xa(Q,(e=>{if(!e[void 0])return;const t=e[void 0];return v&&Ve(v,t)?v:ze(t)}));_n(e,te,(e=>o(63,v=e)));const oe=xa([T,te,H,V,j,U,Z],(([e,t,o,i,n,r,a],s)=>{if(!e||!t||!i)return g;const l=et(i),c=at(l),d=_a(i,o,n),u=at(d),h=Se(me(c),u),p=ge(me(h)),m=Math.max(t.width/o.width,t.height/o.height);s({origin:p,translation:h,rotation:{x:a?Math.PI:0,y:r?Math.PI:0,z:n},scale:m})}));_n(e,oe,(e=>o(45,g=e)));const ie=Fl(x?20:0);let ne;_n(e,ie,(e=>o(39,a=e)));const re={};let ae,se,le,ce,de,he,pe={x:0,y:0};const $e=ba([]);_n(e,$e,(e=>o(41,l=e)));const fe=e=>{const t={...e,data:c,size:p,offset:{...e.offset},mask:{...e.mask},backgroundColor:h};return t.opacity=d,t.offset.y+=a,t.mask.y+=a,t.id="filter",t},ye=()=>u.filter((e=>"filter"!==e.id));Ir((()=>{D.set([])}));return e.$$set=e=>{"isActive"in e&&C(o(0,T=e.isActive)),"isActiveFraction"in e&&k(o(1,P=e.isActiveFraction)),"stores"in e&&o(34,I=e.stores),"locale"in e&&o(2,A=e.locale),"filterFunctions"in e&&o(35,E=e.filterFunctions),"filterOptions"in e&&o(3,L=e.filterOptions)},e.$$.update=()=>{if(262144&e.$$.dirty[1]&&q.set(b),262144&e.$$.dirty[1]&&K.set(b),262144&e.$$.dirty[1]&&J.set(b),8&e.$$.dirty[0]&&o(38,i=Nd(L)),640&e.$$.dirty[1]&&o(12,n=((e,t)=>{if(!e||!e.filter||!t)return 0;const o=e.filter;return t.findIndex((([e])=>{if(!E[e])return!1;const t=E[e]();return ja(t,o)}))})(s,i)),786432&e.$$.dirty[1]&&x&&ie.set(b?0:20),512&e.$$.dirty[0]|458752&e.$$.dirty[1]&&b&&f&&y&&he&&o(37,de={x:y.x-f.x,y:y.y-f.y+he.y}),496&e.$$.dirty[0]|58096&e.$$.dirty[1]&&g&&de&&pe&&ce&&ne){const e=de.x+ce.x+pe.x,t=de.y,o=ce.x+de.x,n=o+ce.width;$e.set(i.map((([i],r)=>{const a=$[i],l=pe.x+a.x,c=l+a.width;if(c<0||l>ce.width)return!1;const d=e+a.x,u=t+a.y,h=(e=>({origin:me(e.origin),translation:me(e.translation),rotation:{...e.rotation},scale:e.scale}))(g);h.offset=ue(.5*a.width+d,.5*a.height+u);h.maskOpacity=1,h.mask=rt(d+0,u,a.width+0,a.height),h.maskFeather=[1,0,1,0,1,n,1,n],l<le&&ae<1&&(h.maskFeather[0]=ae,h.maskFeather[1]=o,h.maskFeather[2]=1,h.maskFeather[3]=o+le),c>ce.width-le&&se<1&&(h.maskFeather[4]=se,h.maskFeather[5]=n-le,h.maskFeather[6]=1,h.maskFeather[7]=n),h.maskCornerRadius=ne[i];let p=s&&Object.keys(s).filter((e=>"filter"!=e)).map((e=>s[e]))||[];return R(E[i])&&p.push(E[i]()),h.colorMatrix=p.length?Tn(p):void 0,h.gamma=m,h})).filter(Boolean))}if(7424&e.$$.dirty[1])if(d>0&&l){const e=[...ye(),...l.map(fe)];D.set(e)}else D.set(ye());256&e.$$.dirty[1]&&o(11,r=a?`transform: translateY(${a}px)`:void 0)},[T,P,A,L,ae,se,le,pe,ce,he,re,r,n,w,F,D,B,O,_,W,V,N,X,G,Y,Q,ee,te,oe,ie,e=>{e.target.className===F$&&o(36,ne=Object.keys(re).reduce(((e,t)=>{const o=re[t],i=getComputedStyle(o),n=["top-left","top-right","bottom-left","bottom-right"].map((e=>i.getPropertyValue(`border-${e}-radius`))).map(td).map((e=>1.25*e));return e[t]=n,e}),{}))},$e,({value:e})=>{Xn(Y,s={...s,filter:R(E[e])?E[e]():void 0},s),z.write()},"filter",I,E,ne,de,i,a,s,l,c,d,m,g,$,f,y,b,x,(e,t)=>ee(e,t.detail),function(e,t){Dr[e?"unshift":"push"]((()=>{re[t.value]=e,o(10,re)}))},e=>o(7,pe=e),function(e){ae=e,o(4,ae)},function(e){se=e,o(5,se)},function(e){le=e,o(6,le)},e=>o(8,ce=e.detail),e=>o(9,he=e.detail),function(t){Fr.call(this,e,t)}]}var D$={util:["filter",class extends $a{constructor(e){super(),ga(this,e,z$,L$,Dn,{name:33,isActive:0,isActiveFraction:1,stores:34,locale:2,filterFunctions:35,filterOptions:3},null,[-1,-1,-1])}get name(){return this.$$.ctx[33]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),Gr()}get stores(){return this.$$.ctx[34]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[2]}set locale(e){this.$$set({locale:e}),Gr()}get filterFunctions(){return this.$$.ctx[35]}set filterFunctions(e){this.$$set({filterFunctions:e}),Gr()}get filterOptions(){return this.$$.ctx[3]}set filterOptions(e){this.$$set({filterOptions:e}),Gr()}}]};function B$(e){let t,o,i=e[42].label+"";return{c(){t=ar("span"),o=lr(i)},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){2048&t[1]&&i!==(i=e[42].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}function O$(e){let t,o;const i=[{class:"PinturaControlList"},{tabs:e[1]},e[5]];let n={$$slots:{default:[B$,({tab:e})=>({42:e}),({tab:e})=>[0,e?2048:0]]},$$scope:{ctx:e}};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new uc({props:n}),t.$on("select",e[24]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=34&o[0]?ca(i,[i[0],2&o[0]&&{tabs:e[1]},32&o[0]&&da(e[5])]):{};6144&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function _$(e){let t,o;const i=[e[7][e[41]]];let n={};for(let e=0;e<i.length;e+=1)n=An(n,i[e]);return t=new zg({props:n}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const n=128&o[0]|1024&o[1]?ca(i,[da(e[7][e[41]])]):{};t.$set(n)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function W$(e){let t,o,i,n,r;o=new rd({props:{elasticity:e[6]*e[9],class:"PinturaControlListScroller",$$slots:{default:[O$]},$$scope:{ctx:e}}});const a=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[4]},e[5]];let s={$$slots:{default:[_$,({panel:e})=>({41:e}),({panel:e})=>[0,e?1024:0]]},$$scope:{ctx:e}};for(let e=0;e<a.length;e+=1)s=An(s,a[e]);return n=new Sc({props:s}),{c(){t=ar("div"),ha(o.$$.fragment),i=cr(),ha(n.$$.fragment),mr(t,"slot","footer"),mr(t,"style",e[3])},m(e,a){nr(e,t,a),pa(o,t,null),tr(t,i),pa(n,t,null),r=!0},p(e,i){const s={};64&i[0]&&(s.elasticity=e[6]*e[9]),38&i[0]|4096&i[1]&&(s.$$scope={dirty:i,ctx:e}),o.$set(s);const l=48&i[0]?ca(a,[a[0],a[1],16&i[0]&&{panels:e[4]},32&i[0]&&da(e[5])]):{};128&i[0]|5120&i[1]&&(l.$$scope={dirty:i,ctx:e}),n.$set(l),(!r||8&i[0])&&mr(t,"style",e[3])},i(e){r||(ta(o.$$.fragment,e),ta(n.$$.fragment,e),r=!0)},o(e){oa(o.$$.fragment,e),oa(n.$$.fragment,e),r=!1},d(e){e&&rr(t),ma(o),ma(n)}}}function V$(e){let t,o;return t=new Ag({props:{$$slots:{footer:[W$]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};254&o[0]|4096&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function N$(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m=Rn,g=()=>(m(),m=Bn(f,(e=>o(21,c=e))),f);e.$$.on_destroy.push((()=>m()));let{stores:$}=t,{isActive:f}=t;g();let{locale:y={}}=t,{finetuneControlConfiguration:b}=t,{finetuneOptions:x}=t,{finetuneNudgePrecision:v}=t;const{history:w,animation:S,scrollElasticity:k,rangeInputElasticity:M,imageColorMatrix:C,imageConvolutionMatrix:T,imageGamma:P,imageVignette:I,imageNoise:A,allowPan:E,allowZoom:F,allowZoomControls:z}=$;_n(e,S,(e=>o(22,d=e)));const D={imageColorMatrix:C,imageConvolutionMatrix:T,imageGamma:P,imageVignette:I,imageNoise:A},B=Lr("elasticityMultiplier");_n(e,B,(e=>o(6,h=e)));const O="finetune-"+L(),_=ba({});_n(e,_,(e=>o(23,u=e)));const W=ba({});_n(e,W,(e=>o(7,p=e)));let V=[];const N=Fl(d?20:0);_n(e,N,(e=>o(20,l=e)));return e.$$set=e=>{"stores"in e&&o(15,$=e.stores),"isActive"in e&&g(o(0,f=e.isActive)),"locale"in e&&o(16,y=e.locale),"finetuneControlConfiguration"in e&&o(17,b=e.finetuneControlConfiguration),"finetuneOptions"in e&&o(18,x=e.finetuneOptions),"finetuneNudgePrecision"in e&&o(19,v=e.finetuneNudgePrecision)},e.$$.update=()=>{var t;2097152&e.$$.dirty[0]&&E.set(c),2097152&e.$$.dirty[0]&&F.set(c),2097152&e.$$.dirty[0]&&z.set(c),327680&e.$$.dirty[0]&&o(1,i=x?x.map((([e,t])=>({id:e,label:R(t)?t(y):t}))):[]),2&e.$$.dirty[0]&&o(2,n=i.length&&i[0].id),4&e.$$.dirty[0]&&o(5,r={name:O,selected:n}),2&e.$$.dirty[0]&&o(4,a=i.map((e=>e.id))),131072&e.$$.dirty[0]&&b&&(t=b,V&&V.forEach((e=>e())),V=a.map((e=>{const{getStore:o,getValue:i=Z}=t[e];return o(D).subscribe((t=>{const o=null!=t?i(t):t;Xn(_,u={...u,[e]:o},u)}))}))),8519680&e.$$.dirty[0]&&b&&u&&Xn(W,p=Object.keys(u).reduce(((e,t)=>{const{base:o,min:i,max:n,getLabel:r,getStore:a,setValue:s=((e,t)=>e.set(t))}=b[t],l=a(D),c=null!=u[t]?u[t]:o;return e[t]={base:o,min:i,max:n,value:c,valueLabel:r?r(c,i,n,n-i):Math.round(100*c),oninputmove:e=>{s(l,e)},oninputend:e=>{s(l,e),w.write()},elasticity:h*M,labelReset:y.labelReset,nudgeMultiplier:v},e}),{}),p),6291456&e.$$.dirty[0]&&d&&N.set(c?0:20),1048576&e.$$.dirty[0]&&o(3,s=l?`transform: translateY(${l}px)`:void 0)},[f,i,n,s,a,r,h,p,S,k,B,_,W,N,"finetune",$,y,b,x,v,l,c,d,u,({detail:e})=>o(2,n=e),function(t){Fr.call(this,e,t)}]}var H$={util:["finetune",class extends $a{constructor(e){super(),ga(this,e,N$,V$,Dn,{name:14,stores:15,isActive:0,locale:16,finetuneControlConfiguration:17,finetuneOptions:18,finetuneNudgePrecision:19},null,[-1,-1])}get name(){return this.$$.ctx[14]}get stores(){return this.$$.ctx[15]}set stores(e){this.$$set({stores:e}),Gr()}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get locale(){return this.$$.ctx[16]}set locale(e){this.$$set({locale:e}),Gr()}get finetuneControlConfiguration(){return this.$$.ctx[17]}set finetuneControlConfiguration(e){this.$$set({finetuneControlConfiguration:e}),Gr()}get finetuneOptions(){return this.$$.ctx[18]}set finetuneOptions(e){this.$$set({finetuneOptions:e}),Gr()}get finetuneNudgePrecision(){return this.$$.ctx[19]}set finetuneNudgePrecision(e){this.$$set({finetuneNudgePrecision:e}),Gr()}}]},j$=(e,t)=>{const o=t.length;return e<0?e%o+o:e>=o?e%o:e};function U$(e,t,o){const i=e.slice();return i[48]=t[o].key,i[49]=t[o].index,i[50]=t[o].translate,i[51]=t[o].scale,i[14]=t[o].rotate,i[52]=t[o].dir,i[53]=t[o].center,i[54]=t[o].type,i[2]=t[o].visible,i}function Z$(e){let t,o;return{c(){t=ar("div"),mr(t,"class","PinturaShapeManipulator"),mr(t,"data-control","point"),mr(t,"style",o=`pointer-events:none;transform: translate3d(${e[53].x}px, ${e[53].y}px, 0) scale(${e[5]}, ${e[5]}); opacity: ${e[4]}`)},m(e,o){nr(e,t,o)},p(e,i){56&i[0]&&o!==(o=`pointer-events:none;transform: translate3d(${e[53].x}px, ${e[53].y}px, 0) scale(${e[5]}, ${e[5]}); opacity: ${e[4]}`)&&mr(t,"style",o)},d(e){e&&rr(t)}}}function X$(e,t){let o,i,n,r,a,s,l,c,d;function u(...e){return t[19](t[49],...e)}let h="edge"===t[54]&&t[2]&&Z$(t);return{key:e,first:null,c(){o=ar("div"),s=cr(),h&&h.c(),l=dr(),mr(o,"role","button"),mr(o,"aria-label",i=`Drag ${t[54]} ${t[48]}`),mr(o,"tabindex",n="edge"===t[54]?-1:0),mr(o,"class","PinturaShapeManipulator"),mr(o,"data-control",r=t[54]),mr(o,"style",a=`cursor:${t[52]?t[52]+"-resize":"move"};opacity:${t[4]};--tx:${t[50].x};--ty:${t[50].y};--r:${"edge"===t[54]?t[14]:0}rad;--sx:${"point"===t[54]?t[5]:t[51].x};--sy:${"point"===t[54]?t[5]:t[51].y};`),this.first=o},m(e,i){nr(e,o,i),nr(e,s,i),h&&h.m(e,i),nr(e,l,i),c||(d=[ur(o,"keydown",t[7]),ur(o,"keyup",t[8]),ur(o,"nudge",u),Gn(Pc.call(null,o,{preventDefault:!0})),ur(o,"interactionstart",(function(){zn(t[11]("start",t[49]))&&t[11]("start",t[49]).apply(this,arguments)})),ur(o,"interactionupdate",(function(){zn(t[11]("move",t[49]))&&t[11]("move",t[49]).apply(this,arguments)})),ur(o,"interactionend",(function(){zn(t[11]("end",t[49]))&&t[11]("end",t[49]).apply(this,arguments)})),Gn(Kc.call(null,o))],c=!0)},p(e,s){t=e,8&s[0]&&i!==(i=`Drag ${t[54]} ${t[48]}`)&&mr(o,"aria-label",i),8&s[0]&&n!==(n="edge"===t[54]?-1:0)&&mr(o,"tabindex",n),8&s[0]&&r!==(r=t[54])&&mr(o,"data-control",r),56&s[0]&&a!==(a=`cursor:${t[52]?t[52]+"-resize":"move"};opacity:${t[4]};--tx:${t[50].x};--ty:${t[50].y};--r:${"edge"===t[54]?t[14]:0}rad;--sx:${"point"===t[54]?t[5]:t[51].x};--sy:${"point"===t[54]?t[5]:t[51].y};`)&&mr(o,"style",a),"edge"===t[54]&&t[2]?h?h.p(t,s):(h=Z$(t),h.c(),h.m(l.parentNode,l)):h&&(h.d(1),h=null)},d(e){e&&rr(o),e&&rr(s),h&&h.d(e),e&&rr(l),c=!1,Fn(d)}}}function G$(e){let t,o,i,n;return{c(){t=ar("div"),mr(t,"role","button"),mr(t,"aria-label","Drag rotator"),mr(t,"tabindex","0"),mr(t,"class","PinturaShapeManipulator"),mr(t,"data-control","rotate"),mr(t,"style",o=`transform: translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[5]}, ${e[5]}); opacity: ${e[4]}`)},m(o,r){nr(o,t,r),i||(n=[ur(t,"keydown",e[7]),ur(t,"keyup",e[8]),ur(t,"nudge",e[13]),Gn(Pc.call(null,t,{preventDefault:!0})),ur(t,"interactionstart",e[14]("start")),ur(t,"interactionupdate",e[14]("move")),ur(t,"interactionend",e[14]("end")),Gn(Kc.call(null,t))],i=!0)},p(e,i){49&i[0]&&o!==(o=`transform: translate3d(${e[0].x}px, ${e[0].y}px, 0) scale(${e[5]}, ${e[5]}); opacity: ${e[4]}`)&&mr(t,"style",o)},d(e){e&&rr(t),i=!1,Fn(n)}}}function Y$(e){let t,o,i=[],n=new Map,r=e[3];const a=e=>e[48];for(let t=0;t<r.length;t+=1){let o=U$(e,r,t),s=a(o);n.set(s,i[t]=X$(s,o))}let s=e[1]&&G$(e);return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=cr(),s&&s.c(),o=dr()},m(e,n){for(let t=0;t<i.length;t+=1)i[t].m(e,n);nr(e,t,n),s&&s.m(e,n),nr(e,o,n)},p(e,l){6584&l[0]&&(r=e[3],i=la(i,l,a,1,e,r,n,t.parentNode,aa,X$,t,U$)),e[1]?s?s.p(e,l):(s=G$(e),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null)},i:Rn,o:Rn,d(e){for(let t=0;t<i.length;t+=1)i[t].d(e);e&&rr(t),s&&s.d(e),e&&rr(o)}}}function q$(e,t,o){let i,n,r,a;const s=Ar(),l=.5*Y,c=G-l,d=G+l,u=-G,h=u-l,p=u+l,m=X-l,g=-X+l,$=l,f=-l,y=G-Y,b=y-l,x=y+l,v=X-Y,w=v-l,S=v+l,k=u-Y,M=k+l,C=k-l,T=u+Y,P=T+l,R=T-l;let{visible:I=!1}=t,{points:A=[]}=t,{rotatorPoint:E}=t,{enableDragEdges:L=!0}=t,{enableDragPoints:F=!0}=t,{enableRotatePoints:z=!0}=t;const D=Lr("isAnimated");_n(e,D,(e=>o(18,n=e)));let B=!1;const O=Fl(.5,{precision:1e-4,stiffness:.3,damping:.7});_n(e,O,(e=>o(5,a=e)));const _=Fl(0,{precision:.001,stiffness:.3,damping:.7});_n(e,_,(e=>o(4,r=e)));const W=e=>{let t="";return(e<=d&&e>=c||e>=h&&e<=p)&&(t="ns"),(e<=g||e>=m||e>=f&&e<=$)&&(t="ew"),(e>=w&&e<=S||e<=P&&e>=R)&&(t="nesw"),(e>=b&&e<=x||e<=M&&e>=C)&&(t="nwse"),t},V=(e,t)=>{s("resizestart",{indexes:e,translation:de()}),s("resizemove",{indexes:e,translation:t}),s("resizeend",{indexes:e,translation:de()})};return e.$$set=e=>{"visible"in e&&o(2,I=e.visible),"points"in e&&o(15,A=e.points),"rotatorPoint"in e&&o(0,E=e.rotatorPoint),"enableDragEdges"in e&&o(16,L=e.enableDragEdges),"enableDragPoints"in e&&o(17,F=e.enableDragPoints),"enableRotatePoints"in e&&o(1,z=e.enableRotatePoints)},e.$$.update=()=>{262148&e.$$.dirty[0]&&O.set(I?1:.5,{hard:!1===n}),262148&e.$$.dirty[0]&&_.set(I?1:0,{hard:!1===n}),32768&e.$$.dirty[0]&&o(3,i=((e,t)=>{let o=0;const i=Ae(e),n=[],r=e.length;for(;o<r;o++){const t=j$(o-1,e),r=j$(o+1,e),a=e[t],s=e[o],l=e[r],c=Math.atan2(l.y-s.y,l.x-s.x);if(F){const e=ye(ue(a.x-s.x,a.y-s.y)),t=ye(ue(l.x-s.x,l.y-s.y)),i=ue(e.x+t.x,e.y+t.y),r=L?F&&W(Math.atan2(i.y,i.x)):void 0;n.push({index:[o],key:"point-"+o,type:"point",scale:{x:1,y:1},translate:{x:s.x,y:s.y},angle:void 0,rotate:z,center:s,dir:r})}if(!L)continue;if(Array.isArray(L)&&!L.some((([e,t])=>o===e&&r===t)))continue;const d=ue(s.x+.5*(l.x-s.x),s.y+.5*(l.y-s.y));n.push({index:[o,r],key:"edge-"+o,type:"edge",scale:{x:Re(s,l),y:1},translate:{x:s.x,y:s.y},angle:c,rotate:c,center:d,visible:Array.isArray(L),dir:W(Math.atan2(i.y-d.y,i.x-d.x))})}return n})(A))},[E,z,I,i,r,a,D,e=>B=e.shiftKey,e=>B=!1,O,_,(e,t)=>({detail:o})=>{const i=o&&o.translation?o.translation:ue(0,0);s("resize"+e,{...o,indexes:t,translation:i,shiftKey:B})},V,({detail:e})=>{s("rotatestart",{translation:de()}),s("rotatemove",{translation:e}),s("rotateend",{translation:de()})},e=>({detail:t})=>{const o=t&&t.translation?t.translation:ue(0,0);s("rotate"+e,{translation:o,shiftKey:B})},A,L,F,n,(e,{detail:t})=>V(e,t)]}class K$ extends $a{constructor(e){super(),ga(this,e,q$,Y$,Dn,{visible:2,points:15,rotatorPoint:0,enableDragEdges:16,enableDragPoints:17,enableRotatePoints:1},null,[-1,-1])}}var J$=(e,t)=>{const o=Sh(e);return Se(o,t)};let Q$=null;var ef=e=>{if(null===Q$&&(Q$=u()&&"visualViewport"in window),!Q$)return!1;const t=visualViewport.height,o=()=>{e(visualViewport.height<t?"visible":"hidden")};return visualViewport.addEventListener("resize",o),()=>visualViewport.removeEventListener("resize",o)};function tf(e){let t,o,i,n,r,a,s,l,c,d;i=new jc({props:{onclick:e[1],label:e[5],icon:e[7],hideLabel:!e[6]}});const u=e[20].default,h=Wn(u,e,e[19],null);return s=new jc({props:{onclick:e[0],label:e[2],icon:e[4],hideLabel:!e[3],class:"PinturaInputFormButtonConfirm"}}),{c(){t=ar("div"),o=ar("div"),ha(i.$$.fragment),n=cr(),r=ar("div"),h&&h.c(),a=cr(),ha(s.$$.fragment),mr(r,"class","PinturaInputFormFields"),mr(o,"class","PinturaInputFormInner"),mr(t,"class","PinturaInputForm"),mr(t,"style",e[9])},m(u,p){nr(u,t,p),tr(t,o),pa(i,o,null),tr(o,n),tr(o,r),h&&h.m(r,null),tr(o,a),pa(s,o,null),e[21](t),l=!0,c||(d=[ur(t,"focusin",e[10]),ur(t,"focusout",e[11]),ur(t,"measure",e[12]),Gn(Gl.call(null,t))],c=!0)},p(e,o){const n={};2&o[0]&&(n.onclick=e[1]),32&o[0]&&(n.label=e[5]),128&o[0]&&(n.icon=e[7]),64&o[0]&&(n.hideLabel=!e[6]),i.$set(n),h&&h.p&&(!l||524288&o[0])&&Hn(h,u,e,e[19],l?Nn(u,e[19],o,null):jn(e[19]),null);const r={};1&o[0]&&(r.onclick=e[0]),4&o[0]&&(r.label=e[2]),16&o[0]&&(r.icon=e[4]),8&o[0]&&(r.hideLabel=!e[3]),s.$set(r),(!l||512&o[0])&&mr(t,"style",e[9])},i(e){l||(ta(i.$$.fragment,e),ta(h,e),ta(s.$$.fragment,e),l=!0)},o(e){oa(i.$$.fragment,e),oa(h,e),oa(s.$$.fragment,e),l=!1},d(o){o&&rr(t),ma(i),h&&h.d(o),ma(s),e[21](null),c=!1,Fn(d)}}}function of(e,t,o){let i,n,r,a,{$$slots:s={},$$scope:l}=t,{onconfirm:c}=t,{oncancel:d}=t,{autoFocus:u=!0}=t,{autoPositionCursor:h=!0}=t,{labelConfirm:p}=t,{labelConfirmShow:m=!0}=t,{iconConfirm:g}=t,{labelCancel:$}=t,{labelCancelShow:f=!1}=t,{iconCancel:y}=t,{panelOffset:b=de()}=t,x=!1,w=void 0,S=void 0,k="",M=0;const C=()=>{const e=a.querySelector("input, textarea");e.focus(),M>=1||e.select()},T=()=>{x=!0,R||!ho()&&!v()||o(16,k="top:1em;bottom:auto;"),ho()&&(e=>{let t;const o=e=>t=e.touches[0].screenY,i=e=>{const o=e.touches[0].screenY,i=e.target;/textarea/i.test(i.nodeName)?(o>t?0==i.scrollTop&&e.preventDefault():o<t?i.scrollTop+i.offsetHeight==i.scrollHeight&&e.preventDefault():e.preventDefault(),t=o):e.preventDefault()};e.addEventListener("touchstart",o),e.addEventListener("touchmove",i)})(a),o(17,M=1)};let P;const R=ef((e=>{n?"hidden"!==e||x?(clearTimeout(S),S=void 0,o(16,k=`top:${visualViewport.height-w-b.y}px`),"visible"===e?(o(8,a.dataset.layout="stick",a),C(),T()):(x=!1,o(17,M=0))):C():o(16,k="top: 4.5em; bottom: auto")}));return Pr((()=>{u&&C()})),Ir((()=>{R&&R()})),e.$$set=e=>{"onconfirm"in e&&o(0,c=e.onconfirm),"oncancel"in e&&o(1,d=e.oncancel),"autoFocus"in e&&o(13,u=e.autoFocus),"autoPositionCursor"in e&&o(14,h=e.autoPositionCursor),"labelConfirm"in e&&o(2,p=e.labelConfirm),"labelConfirmShow"in e&&o(3,m=e.labelConfirmShow),"iconConfirm"in e&&o(4,g=e.iconConfirm),"labelCancel"in e&&o(5,$=e.labelCancel),"labelCancelShow"in e&&o(6,f=e.labelCancelShow),"iconCancel"in e&&o(7,y=e.iconCancel),"panelOffset"in e&&o(15,b=e.panelOffset),"$$scope"in e&&o(19,l=e.$$scope)},e.$$.update=()=>{256&e.$$.dirty[0]&&o(18,i=a&&getComputedStyle(a)),262144&e.$$.dirty[0]&&(n=i&&"1"===i.getPropertyValue("--editor-modal")),196608&e.$$.dirty[0]&&o(9,r=`opacity:${M};${k}`)},[c,d,p,m,g,$,f,y,a,r,e=>{var t;(e=>/textarea/i.test(e))(e.target)&&(P=Date.now(),h&&((t=e.target).selectionStart=t.selectionEnd=t.value.length),clearTimeout(S),S=setTimeout(T,200))},e=>{Date.now()-P>50||(e.stopPropagation(),C())},({detail:e})=>{w=e.height},u,h,b,k,M,i,l,s,function(e){Dr[e?"unshift":"push"]((()=>{a=e,o(8,a)}))}]}class nf extends $a{constructor(e){super(),ga(this,e,of,tf,Dn,{onconfirm:0,oncancel:1,autoFocus:13,autoPositionCursor:14,labelConfirm:2,labelConfirmShow:3,iconConfirm:4,labelCancel:5,labelCancelShow:6,iconCancel:7,panelOffset:15},null,[-1,-1])}}var rf=e=>document.createTextNode(e),af=e=>(jt()&&e.endsWith("<div><br></div>")?e.replace(/<div><br><\/div>$/,"<br><br>"):e).replace(/<div><br><\/div>/g,"<br>").replace(/<\/div>/g,"").replace(/<div>/g,"<br>");function sf(e){let t,o,i,n;return{c(){t=ar("pre"),mr(t,"class","PinturaContentEditable"),mr(t,"data-wrap-content",o=e[3]||e[4]?"wrap":"nowrap"),mr(t,"contenteditable",""),mr(t,"spellcheck",e[0]),mr(t,"autocorrect",e[1]),mr(t,"autocapitalize",e[2]),mr(t,"style",e[6])},m(o,r){nr(o,t,r),e[23](t),i||(n=[ur(t,"input",e[11]),ur(t,"compositionend",e[10]),ur(t,"paste",e[12]),ur(t,"keydown",e[8]),ur(t,"keyup",e[9]),ur(t,"blur",e[7])],i=!0)},p(e,i){24&i[0]&&o!==(o=e[3]||e[4]?"wrap":"nowrap")&&mr(t,"data-wrap-content",o),1&i[0]&&mr(t,"spellcheck",e[0]),2&i[0]&&mr(t,"autocorrect",e[1]),4&i[0]&&mr(t,"autocapitalize",e[2]),64&i[0]&&mr(t,"style",e[6])},i:Rn,o:Rn,d(o){o&&rr(t),e[23](null),i=!1,Fn(n)}}}function lf(e,t,o){let i,{spellcheck:n="false"}=t,{autocorrect:r="off"}=t,{autocapitalize:s="off"}=t,{wrapLines:l=!0}=t,{allowNewline:c=!0}=t,{textStyles:d=!1}=t,{formatInput:u=Z}=t,{formatPaste:h=Z}=t,{style:p}=t,{innerHTML:m}=t,{oninput:$=a}=t;const f=()=>{if(!b)return;const e=document.createRange();e.selectNodeContents(b);const t=M();t.removeAllRanges(),t.addRange(e)},y=Ar();let b;document.execCommand("defaultParagraphSeparator",!1,"br");const x=e=>e.replace(/<\/?(?:i|b|em|strong)>/,""),v=()=>{o(13,m=b.innerHTML);const e=af(m);y("input",e),$(e),requestAnimationFrame((()=>b&&b.scrollTo(0,0)))},w=()=>{C(b);const e=d?b.innerHTML:x(b.innerHTML);o(5,b.innerHTML=u(e),b),T(b),v()},S=e=>{const t=g("span");return t.dataset.bookmark=e,t},k=(e,t,o)=>{const i=S(o);if(e.nodeType===Node.TEXT_NODE){const n=e.textContent;if("start"===o){const o=rf(n.substr(0,t)),r=rf(n.substr(t));e.replaceWith(o,i,r)}else{const o=rf(n.substr(0,t)),r=rf(n.substr(t));e.replaceWith(o,i,r)}}else e.nodeType===Node.ELEMENT_NODE&&e.insertBefore(i,e.childNodes[t])},M=()=>{const e=b.getRootNode();return"getSelection"in e?e.getSelection():document.getSelection()},C=e=>{const t=M();if(!t.getRangeAt||!t.rangeCount)return;const o=t.getRangeAt(0),{startOffset:i,endOffset:n,startContainer:r,endContainer:a}=o;if(e.contains(o.startContainer)&&e.contains(o.endContainer))if(r.nodeType===Node.TEXT_NODE&&r===a){const e=r.textContent,t=e.substr(0,i),o=S("start"),a=n-i>0?e.substr(i,n):"",s=S("end"),l=e.substr(n);r.replaceWith(t,o,a,s,l)}else k(r,i,"start"),k(a,n+(r===a?1:0),"end")},T=e=>{const t=P(e,"start"),o=P(e,"end");if(!t||!o)return;const i=document.createRange();i.setStart(t,0),i.setEnd(o,0);const n=M();n.removeAllRanges(),n.addRange(i),t.remove(),o.remove()},P=(e,t)=>{const o=e.children;for(let e=0;e<o.length;e++){const i=o[e];if(i.dataset.bookmark===t)return i;if(i.children.length){const e=P(i,t);if(e)return e}}};let R;return e.$$set=e=>{"spellcheck"in e&&o(0,n=e.spellcheck),"autocorrect"in e&&o(1,r=e.autocorrect),"autocapitalize"in e&&o(2,s=e.autocapitalize),"wrapLines"in e&&o(3,l=e.wrapLines),"allowNewline"in e&&o(4,c=e.allowNewline),"textStyles"in e&&o(14,d=e.textStyles),"formatInput"in e&&o(15,u=e.formatInput),"formatPaste"in e&&o(16,h=e.formatPaste),"style"in e&&o(17,p=e.style),"innerHTML"in e&&o(13,m=e.innerHTML),"oninput"in e&&o(18,$=e.oninput)},e.$$.update=()=>{var t;if(32&e.$$.dirty[0]&&o(22,i=!!b),4202496&e.$$.dirty[0]&&i&&m&&(t=m)!==b.innerHTML&&(o(5,b.innerHTML=t,b),b===document.activeElement&&f()),131096&e.$$.dirty[0])if(!l&&c){const e=p.includes(":right")?"text-indent:-100px!important":p.includes(":center")?"":"min-width:calc(100% + 100px)!important";o(6,R=p+";overflow:visible;"+e)}else o(6,R=p)},[n,r,s,l,c,b,R,()=>{y("blur")},e=>{if(/escape/i.test(e.code))return e.stopPropagation(),void y("cancel");/enter/i.test(e.code)&&(e.stopPropagation(),e.ctrlKey||e.metaKey?y("confirm"):c||e.preventDefault())},()=>{},e=>{""!==e.data&&w()},e=>{const{inputType:t}=e;"insertCompositionText"!==t&&"deleteCompositionText"!==t&&w()},e=>{e.preventDefault();const t=e.clipboardData.getData("text/plain"),o=d?t:x(t),i=h(o);if(!i.length)return;const n=M().getRangeAt(0);n.deleteContents(),n.insertNode(document.createTextNode(i)),v()},m,d,u,h,p,$,()=>w(),()=>b&&b.focus(),f,i,function(e){Dr[e?"unshift":"push"]((()=>{b=e,o(5,b)}))}]}class cf extends $a{constructor(e){super(),ga(this,e,lf,sf,Dn,{spellcheck:0,autocorrect:1,autocapitalize:2,wrapLines:3,allowNewline:4,textStyles:14,formatInput:15,formatPaste:16,style:17,innerHTML:13,oninput:18,confirm:19,focus:20,select:21},null,[-1,-1])}get spellcheck(){return this.$$.ctx[0]}set spellcheck(e){this.$$set({spellcheck:e}),Gr()}get autocorrect(){return this.$$.ctx[1]}set autocorrect(e){this.$$set({autocorrect:e}),Gr()}get autocapitalize(){return this.$$.ctx[2]}set autocapitalize(e){this.$$set({autocapitalize:e}),Gr()}get wrapLines(){return this.$$.ctx[3]}set wrapLines(e){this.$$set({wrapLines:e}),Gr()}get allowNewline(){return this.$$.ctx[4]}set allowNewline(e){this.$$set({allowNewline:e}),Gr()}get textStyles(){return this.$$.ctx[14]}set textStyles(e){this.$$set({textStyles:e}),Gr()}get formatInput(){return this.$$.ctx[15]}set formatInput(e){this.$$set({formatInput:e}),Gr()}get formatPaste(){return this.$$.ctx[16]}set formatPaste(e){this.$$set({formatPaste:e}),Gr()}get style(){return this.$$.ctx[17]}set style(e){this.$$set({style:e}),Gr()}get innerHTML(){return this.$$.ctx[13]}set innerHTML(e){this.$$set({innerHTML:e}),Gr()}get oninput(){return this.$$.ctx[18]}set oninput(e){this.$$set({oninput:e}),Gr()}get confirm(){return this.$$.ctx[19]}get focus(){return this.$$.ctx[20]}get select(){return this.$$.ctx[21]}}var df=(e,t)=>P(e)?parseFloat(e)/100*t:e,uf=(e,t)=>({x:Bo(e.x,t.width),y:Bo(e.y,t.height)});function hf(e,t,o){const i=e.slice();return i[218]=t[o],i[220]=o,i}function pf(e,t){let o,i,n,r,a,s,l,c,d,u,h,p=t[218].name+"";function m(){return t[146](t[220])}return n=new cm({props:{color:t[218].color}}),{key:e,first:null,c(){o=ar("li"),i=ar("button"),ha(n.$$.fragment),r=cr(),a=ar("span"),s=lr(p),c=cr(),mr(i,"class","PinturaShapeListItem"),mr(i,"type","button"),mr(i,"aria-label",l="Select shape "+t[218].name),this.first=o},m(e,t){nr(e,o,t),tr(o,i),pa(n,i,null),tr(i,r),tr(i,a),tr(a,s),tr(o,c),d=!0,u||(h=ur(i,"click",m),u=!0)},p(e,o){t=e;const r={};524288&o[0]&&(r.color=t[218].color),n.$set(r),(!d||524288&o[0])&&p!==(p=t[218].name+"")&&$r(s,p),(!d||524288&o[0]&&l!==(l="Select shape "+t[218].name))&&mr(i,"aria-label",l)},i(e){d||(ta(n.$$.fragment,e),d=!0)},o(e){oa(n.$$.fragment,e),d=!1},d(e){e&&rr(o),ma(n),u=!1,h()}}}function mf(e){let t,o;return t=new K$({props:{visible:!0,points:e[10],rotatorPoint:e[25],enableDragEdges:e[15],enableDragPoints:e[27],enableRotatePoints:e[13]}}),t.$on("resizestart",e[35]),t.$on("resizemove",e[36]),t.$on("resizeend",e[37]),t.$on("rotatestart",e[38]),t.$on("rotatemove",e[39]),t.$on("rotateend",e[40]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};1024&o[0]&&(i.points=e[10]),33554432&o[0]&&(i.rotatorPoint=e[25]),32768&o[0]&&(i.enableDragEdges=e[15]),134217728&o[0]&&(i.enableDragPoints=e[27]),8192&o[0]&&(i.enableRotatePoints=e[13]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function gf(e){let t,o,i,n;const r=[ff,$f],a=[];function s(e,t){return"modal"===e[4]?0:"inline"===e[4]?1:-1}return~(t=s(e))&&(o=a[t]=r[t](e)),{c(){o&&o.c(),i=dr()},m(e,o){~t&&a[t].m(e,o),nr(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?~t&&a[t].p(e,n):(o&&(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea()),~t?(o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ta(o,1),o.m(i.parentNode,i)):o=null)},i(e){n||(ta(o),n=!0)},o(e){oa(o),n=!1},d(e){~t&&a[t].d(e),e&&rr(i)}}}function $f(e){let t,o,i,n,r,a={formatInput:e[42],wrapLines:!!e[12].width,allowNewline:e[26],style:e[24]};return o=new cf({props:a}),e[149](o),o.$on("input",e[43]),o.$on("keyup",e[46]),o.$on("cancel",e[48]),o.$on("confirm",e[47]),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaInlineInput"),mr(t,"style",e[23])},m(a,s){nr(a,t,s),pa(o,t,null),i=!0,n||(r=ur(t,"focusout",e[150]),n=!0)},p(e,n){const r={};4096&n[0]&&(r.wrapLines=!!e[12].width),67108864&n[0]&&(r.allowNewline=e[26]),16777216&n[0]&&(r.style=e[24]),o.$set(r),(!i||8388608&n[0])&&mr(t,"style",e[23])},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(i){i&&rr(t),e[149](null),ma(o),n=!1,r()}}}function ff(e){let t,o;return t=new nf({props:{panelOffset:e[2],onconfirm:e[47],oncancel:e[48],labelCancel:e[5].shapeLabelInputCancel,iconCancel:e[5].shapeIconInputCancel,labelConfirm:e[5].shapeLabelInputConfirm,iconConfirm:e[5].shapeIconInputConfirm,$$slots:{default:[yf]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};4&o[0]&&(i.panelOffset=e[2]),32&o[0]&&(i.labelCancel=e[5].shapeLabelInputCancel),32&o[0]&&(i.iconCancel=e[5].shapeIconInputCancel),32&o[0]&&(i.labelConfirm=e[5].shapeLabelInputConfirm),32&o[0]&&(i.iconConfirm=e[5].shapeIconInputConfirm),20971648&o[0]|16&o[7]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function yf(e){let t,o,i;return{c(){t=ar("textarea"),mr(t,"spellcheck","false"),mr(t,"autocorrect","off"),mr(t,"autocapitalize","off"),mr(t,"style",e[24])},m(n,r){nr(n,t,r),e[147](t),fr(t,e[22]),o||(i=[ur(t,"keydown",e[45]),ur(t,"keypress",e[44]),ur(t,"keyup",e[46]),ur(t,"input",e[43]),ur(t,"input",e[148])],o=!0)},p(e,o){16777216&o[0]&&mr(t,"style",e[24]),4194304&o[0]&&fr(t,e[22])},d(n){n&&rr(t),e[147](null),o=!1,Fn(i)}}}function bf(e){let t,o,i,n,r;return o=new eh({props:{items:e[20],key:e[9]}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaShapeControls"),mr(t,"style",e[21])},m(a,s){nr(a,t,s),pa(o,t,null),i=!0,n||(r=[ur(t,"measure",e[151]),Gn(Gl.call(null,t))],n=!0)},p(e,n){const r={};1048576&n[0]&&(r.items=e[20]),512&n[0]&&(r.key=e[9]),o.$set(r),(!i||2097152&n[0])&&mr(t,"style",e[21])},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o),n=!1,Fn(r)}}}function xf(e){let t,o,i,n,r,s,l,c,d,u,h=[],p=new Map,m=e[19];const g=e=>e[218].id;for(let t=0;t<m.length;t+=1){let o=hf(e,m,t),i=g(o);p.set(i,h[t]=pf(i,o))}let $=e[14]&&mf(e),f=e[11]&&gf(e),y=e[16]>0&&bf(e);return{c(){t=ar("div"),o=ar("nav"),i=ar("ul");for(let e=0;e<h.length;e+=1)h[e].c();n=cr(),$&&$.c(),r=cr(),f&&f.c(),s=cr(),y&&y.c(),mr(o,"class","PinturaShapeList"),mr(o,"data-visible",e[17]),mr(t,"class","PinturaShapeEditor"),mr(t,"tabindex","0")},m(p,m){nr(p,t,m),tr(t,o),tr(o,i);for(let e=0;e<h.length;e+=1)h[e].m(i,null);tr(t,n),$&&$.m(t,null),tr(t,r),f&&f.m(t,null),tr(t,s),y&&y.m(t,null),e[152](t),c=!0,d||(u=[ur(o,"focusin",e[51]),ur(o,"focusout",e[52]),ur(t,"keydown",(function(){zn(e[1]?a:e[41])&&(e[1]?a:e[41]).apply(this,arguments)})),ur(t,"nudge",(function(){zn(e[1]?a:e[50])&&(e[1]?a:e[50]).apply(this,arguments)})),ur(t,"measure",e[145]),ur(t,"pointermove",(function(){zn(e[1]?a:e[53])&&(e[1]?a:e[53]).apply(this,arguments)})),ur(t,"interactionstart",(function(){zn(e[1]?a:e[30])&&(e[1]?a:e[30]).apply(this,arguments)})),ur(t,"interactionupdate",(function(){zn(e[1]?a:e[32])&&(e[1]?a:e[32]).apply(this,arguments)})),ur(t,"interactioncancel",(function(){zn(e[1]?a:e[31])&&(e[1]?a:e[31]).apply(this,arguments)})),ur(t,"interactionrelease",(function(){zn(e[1]?a:e[33])&&(e[1]?a:e[33]).apply(this,arguments)})),ur(t,"interactionend",(function(){zn(e[1]?a:e[34])&&(e[1]?a:e[34]).apply(this,arguments)})),Gn(Gl.call(null,t)),Gn(Pc.call(null,t)),Gn(l=Kc.call(null,t,{drag:!0,inertia:!0,multiTouch:!1,shouldStartInteraction:Sf,getEventPosition:e[153]}))],d=!0)},p(n,a){e=n,524353&a[0]&&(m=e[19],Qr(),h=la(h,a,g,1,e,m,p,i,sa,pf,null,hf),ea()),(!c||131072&a[0])&&mr(o,"data-visible",e[17]),e[14]?$?($.p(e,a),16384&a[0]&&ta($,1)):($=mf(e),$.c(),ta($,1),$.m(t,r)):$&&(Qr(),oa($,1,1,(()=>{$=null})),ea()),e[11]?f?(f.p(e,a),2048&a[0]&&ta(f,1)):(f=gf(e),f.c(),ta(f,1),f.m(t,s)):f&&(Qr(),oa(f,1,1,(()=>{f=null})),ea()),e[16]>0?y?(y.p(e,a),65536&a[0]&&ta(y,1)):(y=bf(e),y.c(),ta(y,1),y.m(t,null)):y&&(Qr(),oa(y,1,1,(()=>{y=null})),ea()),l&&zn(l.update)&&8&a[0]&&l.update.call(null,{drag:!0,inertia:!0,multiTouch:!1,shouldStartInteraction:Sf,getEventPosition:e[153]})},i(e){if(!c){for(let e=0;e<m.length;e+=1)ta(h[e]);ta($),ta(f),ta(y),c=!0}},o(e){for(let e=0;e<h.length;e+=1)oa(h[e]);oa($),oa(f),oa(y),c=!1},d(o){o&&rr(t);for(let e=0;e<h.length;e+=1)h[e].d();$&&$.d(),f&&f.d(),y&&y.d(),e[152](null),d=!1,Fn(u)}}}const vf=256,wf="markup-hover",Sf=(e,t)=>e.target===t;function kf(e,t,o){let i,n,r,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,S,k,M,C,T,R,I,A,E,F,z,D,B,O,_,W,V,N,H,j,U,X,G,Y,{uid:q=L()}=t,{ui:K}=t,{disabled:J=!1}=t,{markup:Q}=t,{offset:ee}=t,{contextRotation:te=0}=t,{contextFlipX:oe=!1}=t,{contextFlipY:ie=!1}=t,{contextZoom:ne=1}=t,{active:re=!1}=t,{opacity:ae=1}=t,{parentRect:le}=t,{rootRect:he}=t,{utilRect:pe}=t,{hoverColor:ge}=t,{textInputMode:fe="inline"}=t,{oninteractionstart:ke=a}=t,{oninteractionupdate:Te=a}=t,{oninteractionrelease:Ie=a}=t,{oninteractionend:Fe=a}=t,{oninteractioncancel:ze=a}=t,{onaddshape:Be=a}=t,{onupdateshape:Oe=a}=t,{onselectshape:_e=a}=t,{onremoveshape:Ve=a}=t,{ontapshape:Ne=a}=t,{onhovershape:He=a}=t,{onhovercanvas:je=a}=t,{ontapcanvas:Ue=a}=t,{beforeSelectShape:Ge=(()=>!0)}=t,{beforeDeselectShape:qe=(()=>!0)}=t,{beforeRemoveShape:Ke=(()=>!0)}=t,{beforeUpdateShape:Je=((e,t)=>t)}=t,{willRenderShapeControls:Qe=Z}=t,{willStartInteraction:et=((e,t)=>!0)}=t,{mapEditorPointToImagePoint:nt}=t,{mapImagePointToEditorPoint:st}=t,{eraseRadius:lt}=t,{selectRadius:ct}=t,{enableButtonFlipVertical:dt=!1}=t,{enableTapToAddText:ut=!0}=t,{locale:ht}=t;const pt=Lr("isAnimated");_n(e,pt,(e=>o(144,G=e)));const mt=(e,t,o)=>{let i=Je({...e},t,{...o});tn(e,i,o)},gt=(e,t)=>{const o=Re(e,t),i=be(e,t),n=Math.PI/8,r=n*Math.round(i/n)-te%n;t.x=e.x+o*Math.cos(r),t.y=e.y+o*Math.sin(r)},ft=(e,t,o,i)=>{const n=ue(e.x-o.x,e.y-o.y),r=ue(i.x-o.x,i.y-o.y),a=Ce(r,r);let s=Ce(n,r)/a;s=s<0?0:s,s=s>1?1:s;const l=ue(r.x*s+o.x-e.x,r.y*s+o.y-e.y);return Ce(l,l)<=t*t},yt=(e,t,o)=>{const i=o.length;for(let n=0;n<i-1;n++)if(ft(e,t,o[n],o[n+1]))return!0;return!1},bt=(e,t,o)=>!!It(e,o)||(!!yt(e,t,o)||ft(e,t,o[0],o[o.length-1])),St=(e,t,o,i,n)=>bt(e,t,$t(o,i,n||at(o))),kt=Lr("keysPressed");_n(e,kt,(e=>o(166,Y=e)));const Mt=(e,t,o)=>0===e||t&&o?e:t||o?-e:e,Ct=(e,t)=>{const o=st(e);return nt(we(o,t))},Tt=(e,t,o)=>{if(bi(e)){const i=Ct(hi(t),o),n=Ct(pi(t),o);mt(e,{x1:i.x,y1:i.y,x2:n.x,y2:n.y},le)}else if(e.points)mt(e,{points:t.points.map((e=>Ct(e,o)))},le);else if(fi(e)||mi(e)||yi(e)){const i=Ct(t,o);mt(e,i,le)}_t()},Pt={0:1,1:0,2:3,3:2},At={0:3,1:2,2:1,3:0};let Et;const Ft=()=>{if(Q.length)return Q.find(Mi)},zt=()=>{if(Q.length)return Q.findIndex(Mi)},Dt=(e,t=!0)=>{if(!Ft())return Ii(e),Wt(e,t)},Bt=()=>{const e=Ft();if(e)return e._isDraft=!1,_t(),e},Ot=()=>{Ft()&&(Q.splice(zt(),1),_t())},_t=()=>o(0,Q),Wt=(e,t=!0)=>(Q.push(e),t&&_t(),e),Vt=(e,t=[],o=!0)=>{t.filter(Boolean).forEach((t=>delete e[t])),o&&_t()},Nt=(e,t,o=!0)=>{e=Object.assign(e,t),o&&_t()},Ht=(e,t,o,i=!0)=>{e[t]=o,i&&_t()},jt=(e,t=!0)=>{Q.forEach((t=>Nt(t,e,!1))),t&&_t()},Ut=()=>[...Q].reverse().find(Si),Zt=()=>!!Ut(),Xt=e=>{if(!Ke(e))return!1;o(0,Q=Q.filter((t=>t!==e))),Ve(e)},Gt=()=>{const e=Ut();if(!e)return;const t=Q.filter((e=>Li(e)&&Ei(e))),o=t.findIndex((t=>t===e));if(!1===Xt(e))return;if(Yt=e,t.length-1<=0)return qt();const i=o-1<0?t.length-1:o-1;Jt(t[i])};let Yt=void 0;const qt=(e={})=>{const{storePrevious:t=!0}=e;Object.keys(Lo).forEach((e=>Lo[e]={})),t&&(Yt=Kt()),jt({isSelected:!1,isEditing:!1,_prerender:!1})},Kt=()=>Q.find(Si),Jt=(e,t=!0)=>{if(Mi(e))return;const o=Kt()||Yt,i=Si(e);Yt=void 0,Ge(o,e)&&(qt(),(e=>{e.isSelected=!0})(e),!i&&_e(e),t&&_t())},Qt=e=>{ko&&ko.confirm&&e.isEditing&&ko.confirm(),Nt(e,{isSelected:!1,isEditing:!1,_prerender:!1})},eo=e=>{Nt(e,{isSelected:!0,isEditing:!0,_prerender:"inline"===fe})},to=e=>{Nt(e,{isSelected:!0,isEditing:!1,_prerender:!1})},oo=e=>{if(!e.length)return[];const t=e.filter(Ke);return o(0,Q=Q.filter((e=>!t.includes(e)))),t},io=e=>{const t=Yo(e.text,e);return rt(e.x,e.y,e.width?Math.min(e.width,t.width):t.width,e.height?Math.min(e.height,t.height):t.height)},no=e=>{if(Ci(e))return tt(e);if(yi(e))return it(e);const t=io(e);return t.width=Math.max(10,e.width||t.width),t},ro=(e,t=0,o=(()=>!0))=>[...Q].reverse().filter(o).map((e=>({shape:e,priority:1}))).filter((o=>{const{shape:i}=o,n=Ki(si(i),le),r=t+(n.strokeWidth||0);if(fi(n))return St(e,r,n,i.rotation);if(mi(n)){const t=no(n),a=St(e,r,t,i.rotation);let s=!1;if(a&&!Si(i)){const a=io(n);"right"!==i.textAlign||i.flipX||(a.x=t.x+t.width-a.width),"center"===i.textAlign&&(a.x=t.x+.5*t.width-.5*a.width),s=St(e,r,a,i.rotation,at(t)),s||(o.priority=-1)}return a}return yi(n)?((e,t,o,i,n,r)=>{const a=Lt(ue(o.x,o.y),o.rx,o.ry,i,n,r,12);return bt(e,t,a)})(e,r,n,i.rotation,i.flipX,i.flipY):bi(n)?ft(e,Math.max(16,r),hi(n),pi(n)):xi(n)&&n.pathClose?bt(e,r,n.points):!!xi(n)&&yt(e,Math.max(16,r),n.points)})).sort(((e,t)=>e.priority<t.priority?1:e.priority>t.priority?-1:0)).map((e=>e.shape)),ao=(e,t,o,i=0)=>{const n=Math.abs(i),r=Xe(t,o),a=Ye(r,n),s=(({start:e,end:t},o)=>{if(0===o)return[ue(e.x,e.y),ue(e.x,e.y),ue(t.x,t.y),ue(t.x,t.y)];const i=Math.atan2(t.y-e.y,t.x-e.x),n=Math.sin(i)*o,r=Math.cos(i)*o;return[ue(n+e.x,-r+e.y),ue(-n+e.x,r+e.y),ue(-n+t.x,r+t.y),ue(n+t.x,-r+t.y)]})(a,n);return e.filter((e=>{const t=Ki(si(e),le);if(bi(t)||xi(t)){const e=t.points?[...t.points]:[hi(t),pi(t)];return!!Rt(a,e)}return((e,t)=>!!e.find((e=>It(e,t)))||!!t.find((t=>It(t,e))))(s,((e,t=12)=>{if(fi(e))return $t(e,e.rotation,at(e));if(mi(e)){const t=no(e);return $t(t,e.rotation,at(t))}return yi(e)?Lt(ue(e.x,e.y),e.rx,e.ry,e.rotation,e.flipX,e.flipY,t):[]})(t))}))};let so=void 0,lo=void 0,co=void 0,uo=void 0,ho=void 0,po=void 0,mo=!1,go=!1;const $o=()=>{clearTimeout(lo),lo=void 0,o(118,go=!1)},fo=e=>{if(fi(e)){if(e.width<1&&e.height<1)return;const t=at(e),o=wt(e);return(e.flipX||e.flipY)&&Ee(o,e.flipX,e.flipY,t.x,t.y),Le(o,e.rotation,t.x,t.y)}if(yi(e)){if(e.rx<1&&e.ry<1)return;const t=e,o=wt(it(e));return(e.flipX||e.flipY)&&Ee(o,e.flipX,e.flipY,t.x,t.y),Le(o,e.rotation,t.x,t.y)}if(bi(e))return[hi(e),pi(e)];if(xi(e))return[...e.points];if(mi(e)){if(e.width<5&&e.height<5)return;const t=no(e);t.width=Math.max(10,t.width);const o=at(t),i=wt(t);return(e.flipX||e.flipY)&&Ee(i,e.flipX,e.flipY,o.x,o.y),Le(i,e.rotation,o.x,o.y)}return[]},yo=e=>{const t=fo(e);let o,i;return e.flipY?(o=Ae([t[0],t[1]]),i=ye(ue(t[1].x-t[2].x,t[1].y-t[2].y))):(o=Ae([t[2],t[3]]),i=ye(ue(t[2].x-t[1].x,t[2].y-t[1].y))),Me(i,20/ne),{origin:o,dir:i}},bo=()=>{const e=K.filter((e=>e.id!==wf));e.length!==K.length&&o(54,K=e)};let xo;const vo="markup-manipulator-segment-"+q,wo=()=>{o(54,K=K.filter((e=>e.id!==vo)))},So=e=>e.isContentEditable||/input|textarea/i.test(e.nodeName);let ko;const Mo=e=>{o(7,ko.innerHTML=(e=>e.replace(/ {2,}/g," ").replace(/&/g,"&amp;").replace(/\u00a0/g,"&nbsp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").split("\n").join("<br>"))(e),ko)},Co=e=>{let t;var o;void 0===e.value?(o=e.innerHTML,t=af(o).split("<br>").join("\n").replace(/&nbsp;/g,String.fromCharCode(160)).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">")):t=e.value;return gi(i)&&!1!==i.disableNewline?(e=>{const t=e.split(/[\n\r]/g);return t.length>1?t.map((e=>e.trim())).filter((e=>e.length)).join(" "):t[0]})(t):t},To=()=>{const e=Co(ko),t=zi(i,e),o=!0===t?e:t;let n=M.x,r=M.y;if(!i.height){const e=$t({...T},i.rotation),t=Yo(o,l),a=$t({x:n,y:r,...t},i.rotation),[s,,c]=e,[d,,u]=a;let h=s,p=d;i.flipX&&(h=c,p=u);const m=Se(me(h),p);n+=m.x,r+=m.y}Nt(i,{x:P(k.x)?Bo(n,le.width):n,y:P(k.y)?Bo(r,le.height):r,text:o})},Po=()=>{let e=r;r&&Bt(),ko&&ko.confirm&&ko.confirm(),To(),to(i),e?Be(i):Oe(i)},Io=()=>{r?Ot():(Nt(i,{text:k.text,x:k.x,y:k.y}),to(i))},Ao=(e,t,{flipX:o,flipY:i,rotation:n},r="top left")=>{let a,s;const[l,c,d,u]=$t(e,n),[h,p,m,g]=$t(t,n);if("top center"===r){a=Ae(i?[u,d]:[l,c]),s=Ae(i?[g,m]:[h,p])}else"top right"===r&&!o||"top left"===r&&o?(a=i?d:c,s=i?m:p):(a=i?u:l,s=i?g:h);return Se(me(a),s)},Eo=(e,t,o)=>ue(P(e.x)?Bo(t.x+o.x,le.width):t.x+o.x,P(e.y)?Bo(t.y+o.y,le.height):t.y+o.y),Lo={},Fo=()=>eo(i),zo=()=>{const e=Ze(Yo(i.text,l),(e=>Math.ceil(e))),t=Ro(i,"height"),o=!t&&Ro(i,"width"),n=i.id;let r=Lo[n];r||(Lo[n]={},r=Lo[n]);const a=e=>{const{width:t,...o}=l,n=Yo(i.text,o),r=Ao(rt(l.x,l.y,e.width,e.height),rt(l.x,l.y,n.width,n.height),l,"top "+i.textAlign),a=!1!==l.disableNewline;Vt(i,["width","height",a&&"textAlign"]),Nt(i,{...Eo(i,l,r)})},s=t=>{const o=We(r.width||l.width||e.width,e.height),n=r.textAlign||"left",a=Ao(rt(l.x,l.y,t.width,t.height),rt(l.x,l.y,o.width,o.height),l,"top "+n);Vt(i,["height"]),Nt(i,{...Eo(i,l,a),width:P(i.width)?Bo(o.width,le.width):o.width,textAlign:n})},c=t=>{const o=We(r.width||e.width,r.height||e.height),n=r.textAlign||"left",a=Ao(rt(l.x,l.y,t.width,t.height),rt(l.x,l.y,o.width,o.height),l,"top "+n);Nt(i,{...Eo(i,l,a),width:P(i.width)?Bo(o.width,le.width):o.width,height:P(i.width)?Bo(o.height,le.height):o.height,textAlign:n})};if(t){r.textAlign=i.textAlign,r.width=l.width,r.height=l.height;const e=We(l.width,l.height);Di(i,"auto-height")?s(e):Di(i,"auto-width")&&a(e)}else if(o){r.textAlign=i.textAlign,r.width=l.width;const t=We(l.width,e.height);Di(i,"auto-width")?a(t):Di(i,"fixed-size")&&c(t)}else{r.textAlign=i.textAlign;const t=We(Math.ceil(e.width),Math.ceil(e.height));Di(i,"fixed-size")?c(t):Di(i,"auto-height")&&s(t)}},Do=e=>{e.stopPropagation();const t=i.flipX||!1;Ht(i,"flipX",!t),Oe(i)},_o=e=>{e.stopPropagation();const t=i.flipY||!1;Ht(i,"flipY",!t),Oe(i)},Wo=e=>{Ht(i,"opacity",e)},Vo=e=>{Wo(e),Oe(i)},No=e=>{e.stopPropagation(),e.target.blur(),Gt()},Ho=e=>{e.stopPropagation();Q.findIndex((e=>e===i))!==Q.length-1&&(o(0,Q=Q.filter((e=>e!==i)).concat([i])),Oe(i))},jo=e=>{e.stopPropagation(),Uo()},Uo=()=>{const e=si(i);e.id=L();const t=ue(50,-50);if(Ro(e,"points")){const o=en(e,["points"],le);o.points.forEach((e=>{e.x+=t.x,e.y+=t.y})),tn(e,o,le)}else if(bi(e)){const o=en(e,["x1","y1","x2","y2"],le);o.x1+=t.x,o.y1+=t.y,o.x2+=t.x,o.y2+=t.y,tn(e,o,le)}else{const t=en(e,["x","y"],le);t.x+=50,t.y-=50,tn(e,t,le)}Q.push(e),Be(e),Jt(e)},Zo=Fl(0,{stiffness:.2,damping:.7});let Xo;_n(e,Zo,(e=>o(16,X=e)));const Go=(e,t)=>{const{disableTextLayout:o=[]}=t;return"height"in t?o.includes("auto-height")?e.shapeIconButtonTextLayoutAutoWidth:e.shapeIconButtonTextLayoutAutoHeight:"width"in t?o.includes("auto-width")?e.shapeIconButtonTextLayoutFixedSize:e.shapeIconButtonTextLayoutAutoWidth:o.includes("fixed-size")?e.shapeIconButtonTextLayoutAutoHeight:e.shapeIconButtonTextLayoutFixedSize},qo=(e,t)=>{const{disableTextLayout:o=[]}=t;return"height"in t?o.includes("auto-height")?e.shapeTitleButtonTextLayoutAutoWidth:e.shapeTitleButtonTextLayoutAutoHeight:"width"in t?o.includes("auto-width")?e.shapeTitleButtonTextLayoutFixedSize:e.shapeTitleButtonTextLayoutAutoWidth:o.includes("fixed-size")?e.shapeTitleButtonTextLayoutAutoHeight:e.shapeTitleButtonTextLayoutFixedSize};let Ko=!1;let Jo=de(),Qo=void 0;const ei=e=>{He(e),o(119,xo=e)};let ti;Ir((()=>{wo(),bo()}));return e.$$set=e=>{"uid"in e&&o(55,q=e.uid),"ui"in e&&o(54,K=e.ui),"disabled"in e&&o(1,J=e.disabled),"markup"in e&&o(0,Q=e.markup),"offset"in e&&o(2,ee=e.offset),"contextRotation"in e&&o(56,te=e.contextRotation),"contextFlipX"in e&&o(57,oe=e.contextFlipX),"contextFlipY"in e&&o(58,ie=e.contextFlipY),"contextZoom"in e&&o(59,ne=e.contextZoom),"active"in e&&o(60,re=e.active),"opacity"in e&&o(61,ae=e.opacity),"parentRect"in e&&o(62,le=e.parentRect),"rootRect"in e&&o(3,he=e.rootRect),"utilRect"in e&&o(63,pe=e.utilRect),"hoverColor"in e&&o(64,ge=e.hoverColor),"textInputMode"in e&&o(4,fe=e.textInputMode),"oninteractionstart"in e&&o(65,ke=e.oninteractionstart),"oninteractionupdate"in e&&o(66,Te=e.oninteractionupdate),"oninteractionrelease"in e&&o(67,Ie=e.oninteractionrelease),"oninteractionend"in e&&o(68,Fe=e.oninteractionend),"oninteractioncancel"in e&&o(69,ze=e.oninteractioncancel),"onaddshape"in e&&o(70,Be=e.onaddshape),"onupdateshape"in e&&o(71,Oe=e.onupdateshape),"onselectshape"in e&&o(72,_e=e.onselectshape),"onremoveshape"in e&&o(73,Ve=e.onremoveshape),"ontapshape"in e&&o(74,Ne=e.ontapshape),"onhovershape"in e&&o(75,He=e.onhovershape),"onhovercanvas"in e&&o(76,je=e.onhovercanvas),"ontapcanvas"in e&&o(77,Ue=e.ontapcanvas),"beforeSelectShape"in e&&o(78,Ge=e.beforeSelectShape),"beforeDeselectShape"in e&&o(79,qe=e.beforeDeselectShape),"beforeRemoveShape"in e&&o(80,Ke=e.beforeRemoveShape),"beforeUpdateShape"in e&&o(81,Je=e.beforeUpdateShape),"willRenderShapeControls"in e&&o(82,Qe=e.willRenderShapeControls),"willStartInteraction"in e&&o(83,et=e.willStartInteraction),"mapEditorPointToImagePoint"in e&&o(84,nt=e.mapEditorPointToImagePoint),"mapImagePointToEditorPoint"in e&&o(85,st=e.mapImagePointToEditorPoint),"eraseRadius"in e&&o(86,lt=e.eraseRadius),"selectRadius"in e&&o(87,ct=e.selectRadius),"enableButtonFlipVertical"in e&&o(88,dt=e.enableButtonFlipVertical),"enableTapToAddText"in e&&o(89,ut=e.enableTapToAddText),"locale"in e&&o(5,ht=e.locale)},e.$$.update=()=>{var t,a;3&e.$$.dirty[0]&&o(123,i=!J&&Q&&(Ft()||Ut())),1073741824&e.$$.dirty[3]&&o(142,n=!!i),1073741824&e.$$.dirty[3]&&o(134,r=i&&Mi(i)),1073741824&e.$$.dirty[3]|1024&e.$$.dirty[4]&&o(9,s=i&&!r?i.id:void 0),8&e.$$.dirty[0]|1&e.$$.dirty[2]|1073741824&e.$$.dirty[3]&&o(12,l=he&&i&&Ki(si(i),le)),1073741824&e.$$.dirty[3]|1024&e.$$.dirty[4]&&o(121,c=!(!i||!r)),4096&e.$$.dirty[0]|1073741824&e.$$.dirty[1]|1073741824&e.$$.dirty[3]&&o(141,d=i&&ae&&fo(l)||[]),1073741824&e.$$.dirty[3]&&o(143,u=i&&(Bi(t=i)&&Oi(t)&&!0!==t.disableResize&&(Ci(t)||$i(t)||yi(t)||bi(t)||xi(t)&&Ro(t,"pathClose")))&&!vi(i)),1073741824&e.$$.dirty[3]&&o(13,h=i&&(e=>Bi(e)&&!0!==e.disableRotate&&(Ci(e)||Ro(e,"text")||yi(e)))(i)&&!vi(i)),1073741824&e.$$.dirty[3]|524288&e.$$.dirty[4]&&o(15,p=u&&Ro(i,"text")&&!i.height?[[1,2],[3,0]]:(!i||!bi(i)&&!xi(i))&&u),32768&e.$$.dirty[0]|1073741824&e.$$.dirty[3]|524288&e.$$.dirty[4]&&o(27,m=!!i&&(!Array.isArray(p)&&u)),1073741824&e.$$.dirty[3]|131072&e.$$.dirty[4]&&o(14,g=i&&d.length>1),8388608&e.$$.dirty[2]|131072&e.$$.dirty[4]&&o(139,$=d.map(st)),4&e.$$.dirty[0]|32768&e.$$.dirty[4]&&o(10,f=$.map((e=>ue(e.x-ee.x,e.y-ee.y)))),1073741824&e.$$.dirty[3]|262144&e.$$.dirty[4]&&o(26,y=n&&($i(i)?!Ro(i,"disableNewline")||!i.disableNewline:!1===i.disableNewline)),8388608&e.$$.dirty[2]|67108864&e.$$.dirty[3]&&(xo&&st&&!Si(xo)&&Ei(xo)?(e=>{const t=fo(Ki(si(e),le));if(!t)return;const i=t.map(st),n=!!e.pathClose||!xi(e)&&!bi(e),r={id:wf,points:i.map((e=>ue(e.x+1,e.y+1))),strokeColor:[0,0,0,.1],strokeWidth:2,pathClose:n},a={id:wf,points:i,strokeColor:ge,strokeWidth:2,pathClose:n},s=K.filter((e=>e.id!==wf));o(54,K=[...s,r,a])})(xo):bo()),29696&e.$$.dirty[0]|1073741824&e.$$.dirty[1]&&o(140,b=g&&h&&ae&&f&&(e=>{const t=yo(e),o=st({x:t.origin.x+t.dir.x,y:t.origin.y+t.dir.y});return{origin:st(t.origin),position:o}})(l)),4&e.$$.dirty[0]|65536&e.$$.dirty[4]&&o(25,x=b&&ue(b.position.x-ee.x,b.position.y-ee.y)),1207959552&e.$$.dirty[3]|1024&e.$$.dirty[4]&&o(138,v=r&&xi(i)&&Qo),1073741824&e.$$.dirty[1]|1073741824&e.$$.dirty[3]|49152&e.$$.dirty[4]&&i&&$&&ae>0&&((e,t,i)=>{const n=xi(t),r=n&&Ro(t,"pathClose"),a=r&&(e=>e.strokeWidth&&((e,t)=>{const o=e.strokeColor;return!!o&&(3===o.length||o[3]>0)})(e))(t),s=Mi(t),l=vi(t);if(s&&n&&!r)return;const c=[],u=[...$],h=u[u.length-1],p=u[0],m=(l?.05:.1)*e,g=(l?.5:1)*e,f=[0,0,0],y=[1,1,1],x=l?1:1.5;Y.includes(16)&&h&&i&&gt(h,i);const v=u.length&&r&&s&&i?Pe(p,i):1/0,w=u.length&&r&&s&&i?Pe(h,i):1/0,S=v<=vf,k=w<=vf;!S&&i&&u.push(i);const M=u.length>1,C=!!t.pathClose||!xi(t)&&!bi(t)||u.length>2&&S;M&&c.push({id:vo,points:u.map((e=>ue(e.x+1,e.y+1))),pathClose:C,strokeColor:f,strokeWidth:2,opacity:m}),r&&c.push(...u.map((e=>({id:vo,...e,rx:2*x,ry:2*x,backgroundColor:f,opacity:m})))),b&&c.push({id:vo,points:[ue(b.origin.x+1,b.origin.y+1),ue(b.position.x+1,b.position.y+1)],strokeColor:f,strokeWidth:2,opacity:m}),M&&c.push({id:vo,points:u,pathClose:C,strokeColor:y,strokeWidth:x,backgroundColor:s&&t.backgroundColor&&t.backgroundColor[3]>0?t.backgroundColor:[0,0,0,0],opacity:g}),r&&c.push(...u.map((e=>({id:vo,...e,rx:3*x,ry:3*x,backgroundColor:[.5,.5,.5],strokeWidth:x,strokeColor:y})))),r&&s&&$.length>=3&&c.push({...p,id:vo,rx:x*(S?5:4),ry:x*(S?5:4),backgroundColor:S?ge:[.5,.5,.5],strokeWidth:x,strokeColor:y}),r&&s&&a&&!S&&d.length>=2&&c.push({...h,id:vo,rx:x*(k?5:4),ry:x*(k?5:4),backgroundColor:k?ge:[.5,.5,.5],strokeWidth:x,strokeColor:y}),b&&c.push({id:vo,points:[{x:b.origin.x,y:b.origin.y},{x:b.position.x,y:b.position.y}],strokeColor:y,strokeWidth:x,opacity:g}),o(54,K=K.filter((e=>e.id!==vo)).concat(c))})(ae,i,v),1073741824&e.$$.dirty[3]&&(i||wo()),536870912&e.$$.dirty[1]&&(e=>{if(!e)return jt({_prerender:!1});const t=Q.find((e=>e.isEditing));t&&Nt(t,{_prerender:"inline"===fe})})(re),144&e.$$.dirty[0]&&ko&&"inline"===fe&&ko.focus(),1073741824&e.$$.dirty[3]&&o(137,w=i&&mi(i)),1073741824&e.$$.dirty[3]|8192&e.$$.dirty[4]&&o(11,S=w&&!1!==zi(i)&&vi(i)),2048&e.$$.dirty[0]&&o(133,k=S?{...i}:void 0),1&e.$$.dirty[2]|512&e.$$.dirty[4]&&o(135,M=k&&Ki({...k},le)),2048&e.$$.dirty[4]&&o(136,C=M&&Yo(M.text,M)),6144&e.$$.dirty[4]&&(T=M&&rt(M.x,M.y,C.width,C.height)),2048&e.$$.dirty[0]|1073741824&e.$$.dirty[3]&&o(22,R=S?i.text:""),6160&e.$$.dirty[0]&&o(24,I=S&&((e,t)=>{const{textAlign:o="left",fontFamily:i="sans-serif",fontWeight:n="normal",fontStyle:r="normal"}=e,a=e.fontSize,s="!important",l=`text-align:${o}${s};font-family:${i}${s};font-weight:${n}${s};font-style:${r}${s};`;if("modal"===t)return l;const c=Oo(e.color),d=e.lineHeight,u=.5*Math.max(0,a-d);return`--bottom-inset:${u}px;padding:${u}px 0 0${s};color:${c}${s};font-size:${a}px${s};line-height:${d}px${s};${l}`})(l,fe)),6148&e.$$.dirty[0]|301989888&e.$$.dirty[1]&&o(23,A=S&&((e,t,o,n)=>{let r,a;e.width&&e.height?(r=at(e),a=De(e)):(a=Yo(i.text,l),a.width=l.width||a.width,r=ue(e.x+.5*a.width,e.y+.5*a.height));const s=Math.max(0,e.fontSize-e.lineHeight)+e.lineHeight,c=st(r);let d=c.x-t.x-.5*a.width,u=c.y-t.y-.5*a.height,h=e.flipX,p=e.flipY,m=e.rotation;oe&&ie?(h=!h,p=!p):oe?(h=!h,m=-m):ie&&(p=!p,m=-m),m+=n;const g=o*(h?-1:1),$=o*(p?-1:1);return`--line-height:${s}px;width:${a.width}px;height:${a.height}px;transform:translate(${d}px,${u}px) rotate(${m}rad) scale(${g}, ${$})`})(l,ee,ne,te)),2192&e.$$.dirty[0]&&S&&ko&&"inline"===fe&&Mo(R),1342177280&e.$$.dirty[3]|8&e.$$.dirty[4]&&o(127,E=i&&!c?i:E),8&e.$$.dirty[4]&&o(129,F=E&&Fi(E)),8&e.$$.dirty[4]&&o(124,z=E&&Di(E)),8&e.$$.dirty[4]&&o(126,D=E&&(e=>!0!==e.disableDuplicate&&Oi(e))(E)),8&e.$$.dirty[4]&&o(125,B=E&&Li(E)),8&e.$$.dirty[4]&&o(128,O=E&&(e=>!0!==e.disableReorder)(E)),8&e.$$.dirty[4]&&o(122,_=E&&!1!==zi(E)),8&e.$$.dirty[4]&&o(130,W=E&&Ro(E,"backgroundImage")&&Ai(E,"opacity")),2048&e.$$.dirty[0]|1375731712&e.$$.dirty[3]|1048576&e.$$.dirty[4]&&Zo.set(!i||c||go||S?0:1,{hard:!1===G}),1024&e.$$.dirty[0]|1342177280&e.$$.dirty[3]|256&e.$$.dirty[4]&&o(132,V=i&&!c&&f.length?(a=ot(f),ve(ue(a.x+.5*a.width,a.y),kd)):V),256&e.$$.dirty[0]|2&e.$$.dirty[2]|256&e.$$.dirty[4]&&o(131,N=V&&Xo&&pe&&(e=>{const t=pe.x,o=pe.y,i=t+pe.width;let n=Math.max(e.x-.5*Xo.width,t),r=Math.max(e.y-Xo.height-16,o);return n+Xo.width>i&&(n=i-Xo.width),ue(n,r)})(V)),65536&e.$$.dirty[0]|128&e.$$.dirty[4]&&o(21,H=N&&`transform: translate(${N.x}px, ${N.y}px);opacity:${X}`),545&e.$$.dirty[0]|68157440&e.$$.dirty[2]|1610612736&e.$$.dirty[3]|127&e.$$.dirty[4]&&o(20,j=s&&Qe&&xh((()=>Qe([W&&["div","alpha",{class:"PinturaShapeControlsGroup"},[["Slider","adjust-opacity",{onrelease:Vo,onchange:Wo,step:.01,value:Ro(i,"opacity")?i.opacity:1,label:(e,t,o)=>Math.round(e/o*100)+"%",min:0,max:1,direction:"x"}]]],["div","beta",{class:"PinturaShapeControlsGroup"},[F&&["Button","flip-horizontal",{onclick:Do,label:ht.shapeTitleButtonFlipHorizontal,icon:ht.shapeIconButtonFlipHorizontal,hideLabel:!0}],F&&dt&&["Button","flip-vertical",{onclick:_o,label:ht.shapeTitleButtonFlipVertical,icon:ht.shapeIconButtonFlipVertical,hideLabel:!0}],O&&["Button","to-front",{onclick:Ho,label:ht.shapeTitleButtonMoveToFront,icon:ht.shapeIconButtonMoveToFront,hideLabel:!0,disabled:Q[Q.length-1]===E}],D&&["Button","duplicate",{onclick:jo,label:ht.shapeTitleButtonDuplicate,icon:ht.shapeIconButtonDuplicate,hideLabel:!0}],B&&["Button","remove",{onclick:No,label:ht.shapeTitleButtonRemove,icon:ht.shapeIconButtonRemove,hideLabel:!0}]].filter(Boolean)],_&&z&&["div","gamma",{class:"PinturaShapeControlsGroup"},[["Button","text-layout",{onclick:zo,label:jd(qo,ht,i),icon:jd(Go,ht,i),hideLabel:!0}]]],_&&["div","delta",{class:"PinturaShapeControlsGroup"},[["Button","edit-text",{label:ht.shapeLabelInputText,onclick:Fo}]]]].filter(Boolean),s)))),33&e.$$.dirty[0]&&o(19,U=Q.filter(Ei).filter((e=>!Mi(e))).map((e=>({id:e.id,color:mi(e)?e.color:bi(e)?e.strokeColor:e.backgroundColor,name:e.name||ht["shapeLabelTool"+Ia(Zi(e))]}))))},[Q,J,ee,he,fe,ht,Jt,ko,Xo,s,f,S,l,h,g,p,X,Ko,ti,U,j,H,R,A,I,x,y,m,pt,kt,e=>{const{origin:t}=e.detail;uo=void 0,ho=void 0,po=void 0,mo=!1,co=void 0,clearTimeout(lo),lo=setTimeout((()=>o(118,go=!0)),250);const n=Ft();!n||xi(n)&&Ro(n,"pathClose")||Bt(),so=nt(me(t));const r=ro(so,ct,(e=>Ei(e))),a=r.length&&r.shift();if(i&&vi(i)&&Po(),!a&&i&&vi(i)&&Qt(i),!et(t))return;if(a&&Si(a))return mo=!0,uo=a,ho=si(uo),void(po=Ki(si(uo),le));co=a||void 0;!ke(e)&&a&&(Jt(a),uo=a,ho=si(uo),po=Ki(si(uo),le))},e=>{$o(),ze(e)},e=>{const{translation:t}=e.detail;if(uo){if(!Oi(uo))return;if(vi(uo))return;return Tt(uo,po,t)}Te(e)},e=>{$o(),uo?vi(uo)?Io():e.detail.isTap&&mo&&mi(uo)&&!1!==zi(uo)&&eo(uo):Ie(e)},e=>{const t=co&&e.detail.isTap;if(e.detail.isTap&&Ue({target:uo||co,position:so}),uo)return Ne(uo),o=uo,i=ho,JSON.stringify(o)!==JSON.stringify(i)&&Oe(uo),void(uo=void 0);var o,i;const n=Kt(),r=!n||qe(n,co||void 0);r&&qt({storePrevious:!1}),Fe(e),r&&t&&Jt(co)},e=>{o(118,go=!0),uo=i,po=l},e=>{if(!uo)return void o(118,go=!1);const{translation:t,indexes:i,shiftKey:n}=e.detail;((e,t,o,i,n)=>{if(bi(e)||xi(e)&&Ro(e,"pathClose")){const[n]=o,r=Y.includes(16)?gt:(e,t)=>t;let a,s,l;if(bi(e))0===n?(a=()=>hi(t),s=e=>r(pi(t),e),l=(e,t)=>{e.x1=t.x,e.y1=t.y}):1===n&&(a=()=>pi(t),s=e=>r(hi(t),e),l=(e,t)=>{e.x2=t.x,e.y2=t.y});else{const e=t.points;a=()=>e[n],s=t=>{const o=e[j$(n-1,e)],i=e[j$(n+1,e)];r(o,t),r(i,t)},l=(e,t)=>e.points[n]=t}const c=Ct(a(),i);s(c),l(e,c)}else if(Ci(e)||yi(e)||$i(e)){let r,a,s=!1;if(yi(e))r=it(t);else if(Ci(e))r=tt(t);else{s=!0,r=tt(t);const e=Yo(t.text,t);r.height=e.height}e.aspectRatio?a=e.aspectRatio:n.shiftKey&&!s&&(a=r.width/r.height);const l=tt(r),c=at(l),d=e.rotation,u=wt(l),h=$t(l,d);if(1===o.length){let t=o[0];e.flipX&&(t=Pt[t]),e.flipY&&(t=At[t]);const[n,r,s,l]=u,p=st(h[t]);we(p,i);const m=nt(p),g=ue(m.x-h[t].x,m.y-h[t].y),$=$e(me(g),-d),f=ue(u[t].x+$.x,u[t].y+$.y);let y;0===t&&(y=s),1===t&&(y=l),2===t&&(y=n),3===t&&(y=r);const b=ot([y,f]);if(a){const{width:e,height:t}=xt(b,a),[o,i,n,r]=vt(b);b.width=e,b.height=t,f.y<y.y&&(b.y=n-t),f.x<y.x&&(b.x=i-e)}const x=$t(b,d,c),v=Ae(x),w=$e(x[0],-d,v),S=$e(x[2],-d,v),k=ot([w,S]);mt(e,yi(e)?ce(k):k,le)}else{o=o.map((t=>(e.flipX&&(t=Pt[t]),e.flipY&&(t=At[t]),t)));const[t,n]=o.map((e=>h[e])),r={x:t.x+.5*(n.x-t.x),y:t.y+.5*(n.y-t.y)},[l,p]=o.map((e=>u[e])),[m,g]=o.map((e=>{const t=e+2;return t<4?u[t]:u[t-4]})),$={x:m.x+.5*(g.x-m.x),y:m.y+.5*(g.y-m.y)},f=st(r);we(f,i);const y=nt(f),b=ue(y.x-r.x,y.y-r.y),x=$e(me(b),-d),v=Se(me(l),p),w=ve(v,(e=>1-Math.abs(Math.sign(e)))),S=ue(x.x*w.x,x.y*w.y);we(l,S),we(p,S);const k=ot(u);if(a){let e=k.width,t=k.height;0===w.y?t=e/a:e=t*a,k.width=e,k.height=t,0===w.y?k.y=$.y-.5*t:k.x=$.x-.5*e}const M=$t(k,d,c),C=Ae(M),T=$e(M[0],-d,C),P=$e(M[2],-d,C),R=ot([T,P]);let I;yi(e)?I=ce(R):Ci(e)?I=R:s&&(I={x:R.x,y:R.y,width:R.width}),mt(e,I,le)}}_t()})(uo,po,i,t,{shiftKey:n})},e=>{if(!uo)return void o(118,go=!1);Jt(uo);const{isTap:t}=e.detail;t&&Ne(uo),uo=void 0,o(118,go=!1),Oe(i)},e=>{Et=yo(l).origin,o(118,go=!0),uo=i,po=l},e=>{if(!uo)return void o(118,go=!1);const{translation:t,shiftKey:i}=e.detail;((e,t,o,i)=>{const n=no(Ki(si(e),le)),r=at(n),a=Ct(Et,o);let s=be(a,r)+Math.PI/2;if(i.shiftKey){const e=Math.PI/16;s=e*Math.round(s/e)-te%e}mt(e,{rotation:s},le),_t()})(uo,0,t,{shiftKey:i})},()=>{uo?(Jt(uo),uo=void 0,o(118,go=!1),Oe(i)):o(118,go=!1)},e=>{const{key:t}=e,o=/escape/i.test(t);if(Zt()){if(o)return e.preventDefault(),e.stopPropagation(),Qt(i);/backspace|delete/i.test(t)&&!So(e.target)&&(e.preventDefault(),Gt()),D&&"d"===t&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),Uo())}},e=>{const t=zi(i,e);return!0===t?e:t},To,e=>{const{target:t,key:o}=e,n=t.value||t.innerText,r=t.selectionStart||0,a=t.selectionEnd||n.length,s=n.substring(0,r)+o+n.substring(a);if(zi(i,s)!==s)return e.preventDefault()},e=>gi(i)&&/enter/i.test(e.code)&&!1!==i.disableNewline?e.preventDefault():/arrow/i.test(e.code)?e.stopPropagation():/escape/i.test(e.key)?Io():void 0,e=>{const{key:t,ctrlKey:o,altKey:i}=e;if(/enter/i.test(t)&&(o||i))return Po()},Po,Io,Zo,e=>{const t=Ut();t&&(vi(t)||Oi(t)&&(uo=t,po=Ki(si(uo),le),Tt(uo,po,e.detail)))},e=>{o(17,Ko=!0)},({relatedTarget:e})=>{e&&e.classList.contains("shape-selector__button")||o(17,Ko=!1)},e=>{if("touch"===e.pointerType)return;(go||lo)&&ei(void 0);const t=J$(e,he),i=ve(nt(t),(e=>Math.round(e)));if(xe(i,Jo))return;if(Jo=me(i),o(120,Qo=t),go||lo)return;if(je(t,i),c)return;const[n]=ro(i,0,Ei);n&&Mi(n)||ei(n)},K,q,te,oe,ie,ne,re,ae,le,pe,ge,ke,Te,Ie,Fe,ze,Be,Oe,_e,Ve,Ne,He,je,Ue,Ge,qe,Ke,Je,Qe,et,nt,st,lt,ct,dt,ut,(e,t={})=>{let o,i,n,r=yi(e),a=mi(e),s="relative"===t.position;const l="step"===t.inputMode;if(xi(e)){if(l){let t=!1;const r=(e,o)=>{const i=Ft(),n=e&&ue(df(e.x,le.width),df(e.y,le.height)),r=n&&st(n);Y.includes(16)&&r&&gt(r,o);const a=nt(o),l=i.points.length?i.points[0]:a,c=ue(df(l.x,le.width),df(l.y,le.height)),d=st(c),u=Pe(d,o);if(!t&&1===i.points.length&&u<36)return Ot();if(i.points.length>2&&u<=vf){i.pathClose=!0,Jt(i);const e=Bt();return void Be(e)}const h=i.strokeWidth&&i.strokeColor&&(void 0===i.strokeColor[3]||i.strokeColor[3]>0),p=Pe(r,o);if(h&&i.points.length>1&&p<vf){i.pathClose=!1,i.backgroundColor=[0,0,0,0],Jt(i);const e=Bt();Be(e)}else if(!(i.points.length>0&&p<100))return s?uf(a,le):a};return{start:e=>{const{origin:a}=e.detail;i=4,o=me(a),n=me(a);const s=Ft();if(s){const e=s.points[s.points.length-1],t=r(e,o);return t&&(s.points=[...s.points,t]),_t()}t=!0},update:e=>{if(!t)return;const i=Ft();if(!i)return;const n=i.points[0],a=r(n,ue(o.x+e.detail.translation.x,o.y+e.detail.translation.y));a&&(i.points[1]=a,_t())},release:e=>e.detail.preventInertia(),cancel:e=>Ot(),end:i=>{if(!t)return;const n=nt(o),r=s?uf(n,le):n,{isTap:a}=i.detail;if(a){if(ro(n,0,Ei).length)return Ot()}Dt({...e,points:[r]})}}}return{start:t=>{const{origin:r}=t.detail;i=4,o=me(r),n=me(r);const a=nt(r),l=s?uf(a,le):a;Dt({...e,points:[l]})},update:e=>{const t=Ft(),{translation:r}=e.detail,a=ue(o.x+r.x,o.y+r.y),l=Re(n,a);if(se(l,5)<=i)return;const c=be(a,n),d=i-l;n.x+=d*Math.cos(c),n.y+=d*Math.sin(c);const u=nt(n),h=s?uf(u,le):u;t.points=t.points.concat(h),_t()},release:e=>e.detail.preventInertia(),cancel:()=>{Ot()},end:e=>{if(e.detail.isTap)return Ot();const t=Bt();Be(t)}}}return r||a||fi(e)?{start:t=>{const{origin:i}=t.detail;o=me(i);const n=nt(o),a=s?uf(n,le):n,l=-1*Mt(te,oe,ie),c={...e,rotation:l,...a};c.flipX=oe,c.flipY=ie,delete c.position,c.opacity=0;(r?["rx","ry"]:["width","height"]).forEach((e=>{c[e]=s?"0%":0})),Dt(c)},update:e=>{const t=Ft();t.opacity=1;const{aspectRatio:i}=t;let{translation:n}=e.detail;if(i){const e=Math.abs(n.x)*i;n.x=n.x,n.y=e*Math.sign(n.y)}const a=ue(o.x+n.x,o.y+n.y),s=nt(o),l=nt(a),c={x:s.x+.5*(l.x-s.x),y:s.y+.5*(l.y-s.y)},d=Mt(te,oe,ie);$e(s,d,c),$e(l,d,c);const u=Math.min(s.x,l.x),h=Math.min(s.y,l.y);let p=Math.max(s.x,l.x)-u,m=Math.max(s.y,l.y)-h,g={};r?(g.x=u+.5*p,g.y=h+.5*m,g.rx=.5*p,g.ry=.5*m):(g.x=u,g.y=h,g.width=p,g.height=m),mt(t,g,le),_t()},release:e=>{e.detail.preventInertia()},cancel:e=>{Ot()},end:e=>{const t=Ft();if(e.detail.isTap){if(!mi(t)||!ut||co)return Ot();delete t.width,delete t.height,!1!==t.disableNewline&&delete t.textAlign;const e=Ki({...t},le),i=Yo(t.text,e),n=nt({x:o.x,y:o.y-.5*i.height}),r=nt({x:o.x+i.width,y:o.y+.5*i.height}),a={x:n.x+.5*(r.x-n.x),y:n.y+.5*(r.y-n.y)},s=Mt(te,oe,ie);$e(n,s,a),$e(r,s,a);let l=Math.min(n.x,r.x),c=Math.min(n.y,r.y);l<0&&(l=0),c<0&&(c=0),l+i.width>le.width&&(l=le.width-i.width),c+i.height>le.height&&(c=le.height-i.height),t.x=P(t.x)?Bo(l,le.width):l,t.y=P(t.y)?Bo(c,le.height):c}if(t.opacity=1,!mi(t)){const e=Bt();Be(e)}Jt(t),mi(t)&&eo(t)}}:bi(e)?{start:t=>{const{origin:i}=t.detail,n=nt(i),r=ve(n,kd);o=me(i),Dt({...e,x1:s?Bo(r.x,le.width):r.x,y1:s?Bo(r.y,le.height):r.y,x2:s?Bo(r.x,le.width):r.x,y2:s?Bo(r.y,le.height):r.y,opacity:0})},update:e=>{const t=Ft(),{translation:i}=e.detail,n=we(me(o),i);if(Y.includes(16)){const e=Re(o,n),t=be(o,n),i=Math.PI/4,r=i*Math.round(t/i);n.x=o.x+e*Math.cos(r),n.y=o.y+e*Math.sin(r)}const r=nt(n);Nt(t,{x2:s?Bo(r.x,le.width):r.x,y2:s?Bo(r.y,le.height):r.y,opacity:1}),_t()},release:e=>e.detail.preventInertia(),cancel:e=>{Ot()},end:e=>{const t=Ft();if(e.detail.isTap)return Ot();t.opacity=1;const o=Bt();Be(o),Jt(o)}}:void 0},()=>{let e,t;const o=lt*lt,i=(e,t,i=!1)=>{const n=Pe(e,t);if(!i&&n<2)return!1;const r=Q.filter((e=>!e.disableErase));let a;a=n<o?ro(nt(t),lt):ao(r,nt(e),nt(t),lt);return oo(a).forEach(Ve),!0};return{start:o=>{e=ue(Math.round(o.detail.origin.x),Math.round(o.detail.origin.y)),i(e,e,!0),t=e},update:o=>{const{translation:n}=o.detail,r=ue(Math.round(e.x+n.x),Math.round(e.y+n.y));i(t,r)&&(t=me(r))},release:e=>e.detail.preventInertia(),end:()=>{}}},Ft,zt,Dt,Bt,Ot,(e={})=>({id:L(),...e}),_t,Wt,Vt,Nt,Ht,(e,t,o=!0)=>{Q.forEach((o=>Ht(o,e,t,!1))),o&&_t()},jt,Ut,Zt,Xt,Gt,qt,Qt,eo,to,oo,io,no,ro,ao,go,xo,Qo,c,_,i,z,B,D,E,O,F,W,N,V,k,r,M,C,w,v,$,b,d,n,u,G,function(t){Fr.call(this,e,t)},e=>Jt(Q[e]),function(e){Dr[e?"unshift":"push"]((()=>{ko=e,o(7,ko)}))},function(){R=this.value,o(22,R),o(11,S),o(123,i),o(137,w),o(1,J),o(0,Q)},function(e){Dr[e?"unshift":"push"]((()=>{ko=e,o(7,ko)}))},()=>{ti&&ti.focus()},e=>o(8,Xo=e.detail),function(e){Dr[e?"unshift":"push"]((()=>{ti=e,o(18,ti)}))},e=>J$(e,he)]}class Mf extends $a{constructor(e){super(),ga(this,e,kf,xf,Dn,{uid:55,ui:54,disabled:1,markup:0,offset:2,contextRotation:56,contextFlipX:57,contextFlipY:58,contextZoom:59,active:60,opacity:61,parentRect:62,rootRect:3,utilRect:63,hoverColor:64,textInputMode:4,oninteractionstart:65,oninteractionupdate:66,oninteractionrelease:67,oninteractionend:68,oninteractioncancel:69,onaddshape:70,onupdateshape:71,onselectshape:72,onremoveshape:73,ontapshape:74,onhovershape:75,onhovercanvas:76,ontapcanvas:77,beforeSelectShape:78,beforeDeselectShape:79,beforeRemoveShape:80,beforeUpdateShape:81,willRenderShapeControls:82,willStartInteraction:83,mapEditorPointToImagePoint:84,mapImagePointToEditorPoint:85,eraseRadius:86,selectRadius:87,enableButtonFlipVertical:88,enableTapToAddText:89,locale:5,createShape:90,eraseShape:91,getMarkupItemDraft:92,getMarkupItemDraftIndex:93,addMarkupItemDraft:94,confirmMarkupItemDraft:95,discardMarkupItemDraft:96,createMarkupItem:97,syncShapes:98,addShape:99,removeMarkupShapeProps:100,updateMarkupShape:101,updateMarkupShapeProperty:102,updateMarkupItemsShapeProperty:103,updateMarkupShapeItems:104,getActiveMarkupItem:105,hasActiveMarkupItem:106,removeShape:107,removeActiveMarkupItem:108,blurShapes:109,selectShape:6,deselectMarkupItem:110,editMarkupItem:111,finishEditMarkupItem:112,removeMarkupItems:113,getTextShapeRect:114,getMarkupShapeRect:115,getShapesNearPosition:116,getShapesBetweenPoints:117},null,[-1,-1,-1,-1,-1,-1,-1,-1])}get createShape(){return this.$$.ctx[90]}get eraseShape(){return this.$$.ctx[91]}get getMarkupItemDraft(){return this.$$.ctx[92]}get getMarkupItemDraftIndex(){return this.$$.ctx[93]}get addMarkupItemDraft(){return this.$$.ctx[94]}get confirmMarkupItemDraft(){return this.$$.ctx[95]}get discardMarkupItemDraft(){return this.$$.ctx[96]}get createMarkupItem(){return this.$$.ctx[97]}get syncShapes(){return this.$$.ctx[98]}get addShape(){return this.$$.ctx[99]}get removeMarkupShapeProps(){return this.$$.ctx[100]}get updateMarkupShape(){return this.$$.ctx[101]}get updateMarkupShapeProperty(){return this.$$.ctx[102]}get updateMarkupItemsShapeProperty(){return this.$$.ctx[103]}get updateMarkupShapeItems(){return this.$$.ctx[104]}get getActiveMarkupItem(){return this.$$.ctx[105]}get hasActiveMarkupItem(){return this.$$.ctx[106]}get removeShape(){return this.$$.ctx[107]}get removeActiveMarkupItem(){return this.$$.ctx[108]}get blurShapes(){return this.$$.ctx[109]}get selectShape(){return this.$$.ctx[6]}get deselectMarkupItem(){return this.$$.ctx[110]}get editMarkupItem(){return this.$$.ctx[111]}get finishEditMarkupItem(){return this.$$.ctx[112]}get removeMarkupItems(){return this.$$.ctx[113]}get getTextShapeRect(){return this.$$.ctx[114]}get getMarkupShapeRect(){return this.$$.ctx[115]}get getShapesNearPosition(){return this.$$.ctx[116]}get getShapesBetweenPoints(){return this.$$.ctx[117]}}function Cf(e,t,o){const i=e.slice();return i[9]=t[o],i}function Tf(e,t){let o,i,n,r,a,s,l,c=jd(t[9].componentProps.title,t[1])+"";const d=[t[9].componentProps];var u=t[9].component;function h(e){let t={};for(let e=0;e<d.length;e+=1)t=An(t,d[e]);return{props:t}}return u&&(a=xr(u,h())),{key:e,first:null,c(){o=ar("li"),i=ar("span"),n=lr(c),r=cr(),a&&ha(a.$$.fragment),s=cr(),mr(i,"class","PinturaShapeStyleLabel"),mr(o,"class","PinturaShapeStyle"),this.first=o},m(e,t){nr(e,o,t),tr(o,i),tr(i,n),tr(o,r),a&&pa(a,o,null),tr(o,s),l=!0},p(e,i){t=e,(!l||3&i)&&c!==(c=jd(t[9].componentProps.title,t[1])+"")&&$r(n,c);const r=1&i?ca(d,[da(t[9].componentProps)]):{};if(u!==(u=t[9].component)){if(a){Qr();const e=a;oa(e.$$.fragment,1,0,(()=>{ma(e,1)})),ea()}u?(a=xr(u,h()),ha(a.$$.fragment),ta(a.$$.fragment,1),pa(a,o,s)):a=null}else u&&a.$set(r)},i(e){l||(a&&ta(a.$$.fragment,e),l=!0)},o(e){a&&oa(a.$$.fragment,e),l=!1},d(e){e&&rr(o),a&&ma(a)}}}function Pf(e){let t,o,i=[],n=new Map,r=e[0];const a=e=>e[9].id;for(let t=0;t<r.length;t+=1){let o=Cf(e,r,t),s=a(o);n.set(s,i[t]=Tf(s,o))}return{c(){t=ar("ul");for(let e=0;e<i.length;e+=1)i[e].c();mr(t,"class","PinturaShapeStyleList")},m(e,n){nr(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,o){3&o&&(r=e[0],Qr(),i=la(i,o,a,1,e,r,n,t,sa,Tf,null,Cf),ea())},i(e){if(!o){for(let e=0;e<r.length;e+=1)ta(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)oa(i[e]);o=!1},d(e){e&&rr(t);for(let e=0;e<i.length;e+=1)i[e].d()}}}function Rf(e){let t,o,i;return o=new rd({props:{class:"PinturaShapeStyles",elasticity:e[2],$$slots:{default:[Pf]},$$scope:{ctx:e}}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"style",e[3])},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,[n]){const r={};4&n&&(r.elasticity=e[2]),4099&n&&(r.$$scope={dirty:n,ctx:e}),o.$set(r),(!i||8&n)&&mr(t,"style",e[3])},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function If(e,t,o){let i,n,r,{isActive:a=!1}=t,{controls:s=[]}=t,{locale:l}=t,{scrollElasticity:c}=t;const d=Lr("isAnimated");_n(e,d,(e=>o(8,r=e)));const u=Fl(0,{stiffness:.25,damping:.9});return _n(e,u,(e=>o(7,n=e))),e.$$set=e=>{"isActive"in e&&o(6,a=e.isActive),"controls"in e&&o(0,s=e.controls),"locale"in e&&o(1,l=e.locale),"scrollElasticity"in e&&o(2,c=e.scrollElasticity)},e.$$.update=()=>{320&e.$$.dirty&&u.set(a?1:0,{hard:!1===r}),192&e.$$.dirty&&o(3,i=`opacity:${n};${a?"":"pointer-events:none;"}${n<=0?"visibility:hidden":""}`)},[s,l,c,i,d,u,a,n,r]}class Af extends $a{constructor(e){super(),ga(this,e,If,Rf,Dn,{isActive:6,controls:0,locale:1,scrollElasticity:2})}}function Ef(e,t,o){const i=e.slice();return i[12]=t[o].key,i[3]=t[o].controls,i[13]=t[o].isActive,i}function Lf(e,t){let o,i,n;return i=new Af({props:{isActive:t[13],controls:t[3],locale:t[1],scrollElasticity:t[2]}}),{key:e,first:null,c(){o=dr(),ha(i.$$.fragment),this.first=o},m(e,t){nr(e,o,t),pa(i,e,t),n=!0},p(e,o){t=e;const n={};16&o&&(n.isActive=t[13]),16&o&&(n.controls=t[3]),2&o&&(n.locale=t[1]),4&o&&(n.scrollElasticity=t[2]),i.$set(n)},i(e){n||(ta(i.$$.fragment,e),n=!0)},o(e){oa(i.$$.fragment,e),n=!1},d(e){e&&rr(o),ma(i,e)}}}function Ff(e){let t,o,i,n=[],r=new Map,a=e[4];const s=e=>e[12];for(let t=0;t<a.length;t+=1){let o=Ef(e,a,t),i=s(o);r.set(i,n[t]=Lf(i,o))}return{c(){t=ar("div");for(let e=0;e<n.length;e+=1)n[e].c();mr(t,"class",o=ic(["PinturaShapeStyleEditor",e[0]]))},m(e,o){nr(e,t,o);for(let e=0;e<n.length;e+=1)n[e].m(t,null);i=!0},p(e,[l]){22&l&&(a=e[4],Qr(),n=la(n,l,s,1,e,a,r,t,sa,Lf,null,Ef),ea()),(!i||1&l&&o!==(o=ic(["PinturaShapeStyleEditor",e[0]])))&&mr(t,"class",o)},i(e){if(!i){for(let e=0;e<a.length;e+=1)ta(n[e]);i=!0}},o(e){for(let e=0;e<n.length;e+=1)oa(n[e]);i=!1},d(e){e&&rr(t);for(let e=0;e<n.length;e+=1)n[e].d()}}}function zf(e,t,o){let i,n,r,{class:a}=t,{controls:s={}}=t,{shape:l}=t,{onchange:c}=t,{locale:d}=t,{scrollElasticity:u}=t;const h=[];return e.$$set=e=>{"class"in e&&o(0,a=e.class),"controls"in e&&o(3,s=e.controls),"shape"in e&&o(5,l=e.shape),"onchange"in e&&o(6,c=e.onchange),"locale"in e&&o(1,d=e.locale),"scrollElasticity"in e&&o(2,u=e.scrollElasticity)},e.$$.update=()=>{8&e.$$.dirty&&o(8,i=Object.keys(s).filter((e=>s[e]))),288&e.$$.dirty&&o(7,n=l&&Object.keys(l).length&&i&&Ai(l)?(e=>i.filter((t=>t.split("_").every((t=>Ro(e,t)&&Ai(e,t))))).map((t=>{const o=t.split("_"),i=o.length>1?o.map((t=>e[t])):e[t];let[n,r]=s[t];if(P(n))if(s[n]){const e={...r};[n,r]=s[n],r={...r,...e}}else{if("Dropdown"!==n)return;n=Eu}const a=R(r.options)?r.options(e):r.options;return{id:t,component:n,componentProps:{...r,options:a,locale:d,value:i,optionLabelClass:"PinturaButtonLabel",onchange:i=>{const n=M(i)&&!Io(i)?i.value:i;r.onchange&&r.onchange(n,e);const a=o.length>1?o.reduce(((e,t,o)=>({...e,[t]:Array.isArray(n)?n[o]:n})),{}):{[t]:n};c(a)}}}})).filter(Boolean))(l):[]),160&e.$$.dirty&&o(4,r=((e,t)=>{let o=h.find((t=>t.key===e));return o||(o={key:e,controls:t},h.push(o)),h.forEach((e=>e.isActive=!1)),o.controls=t,o.isActive=!0,h})(l&&Object.keys(l).length?Object.keys(l).join("_"):"none",n||[]))},[a,d,u,s,r,l,c,n,i]}class Df extends $a{constructor(e){super(),ga(this,e,zf,Ff,Dn,{class:0,controls:3,shape:5,onchange:6,locale:1,scrollElasticity:2})}}const{document:Bf}=ra;function Of(e){let t,o,i,n;return{c(){t=cr(),o=ar("button"),mr(o,"class","PinturaDragButton"),mr(o,"type","button"),mr(o,"title",e[1]),o.disabled=e[2]},m(r,a){nr(r,t,a),nr(r,o,a),o.innerHTML=e[0],e[11](o),i||(n=[ur(Bf.body,"load",e[5],!0),ur(Bf.body,"error",e[6],!0),ur(o,"pointerdown",e[4])],i=!0)},p(e,[t]){1&t&&(o.innerHTML=e[0]),2&t&&mr(o,"title",e[1]),4&t&&(o.disabled=e[2])},i:Rn,o:Rn,d(r){r&&rr(t),r&&rr(o),e[11](null),i=!1,Fn(n)}}}function _f(e,t,o){let i,{html:n}=t,{title:r}=t,{onclick:s}=t,{disabled:l=!1}=t,{ongrab:c=a}=t,{ondrag:d=a}=t,{ondrop:u=a}=t;const h=e=>Pe(p,ue(e.pageX,e.pageY))<256;let p;const m=e=>{document.documentElement.removeEventListener("pointermove",g),document.documentElement.removeEventListener("pointerup",m);const t=ue(e.pageX,e.pageY);if(Pe(p,t)<32)return s(e);h(e)||u(e)},g=e=>{h(e)||d(e)},$=e=>i&&i.contains(e)&&"IMG"===e.nodeName;return e.$$set=e=>{"html"in e&&o(0,n=e.html),"title"in e&&o(1,r=e.title),"onclick"in e&&o(7,s=e.onclick),"disabled"in e&&o(2,l=e.disabled),"ongrab"in e&&o(8,c=e.ongrab),"ondrag"in e&&o(9,d=e.ondrag),"ondrop"in e&&o(10,u=e.ondrop)},e.$$.update=()=>{8&e.$$.dirty&&i&&i.querySelector("img")&&o(3,i.dataset.loader=!0,i)},[n,r,l,i,e=>{p=ue(e.pageX,e.pageY),c(e),document.documentElement.addEventListener("pointermove",g),document.documentElement.addEventListener("pointerup",m)},({target:e})=>{$(e)&&o(3,i.dataset.load=!0,i)},({target:e})=>{$(e)&&o(3,i.dataset.error=!0,i)},s,c,d,u,function(e){Dr[e?"unshift":"push"]((()=>{i=e,o(3,i)}))}]}class Wf extends $a{constructor(e){super(),ga(this,e,_f,Of,Dn,{html:0,title:1,onclick:7,disabled:2,ongrab:8,ondrag:9,ondrop:10})}}function Vf(e,t,o){const i=e.slice();return i[14]=t[o],i}function Nf(e,t){let o,i,n,r,a,s,l;function c(){return t[10](t[14])}function d(...e){return t[11](t[14],...e)}function u(...e){return t[12](t[14],...e)}function h(...e){return t[13](t[14],...e)}return i=new Wf({props:{onclick:c,ongrab:d,ondrag:u,ondrop:h,disabled:t[1]||t[14].disabled,title:t[14].title,html:t[14].thumb}}),{key:e,first:null,c(){o=ar("li"),ha(i.$$.fragment),n=cr(),mr(o,"class","PinturaShapePreset"),mr(o,"style",t[6]),this.first=o},m(e,c){nr(e,o,c),pa(i,o,null),tr(o,n),a=!0,s||(l=Gn(r=t[8].call(null,o,t[14])),s=!0)},p(e,n){t=e;const s={};5&n&&(s.onclick=c),9&n&&(s.ongrab=d),17&n&&(s.ondrag=u),33&n&&(s.ondrop=h),3&n&&(s.disabled=t[1]||t[14].disabled),1&n&&(s.title=t[14].title),1&n&&(s.html=t[14].thumb),i.$set(s),(!a||64&n)&&mr(o,"style",t[6]),r&&zn(r.update)&&1&n&&r.update.call(null,t[14])},i(e){a||(ta(i.$$.fragment,e),a=!0)},o(e){oa(i.$$.fragment,e),a=!1},d(e){e&&rr(o),ma(i),s=!1,l()}}}function Hf(e){let t,o,i=[],n=new Map,r=e[0];const a=e=>e[14].id;for(let t=0;t<r.length;t+=1){let o=Vf(e,r,t),s=a(o);n.set(s,i[t]=Nf(s,o))}return{c(){t=ar("ul");for(let e=0;e<i.length;e+=1)i[e].c();mr(t,"class","PinturaShapePresetsList")},m(e,n){nr(e,t,n);for(let e=0;e<i.length;e+=1)i[e].m(t,null);o=!0},p(e,[o]){127&o&&(r=e[0],Qr(),i=la(i,o,a,1,e,r,n,t,sa,Nf,null,Vf),ea())},i(e){if(!o){for(let e=0;e<r.length;e+=1)ta(i[e]);o=!0}},o(e){for(let e=0;e<i.length;e+=1)oa(i[e]);o=!1},d(e){e&&rr(t);for(let e=0;e<i.length;e+=1)i[e].d()}}}function jf(e,t,o){let i,n,{presets:r}=t,{disabled:a}=t,{onclickpreset:s}=t,{ongrabpreset:l}=t,{ondragpreset:c}=t,{ondroppreset:d}=t;const u=Fl(0,{stiffness:.25,damping:.9});_n(e,u,(e=>o(9,n=e)));Pr((()=>u.set(1)));return e.$$set=e=>{"presets"in e&&o(0,r=e.presets),"disabled"in e&&o(1,a=e.disabled),"onclickpreset"in e&&o(2,s=e.onclickpreset),"ongrabpreset"in e&&o(3,l=e.ongrabpreset),"ondragpreset"in e&&o(4,c=e.ondragpreset),"ondroppreset"in e&&o(5,d=e.ondroppreset)},e.$$.update=()=>{512&e.$$.dirty&&o(6,i="opacity:"+n)},[r,a,s,l,c,d,i,u,(e,t)=>t.mount&&t.mount(e.firstChild,t),n,e=>s(e.id),(e,t)=>l&&l(e.id,t),(e,t)=>c&&c(e.id,t),(e,t)=>d&&d(e.id,t)]}class Uf extends $a{constructor(e){super(),ga(this,e,jf,Hf,Dn,{presets:0,disabled:1,onclickpreset:2,ongrabpreset:3,ondragpreset:4,ondroppreset:5})}}var Zf=e=>/<svg /.test(e);function Xf(e){let t,o;return t=new eh({props:{items:e[10]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Gf(e){let t,o,i,n;const r=[qf,Yf],a=[];function s(e,t){return e[8]?0:1}return t=s(e),o=a[t]=r[t](e),{c(){o.c(),i=dr()},m(e,o){a[t].m(e,o),nr(e,i,o),n=!0},p(e,n){let l=t;t=s(e),t===l?a[t].p(e,n):(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea(),o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ta(o,1),o.m(i.parentNode,i))},i(e){n||(ta(o),n=!0)},o(e){oa(o),n=!1},d(e){a[t].d(e),e&&rr(i)}}}function Yf(e){let t,o,i,n,r=e[10]&&Kf(e);return i=new rd({props:{scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Jf]},$$scope:{ctx:e}}}),{c(){t=ar("div"),r&&r.c(),o=cr(),ha(i.$$.fragment),mr(t,"class","PinturaShapePresetsFlat")},m(e,a){nr(e,t,a),r&&r.m(t,null),tr(t,o),pa(i,t,null),n=!0},p(e,n){e[10]?r?(r.p(e,n),1024&n&&ta(r,1)):(r=Kf(e),r.c(),ta(r,1),r.m(t,o)):r&&(Qr(),oa(r,1,1,(()=>{r=null})),ea());const a={};512&n&&(a.scrollAutoCancel=e[9]),1&n&&(a.elasticity=e[0]),536871070&n&&(a.$$scope={dirty:n,ctx:e}),i.$set(a)},i(e){n||(ta(r),ta(i.$$.fragment,e),n=!0)},o(e){oa(r),oa(i.$$.fragment,e),n=!1},d(e){e&&rr(t),r&&r.d(),ma(i)}}}function qf(e){let t,o,i,n,r;o=new rd({props:{elasticity:e[0],class:"PinturaShapePresetsGroups",$$slots:{default:[ny]},$$scope:{ctx:e}}});const a=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[11]},e[12]];let s={$$slots:{default:[ay,({panel:e,panelIsActive:t})=>({26:e,27:t}),({panel:e,panelIsActive:t})=>(e?67108864:0)|(t?134217728:0)]},$$scope:{ctx:e}};for(let e=0;e<a.length;e+=1)s=An(s,a[e]);return n=new Sc({props:s}),{c(){t=ar("div"),ha(o.$$.fragment),i=cr(),ha(n.$$.fragment),mr(t,"class","PinturaShapePresetsGrouped")},m(e,a){nr(e,t,a),pa(o,t,null),tr(t,i),pa(n,t,null),r=!0},p(e,t){const i={};1&t&&(i.elasticity=e[0]),536876128&t&&(i.$$scope={dirty:t,ctx:e}),o.$set(i);const r=6144&t?ca(a,[a[0],a[1],2048&t&&{panels:e[11]},4096&t&&da(e[12])]):{};738206239&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r)},i(e){r||(ta(o.$$.fragment,e),ta(n.$$.fragment,e),r=!0)},o(e){oa(o.$$.fragment,e),oa(n.$$.fragment,e),r=!1},d(e){e&&rr(t),ma(o),ma(n)}}}function Kf(e){let t,o;return t=new eh({props:{items:e[10]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Jf(e){let t,o;return t=new Uf({props:{presets:e[7],onclickpreset:e[1],ongrabpreset:e[2],ondragpreset:e[3],ondroppreset:e[4]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};128&o&&(i.presets=e[7]),2&o&&(i.onclickpreset=e[1]),4&o&&(i.ongrabpreset=e[2]),8&o&&(i.ondragpreset=e[3]),16&o&&(i.ondroppreset=e[4]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Qf(e){let t,o;return t=new eh({props:{items:e[10]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};1024&o&&(i.items=e[10]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function ey(e){let t,o;return t=new Tc({props:{$$slots:{default:[ty]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};805306368&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function ty(e){let t,o=e[28].icon+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){268435456&i&&o!==(o=e[28].icon+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function oy(e){let t,o,i=e[28].label+"";return{c(){t=ar("span"),o=lr(i)},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){268435456&t&&i!==(i=e[28].label+"")&&$r(o,i)},d(e){e&&rr(t)}}}function iy(e){let t,o,i,n=e[28].icon&&ey(e),r=!e[28].hideLabel&&oy(e);return{c(){n&&n.c(),t=cr(),r&&r.c(),o=dr()},m(e,a){n&&n.m(e,a),nr(e,t,a),r&&r.m(e,a),nr(e,o,a),i=!0},p(e,i){e[28].icon?n?(n.p(e,i),268435456&i&&ta(n,1)):(n=ey(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea()),e[28].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=oy(e),r.c(),r.m(o.parentNode,o))},i(e){i||(ta(n),i=!0)},o(e){oa(n),i=!1},d(e){n&&n.d(e),e&&rr(t),r&&r.d(e),e&&rr(o)}}}function ny(e){let t,o,i,n=e[10]&&Qf(e);const r=[{class:"PinturaControlList"},{tabs:e[5]},e[12],{layout:"compact"}];let a={$$slots:{default:[iy,({tab:e})=>({28:e}),({tab:e})=>e?268435456:0]},$$scope:{ctx:e}};for(let e=0;e<r.length;e+=1)a=An(a,r[e]);return o=new uc({props:a}),o.$on("select",e[18]),{c(){n&&n.c(),t=cr(),ha(o.$$.fragment)},m(e,r){n&&n.m(e,r),nr(e,t,r),pa(o,e,r),i=!0},p(e,i){e[10]?n?(n.p(e,i),1024&i&&ta(n,1)):(n=Qf(e),n.c(),ta(n,1),n.m(t.parentNode,t)):n&&(Qr(),oa(n,1,1,(()=>{n=null})),ea());const a=4128&i?ca(r,[r[0],32&i&&{tabs:e[5]},4096&i&&da(e[12]),r[3]]):{};805306368&i&&(a.$$scope={dirty:i,ctx:e}),o.$set(a)},i(e){i||(ta(n),ta(o.$$.fragment,e),i=!0)},o(e){oa(n),oa(o.$$.fragment,e),i=!1},d(e){n&&n.d(e),e&&rr(t),ma(o,e)}}}function ry(e){let t,o;return t=new Uf({props:{presets:e[13][e[26]].items,disabled:e[13][e[26]].disabled,onclickpreset:e[1],ongrabpreset:e[2],ondragpreset:e[3],ondroppreset:e[4]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};67117056&o&&(i.presets=e[13][e[26]].items),67117056&o&&(i.disabled=e[13][e[26]].disabled),2&o&&(i.onclickpreset=e[1]),4&o&&(i.ongrabpreset=e[2]),8&o&&(i.ondragpreset=e[3]),16&o&&(i.ondroppreset=e[4]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function ay(e){let t,o;return t=new rd({props:{scroll:e[27]?{scrollOffset:0,animate:!1}:void 0,scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[ry]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};134217728&o&&(i.scroll=e[27]?{scrollOffset:0,animate:!1}:void 0),512&o&&(i.scrollAutoCancel=e[9]),1&o&&(i.elasticity=e[0]),603987998&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function sy(e){let t,o,i,n;const r=[Gf,Xf],a=[];function s(e,t){return e[9]?0:e[10]?1:-1}return~(o=s(e))&&(i=a[o]=r[o](e)),{c(){t=ar("div"),i&&i.c(),mr(t,"class","PinturaShapePresetsPalette")},m(e,i){nr(e,t,i),~o&&a[o].m(t,null),n=!0},p(e,[n]){let l=o;o=s(e),o===l?~o&&a[o].p(e,n):(i&&(Qr(),oa(a[l],1,1,(()=>{a[l]=null})),ea()),~o?(i=a[o],i?i.p(e,n):(i=a[o]=r[o](e),i.c()),ta(i,1),i.m(t,null)):i=null)},i(e){n||(ta(i),n=!0)},o(e){oa(i),n=!1},d(e){e&&rr(t),~o&&a[o].d()}}}function ly(e,t,o){let i,n,r,s,l,c,d,u,h,{locale:p}=t,{presets:m}=t,{scrollElasticity:g}=t,{enableSelectImage:$=!0}=t,{willRenderPresetToolbar:f=Z}=t,{onaddpreset:y=a}=t,{ongrabpreset:b}=t,{ondragpreset:x}=t,{ondroppreset:v}=t;const w="presets-"+L(),S=(e,t="")=>Zf(e)?e:Po(e)?zo(e,t):`<img src="${e}" alt="${t}"/>`,k=e=>V(Ot(e)),M=["src","alt","thumb","shape","id","mount","disabled"],C=e=>e.map((e=>(e=>Io(e)&&P(e[0])&&Io(e[1]))(e)?{...e[2],id:`${w}-${e[0].toLowerCase()}`,label:e[0],items:C(e[1])}:(e=>{let t,o,i,n,r,a,s,l=e;return P(e)?Po(e)?(t=e,r=e,n=S(t,r)):(t=e,r=k(t),n=S(t,r)):(t=e.src,r=e.alt||(P(t)?k(t):P(e.thumb)?k(e.thumb):void 0),n=S(e.thumb||t,r),o=e.shape,a=e.mount,s=e.disabled,i=Object.keys(e).reduce(((t,o)=>(M.includes(o)||(t[o]=e[o]),t)),{})),{id:l,src:t,thumb:n,shape:o,shapeProps:i,alt:r,title:r,mount:a,disabled:s}})(e)));return e.$$set=e=>{"locale"in e&&o(14,p=e.locale),"presets"in e&&o(15,m=e.presets),"scrollElasticity"in e&&o(0,g=e.scrollElasticity),"enableSelectImage"in e&&o(16,$=e.enableSelectImage),"willRenderPresetToolbar"in e&&o(17,f=e.willRenderPresetToolbar),"onaddpreset"in e&&o(1,y=e.onaddpreset),"ongrabpreset"in e&&o(2,b=e.ongrabpreset),"ondragpreset"in e&&o(3,x=e.ondragpreset),"ondroppreset"in e&&o(4,v=e.ondroppreset)},e.$$.update=()=>{32768&e.$$.dirty&&o(7,i=C(m)),128&e.$$.dirty&&o(9,n=i.length),640&e.$$.dirty&&o(8,r=n&&i.some((e=>!!e.items))),384&e.$$.dirty&&o(5,s=r&&i),384&e.$$.dirty&&o(13,l=r&&i.reduce(((e,t)=>(e[t.id]=t,e)),{})),96&e.$$.dirty&&o(6,c=c||s&&(s.find((e=>!e.disabled))||{}).id),64&e.$$.dirty&&o(12,d={name:w,selected:c}),32&e.$$.dirty&&o(11,u=s&&s.map((e=>e.id))),212994&e.$$.dirty&&o(10,h=p&&f([$&&["Button","browse",{label:p.shapeLabelButtonSelectSticker,icon:p.shapeIconButtonSelectSticker,onclick:()=>{bh().then((e=>{e&&y(e)}))}}]]))},[g,y,b,x,v,s,c,i,r,n,h,u,d,l,p,m,$,f,({detail:e})=>o(6,c=e)]}class cy extends $a{constructor(e){super(),ga(this,e,ly,sy,Dn,{locale:14,presets:15,scrollElasticity:0,enableSelectImage:16,willRenderPresetToolbar:17,onaddpreset:1,ongrabpreset:2,ondragpreset:3,ondroppreset:4})}}function dy(e){let t,o,i,n;const r=[{locale:e[4]},{uid:e[14]},{parentRect:e[29]},{rootRect:e[43]},{utilRect:e[30]},{offset:e[38]},{disabled:e[28]},{contextRotation:e[17]},{contextFlipX:e[18]},{contextFlipY:e[19]},{contextZoom:e[42]},{active:e[26]},{opacity:e[45]},{hoverColor:e[46]},{eraseRadius:e[37]},{selectRadius:e[6]},{enableButtonFlipVertical:e[9]},{mapEditorPointToImagePoint:e[15]},{mapImagePointToEditorPoint:e[16]},{enableTapToAddText:e[12]},{textInputMode:e[7]},{willStartInteraction:e[80]},{oninteractionstart:e[66]},{oninteractionupdate:e[67]},{oninteractionrelease:e[68]},{oninteractionend:e[70]},{oninteractioncancel:e[69]},{onhovershape:e[74]},{ontapcanvas:e[73]},{onaddshape:e[122]},{onselectshape:e[123]},{ontapshape:e[124]},{onupdateshape:e[125]},{onremoveshape:e[126]},e[32]];function a(t){e[128](t)}function s(t){e[129](t)}let l={};for(let e=0;e<r.length;e+=1)l=An(l,r[e]);return void 0!==e[27]&&(l.markup=e[27]),void 0!==e[44]&&(l.ui=e[44]),t=new Mf({props:l}),e[127](t),Dr.push((()=>ua(t,"markup",a))),Dr.push((()=>ua(t,"ui",s))),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),n=!0},p(e,n){const a=1955582672&n[0]|55490&n[1]|793072&n[2]?ca(r,[16&n[0]&&{locale:e[4]},16384&n[0]&&{uid:e[14]},536870912&n[0]&&{parentRect:e[29]},4096&n[1]&&{rootRect:e[43]},1073741824&n[0]&&{utilRect:e[30]},128&n[1]&&{offset:e[38]},268435456&n[0]&&{disabled:e[28]},131072&n[0]&&{contextRotation:e[17]},262144&n[0]&&{contextFlipX:e[18]},524288&n[0]&&{contextFlipY:e[19]},2048&n[1]&&{contextZoom:e[42]},67108864&n[0]&&{active:e[26]},16384&n[1]&&{opacity:e[45]},32768&n[1]&&{hoverColor:e[46]},64&n[1]&&{eraseRadius:e[37]},64&n[0]&&{selectRadius:e[6]},512&n[0]&&{enableButtonFlipVertical:e[9]},32768&n[0]&&{mapEditorPointToImagePoint:e[15]},65536&n[0]&&{mapImagePointToEditorPoint:e[16]},4096&n[0]&&{enableTapToAddText:e[12]},128&n[0]&&{textInputMode:e[7]},262144&n[2]&&{willStartInteraction:e[80]},16&n[2]&&{oninteractionstart:e[66]},32&n[2]&&{oninteractionupdate:e[67]},64&n[2]&&{oninteractionrelease:e[68]},256&n[2]&&{oninteractionend:e[70]},128&n[2]&&{oninteractioncancel:e[69]},4096&n[2]&&{onhovershape:e[74]},2048&n[2]&&{ontapcanvas:e[73]},8388608&n[0]|524288&n[2]&&{onaddshape:e[122]},8388608&n[0]&&{onselectshape:e[123]},8388608&n[0]&&{ontapshape:e[124]},8388608&n[0]|524288&n[2]&&{onupdateshape:e[125]},8388608&n[0]|524288&n[2]&&{onremoveshape:e[126]},2&n[1]&&da(e[32])]):{};!o&&134217728&n[0]&&(o=!0,a.markup=e[27],jr((()=>o=!1))),!i&&8192&n[1]&&(i=!0,a.ui=e[44],jr((()=>i=!1))),t.$set(a)},i(e){n||(ta(t.$$.fragment,e),n=!0)},o(e){oa(t.$$.fragment,e),n=!1},d(o){e[127](null),ma(t,o)}}}function uy(e){let t,o,i,n,r,s=e[39]&&dy(e);return{c(){t=ar("div"),s&&s.c(),mr(t,"slot","main"),mr(t,"style",o="cursor:"+e[35])},m(o,l){nr(o,t,l),s&&s.m(t,null),e[130](t),i=!0,n||(r=[ur(t,"keydown",e[71]),Gn(Kl.call(null,t)),ur(t,"dropfiles",(function(){zn(e[11]?e[79]:a)&&(e[11]?e[79]:a).apply(this,arguments)})),Gn(Gl.call(null,t)),ur(t,"measure",e[120])],n=!0)},p(n,r){(e=n)[39]?s?(s.p(e,r),256&r[1]&&ta(s,1)):(s=dy(e),s.c(),ta(s,1),s.m(t,null)):s&&(Qr(),oa(s,1,1,(()=>{s=null})),ea()),(!i||16&r[1]&&o!==(o="cursor:"+e[35]))&&mr(t,"style",o)},i(e){i||(ta(s),i=!0)},o(e){oa(s),i=!1},d(o){o&&rr(t),s&&s.d(),e[130](null),n=!1,Fn(r)}}}function hy(e){let t,o;return t=new cy({props:{locale:e[4],presets:e[13],enableSelectImage:e[10],willRenderPresetToolbar:e[33],onaddpreset:e[78],ongrabpreset:e[75],ondragpreset:e[76],ondroppreset:e[77],scrollElasticity:e[34]}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),8192&o[0]&&(i.presets=e[13]),1024&o[0]&&(i.enableSelectImage=e[10]),4&o[1]&&(i.willRenderPresetToolbar=e[33]),8&o[1]&&(i.scrollElasticity=e[34]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function py(e){let t,o,i,n,r,a;const s=[gy,my],l=[];function c(e,t){return e[36]?0:1}o=c(e),i=l[o]=s[o](e);let d=e[41]&&$y(e);return{c(){t=ar("div"),i.c(),n=cr(),d&&d.c(),r=dr(),mr(t,"class","PinturaControlPanels")},m(e,i){nr(e,t,i),l[o].m(t,null),nr(e,n,i),d&&d.m(e,i),nr(e,r,i),a=!0},p(e,n){let a=o;o=c(e),o===a?l[o].p(e,n):(Qr(),oa(l[a],1,1,(()=>{l[a]=null})),ea(),i=l[o],i?i.p(e,n):(i=l[o]=s[o](e),i.c()),ta(i,1),i.m(t,null)),e[41]?d?(d.p(e,n),1024&n[1]&&ta(d,1)):(d=$y(e),d.c(),ta(d,1),d.m(r.parentNode,r)):d&&(Qr(),oa(d,1,1,(()=>{d=null})),ea())},i(e){a||(ta(i),ta(d),a=!0)},o(e){oa(i),oa(d),a=!1},d(e){e&&rr(t),l[o].d(),e&&rr(n),d&&d.d(e),e&&rr(r)}}}function my(e){let t,o,i;return o=new Df({props:{locale:e[4],shape:e[24],onchange:e[72],controls:e[8],scrollElasticity:e[34]}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaControlPanel")},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,t){const i={};16&t[0]&&(i.locale=e[4]),16777216&t[0]&&(i.shape=e[24]),256&t[0]&&(i.controls=e[8]),8&t[1]&&(i.scrollElasticity=e[34]),o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function gy(e){let t,o,i;return o=new cy({props:{locale:e[4],presets:e[13],enableSelectImage:e[10],willRenderPresetToolbar:e[33],onaddpreset:e[78],ongrabpreset:e[75],ondragpreset:e[76],ondroppreset:e[77],scrollElasticity:e[34]}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"class","PinturaControlPanel")},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,t){const i={};16&t[0]&&(i.locale=e[4]),8192&t[0]&&(i.presets=e[13]),1024&t[0]&&(i.enableSelectImage=e[10]),4&t[1]&&(i.willRenderPresetToolbar=e[33]),8&t[1]&&(i.scrollElasticity=e[34]),o.$set(i)},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function $y(e){let t,o;return t=new rd({props:{class:"PinturaControlListScroller",elasticity:e[34],$$slots:{default:[xy]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};8&o[1]&&(i.elasticity=e[34]),33554449&o[0]|512&o[5]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function fy(e){let t,o;return t=new Tc({props:{$$slots:{default:[yy]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};16&o[0]|768&o[5]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function yy(e){let t,o=(R(e[163].icon)?e[163].icon(e[4]):e[163].icon)+"";return{c(){t=sr("g")},m(e,i){nr(e,t,i),t.innerHTML=o},p(e,i){16&i[0]|256&i[5]&&o!==(o=(R(e[163].icon)?e[163].icon(e[4]):e[163].icon)+"")&&(t.innerHTML=o)},d(e){e&&rr(t)}}}function by(e){let t,o,i,n,r,a=(R(e[163].label)?e[163].label(e[4]):e[163].label)+"",s=e[163].icon&&fy(e);return{c(){t=ar("div"),s&&s.c(),o=cr(),i=ar("span"),n=lr(a),mr(t,"slot","option")},m(e,a){nr(e,t,a),s&&s.m(t,null),tr(t,o),tr(t,i),tr(i,n),r=!0},p(e,i){e[163].icon?s?(s.p(e,i),256&i[5]&&ta(s,1)):(s=fy(e),s.c(),ta(s,1),s.m(t,o)):s&&(Qr(),oa(s,1,1,(()=>{s=null})),ea()),(!r||16&i[0]|256&i[5])&&a!==(a=(R(e[163].label)?e[163].label(e[4]):e[163].label)+"")&&$r(n,a)},i(e){r||(ta(s),r=!0)},o(e){oa(s),r=!1},d(e){e&&rr(t),s&&s.d()}}}function xy(e){let t,o;return t=new yu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[25],selectedIndex:e[25].findIndex(e[121]),onchange:e[65],$$slots:{option:[by,({option:e})=>({163:e}),({option:e})=>[0,0,0,0,0,e?256:0]]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};16&o[0]&&(i.locale=e[4]),33554432&o[0]&&(i.options=e[25]),33554433&o[0]&&(i.selectedIndex=e[25].findIndex(e[121])),16&o[0]|768&o[5]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function vy(e){let t,o,i,n;const r=[py,hy],a=[];function s(e,t){return e[40]?0:e[36]?1:-1}return~(o=s(e))&&(i=a[o]=r[o](e)),{c(){t=ar("div"),i&&i.c(),mr(t,"slot","footer"),mr(t,"style",e[31])},m(e,i){nr(e,t,i),~o&&a[o].m(t,null),n=!0},p(e,l){let c=o;o=s(e),o===c?~o&&a[o].p(e,l):(i&&(Qr(),oa(a[c],1,1,(()=>{a[c]=null})),ea()),~o?(i=a[o],i?i.p(e,l):(i=a[o]=r[o](e),i.c()),ta(i,1),i.m(t,null)):i=null),(!n||1&l[1])&&mr(t,"style",e[31])},i(e){n||(ta(i),n=!0)},o(e){oa(i),n=!1},d(e){e&&rr(t),~o&&a[o].d()}}}function wy(e){let t,o;return t=new Ag({props:{$$slots:{footer:[vy],main:[uy]},$$scope:{ctx:e}}}),t.$on("measure",e[131]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};2146435025&o[0]|65535&o[1]|512&o[5]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Sy(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,S,k,M,C,T,R,I,A,E,L,F,z,D,B,O,_,W,V,N,H,j,U,X,G,Y,q,K,J,Q,ee,te,oe,ie=Rn,ne=()=>(ie(),ie=Bn(me,(e=>o(26,E=e))),me),re=Rn,ae=()=>(re(),re=Bn(be,(e=>o(27,F=e))),be),se=Rn,le=()=>(se(),se=Bn(Ze,(e=>o(29,U=e))),Ze),ce=Rn,de=()=>(ce(),ce=Bn($e,(e=>o(118,K=e))),$e),he=Rn,pe=()=>(he(),he=Bn(ge,(e=>o(45,te=e))),ge);e.$$.on_destroy.push((()=>ie())),e.$$.on_destroy.push((()=>re())),e.$$.on_destroy.push((()=>se())),e.$$.on_destroy.push((()=>ce())),e.$$.on_destroy.push((()=>he()));let{isActive:me}=t;ne();let{isActiveFraction:ge}=t;pe();let{isVisible:$e}=t;de();let{stores:fe}=t,{locale:ye={}}=t,{shapes:be}=t;ae();let{toolbar:xe=[]}=t,{toolShapes:ve={}}=t,{toolActive:we}=t,{toolSelectRadius:Se}=t,{toolRetainStyles:ke=!1}=t,{textInputMode:Me}=t,{shapeControls:Ce={}}=t,{enableButtonFlipVertical:Te=!1}=t,{enablePresetSelectImage:Pe=!0}=t,{enablePresetDropImage:Ie=!0}=t,{enableSelectToolToAddShape:Ee=!1}=t,{enableAutoSelectMoveTool:Le=["line","arrow","path","rectangle","ellipse","text"]}=t,{enableTapToAddText:Fe=!1}=t,{enableMoveTool:ze=!1}=t,{enableViewTool:De=!1}=t,{willRenderPresetToolbar:Be}=t,{willStartInteraction:Oe}=t,{shapePresets:_e=[]}=t,{utilKey:We}=t,{mapScreenPointToImagePoint:Ve}=t,{mapImagePointToScreenPoint:Ne}=t,{imageRotation:He=0}=t,{imageFlipX:je=!1}=t,{imageFlipY:Ue=!1}=t,{parentRect:Ze}=t;le();let{hooks:Xe={}}=t;const Ge=Lr("isAnimated");_n(e,Ge,(e=>o(111,L=e)));const Ye=Lr("elasticityMultiplier");_n(e,Ye,(e=>o(114,B=e)));const qe=Lr("ui");let Ke;_n(e,qe,(e=>o(140,Y=e)));const{env:Je,history:Qe,rootRect:et,rootColorSecondary:tt,enablePanInput:ot,enablePanInputStatus:it,enableZoomInput:nt,stageRect:rt,utilRectPadded:st,scrollElasticity:lt,imageOverlayMarkup:ct,imagePreviewModifiers:dt,imageCropRect:ut,shapePreprocessor:ht,stageScalar:pt,imageSelectionRect:mt,imageSelectionZoomCurrent:gt,imageSelectionPan:$t,allowPan:ft,allowZoom:bt,allowZoomControls:xt}=fe;_n(e,Je,(e=>o(112,z=e))),_n(e,et,(e=>o(43,Q=e))),_n(e,tt,(e=>o(46,oe=e))),_n(e,it,(e=>o(28,H=e))),_n(e,rt,(e=>o(115,O=e))),_n(e,st,(e=>o(30,q=e))),_n(e,ct,(e=>o(44,ee=e))),_n(e,dt,(e=>o(119,J=e))),_n(e,ut,(e=>o(139,X=e))),_n(e,ht,(e=>o(117,G=e))),_n(e,pt,(e=>o(137,V=e))),_n(e,mt,(e=>o(138,N=e))),_n(e,gt,(e=>o(42,_=e))),_n(e,$t,(e=>o(136,W=e)));const vt=Lr("keysPressed");_n(e,vt,(e=>o(116,j=e)));const wt=e=>{const[t,o]=Ke[e];let i,n,r="relative"===o.position;const a=r?"0%":0,s=r?"0%":0;fi(t)||mi(t)?(n=r?"20%":.2*U.width,i=si(t),i.x=a,i.y=s,tn(i,{width:n,height:n},U)):yi(t)?(n=r?"10%":.1*U.width,i=si(t),i.x=a,i.y=s,tn(i,{rx:n,ry:n},U)):bi(t)&&(n=r?"10%":.1*U.width,i=si(t),i.x1=a,i.y1=s,i.x2=a,i.y2=s),i&&Promise.resolve().then((()=>{Et(It(i,void 0,n))}))},St=e=>Ve(J$(e,Q));let kt,Mt,Ct={};const Tt=e=>{if(!(xi(e)&&Ro(e,"pathClose")))return;const t=[...e.strokeColor];t[3]=1,kt.updateMarkupShape(e,{pathClose:!1,strokeColor:t},!1),kt.removeMarkupShapeProps(e,["backgroundColor"],!1),kt.confirmMarkupItemDraft(),kt.selectShape(e)};let Pt,Rt;const It=(e,t,o)=>{let i=!1;t||(i=!0,t=b?Ve(at(O)):at(X)),t.x-=U.x||0,t.y-=U.y||0,(je||Ue)&&(e.flipX=je,e.flipY=Ue);const n=kt.getShapesNearPosition(t);if(i&&n.length){const e=.1*Math.min(X.width,X.height);t.x+=Math.round(-e+Math.random()*e*2),t.y+=Math.round(-e+Math.random()*e*2)}if(0!==He&&(e.rotation=je&&Ue?-He:je||Ue?He:-He),Ro(e,"width")&&Ro(e,"height")){const{width:o,height:i}=en(e,["width","height"],U);tn(e,{x:t.x-.5*o,y:t.y-.5*i},U)}else if(yi(e))tn(e,{x:t.x,y:t.y},U);else if(bi(e)){const{x1:i,y1:n,x2:r,y2:a}=en(e,["x1","y1","x2","y2"],U),s=Re(ue(i,n),ue(r,a)),l=P(o)?Xi(o,U.width):s;tn(e,{x1:t.x-l,y1:t.y+l,x2:t.x+l,y2:t.y-l},U)}else if(xi(e)){const{points:o}=en(e,["points"],U),i=Ae(o);tn(e,{points:o.map((e=>({x:e.x+t.x-i.x,y:e.y+t.y-i.y})))},U)}return e},At=(e,t)=>{const o=It(ui(e,X),t);return e.shape&&(Ro(e.shape,"x")&&(o.x=e.shape.x),Ro(e.shape,"y")&&(o.y=e.shape.y)),Et(o)},Et=e=>{const{beforeAddShape:t=(()=>!0)}=Xe;if(t(e))return kt.addShape(e),kt.selectShape(e),Qe.write(),M("addshape",e),e};let Lt=!1;const Ft=()=>{Qe.write()};let zt;const Dt=Lr("redrawTrigger");_n(e,Dt,(e=>o(113,D=e)));const Bt=Fl(L?20:0);_n(e,Bt,(e=>o(110,A=e)));return e.$$set=e=>{"isActive"in e&&ne(o(1,me=e.isActive)),"isActiveFraction"in e&&pe(o(2,ge=e.isActiveFraction)),"isVisible"in e&&de(o(3,$e=e.isVisible)),"stores"in e&&o(84,fe=e.stores),"locale"in e&&o(4,ye=e.locale),"shapes"in e&&ae(o(5,be=e.shapes)),"toolbar"in e&&o(85,xe=e.toolbar),"toolShapes"in e&&o(86,ve=e.toolShapes),"toolActive"in e&&o(0,we=e.toolActive),"toolSelectRadius"in e&&o(6,Se=e.toolSelectRadius),"toolRetainStyles"in e&&o(87,ke=e.toolRetainStyles),"textInputMode"in e&&o(7,Me=e.textInputMode),"shapeControls"in e&&o(8,Ce=e.shapeControls),"enableButtonFlipVertical"in e&&o(9,Te=e.enableButtonFlipVertical),"enablePresetSelectImage"in e&&o(10,Pe=e.enablePresetSelectImage),"enablePresetDropImage"in e&&o(11,Ie=e.enablePresetDropImage),"enableSelectToolToAddShape"in e&&o(88,Ee=e.enableSelectToolToAddShape),"enableAutoSelectMoveTool"in e&&o(89,Le=e.enableAutoSelectMoveTool),"enableTapToAddText"in e&&o(12,Fe=e.enableTapToAddText),"enableMoveTool"in e&&o(90,ze=e.enableMoveTool),"enableViewTool"in e&&o(91,De=e.enableViewTool),"willRenderPresetToolbar"in e&&o(92,Be=e.willRenderPresetToolbar),"willStartInteraction"in e&&o(93,Oe=e.willStartInteraction),"shapePresets"in e&&o(13,_e=e.shapePresets),"utilKey"in e&&o(14,We=e.utilKey),"mapScreenPointToImagePoint"in e&&o(15,Ve=e.mapScreenPointToImagePoint),"mapImagePointToScreenPoint"in e&&o(16,Ne=e.mapImagePointToScreenPoint),"imageRotation"in e&&o(17,He=e.imageRotation),"imageFlipX"in e&&o(18,je=e.imageFlipX),"imageFlipY"in e&&o(19,Ue=e.imageFlipY),"parentRect"in e&&le(o(20,Ze=e.parentRect)),"hooks"in e&&o(94,Xe=e.hooks)},e.$$.update=()=>{var t,P;if(16777216&e.$$.dirty[2]|4&e.$$.dirty[3]&&(Ke&&ve===Ke||o(95,Ke=ve)),67108864&e.$$.dirty[0]&&ft.set(E),67108864&e.$$.dirty[0]&&bt.set(E),67108864&e.$$.dirty[0]&&xt.set(E),8192&e.$$.dirty[0]|1887436800&e.$$.dirty[2]&&o(25,i=((e,{willRenderPresetToolbar:t,shapePresets:o,enableViewTool:i,enableMoveTool:n})=>{let r=0!==o.length||t?e:e.filter((e=>"preset"!==e[0]));return r=n?r:r.filter((e=>"move"!==e[0])),i?r:r.filter((e=>"view"!==e[0]))})(xe,{willRenderPresetToolbar:Be,shapePresets:_e,enableMoveTool:ze,enableViewTool:De})),256&e.$$.dirty[0]&&o(107,n=Object.keys(Ce).length),33554432&e.$$.dirty[0]&&o(41,r=i.length>1),33554432&e.$$.dirty[0]&&o(108,a=!!i.length),33554433&e.$$.dirty[0]|32768&e.$$.dirty[3]&&a&&void 0===we&&o(0,we=i[0][0]),1&e.$$.dirty[0]&&o(109,s=void 0!==we),114688&e.$$.dirty[3]&&o(40,l=(!s||a)&&n),4194304&e.$$.dirty[0]&&o(23,M=zt&&(t=zt,(e,o)=>{t.dispatchEvent(ih(e,o))})),75497473&e.$$.dirty[0]&&E&&M&&M("selectcontrol",we),67125248&e.$$.dirty[0]|67108864&e.$$.dirty[3]&&(E?Xn(dt,J[We]={maskMarkupOpacity:.85},J):delete J[We]),2097153&e.$$.dirty[0]&&we&&kt){const e=kt.getMarkupItemDraft();e&&Tt(e)}1&e.$$.dirty[0]&&we&&kt&&"move"!==we&&kt.blurShapes(),67108864&e.$$.dirty[0]|33554432&e.$$.dirty[3]&&o(39,c=E&&K),1073741824&e.$$.dirty[0]|4194304&e.$$.dirty[3]&&o(38,d=q&&ue(O.x-q.x,O.y-q.y)),256&e.$$.dirty[0]&&o(106,u=Object.keys(Ce)),201326592&e.$$.dirty[0]&&o(98,h=E&&F.filter(Si)[0]),201326592&e.$$.dirty[0]&&o(101,p=E&&F.find((e=>ki(e)))),67108865&e.$$.dirty[0]|4&e.$$.dirty[3]&&o(104,m=E&&Ke[we]?Ui(si({...Ke[we][0],...Y[We]?Y[We][we]:{}})):{}),4&e.$$.dirty[3]&&Ke&&o(96,Ct={}),10248&e.$$.dirty[3]&&o(105,g=m&&Object.keys(m).reduce(((e,t)=>{const o="disableStyle"===t,i=u.find((e=>e.split("_").includes(t)));return o||i?(void 0===m[t]||!0===m.disableStyle||m.disableStyle&&m.disableStyle.includes(t)||(e[t]=Ro(Ct,t)?Ct[t]:m[t]),e):e}),{})),16385&e.$$.dirty[0]|33554432&e.$$.dirty[2]|4096&e.$$.dirty[3]&&(ke?((e,t,o)=>{const i=Y[e],n=i?i[t]:{};qe.set({...Y,[e]:{...i,[t]:{...n,...o}}})})(We,we,g):(P=We,qe.set({[P]:{}}))),67108864&e.$$.dirty[0]|4128&e.$$.dirty[3]&&o(24,$=E?h||g:void 0),16777216&e.$$.dirty[0]|16777216&e.$$.dirty[3]&&$&&$.lineEnd&&!G&&console.warn("Set shapePreprocessor property to draw lineStart and lineEnd styles.\nhttps://pqina.nl/pintura/docs/v8/api/exports/#createshapepreprocessor"),6144&e.$$.dirty[3]&&o(37,f=m&&To(m.eraseRadius)?(g||m).eraseRadius:void 0),9217&e.$$.dirty[0]|1073741824&e.$$.dirty[2]&&o(36,y="preset"===we&&(_e.length>0||Pe||Be)),536870912&e.$$.dirty[0]&&(b=!Ro(U,"x")&&!Ro(U,"y")),67108864&e.$$.dirty[0]|8388608&e.$$.dirty[3]&&o(102,x=E&&j&&32===j[0]),67108865&e.$$.dirty[0]&&o(103,v=E&&"view"===we),1536&e.$$.dirty[3]&&o(100,w=v||x),256&e.$$.dirty[3]&&o(99,S=!!p),67108864&e.$$.dirty[0]|192&e.$$.dirty[3]&&ot.set(!E||w&&!S),67108864&e.$$.dirty[0]|64&e.$$.dirty[3]&&nt.set(!E||!S),268435457&e.$$.dirty[0]|48&e.$$.dirty[3]&&o(35,k=((e,t,o,i,n)=>{if(o)return i?"grabbing":"grab";if(!e)return"move"===n?"default":"crosshair";let r=e||t;return Si(r)?ki(r)?"modal"===Me?"default":"text":Oi(r)?"move":"default":"default"})(Rt,h,H,false,we)),2097152&e.$$.dirty[3]&&o(34,C=B*lt),1073741824&e.$$.dirty[2]|1572864&e.$$.dirty[3]&&o(33,T=D&&Be?e=>xh((()=>Be(e,At,{...z},(()=>Dt.set({}))))):Z),2&e.$$.dirty[3]&&o(32,R=Object.keys(Xe).reduce(((e,t)=>("beforeAddShape"===t||void 0===Xe[t]||(e[t]=Xe[t]),e)),{})),67108864&e.$$.dirty[0]&&(e=>{be&&be.set(F.map((t=>(t._prerender=!!e&&ki(t),t))))})(E),67108864&e.$$.dirty[0]|262144&e.$$.dirty[3]&&L&&Bt.set(E?0:20),131072&e.$$.dirty[3]&&o(31,I=A?`transform: translateY(${A}px)`:void 0)},[we,me,ge,$e,ye,be,Se,Me,Ce,Te,Pe,Ie,Fe,_e,We,Ve,Ne,He,je,Ue,Ze,kt,zt,M,$,i,E,F,H,U,q,I,R,T,C,k,y,f,d,c,l,r,_,Q,ee,te,oe,Ge,Ye,qe,Je,et,tt,it,rt,st,ct,dt,ut,ht,pt,mt,gt,$t,vt,({value:e},t)=>{o(0,we=e),(Ee||/enter/i.test(t.key))&&wt(e)},e=>{if("eraser"===we)Mt=kt.eraseShape();else if(we&&Ke[we]){const[e,t]=Ke[we];Mt=kt.createShape({...e,...g},t)}else Mt=void 0;return!!Mt&&(Mt.start(e),!0)},e=>!!Mt&&(Mt.update(e),!0),e=>!!Mt&&(Mt.release(e),!0),e=>!!Mt&&(Mt.cancel(e),Mt=void 0,!0),e=>{if(!Mt)return!1;Mt.end(e),Mt=void 0;const t=kt.getMarkupItemDraft(),i=ze&&(!0===Le||Array.isArray(Le)&&Le.includes(we));return t&&!t.isEditing||!i||o(0,we="move"),!0},e=>{const{key:t}=e,o=kt.getMarkupItemDraft();/escape/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),kt.discardMarkupItemDraft(),Mt=void 0),/enter/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),Tt(o),Mt=void 0)},function(e){Object.keys(e).forEach((t=>o(96,Ct[t]=e[t],Ct))),M("selectstyle",e),h&&(kt.updateMarkupShape(h,e),clearTimeout(Pt),Pt=setTimeout((()=>{Ft()}),200))},e=>M("markuptap",e),e=>o(97,Rt=e),()=>{Lt=!1},(e,t)=>{if(Lt)return;const{beforeAddShape:o=(()=>!0)}=Xe,i=St(t),n=kt.getMarkupItemDraft(),r=yt(X,{x:i.x+(U.x||0),y:i.y+(U.y||0)});if(n&&!r&&kt.discardMarkupItemDraft(),r){if(!n){const n=ui(e,X),r=It(n,i);return o(r)?(Ii(r),void kt.addShape(r)):(Lt=!0,void t.preventDefault())}fi(n)&&(i.x-=.5*n.width,i.y-=.5*n.height),e.shape&&(Ro(e.shape,"x")&&(i.x=e.shape.x),Ro(e.shape,"y")&&(i.y=e.shape.y)),kt.updateMarkupShape(n,i)}},(e,t)=>{if(Lt)return;const o=St(t);if(!yt(X,{x:o.x+(U.x||0),y:o.y+(U.y||0)}))return void kt.discardMarkupItemDraft();const i=kt.confirmMarkupItemDraft();kt.selectShape(i),M("addshape",i),Qe.write()},e=>At(e),e=>{return t=e.detail.resources,o=St(e.detail.event),t.forEach((e=>At(e,o)));var t,o},e=>{if(!Oe)return!0;const t=rectClone(N);return rectScale(t,1/V),rectTranslate(t,W),rectScale(t,_),Oe(e,{...t,x:t.x+O.x,y:t.y+O.y})},Ft,Dt,Bt,fe,xe,ve,ke,Ee,Le,ze,De,Be,Oe,Xe,Ke,Ct,Rt,h,S,w,p,x,v,m,g,u,n,a,s,A,L,z,D,B,O,j,G,K,J,function(t){Fr.call(this,e,t)},e=>e[0]===we,e=>{M("addshape",e),Ft()},e=>{M("selectshape",e)},e=>{M("tapshape",e)},e=>{M("updateshape",e),Ft()},e=>{M("removeshape",e),Ft()},function(e){Dr[e?"unshift":"push"]((()=>{kt=e,o(21,kt)}))},function(e){F=e,be.set(F)},function(e){ee=e,ct.set(ee)},function(e){Dr[e?"unshift":"push"]((()=>{zt=e,o(22,zt)}))},function(t){Fr.call(this,e,t)}]}class ky extends $a{constructor(e){super(),ga(this,e,Sy,wy,Dn,{isActive:1,isActiveFraction:2,isVisible:3,stores:84,locale:4,shapes:5,toolbar:85,toolShapes:86,toolActive:0,toolSelectRadius:6,toolRetainStyles:87,textInputMode:7,shapeControls:8,enableButtonFlipVertical:9,enablePresetSelectImage:10,enablePresetDropImage:11,enableSelectToolToAddShape:88,enableAutoSelectMoveTool:89,enableTapToAddText:12,enableMoveTool:90,enableViewTool:91,willRenderPresetToolbar:92,willStartInteraction:93,shapePresets:13,utilKey:14,mapScreenPointToImagePoint:15,mapImagePointToScreenPoint:16,imageRotation:17,imageFlipX:18,imageFlipY:19,parentRect:20,hooks:94},null,[-1,-1,-1,-1,-1,-1])}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),Gr()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),Gr()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),Gr()}get stores(){return this.$$.ctx[84]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),Gr()}get shapes(){return this.$$.ctx[5]}set shapes(e){this.$$set({shapes:e}),Gr()}get toolbar(){return this.$$.ctx[85]}set toolbar(e){this.$$set({toolbar:e}),Gr()}get toolShapes(){return this.$$.ctx[86]}set toolShapes(e){this.$$set({toolShapes:e}),Gr()}get toolActive(){return this.$$.ctx[0]}set toolActive(e){this.$$set({toolActive:e}),Gr()}get toolSelectRadius(){return this.$$.ctx[6]}set toolSelectRadius(e){this.$$set({toolSelectRadius:e}),Gr()}get toolRetainStyles(){return this.$$.ctx[87]}set toolRetainStyles(e){this.$$set({toolRetainStyles:e}),Gr()}get textInputMode(){return this.$$.ctx[7]}set textInputMode(e){this.$$set({textInputMode:e}),Gr()}get shapeControls(){return this.$$.ctx[8]}set shapeControls(e){this.$$set({shapeControls:e}),Gr()}get enableButtonFlipVertical(){return this.$$.ctx[9]}set enableButtonFlipVertical(e){this.$$set({enableButtonFlipVertical:e}),Gr()}get enablePresetSelectImage(){return this.$$.ctx[10]}set enablePresetSelectImage(e){this.$$set({enablePresetSelectImage:e}),Gr()}get enablePresetDropImage(){return this.$$.ctx[11]}set enablePresetDropImage(e){this.$$set({enablePresetDropImage:e}),Gr()}get enableSelectToolToAddShape(){return this.$$.ctx[88]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),Gr()}get enableAutoSelectMoveTool(){return this.$$.ctx[89]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),Gr()}get enableTapToAddText(){return this.$$.ctx[12]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),Gr()}get enableMoveTool(){return this.$$.ctx[90]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),Gr()}get enableViewTool(){return this.$$.ctx[91]}set enableViewTool(e){this.$$set({enableViewTool:e}),Gr()}get willRenderPresetToolbar(){return this.$$.ctx[92]}set willRenderPresetToolbar(e){this.$$set({willRenderPresetToolbar:e}),Gr()}get willStartInteraction(){return this.$$.ctx[93]}set willStartInteraction(e){this.$$set({willStartInteraction:e}),Gr()}get shapePresets(){return this.$$.ctx[13]}set shapePresets(e){this.$$set({shapePresets:e}),Gr()}get utilKey(){return this.$$.ctx[14]}set utilKey(e){this.$$set({utilKey:e}),Gr()}get mapScreenPointToImagePoint(){return this.$$.ctx[15]}set mapScreenPointToImagePoint(e){this.$$set({mapScreenPointToImagePoint:e}),Gr()}get mapImagePointToScreenPoint(){return this.$$.ctx[16]}set mapImagePointToScreenPoint(e){this.$$set({mapImagePointToScreenPoint:e}),Gr()}get imageRotation(){return this.$$.ctx[17]}set imageRotation(e){this.$$set({imageRotation:e}),Gr()}get imageFlipX(){return this.$$.ctx[18]}set imageFlipX(e){this.$$set({imageFlipX:e}),Gr()}get imageFlipY(){return this.$$.ctx[19]}set imageFlipY(e){this.$$set({imageFlipY:e}),Gr()}get parentRect(){return this.$$.ctx[20]}set parentRect(e){this.$$set({parentRect:e}),Gr()}get hooks(){return this.$$.ctx[94]}set hooks(e){this.$$set({hooks:e}),Gr()}}var My=(e,t,o,i,n,r,a,s,l)=>{const c=me(e),d=.5*o.width,u=.5*o.height,h=.5*t.width,p=.5*t.height,m=n.x+i.x,g=n.y+i.y;s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y);const $=Math.cos(r),f=Math.sin(r);c.x-=d,c.y-=u;const y=c.x*$-c.y*f,b=c.x*f+c.y*$;c.x=d+y,c.y=u+b,c.x*=a,c.y*=a,c.x+=h,c.y+=p,c.x+=m,c.y+=g,c.x-=d*a,c.y-=u*a;const x=(n.x-m)*a,v=(n.y-g)*a,w=x*$-v*f,S=x*f+v*$;return c.x+=w,c.y+=S,c},Cy=(e,t,o,i,n,r,a,s,l)=>{const c=me(e),d=He(o),u=He(t),h=ue(n.x+i.x,n.y+i.y),p=Math.cos(r),m=Math.sin(r);c.x-=u.x,c.y-=u.y;const g=(n.x-h.x)*a,$=(n.y-h.y)*a,f=g*p-$*m,y=g*m+$*p;c.x-=f,c.y-=y,c.x-=h.x,c.y-=h.y,c.x/=a,c.y/=a;const b=c.x*p+c.y*m,x=c.x*m-c.y*p;return c.x=b,c.y=-x,c.x+=d.x,c.y+=d.y,s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y),c};function Ty(e){let t,o,i;function n(t){e[51](t)}let r={utilKey:"annotate",stores:e[4],locale:e[5],isActive:e[1],isActiveFraction:e[2],isVisible:e[3],mapScreenPointToImagePoint:e[36],mapImagePointToScreenPoint:e[35],imageRotation:e[37],imageFlipX:e[34],imageFlipY:e[33],shapes:e[39],toolbar:e[13]||e[6],toolShapes:e[14]||e[7],toolRetainStyles:e[8],enableSelectToolToAddShape:e[23],enableTapToAddText:e[24],enableViewTool:e[22],enableMoveTool:e[26],enableAutoSelectMoveTool:e[25],shapeControls:e[15]||e[9],shapePresets:e[19],enableButtonFlipVertical:e[16],parentRect:e[40],enablePresetDropImage:e[18],enablePresetSelectImage:e[17],toolSelectRadius:e[10],textInputMode:e[11],willStartInteraction:e[21],willRenderPresetToolbar:e[20]||e[12],hooks:{willRenderShapeControls:e[27],beforeAddShape:e[28],beforeRemoveShape:e[29],beforeDeselectShape:e[30],beforeSelectShape:e[31],beforeUpdateShape:e[32]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new ky({props:r}),Dr.push((()=>ua(t,"toolActive",n))),t.$on("measure",e[52]),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(e,i){const n={};16&i[0]&&(n.stores=e[4]),32&i[0]&&(n.locale=e[5]),2&i[0]&&(n.isActive=e[1]),4&i[0]&&(n.isActiveFraction=e[2]),8&i[0]&&(n.isVisible=e[3]),32&i[1]&&(n.mapScreenPointToImagePoint=e[36]),16&i[1]&&(n.mapImagePointToScreenPoint=e[35]),64&i[1]&&(n.imageRotation=e[37]),8&i[1]&&(n.imageFlipX=e[34]),4&i[1]&&(n.imageFlipY=e[33]),8256&i[0]&&(n.toolbar=e[13]||e[6]),16512&i[0]&&(n.toolShapes=e[14]||e[7]),256&i[0]&&(n.toolRetainStyles=e[8]),8388608&i[0]&&(n.enableSelectToolToAddShape=e[23]),16777216&i[0]&&(n.enableTapToAddText=e[24]),4194304&i[0]&&(n.enableViewTool=e[22]),67108864&i[0]&&(n.enableMoveTool=e[26]),33554432&i[0]&&(n.enableAutoSelectMoveTool=e[25]),33280&i[0]&&(n.shapeControls=e[15]||e[9]),524288&i[0]&&(n.shapePresets=e[19]),65536&i[0]&&(n.enableButtonFlipVertical=e[16]),262144&i[0]&&(n.enablePresetDropImage=e[18]),131072&i[0]&&(n.enablePresetSelectImage=e[17]),1024&i[0]&&(n.toolSelectRadius=e[10]),2048&i[0]&&(n.textInputMode=e[11]),2097152&i[0]&&(n.willStartInteraction=e[21]),1052672&i[0]&&(n.willRenderPresetToolbar=e[20]||e[12]),2013265920&i[0]|3&i[1]&&(n.hooks={willRenderShapeControls:e[27],beforeAddShape:e[28],beforeRemoveShape:e[29],beforeDeselectShape:e[30],beforeSelectShape:e[31],beforeUpdateShape:e[32]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],jr((()=>o=!1))),t.$set(n)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}function Py(e,t,o){let i,n,r,a,s,l,c,d,u;let{isActive:h}=t,{isActiveFraction:p}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{markupEditorToolbar:f}=t,{markupEditorToolStyles:y}=t,{markupEditorToolRetainStyles:b}=t,{markupEditorShapeStyleControls:x}=t,{markupEditorToolSelectRadius:v}=t,{markupEditorTextInputMode:w}=t,{willRenderShapePresetToolbar:S}=t,{annotateTools:k}=t,{annotateToolShapes:M}=t,{annotateShapeControls:C}=t,{annotateActiveTool:T}=t,{annotateEnableButtonFlipVertical:P=!1}=t,{annotateEnableSelectImagePreset:R=!1}=t,{annotateEnableDropImagePreset:I=!0}=t,{annotatePresets:A=[]}=t,{annotateWillRenderShapePresetToolbar:E}=t,{markupEditorWillStartInteraction:L}=t,{enableViewTool:F}=t,{enableSelectToolToAddShape:z}=t,{enableTapToAddText:D}=t,{enableAutoSelectMoveTool:B}=t,{enableMoveTool:O}=t,{willRenderShapeControls:_}=t,{beforeAddShape:W}=t,{beforeRemoveShape:V}=t,{beforeDeselectShape:N}=t,{beforeSelectShape:H}=t,{beforeUpdateShape:j}=t;const{rootRect:U,imageAnnotation:Z,imageSize:X,imageRotation:G,imageFlipX:Y,imageFlipY:q,imageTransforms:K,imageTransformsInterpolated:J}=g;return _n(e,U,(e=>o(50,d=e))),_n(e,X,(e=>o(49,c=e))),_n(e,G,(e=>o(37,u=e))),_n(e,Y,(e=>o(34,a=e))),_n(e,q,(e=>o(33,r=e))),_n(e,K,(e=>o(48,l=e))),_n(e,J,(e=>o(47,s=e))),e.$$set=e=>{"isActive"in e&&o(1,h=e.isActive),"isActiveFraction"in e&&o(2,p=e.isActiveFraction),"isVisible"in e&&o(3,m=e.isVisible),"stores"in e&&o(4,g=e.stores),"locale"in e&&o(5,$=e.locale),"markupEditorToolbar"in e&&o(6,f=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(7,y=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(8,b=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(9,x=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(10,v=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(11,w=e.markupEditorTextInputMode),"willRenderShapePresetToolbar"in e&&o(12,S=e.willRenderShapePresetToolbar),"annotateTools"in e&&o(13,k=e.annotateTools),"annotateToolShapes"in e&&o(14,M=e.annotateToolShapes),"annotateShapeControls"in e&&o(15,C=e.annotateShapeControls),"annotateActiveTool"in e&&o(0,T=e.annotateActiveTool),"annotateEnableButtonFlipVertical"in e&&o(16,P=e.annotateEnableButtonFlipVertical),"annotateEnableSelectImagePreset"in e&&o(17,R=e.annotateEnableSelectImagePreset),"annotateEnableDropImagePreset"in e&&o(18,I=e.annotateEnableDropImagePreset),"annotatePresets"in e&&o(19,A=e.annotatePresets),"annotateWillRenderShapePresetToolbar"in e&&o(20,E=e.annotateWillRenderShapePresetToolbar),"markupEditorWillStartInteraction"in e&&o(21,L=e.markupEditorWillStartInteraction),"enableViewTool"in e&&o(22,F=e.enableViewTool),"enableSelectToolToAddShape"in e&&o(23,z=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(24,D=e.enableTapToAddText),"enableAutoSelectMoveTool"in e&&o(25,B=e.enableAutoSelectMoveTool),"enableMoveTool"in e&&o(26,O=e.enableMoveTool),"willRenderShapeControls"in e&&o(27,_=e.willRenderShapeControls),"beforeAddShape"in e&&o(28,W=e.beforeAddShape),"beforeRemoveShape"in e&&o(29,V=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(30,N=e.beforeDeselectShape),"beforeSelectShape"in e&&o(31,H=e.beforeSelectShape),"beforeUpdateShape"in e&&o(32,j=e.beforeUpdateShape)},e.$$.update=()=>{983052&e.$$.dirty[1]&&o(36,i=e=>Cy(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r)),983052&e.$$.dirty[1]&&o(35,n=e=>My(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r))},[T,h,p,m,g,$,f,y,b,x,v,w,S,k,M,C,P,R,I,A,E,L,F,z,D,B,O,_,W,V,N,H,j,r,a,n,i,u,U,Z,X,G,Y,q,K,J,"annotate",s,l,c,d,function(e){T=e,o(0,T)},function(t){Fr.call(this,e,t)}]}var Ry={util:["annotate",class extends $a{constructor(e){super(),ga(this,e,Py,Ty,Dn,{name:46,isActive:1,isActiveFraction:2,isVisible:3,stores:4,locale:5,markupEditorToolbar:6,markupEditorToolStyles:7,markupEditorToolRetainStyles:8,markupEditorShapeStyleControls:9,markupEditorToolSelectRadius:10,markupEditorTextInputMode:11,willRenderShapePresetToolbar:12,annotateTools:13,annotateToolShapes:14,annotateShapeControls:15,annotateActiveTool:0,annotateEnableButtonFlipVertical:16,annotateEnableSelectImagePreset:17,annotateEnableDropImagePreset:18,annotatePresets:19,annotateWillRenderShapePresetToolbar:20,markupEditorWillStartInteraction:21,enableViewTool:22,enableSelectToolToAddShape:23,enableTapToAddText:24,enableAutoSelectMoveTool:25,enableMoveTool:26,willRenderShapeControls:27,beforeAddShape:28,beforeRemoveShape:29,beforeDeselectShape:30,beforeSelectShape:31,beforeUpdateShape:32},null,[-1,-1])}get name(){return this.$$.ctx[46]}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),Gr()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),Gr()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),Gr()}get stores(){return this.$$.ctx[4]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[5]}set locale(e){this.$$set({locale:e}),Gr()}get markupEditorToolbar(){return this.$$.ctx[6]}set markupEditorToolbar(e){this.$$set({markupEditorToolbar:e}),Gr()}get markupEditorToolStyles(){return this.$$.ctx[7]}set markupEditorToolStyles(e){this.$$set({markupEditorToolStyles:e}),Gr()}get markupEditorToolRetainStyles(){return this.$$.ctx[8]}set markupEditorToolRetainStyles(e){this.$$set({markupEditorToolRetainStyles:e}),Gr()}get markupEditorShapeStyleControls(){return this.$$.ctx[9]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),Gr()}get markupEditorToolSelectRadius(){return this.$$.ctx[10]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),Gr()}get markupEditorTextInputMode(){return this.$$.ctx[11]}set markupEditorTextInputMode(e){this.$$set({markupEditorTextInputMode:e}),Gr()}get willRenderShapePresetToolbar(){return this.$$.ctx[12]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),Gr()}get annotateTools(){return this.$$.ctx[13]}set annotateTools(e){this.$$set({annotateTools:e}),Gr()}get annotateToolShapes(){return this.$$.ctx[14]}set annotateToolShapes(e){this.$$set({annotateToolShapes:e}),Gr()}get annotateShapeControls(){return this.$$.ctx[15]}set annotateShapeControls(e){this.$$set({annotateShapeControls:e}),Gr()}get annotateActiveTool(){return this.$$.ctx[0]}set annotateActiveTool(e){this.$$set({annotateActiveTool:e}),Gr()}get annotateEnableButtonFlipVertical(){return this.$$.ctx[16]}set annotateEnableButtonFlipVertical(e){this.$$set({annotateEnableButtonFlipVertical:e}),Gr()}get annotateEnableSelectImagePreset(){return this.$$.ctx[17]}set annotateEnableSelectImagePreset(e){this.$$set({annotateEnableSelectImagePreset:e}),Gr()}get annotateEnableDropImagePreset(){return this.$$.ctx[18]}set annotateEnableDropImagePreset(e){this.$$set({annotateEnableDropImagePreset:e}),Gr()}get annotatePresets(){return this.$$.ctx[19]}set annotatePresets(e){this.$$set({annotatePresets:e}),Gr()}get annotateWillRenderShapePresetToolbar(){return this.$$.ctx[20]}set annotateWillRenderShapePresetToolbar(e){this.$$set({annotateWillRenderShapePresetToolbar:e}),Gr()}get markupEditorWillStartInteraction(){return this.$$.ctx[21]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),Gr()}get enableViewTool(){return this.$$.ctx[22]}set enableViewTool(e){this.$$set({enableViewTool:e}),Gr()}get enableSelectToolToAddShape(){return this.$$.ctx[23]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),Gr()}get enableTapToAddText(){return this.$$.ctx[24]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),Gr()}get enableAutoSelectMoveTool(){return this.$$.ctx[25]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),Gr()}get enableMoveTool(){return this.$$.ctx[26]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),Gr()}get willRenderShapeControls(){return this.$$.ctx[27]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),Gr()}get beforeAddShape(){return this.$$.ctx[28]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),Gr()}get beforeRemoveShape(){return this.$$.ctx[29]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),Gr()}get beforeDeselectShape(){return this.$$.ctx[30]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),Gr()}get beforeSelectShape(){return this.$$.ctx[31]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),Gr()}get beforeUpdateShape(){return this.$$.ctx[32]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),Gr()}}]};function Iy(e){let t,o,i;function n(t){e[43](t)}let r={stores:e[4],locale:e[5],isActive:e[1],isActiveFraction:e[2],isVisible:e[3],mapScreenPointToImagePoint:e[34],mapImagePointToScreenPoint:e[33],utilKey:"decorate",shapes:e[36],toolbar:e[13]||e[6],toolShapes:e[14]||e[7],toolRetainStyles:e[8],shapeControls:e[15]||e[9],shapePresets:e[19],enableSelectToolToAddShape:e[21],enableTapToAddText:e[22],enableViewTool:e[23],enableMoveTool:e[24],enableAutoSelectMoveTool:e[25],enablePresetSelectImage:e[17],enablePresetDropImage:e[18],enableButtonFlipVertical:e[16],parentRect:e[35],toolSelectRadius:e[10],textInputMode:e[11],willStartInteraction:e[32],willRenderPresetToolbar:e[20]||e[12],hooks:{willRenderShapeControls:e[26],beforeAddShape:e[27],beforeRemoveShape:e[28],beforeDeselectShape:e[29],beforeSelectShape:e[30],beforeUpdateShape:e[31]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new ky({props:r}),Dr.push((()=>ua(t,"toolActive",n))),t.$on("measure",e[44]),{c(){ha(t.$$.fragment)},m(e,o){pa(t,e,o),i=!0},p(e,i){const n={};16&i[0]&&(n.stores=e[4]),32&i[0]&&(n.locale=e[5]),2&i[0]&&(n.isActive=e[1]),4&i[0]&&(n.isActiveFraction=e[2]),8&i[0]&&(n.isVisible=e[3]),8&i[1]&&(n.mapScreenPointToImagePoint=e[34]),4&i[1]&&(n.mapImagePointToScreenPoint=e[33]),8256&i[0]&&(n.toolbar=e[13]||e[6]),16512&i[0]&&(n.toolShapes=e[14]||e[7]),256&i[0]&&(n.toolRetainStyles=e[8]),33280&i[0]&&(n.shapeControls=e[15]||e[9]),524288&i[0]&&(n.shapePresets=e[19]),2097152&i[0]&&(n.enableSelectToolToAddShape=e[21]),4194304&i[0]&&(n.enableTapToAddText=e[22]),8388608&i[0]&&(n.enableViewTool=e[23]),16777216&i[0]&&(n.enableMoveTool=e[24]),33554432&i[0]&&(n.enableAutoSelectMoveTool=e[25]),131072&i[0]&&(n.enablePresetSelectImage=e[17]),262144&i[0]&&(n.enablePresetDropImage=e[18]),65536&i[0]&&(n.enableButtonFlipVertical=e[16]),1024&i[0]&&(n.toolSelectRadius=e[10]),2048&i[0]&&(n.textInputMode=e[11]),2&i[1]&&(n.willStartInteraction=e[32]),1052672&i[0]&&(n.willRenderPresetToolbar=e[20]||e[12]),2080374784&i[0]|1&i[1]&&(n.hooks={willRenderShapeControls:e[26],beforeAddShape:e[27],beforeRemoveShape:e[28],beforeDeselectShape:e[29],beforeSelectShape:e[30],beforeUpdateShape:e[31]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],jr((()=>o=!1))),t.$set(n)},i(e){i||(ta(t.$$.fragment,e),i=!0)},o(e){oa(t.$$.fragment,e),i=!1},d(e){ma(t,e)}}}function Ay(e,t,o){let i,n,r,a,s;let{isActive:l}=t,{isActiveFraction:c}=t,{isVisible:d}=t,{stores:u}=t,{locale:h={}}=t,{markupEditorToolbar:p}=t,{markupEditorToolStyles:m}=t,{markupEditorToolRetainStyles:g}=t,{markupEditorShapeStyleControls:$}=t,{markupEditorToolSelectRadius:f}=t,{markupEditorTextInputMode:y}=t,{willRenderShapePresetToolbar:b}=t,{decorateTools:x}=t,{decorateToolShapes:v}=t,{decorateShapeControls:w}=t,{decorateActiveTool:S}=t,{decorateEnableButtonFlipVertical:k=!1}=t,{decorateEnableSelectImagePreset:M=!1}=t,{decorateEnableDropImagePreset:C=!0}=t,{decoratePresets:T=[]}=t,{decorateWillRenderShapePresetToolbar:P}=t,{enableSelectToolToAddShape:R}=t,{enableTapToAddText:I}=t,{enableViewTool:A}=t,{enableMoveTool:E}=t,{enableAutoSelectMoveTool:L}=t,{willRenderShapeControls:F}=t,{beforeAddShape:z}=t,{beforeRemoveShape:D}=t,{beforeDeselectShape:B}=t,{beforeSelectShape:O}=t,{beforeUpdateShape:_}=t,{markupEditorWillStartInteraction:W}=t;const{imageCropRect:V,imageDecoration:N,imageSelectionRectPresentation:H,imageTransformsInterpolated:j}=u;return _n(e,H,(e=>o(41,a=e))),_n(e,j,(e=>o(42,s=e))),e.$$set=e=>{"isActive"in e&&o(1,l=e.isActive),"isActiveFraction"in e&&o(2,c=e.isActiveFraction),"isVisible"in e&&o(3,d=e.isVisible),"stores"in e&&o(4,u=e.stores),"locale"in e&&o(5,h=e.locale),"markupEditorToolbar"in e&&o(6,p=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(7,m=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(8,g=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(9,$=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(10,f=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(11,y=e.markupEditorTextInputMode),"willRenderShapePresetToolbar"in e&&o(12,b=e.willRenderShapePresetToolbar),"decorateTools"in e&&o(13,x=e.decorateTools),"decorateToolShapes"in e&&o(14,v=e.decorateToolShapes),"decorateShapeControls"in e&&o(15,w=e.decorateShapeControls),"decorateActiveTool"in e&&o(0,S=e.decorateActiveTool),"decorateEnableButtonFlipVertical"in e&&o(16,k=e.decorateEnableButtonFlipVertical),"decorateEnableSelectImagePreset"in e&&o(17,M=e.decorateEnableSelectImagePreset),"decorateEnableDropImagePreset"in e&&o(18,C=e.decorateEnableDropImagePreset),"decoratePresets"in e&&o(19,T=e.decoratePresets),"decorateWillRenderShapePresetToolbar"in e&&o(20,P=e.decorateWillRenderShapePresetToolbar),"enableSelectToolToAddShape"in e&&o(21,R=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(22,I=e.enableTapToAddText),"enableViewTool"in e&&o(23,A=e.enableViewTool),"enableMoveTool"in e&&o(24,E=e.enableMoveTool),"enableAutoSelectMoveTool"in e&&o(25,L=e.enableAutoSelectMoveTool),"willRenderShapeControls"in e&&o(26,F=e.willRenderShapeControls),"beforeAddShape"in e&&o(27,z=e.beforeAddShape),"beforeRemoveShape"in e&&o(28,D=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(29,B=e.beforeDeselectShape),"beforeSelectShape"in e&&o(30,O=e.beforeSelectShape),"beforeUpdateShape"in e&&o(31,_=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(32,W=e.markupEditorWillStartInteraction)},e.$$.update=()=>{2048&e.$$.dirty[1]&&o(40,i=s?s.scale:1),1536&e.$$.dirty[1]&&o(34,n=e=>{const t=me(e);return t.x-=a.x,t.y-=a.y,t.x/=i,t.y/=i,t}),1536&e.$$.dirty[1]&&o(33,r=e=>{const t=me(e);return t.x*=i,t.y*=i,t.x+=a.x,t.y+=a.y,t})},[S,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,k,M,C,T,P,R,I,A,E,L,F,z,D,B,O,_,W,r,n,V,N,H,j,"decorate",i,a,s,function(e){S=e,o(0,S)},function(t){Fr.call(this,e,t)}]}var Ey={util:["decorate",class extends $a{constructor(e){super(),ga(this,e,Ay,Iy,Dn,{name:39,isActive:1,isActiveFraction:2,isVisible:3,stores:4,locale:5,markupEditorToolbar:6,markupEditorToolStyles:7,markupEditorToolRetainStyles:8,markupEditorShapeStyleControls:9,markupEditorToolSelectRadius:10,markupEditorTextInputMode:11,willRenderShapePresetToolbar:12,decorateTools:13,decorateToolShapes:14,decorateShapeControls:15,decorateActiveTool:0,decorateEnableButtonFlipVertical:16,decorateEnableSelectImagePreset:17,decorateEnableDropImagePreset:18,decoratePresets:19,decorateWillRenderShapePresetToolbar:20,enableSelectToolToAddShape:21,enableTapToAddText:22,enableViewTool:23,enableMoveTool:24,enableAutoSelectMoveTool:25,willRenderShapeControls:26,beforeAddShape:27,beforeRemoveShape:28,beforeDeselectShape:29,beforeSelectShape:30,beforeUpdateShape:31,markupEditorWillStartInteraction:32},null,[-1,-1])}get name(){return this.$$.ctx[39]}get isActive(){return this.$$.ctx[1]}set isActive(e){this.$$set({isActive:e}),Gr()}get isActiveFraction(){return this.$$.ctx[2]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),Gr()}get isVisible(){return this.$$.ctx[3]}set isVisible(e){this.$$set({isVisible:e}),Gr()}get stores(){return this.$$.ctx[4]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[5]}set locale(e){this.$$set({locale:e}),Gr()}get markupEditorToolbar(){return this.$$.ctx[6]}set markupEditorToolbar(e){this.$$set({markupEditorToolbar:e}),Gr()}get markupEditorToolStyles(){return this.$$.ctx[7]}set markupEditorToolStyles(e){this.$$set({markupEditorToolStyles:e}),Gr()}get markupEditorToolRetainStyles(){return this.$$.ctx[8]}set markupEditorToolRetainStyles(e){this.$$set({markupEditorToolRetainStyles:e}),Gr()}get markupEditorShapeStyleControls(){return this.$$.ctx[9]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),Gr()}get markupEditorToolSelectRadius(){return this.$$.ctx[10]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),Gr()}get markupEditorTextInputMode(){return this.$$.ctx[11]}set markupEditorTextInputMode(e){this.$$set({markupEditorTextInputMode:e}),Gr()}get willRenderShapePresetToolbar(){return this.$$.ctx[12]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),Gr()}get decorateTools(){return this.$$.ctx[13]}set decorateTools(e){this.$$set({decorateTools:e}),Gr()}get decorateToolShapes(){return this.$$.ctx[14]}set decorateToolShapes(e){this.$$set({decorateToolShapes:e}),Gr()}get decorateShapeControls(){return this.$$.ctx[15]}set decorateShapeControls(e){this.$$set({decorateShapeControls:e}),Gr()}get decorateActiveTool(){return this.$$.ctx[0]}set decorateActiveTool(e){this.$$set({decorateActiveTool:e}),Gr()}get decorateEnableButtonFlipVertical(){return this.$$.ctx[16]}set decorateEnableButtonFlipVertical(e){this.$$set({decorateEnableButtonFlipVertical:e}),Gr()}get decorateEnableSelectImagePreset(){return this.$$.ctx[17]}set decorateEnableSelectImagePreset(e){this.$$set({decorateEnableSelectImagePreset:e}),Gr()}get decorateEnableDropImagePreset(){return this.$$.ctx[18]}set decorateEnableDropImagePreset(e){this.$$set({decorateEnableDropImagePreset:e}),Gr()}get decoratePresets(){return this.$$.ctx[19]}set decoratePresets(e){this.$$set({decoratePresets:e}),Gr()}get decorateWillRenderShapePresetToolbar(){return this.$$.ctx[20]}set decorateWillRenderShapePresetToolbar(e){this.$$set({decorateWillRenderShapePresetToolbar:e}),Gr()}get enableSelectToolToAddShape(){return this.$$.ctx[21]}set enableSelectToolToAddShape(e){this.$$set({enableSelectToolToAddShape:e}),Gr()}get enableTapToAddText(){return this.$$.ctx[22]}set enableTapToAddText(e){this.$$set({enableTapToAddText:e}),Gr()}get enableViewTool(){return this.$$.ctx[23]}set enableViewTool(e){this.$$set({enableViewTool:e}),Gr()}get enableMoveTool(){return this.$$.ctx[24]}set enableMoveTool(e){this.$$set({enableMoveTool:e}),Gr()}get enableAutoSelectMoveTool(){return this.$$.ctx[25]}set enableAutoSelectMoveTool(e){this.$$set({enableAutoSelectMoveTool:e}),Gr()}get willRenderShapeControls(){return this.$$.ctx[26]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),Gr()}get beforeAddShape(){return this.$$.ctx[27]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),Gr()}get beforeRemoveShape(){return this.$$.ctx[28]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),Gr()}get beforeDeselectShape(){return this.$$.ctx[29]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),Gr()}get beforeSelectShape(){return this.$$.ctx[30]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),Gr()}get beforeUpdateShape(){return this.$$.ctx[31]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),Gr()}get markupEditorWillStartInteraction(){return this.$$.ctx[32]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),Gr()}}]};function Ly(e){let t,o;return t=new ky({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[24],mapImagePointToScreenPoint:e[23],utilKey:"sticker",shapePresets:e[5],shapes:e[6]?e[30]:e[31],toolActive:"preset",imageFlipX:!!e[6]&&e[22],imageFlipY:!!e[6]&&e[21],imageRotation:e[6]?e[26]:0,parentRect:e[6]?e[32]:e[28],enablePresetDropImage:e[7],enablePresetSelectImage:e[25],enableButtonFlipVertical:e[10]||e[8],toolSelectRadius:e[13],willStartInteraction:e[20],willRenderPresetToolbar:e[11]||e[9]||e[14],hooks:{willRenderShapeControls:e[12],beforeAddShape:e[15],beforeRemoveShape:e[16],beforeDeselectShape:e[17],beforeSelectShape:e[18],beforeUpdateShape:e[19]}}}),t.$on("measure",e[47]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};8&o[0]&&(i.stores=e[3]),16&o[0]&&(i.locale=e[4]),1&o[0]&&(i.isActive=e[0]),2&o[0]&&(i.isActiveFraction=e[1]),4&o[0]&&(i.isVisible=e[2]),16777216&o[0]&&(i.mapScreenPointToImagePoint=e[24]),8388608&o[0]&&(i.mapImagePointToScreenPoint=e[23]),32&o[0]&&(i.shapePresets=e[5]),64&o[0]&&(i.shapes=e[6]?e[30]:e[31]),4194368&o[0]&&(i.imageFlipX=!!e[6]&&e[22]),2097216&o[0]&&(i.imageFlipY=!!e[6]&&e[21]),67108928&o[0]&&(i.imageRotation=e[6]?e[26]:0),64&o[0]&&(i.parentRect=e[6]?e[32]:e[28]),128&o[0]&&(i.enablePresetDropImage=e[7]),33554432&o[0]&&(i.enablePresetSelectImage=e[25]),1280&o[0]&&(i.enableButtonFlipVertical=e[10]||e[8]),8192&o[0]&&(i.toolSelectRadius=e[13]),1048576&o[0]&&(i.willStartInteraction=e[20]),18944&o[0]&&(i.willRenderPresetToolbar=e[11]||e[9]||e[14]),1019904&o[0]&&(i.hooks={willRenderShapeControls:e[12],beforeAddShape:e[15],beforeRemoveShape:e[16],beforeDeselectShape:e[17],beforeSelectShape:e[18],beforeUpdateShape:e[19]}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Fy(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m;let{isActive:g}=t,{isActiveFraction:$}=t,{isVisible:f}=t,{stores:y}=t,{locale:b={}}=t,{stickers:x=[]}=t,{stickerStickToImage:v=!1}=t,{stickerEnableSelectImagePreset:w=!0}=t,{stickerEnableDropImagePreset:S=!0}=t,{stickerEnableButtonFlipVertical:k=!1}=t,{stickerWillRenderShapePresetToolbar:M}=t,{stickerEnableSelectImage:C=!0}=t,{stickersEnableButtonFlipVertical:T=!1}=t,{stickersWillRenderShapePresetToolbar:P}=t,{willRenderShapeControls:R}=t,{markupEditorToolSelectRadius:I}=t,{willRenderShapePresetToolbar:A}=t,{beforeAddShape:E}=t,{beforeRemoveShape:L}=t,{beforeDeselectShape:F}=t,{beforeSelectShape:z}=t,{beforeUpdateShape:D}=t,{markupEditorWillStartInteraction:B}=t;const{rootRect:O,imageCropRect:_,imageSelectionRectPresentation:W,imageAnnotation:V,imageDecoration:N,imageSize:H,imageTransforms:j,imageTransformsInterpolated:U,imageRotation:Z,imageFlipX:X,imageFlipY:G}=y;return _n(e,O,(e=>o(46,p=e))),_n(e,W,(e=>o(42,s=e))),_n(e,H,(e=>o(45,h=e))),_n(e,j,(e=>o(44,u=e))),_n(e,U,(e=>o(43,d=e))),_n(e,Z,(e=>o(26,m=e))),_n(e,X,(e=>o(22,c=e))),_n(e,G,(e=>o(21,l=e))),e.$$set=e=>{"isActive"in e&&o(0,g=e.isActive),"isActiveFraction"in e&&o(1,$=e.isActiveFraction),"isVisible"in e&&o(2,f=e.isVisible),"stores"in e&&o(3,y=e.stores),"locale"in e&&o(4,b=e.locale),"stickers"in e&&o(5,x=e.stickers),"stickerStickToImage"in e&&o(6,v=e.stickerStickToImage),"stickerEnableSelectImagePreset"in e&&o(39,w=e.stickerEnableSelectImagePreset),"stickerEnableDropImagePreset"in e&&o(7,S=e.stickerEnableDropImagePreset),"stickerEnableButtonFlipVertical"in e&&o(8,k=e.stickerEnableButtonFlipVertical),"stickerWillRenderShapePresetToolbar"in e&&o(9,M=e.stickerWillRenderShapePresetToolbar),"stickerEnableSelectImage"in e&&o(40,C=e.stickerEnableSelectImage),"stickersEnableButtonFlipVertical"in e&&o(10,T=e.stickersEnableButtonFlipVertical),"stickersWillRenderShapePresetToolbar"in e&&o(11,P=e.stickersWillRenderShapePresetToolbar),"willRenderShapeControls"in e&&o(12,R=e.willRenderShapeControls),"markupEditorToolSelectRadius"in e&&o(13,I=e.markupEditorToolSelectRadius),"willRenderShapePresetToolbar"in e&&o(14,A=e.willRenderShapePresetToolbar),"beforeAddShape"in e&&o(15,E=e.beforeAddShape),"beforeRemoveShape"in e&&o(16,L=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(17,F=e.beforeDeselectShape),"beforeSelectShape"in e&&o(18,z=e.beforeSelectShape),"beforeUpdateShape"in e&&o(19,D=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(20,B=e.markupEditorWillStartInteraction)},e.$$.update=()=>{4096&e.$$.dirty[1]&&o(41,i=d?d.scale:1),768&e.$$.dirty[1]&&o(25,n=!1!==w&&C),6291520&e.$$.dirty[0]|64512&e.$$.dirty[1]&&o(24,r=v?e=>Cy(e,p,h,d.origin,d.translation,u.rotation.z,d.scale,c,l):e=>{const t=me(e);return t.x-=s.x,t.y-=s.y,t.x/=i,t.y/=i,t}),6291520&e.$$.dirty[0]|64512&e.$$.dirty[1]&&o(23,a=v?e=>My(e,p,h,d.origin,d.translation,u.rotation.z,d.scale,c,l):e=>{const t=me(e);return t.x*=i,t.y*=i,t.x+=s.x,t.y+=s.y,t})},[g,$,f,y,b,x,v,S,k,M,T,P,R,I,A,E,L,F,z,D,B,l,c,a,r,n,m,O,_,W,V,N,H,j,U,Z,X,G,"sticker",w,C,i,s,d,u,h,p,function(t){Fr.call(this,e,t)}]}var zy={util:["sticker",class extends $a{constructor(e){super(),ga(this,e,Fy,Ly,Dn,{name:38,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,stickers:5,stickerStickToImage:6,stickerEnableSelectImagePreset:39,stickerEnableDropImagePreset:7,stickerEnableButtonFlipVertical:8,stickerWillRenderShapePresetToolbar:9,stickerEnableSelectImage:40,stickersEnableButtonFlipVertical:10,stickersWillRenderShapePresetToolbar:11,willRenderShapeControls:12,markupEditorToolSelectRadius:13,willRenderShapePresetToolbar:14,beforeAddShape:15,beforeRemoveShape:16,beforeDeselectShape:17,beforeSelectShape:18,beforeUpdateShape:19,markupEditorWillStartInteraction:20},null,[-1,-1])}get name(){return this.$$.ctx[38]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),Gr()}get isVisible(){return this.$$.ctx[2]}set isVisible(e){this.$$set({isVisible:e}),Gr()}get stores(){return this.$$.ctx[3]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),Gr()}get stickers(){return this.$$.ctx[5]}set stickers(e){this.$$set({stickers:e}),Gr()}get stickerStickToImage(){return this.$$.ctx[6]}set stickerStickToImage(e){this.$$set({stickerStickToImage:e}),Gr()}get stickerEnableSelectImagePreset(){return this.$$.ctx[39]}set stickerEnableSelectImagePreset(e){this.$$set({stickerEnableSelectImagePreset:e}),Gr()}get stickerEnableDropImagePreset(){return this.$$.ctx[7]}set stickerEnableDropImagePreset(e){this.$$set({stickerEnableDropImagePreset:e}),Gr()}get stickerEnableButtonFlipVertical(){return this.$$.ctx[8]}set stickerEnableButtonFlipVertical(e){this.$$set({stickerEnableButtonFlipVertical:e}),Gr()}get stickerWillRenderShapePresetToolbar(){return this.$$.ctx[9]}set stickerWillRenderShapePresetToolbar(e){this.$$set({stickerWillRenderShapePresetToolbar:e}),Gr()}get stickerEnableSelectImage(){return this.$$.ctx[40]}set stickerEnableSelectImage(e){this.$$set({stickerEnableSelectImage:e}),Gr()}get stickersEnableButtonFlipVertical(){return this.$$.ctx[10]}set stickersEnableButtonFlipVertical(e){this.$$set({stickersEnableButtonFlipVertical:e}),Gr()}get stickersWillRenderShapePresetToolbar(){return this.$$.ctx[11]}set stickersWillRenderShapePresetToolbar(e){this.$$set({stickersWillRenderShapePresetToolbar:e}),Gr()}get willRenderShapeControls(){return this.$$.ctx[12]}set willRenderShapeControls(e){this.$$set({willRenderShapeControls:e}),Gr()}get markupEditorToolSelectRadius(){return this.$$.ctx[13]}set markupEditorToolSelectRadius(e){this.$$set({markupEditorToolSelectRadius:e}),Gr()}get willRenderShapePresetToolbar(){return this.$$.ctx[14]}set willRenderShapePresetToolbar(e){this.$$set({willRenderShapePresetToolbar:e}),Gr()}get beforeAddShape(){return this.$$.ctx[15]}set beforeAddShape(e){this.$$set({beforeAddShape:e}),Gr()}get beforeRemoveShape(){return this.$$.ctx[16]}set beforeRemoveShape(e){this.$$set({beforeRemoveShape:e}),Gr()}get beforeDeselectShape(){return this.$$.ctx[17]}set beforeDeselectShape(e){this.$$set({beforeDeselectShape:e}),Gr()}get beforeSelectShape(){return this.$$.ctx[18]}set beforeSelectShape(e){this.$$set({beforeSelectShape:e}),Gr()}get beforeUpdateShape(){return this.$$.ctx[19]}set beforeUpdateShape(e){this.$$set({beforeUpdateShape:e}),Gr()}get markupEditorWillStartInteraction(){return this.$$.ctx[20]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),Gr()}}]};function Dy(e){let t,o,i,n,r,a=(e[14](e[33].value)||"")+"",s=(R(e[33].label)?e[33].label(e[1]):e[33].label)+"";return{c(){t=ar("div"),o=new br(!1),i=cr(),n=ar("span"),r=lr(s),o.a=i,mr(t,"slot","option")},m(e,s){nr(e,t,s),o.m(a,t),tr(t,i),tr(t,n),tr(n,r)},p(e,t){4&t[1]&&a!==(a=(e[14](e[33].value)||"")+"")&&o.p(a),2&t[0]|4&t[1]&&s!==(s=(R(e[33].label)?e[33].label(e[1]):e[33].label)+"")&&$r(r,s)},d(e){e&&rr(t)}}}function By(e){let t,o;return t=new yu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[6],onchange:e[12],$$slots:{option:[Dy,({option:e})=>({33:e}),({option:e})=>[0,e?4:0]]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};2&o[0]&&(i.locale=e[1]),4&o[0]&&(i.options=e[2]),64&o[0]&&(i.selectedIndex=e[6]),2&o[0]|12&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Oy(e){let t,o,i,n,r;return o=new Df({props:{locale:e[1],class:"PinturaControlPanels",shape:e[4],onchange:e[13],controls:e[3],scrollElasticity:e[7]}}),n=new rd({props:{elasticity:e[10],$$slots:{default:[By]},$$scope:{ctx:e}}}),{c(){t=ar("div"),ha(o.$$.fragment),i=cr(),ha(n.$$.fragment),mr(t,"slot","footer"),mr(t,"style",e[5])},m(e,a){nr(e,t,a),pa(o,t,null),tr(t,i),pa(n,t,null),r=!0},p(e,i){const a={};2&i[0]&&(a.locale=e[1]),16&i[0]&&(a.shape=e[4]),8&i[0]&&(a.controls=e[3]),128&i[0]&&(a.scrollElasticity=e[7]),o.$set(a);const s={};70&i[0]|8&i[1]&&(s.$$scope={dirty:i,ctx:e}),n.$set(s),(!r||32&i[0])&&mr(t,"style",e[5])},i(e){r||(ta(o.$$.fragment,e),ta(n.$$.fragment,e),r=!0)},o(e){oa(o.$$.fragment,e),oa(n.$$.fragment,e),r=!1},d(e){e&&rr(t),ma(o),ma(n)}}}function _y(e){let t,o;return t=new Ag({props:{$$slots:{footer:[Oy]},$$scope:{ctx:e}}}),t.$on("measure",e[23]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};254&o[0]|8&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Wy(e,t,o){let i,n,r,a,s,l,c,d,u=Rn,h=()=>(u(),u=Bn(p,(e=>o(20,s=e))),p);e.$$.on_destroy.push((()=>u()));let{isActive:p}=t;h();let{stores:m}=t,{locale:g={}}=t,{frameStyles:$={}}=t,{frameOptions:f=[]}=t,{markupEditorShapeStyleControls:y}=t;const b=Lr("elasticityMultiplier");_n(e,b,(e=>o(22,d=e)));const{history:x,animation:v,scrollElasticity:w,imageFrame:S,allowPan:k,allowZoom:M,allowZoomControls:C}=m;_n(e,v,(e=>o(21,l=e))),_n(e,S,(e=>o(4,c=e)));let T={};let P;const R=Fl(l?20:0);return _n(e,R,(e=>o(19,a=e))),e.$$set=e=>{"isActive"in e&&h(o(0,p=e.isActive)),"stores"in e&&o(17,m=e.stores),"locale"in e&&o(1,g=e.locale),"frameStyles"in e&&o(18,$=e.frameStyles),"frameOptions"in e&&o(2,f=e.frameOptions),"markupEditorShapeStyleControls"in e&&o(3,y=e.markupEditorShapeStyleControls)},e.$$.update=()=>{1048576&e.$$.dirty[0]&&k.set(s),1048576&e.$$.dirty[0]&&M.set(s),1048576&e.$$.dirty[0]&&C.set(s),4194304&e.$$.dirty[0]&&o(7,i=d*w),20&e.$$.dirty[0]&&o(6,n=c?f.findIndex((([e])=>e===c.id)):0),3145728&e.$$.dirty[0]&&l&&R.set(s?0:20),524288&e.$$.dirty[0]&&o(5,r=a?`transform: translateY(${a}px)`:void 0)},[p,g,f,y,c,r,n,i,b,v,w,S,({value:e})=>{const t=$[e];if(!t||!t.shape)return S.set(void 0),void x.write();const{shape:o}=t,i={id:e,...si(o),...Object.keys(T).reduce(((e,t)=>o[t]?(e[t]=T[t],e):e),{})};S.set(i),x.write()},function(e){Ro(e,"frameColor")&&(T.frameColor=e.frameColor),c&&(tn(c,e),S.set(c),clearTimeout(P),P=setTimeout((()=>{x.write()}),200))},e=>{const t=$[e];var o;if(t&&t.thumb)return o=t.thumb,/div/i.test(o)||Zf(o)?o:/rect|path|circle|line|<g>/i.test(o)?`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" stroke-width="1" stroke="currentColor" fill="none" aria-hidden="true" focusable="false" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`:`<img src="${o}" alt=""/>`},R,"frame",m,$,a,s,l,d,function(t){Fr.call(this,e,t)}]}var Vy={util:["frame",class extends $a{constructor(e){super(),ga(this,e,Wy,_y,Dn,{name:16,isActive:0,stores:17,locale:1,frameStyles:18,frameOptions:2,markupEditorShapeStyleControls:3},null,[-1,-1])}get name(){return this.$$.ctx[16]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get stores(){return this.$$.ctx[17]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),Gr()}get frameStyles(){return this.$$.ctx[18]}set frameStyles(e){this.$$set({frameStyles:e}),Gr()}get frameOptions(){return this.$$.ctx[2]}set frameOptions(e){this.$$set({frameOptions:e}),Gr()}get markupEditorShapeStyleControls(){return this.$$.ctx[3]}set markupEditorShapeStyleControls(e){this.$$set({markupEditorShapeStyleControls:e}),Gr()}},({duration:e})=>!e]};function Ny(e){let t,o,i,n,r,a,s,l;return{c(){t=ar("div"),o=ar("input"),n=cr(),r=ar("label"),a=lr(e[1]),mr(o,"id",e[0]),mr(o,"type","number"),mr(o,"min","1"),mr(o,"inputmode","numeric"),mr(o,"pattern","[0-9]*"),mr(o,"data-state",e[3]),mr(o,"autocomplete","off"),mr(o,"placeholder",e[4]),o.value=i=void 0===e[5]?"":e[7](e[5]+""),mr(r,"for",e[0]),mr(r,"title",e[2]),mr(r,"aria-label",e[2]),mr(t,"class","PinturaInputDimension")},m(i,c){nr(i,t,c),tr(t,o),tr(t,n),tr(t,r),tr(r,a),s||(l=ur(o,"input",e[8]),s=!0)},p(e,[t]){1&t&&mr(o,"id",e[0]),8&t&&mr(o,"data-state",e[3]),16&t&&mr(o,"placeholder",e[4]),160&t&&i!==(i=void 0===e[5]?"":e[7](e[5]+""))&&o.value!==i&&(o.value=i),2&t&&$r(a,e[1]),1&t&&mr(r,"for",e[0]),4&t&&mr(r,"title",e[2]),4&t&&mr(r,"aria-label",e[2])},i:Rn,o:Rn,d(e){e&&rr(t),s=!1,l()}}}function Hy(e,t,o){let{id:i}=t,{label:n}=t,{title:r}=t,{state:a}=t,{placeholder:s}=t,{value:l}=t,{onchange:c}=t,{format:d=(e=>e.replace(/\D/g,""))}=t;return e.$$set=e=>{"id"in e&&o(0,i=e.id),"label"in e&&o(1,n=e.label),"title"in e&&o(2,r=e.title),"state"in e&&o(3,a=e.state),"placeholder"in e&&o(4,s=e.placeholder),"value"in e&&o(5,l=e.value),"onchange"in e&&o(6,c=e.onchange),"format"in e&&o(7,d=e.format)},[i,n,r,a,s,l,c,d,e=>c(d(e.currentTarget.value))]}class jy extends $a{constructor(e){super(),ga(this,e,Hy,Ny,Dn,{id:0,label:1,title:2,state:3,placeholder:4,value:5,onchange:6,format:7})}}function Uy(e){let t;return{c(){t=sr("g")},m(o,i){nr(o,t,i),t.innerHTML=e[2]},p(e,o){4&o&&(t.innerHTML=e[2])},d(e){e&&rr(t)}}}function Zy(e){let t,o,i,n,r,a,s,l;return r=new Tc({props:{$$slots:{default:[Uy]},$$scope:{ctx:e}}}),{c(){t=ar("div"),o=ar("input"),i=cr(),n=ar("label"),ha(r.$$.fragment),mr(o,"id",e[0]),mr(o,"class","implicit"),mr(o,"type","checkbox"),o.checked=e[1],mr(n,"for",e[0]),mr(n,"title",e[3])},m(c,d){nr(c,t,d),tr(t,o),tr(t,i),tr(t,n),pa(r,n,null),a=!0,s||(l=ur(o,"change",e[5]),s=!0)},p(e,[t]){(!a||1&t)&&mr(o,"id",e[0]),(!a||2&t)&&(o.checked=e[1]);const i={};68&t&&(i.$$scope={dirty:t,ctx:e}),r.$set(i),(!a||1&t)&&mr(n,"for",e[0]),(!a||8&t)&&mr(n,"title",e[3])},i(e){a||(ta(r.$$.fragment,e),a=!0)},o(e){oa(r.$$.fragment,e),a=!1},d(e){e&&rr(t),ma(r),s=!1,l()}}}function Xy(e,t,o){let{id:i}=t,{locked:n}=t,{icon:r}=t,{title:a}=t,{onchange:s}=t;return e.$$set=e=>{"id"in e&&o(0,i=e.id),"locked"in e&&o(1,n=e.locked),"icon"in e&&o(2,r=e.icon),"title"in e&&o(3,a=e.title),"onchange"in e&&o(4,s=e.onchange)},[i,n,r,a,s,e=>s(e.currentTarget.checked)]}class Gy extends $a{constructor(e){super(),ga(this,e,Xy,Zy,Dn,{id:0,locked:1,icon:2,title:3,onchange:4})}}function Yy(e){let t;return{c(){t=lr("Save")},m(e,o){nr(e,t,o)},d(e){e&&rr(t)}}}function qy(e){let t,o,i,n,r,a,s,l,c,d,u,h,p,m=e[1].resizeLabelFormCaption+"";return l=new eh({props:{items:e[4]}}),d=new jc({props:{type:"submit",class:"implicit",$$slots:{default:[Yy]},$$scope:{ctx:e}}}),{c(){t=ar("form"),o=ar("div"),i=ar("fieldset"),n=ar("legend"),r=lr(m),a=cr(),s=ar("div"),ha(l.$$.fragment),c=cr(),ha(d.$$.fragment),mr(n,"class","implicit"),mr(s,"class","PinturaFieldsetInner"),mr(o,"class","PinturaFormInner"),mr(t,"slot","footer"),mr(t,"style",e[3])},m(m,g){nr(m,t,g),tr(t,o),tr(o,i),tr(i,n),tr(n,r),tr(i,a),tr(i,s),pa(l,s,null),e[64](s),tr(o,c),pa(d,o,null),u=!0,h||(p=[ur(s,"focusin",e[15]),ur(s,"focusout",e[16]),ur(t,"submit",hr(e[17]))],h=!0)},p(e,o){(!u||2&o[0])&&m!==(m=e[1].resizeLabelFormCaption+"")&&$r(r,m);const i={};16&o[0]&&(i.items=e[4]),l.$set(i);const n={};4&o[3]&&(n.$$scope={dirty:o,ctx:e}),d.$set(n),(!u||8&o[0])&&mr(t,"style",e[3])},i(e){u||(ta(l.$$.fragment,e),ta(d.$$.fragment,e),u=!0)},o(e){oa(l.$$.fragment,e),oa(d.$$.fragment,e),u=!1},d(o){o&&rr(t),ma(l),e[64](null),ma(d),h=!1,Fn(p)}}}function Ky(e){let t,o;return t=new Ag({props:{$$slots:{footer:[qy]},$$scope:{ctx:e}}}),t.$on("measure",e[65]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};30&o[0]|4&o[3]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function Jy(e,t,o){let i,n,r,a,s,l,c,d,u,h,p,m,g,$,f,y,b,x,v,w,S,k,M,C,T,R,I,A,E,F,z=Rn,D=()=>(z(),z=Bn(O,(e=>o(48,p=e))),O);e.$$.on_destroy.push((()=>z()));const B=(e,t=0,o=9999)=>{if(P(e)&&!(e=e.replace(/\D/g,"")).length)return;const i=Math.round(e);return Number.isNaN(i)?void 0:Wa(i,t,o)};let{isActive:O}=t;D();let{stores:_}=t,{locale:W={}}=t,{resizeMinSize:V=We(1,1)}=t,{resizeMaxSize:N=We(9999,9999)}=t,{resizeSizePresetOptions:H}=t,{resizeWidthPresetOptions:j}=t,{resizeHeightPresetOptions:X}=t,{resizeWillRenderFooter:G=Z}=t;const Y=Fl(0,{stiffness:.15,damping:.3});_n(e,Y,(e=>o(53,y=e)));const{animation:q,imageSize:K,imageCropRect:J,imageCropRectAspectRatio:Q,imageCropAspectRatio:ee,imageOutputSize:te,imageSelectionZoom:oe,imageSelectionPan:ie,history:ne,env:re,allowPan:ae,allowZoom:se,allowZoomControls:le}=_;_n(e,q,(e=>o(49,m=e))),_n(e,K,(e=>o(72,A=e))),_n(e,J,(e=>o(51,$=e))),_n(e,Q,(e=>o(52,f=e))),_n(e,ee,(e=>o(71,C=e))),_n(e,te,(e=>o(60,M=e))),_n(e,oe,(e=>o(73,E=e))),_n(e,ie,(e=>o(74,F=e))),_n(e,re,(e=>o(50,g=e)));const ce=L();let ue,he,pe,me,ge,$e,fe=!1,ye=de();const be=(e,t,o,i,n)=>null!=e&&o!==t?e>=i[t]&&e<=n[t]?"valid":"invalid":"undetermined",xe=(e,t,o)=>Math.round(null!=e?e/t:o.height),ve=()=>{fe&&he&&pe&&("width"===me?o(38,pe=Math.round(he/f)):"height"===me?o(37,he=Math.round(pe*f)):("width"===ge?o(38,pe=Math.round(he/f)):"height"===ge&&o(37,he=Math.round(pe*f)),we()))},we=e=>{let t=B(he),i=B(pe),n=t,r=i,a=n&&r,s=e||f;if(!n&&!r)return;n&&!r?r=Math.round(n/s):r&&!n&&(n=Math.round(r*s)),s=e||a?U(n,r):f;let l=We(n,r);Ue(N,l)||(l=xt(N,s)),Ue(l,V)||(l=bt(V,s)),o(37,he=null!=t?Math.round(l.width):void 0),o(38,pe=null!=i?Math.round(l.height):void 0)},Se=()=>{we();const{width:e,height:t}=M||{};e===he&&t===pe||(he||pe?(he&&pe&&Xn(ee,C=he/pe,C),Xn(te,M=We(he,pe),M)):(Xn(ee,C=A.width/A.height,C),Xn(ee,C=void 0,C),Xn(te,M=void 0,M)),ne.write())},ke=te.subscribe((e=>{if(!e)return o(37,he=void 0),void o(38,pe=void 0);o(37,he=e.width),o(38,pe=e.height),we()})),Me=ee.subscribe((e=>{(he||pe)&&e&&(he&&pe&&U(he,pe)!==e?(o(38,pe=he/e),we(e)):we())})),Ce=e=>P(e[0])?(e[1]=e[1].map(Ce),e):To(e)?[e,""+e]:e,Te=e=>{if(P(e[0]))return e[1]=e[1].map(Te),e;let[t,o]=e;if(To(t)&&To(o)){const[e,i]=[t,o];o=`${e} &times; ${i}`,t=[e,i]}return[t,o]},Pe=ba();_n(e,Pe,(e=>o(59,k=e)));const Re=ba();_n(e,Re,(e=>o(63,I=e)));const Ie=ba();_n(e,Ie,(e=>o(57,w=e)));const Ae=ba();_n(e,Ae,(e=>o(62,R=e)));const Ee=ba();_n(e,Ee,(e=>o(55,x=e)));const Le=ba();_n(e,Le,(e=>o(61,T=e)));const Fe=xa([te,Re],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>{if(!t&&!e)return!0;if(!t)return!1;const[o,i]=t;return e.width===o&&e.height===i}));o(i<0?0:i)}));_n(e,Fe,(e=>o(58,S=e)));const ze=xa([te,Ae],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>!t&&!e||!!t&&e.width===t));o(i<0?0:i)}));_n(e,ze,(e=>o(56,v=e)));const De=xa([te,Le],(([e,t],o)=>{if(!t)return o(-1);const i=t.findIndex((([t])=>!t&&!e||!!t&&e.height===t));o(i<0?0:i)}));_n(e,De,(e=>o(54,b=e)));let Be=void 0,_e=void 0;const Ve=Lr("redrawTrigger"),Ne=Fl(m?20:0);return _n(e,Ne,(e=>o(47,h=e))),Ir((()=>{ke(),Me()})),e.$$set=e=>{"isActive"in e&&D(o(0,O=e.isActive)),"stores"in e&&o(29,_=e.stores),"locale"in e&&o(1,W=e.locale),"resizeMinSize"in e&&o(30,V=e.resizeMinSize),"resizeMaxSize"in e&&o(31,N=e.resizeMaxSize),"resizeSizePresetOptions"in e&&o(32,H=e.resizeSizePresetOptions),"resizeWidthPresetOptions"in e&&o(33,j=e.resizeWidthPresetOptions),"resizeHeightPresetOptions"in e&&o(34,X=e.resizeHeightPresetOptions),"resizeWillRenderFooter"in e&&o(35,G=e.resizeWillRenderFooter)},e.$$.update=()=>{var t;131072&e.$$.dirty[1]&&ae.set(!p),131072&e.$$.dirty[1]&&se.set(!p),131072&e.$$.dirty[1]&&le.set(!p),268435458&e.$$.dirty[1]&&H&&(Xn(Pe,k=H.map(Te),k),Xn(Re,I=Nd(k),I)),268435456&e.$$.dirty[1]&&o(46,a=!!k),134217728&e.$$.dirty[1]|2&e.$$.dirty[2]&&o(45,i=S>-1&&I[S][1]),67108868&e.$$.dirty[1]&&j&&(Xn(Ie,w=j.map(Ce),w),Xn(Ae,R=Nd(w),R)),67141632&e.$$.dirty[1]&&o(43,s=!a&&w),33554432&e.$$.dirty[1]|1&e.$$.dirty[2]&&o(44,n=v>-1&&R[v][1]),16777224&e.$$.dirty[1]&&X&&(Xn(Ee,x=X.map(Ce),x),Xn(Le,T=Nd(x),T)),16809984&e.$$.dirty[1]&&o(42,l=!a&&x),1082130432&e.$$.dirty[1]&&o(41,r=b>-1&&T[b][1]),38912&e.$$.dirty[1]&&o(40,c=!a&&!s&&!l),1073741826&e.$$.dirty[0]|536412145&e.$$.dirty[1]&&o(4,d=Ve&&xh((()=>{return G([a&&["Dropdown","size-presets",{label:i,options:k,onchange:e=>{return(t=e.value)&&!Be&&(Be={...$},_e=C),t?(Xn(ee,C=U(t[0],t[1]),C),Xn(te,M=Oe(t),M)):(Xn(J,$=Be,$),Xn(ee,C=_e,C),Xn(te,M=void 0,M),Be=void 0,_e=void 0),void ne.write();var t},selectedIndex:S}],s&&["Dropdown","width-presets",{label:n,options:w,onchange:e=>{o(37,he=e.value),Se()},selectedIndex:v}],s&&l&&["span","times",{class:"PinturaResizeLabel",innerHTML:"&times;"}],l&&["Dropdown","height-presets",{label:r,options:x,onchange:e=>{o(38,pe=e.value),Se()},selectedIndex:b}],c&&[jy,"width-input",{id:"width-"+ce,title:W.resizeTitleInputWidth,label:W.resizeLabelInputWidth,placeholder:(e=B(pe),t=f,d=$,Math.round(null!=e?e*t:d.width)),value:he,state:be(B(he),"width",me,V,N),onchange:e=>{o(37,he=e),ve()}}],c&&[Gy,"aspect-ratio-lock",{id:"aspect-ratio-lock-"+ce,title:W.resizeTitleButtonMaintainAspectRatio,icon:P(W.resizeIconButtonMaintainAspectRatio)?W.resizeIconButtonMaintainAspectRatio:W.resizeIconButtonMaintainAspectRatio(fe,y),locked:fe,onchange:e=>{o(36,fe=e),ve()}}],c&&[jy,"height-input",{id:"height-"+ce,title:W.resizeTitleInputHeight,label:W.resizeLabelInputHeight,placeholder:xe(B(he),f,$),value:pe,state:be(B(pe),"height",me,V,N),onchange:e=>{o(38,pe=e),ve()}}]].filter(Boolean),{...g},(()=>Ve.set({})));var e,t,d})).filter(Boolean)),32&e.$$.dirty[1]&&Y.set(fe?1:0),256&e.$$.dirty[1]&&me&&(ge=me),131072&e.$$.dirty[1]&&p&&(ye=F,$e=E),537001984&e.$$.dirty[1]&&(p?(t=M,Xn(ie,F=de(),F),Xn(oe,E=t&&$?t.width/$.width||t.height/$.height:1,E)):(Xn(ie,F=ye,F),Xn(oe,E=$e,E))),393216&e.$$.dirty[1]&&m&&Ne.set(p?0:20),65536&e.$$.dirty[1]&&o(3,u=h?`transform: translateY(${h}px)`:void 0)},[O,W,ue,u,d,Y,q,K,J,Q,ee,te,oe,ie,re,e=>{const t=e.target.id;/width/.test(t)?o(39,me="width"):/height/.test(t)?o(39,me="height"):/aspectRatio/i.test(t)?o(39,me="lock"):o(39,me=void 0)},e=>{ue.contains(e.relatedTarget)||Se(),o(39,me=void 0)},Se,Pe,Re,Ie,Ae,Ee,Le,Fe,ze,De,Ne,"resize",_,V,N,H,j,X,G,fe,he,pe,me,c,r,l,s,n,i,a,h,p,m,g,$,f,y,b,x,v,w,S,k,M,T,R,I,function(e){Dr[e?"unshift":"push"]((()=>{ue=e,o(2,ue)}))},function(t){Fr.call(this,e,t)}]}var Qy={util:["resize",class extends $a{constructor(e){super(),ga(this,e,Jy,Ky,Dn,{name:28,isActive:0,stores:29,locale:1,resizeMinSize:30,resizeMaxSize:31,resizeSizePresetOptions:32,resizeWidthPresetOptions:33,resizeHeightPresetOptions:34,resizeWillRenderFooter:35},null,[-1,-1,-1,-1])}get name(){return this.$$.ctx[28]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get stores(){return this.$$.ctx[29]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),Gr()}get resizeMinSize(){return this.$$.ctx[30]}set resizeMinSize(e){this.$$set({resizeMinSize:e}),Gr()}get resizeMaxSize(){return this.$$.ctx[31]}set resizeMaxSize(e){this.$$set({resizeMaxSize:e}),Gr()}get resizeSizePresetOptions(){return this.$$.ctx[32]}set resizeSizePresetOptions(e){this.$$set({resizeSizePresetOptions:e}),Gr()}get resizeWidthPresetOptions(){return this.$$.ctx[33]}set resizeWidthPresetOptions(e){this.$$set({resizeWidthPresetOptions:e}),Gr()}get resizeHeightPresetOptions(){return this.$$.ctx[34]}set resizeHeightPresetOptions(e){this.$$set({resizeHeightPresetOptions:e}),Gr()}get resizeWillRenderFooter(){return this.$$.ctx[35]}set resizeWillRenderFooter(e){this.$$set({resizeWillRenderFooter:e}),Gr()}},({duration:e})=>!e]};function eb(e){let t,o;return t=new ky({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[9],mapImagePointToScreenPoint:e[8],utilKey:"redact",imageRotation:e[10],imageFlipX:e[7],imageFlipY:e[6],shapes:e[11],toolbar:["rect"],toolShapes:{rectangle:[{x:0,y:0,width:0,height:0}]},toolActive:"rectangle",parentRect:e[13],enablePresetDropImage:!1,enablePresetSelectImage:!1,willStartInteraction:e[5],hooks:{willRenderShapeControls:e[24]}}}),t.$on("measure",e[25]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,[o]){const i={};8&o&&(i.stores=e[3]),16&o&&(i.locale=e[4]),1&o&&(i.isActive=e[0]),2&o&&(i.isActiveFraction=e[1]),4&o&&(i.isVisible=e[2]),512&o&&(i.mapScreenPointToImagePoint=e[9]),256&o&&(i.mapImagePointToScreenPoint=e[8]),1024&o&&(i.imageRotation=e[10]),128&o&&(i.imageFlipX=e[7]),64&o&&(i.imageFlipY=e[6]),32&o&&(i.willStartInteraction=e[5]),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function tb(e,t,o){let i,n,r,a,s,l,c,d,u;let{isActive:h}=t,{isActiveFraction:p}=t,{isVisible:m}=t,{stores:g}=t,{locale:$={}}=t,{markupEditorWillStartInteraction:f}=t;const{imageRedaction:y,rootRect:b,imageSize:x,imageRotation:v,imageFlipX:w,imageFlipY:S,imageTransforms:k,imageTransformsInterpolated:M}=g;_n(e,b,(e=>o(23,d=e))),_n(e,x,(e=>o(22,c=e))),_n(e,v,(e=>o(10,u=e))),_n(e,w,(e=>o(7,a=e))),_n(e,S,(e=>o(6,r=e))),_n(e,k,(e=>o(21,l=e))),_n(e,M,(e=>o(20,s=e)));return e.$$set=e=>{"isActive"in e&&o(0,h=e.isActive),"isActiveFraction"in e&&o(1,p=e.isActiveFraction),"isVisible"in e&&o(2,m=e.isVisible),"stores"in e&&o(3,g=e.stores),"locale"in e&&o(4,$=e.locale),"markupEditorWillStartInteraction"in e&&o(5,f=e.markupEditorWillStartInteraction)},e.$$.update=()=>{15728832&e.$$.dirty&&o(9,i=e=>Cy(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r)),15728832&e.$$.dirty&&o(8,n=e=>My(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r))},[h,p,m,g,$,f,r,a,n,i,u,y,b,x,v,w,S,k,M,"redact",s,l,c,d,e=>{const t=gp(e[0]);return fp("to-front",t),e},function(t){Fr.call(this,e,t)}]}var ob={util:["redact",class extends $a{constructor(e){super(),ga(this,e,tb,eb,Dn,{name:19,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,markupEditorWillStartInteraction:5})}get name(){return this.$$.ctx[19]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get isActiveFraction(){return this.$$.ctx[1]}set isActiveFraction(e){this.$$set({isActiveFraction:e}),Gr()}get isVisible(){return this.$$.ctx[2]}set isVisible(e){this.$$set({isVisible:e}),Gr()}get stores(){return this.$$.ctx[3]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[4]}set locale(e){this.$$set({locale:e}),Gr()}get markupEditorWillStartInteraction(){return this.$$.ctx[5]}set markupEditorWillStartInteraction(e){this.$$set({markupEditorWillStartInteraction:e}),Gr()}},({duration:e})=>!e]};function ib(e){let t,o,i=(R(e[31].label)?e[31].label(e[1]):e[31].label)+"";return{c(){t=ar("span"),o=lr(i)},m(e,i){nr(e,t,i),tr(t,o)},p(e,t){2&t[0]|1&t[1]&&i!==(i=(R(e[31].label)?e[31].label(e[1]):e[31].label)+"")&&$r(o,i)},d(e){e&&rr(t)}}}function nb(e){let t,o,i,n=(e[11](e[31].value)||"")+"",r=e[31].label&&ib(e);return{c(){t=ar("div"),o=new br(!1),i=cr(),r&&r.c(),o.a=i,mr(t,"slot","option")},m(e,a){nr(e,t,a),o.m(n,t),tr(t,i),r&&r.m(t,null)},p(e,i){1&i[1]&&n!==(n=(e[11](e[31].value)||"")+"")&&o.p(n),e[31].label?r?r.p(e,i):(r=ib(e),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(e){e&&rr(t),r&&r.d()}}}function rb(e){let t,o;return t=new yu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[4],onchange:e[10],$$slots:{option:[nb,({option:e})=>({31:e}),({option:e})=>[0,e?1:0]]},$$scope:{ctx:e}}}),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};2&o[0]&&(i.locale=e[1]),4&o[0]&&(i.options=e[2]),16&o[0]&&(i.selectedIndex=e[4]),2&o[0]|3&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function ab(e){let t,o,i;return o=new rd({props:{elasticity:e[5],$$slots:{default:[rb]},$$scope:{ctx:e}}}),{c(){t=ar("div"),ha(o.$$.fragment),mr(t,"slot","footer"),mr(t,"style",e[3])},m(e,n){nr(e,t,n),pa(o,t,null),i=!0},p(e,n){const r={};32&n[0]&&(r.elasticity=e[5]),22&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:e}),o.$set(r),(!i||8&n[0])&&mr(t,"style",e[3])},i(e){i||(ta(o.$$.fragment,e),i=!0)},o(e){oa(o.$$.fragment,e),i=!1},d(e){e&&rr(t),ma(o)}}}function sb(e){let t,o;return t=new Ag({props:{$$slots:{footer:[ab]},$$scope:{ctx:e}}}),t.$on("measure",e[22]),{c(){ha(t.$$.fragment)},m(e,i){pa(t,e,i),o=!0},p(e,o){const i={};62&o[0]|2&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i)},i(e){o||(ta(t.$$.fragment,e),o=!0)},o(e){oa(t.$$.fragment,e),o=!1},d(e){ma(t,e)}}}function lb(e,t,o){let i,n,r,a,s,l,c,d,u,h,p=Rn,m=()=>(p(),p=Bn(g,(e=>o(17,l=e))),g);e.$$.on_destroy.push((()=>p()));let{isActive:g}=t;m();let{stores:$}=t,{locale:f={}}=t,{fillOptions:y=[]}=t;const b=e=>e.map((e=>(e=>Io(e)&&P(e[0])&&Io(e[1]))(e)?[e[0],b(e[1]),e[2]]:(e=>[Array.isArray(e)&&3===e.length?[...e,1]:e,void 0,{disabled:!1}])(e))),x=Lr("elasticityMultiplier");_n(e,x,(e=>o(21,h=e)));const{history:v,animation:w,scrollElasticity:S,imageBackgroundColor:k,imageBackgroundImage:M,allowPan:C,allowZoom:T,allowZoomControls:R}=$;_n(e,w,(e=>o(18,c=e))),_n(e,k,(e=>o(20,u=e))),_n(e,M,(e=>o(19,d=e)));const I=Fl(c?20:0);return _n(e,I,(e=>o(16,s=e))),e.$$set=e=>{"isActive"in e&&m(o(0,g=e.isActive)),"stores"in e&&o(14,$=e.stores),"locale"in e&&o(1,f=e.locale),"fillOptions"in e&&o(15,y=e.fillOptions)},e.$$.update=()=>{32768&e.$$.dirty[0]&&o(2,i=b(y)),131072&e.$$.dirty[0]&&C.set(l),131072&e.$$.dirty[0]&&T.set(l),131072&e.$$.dirty[0]&&R.set(l),2097152&e.$$.dirty[0]&&o(5,n=h*S),1572868&e.$$.dirty[0]&&o(4,r=i.findIndex((([e])=>d?e===d:Array.isArray(e)?ja(e,u):void 0))||0),393216&e.$$.dirty[0]&&c&&I.set(l?0:20),65536&e.$$.dirty[0]&&o(3,a=s?`transform: translateY(${s}px)`:void 0)},[g,f,i,a,r,n,x,w,k,M,({value:e})=>{P(e)&&(Xn(k,u=void 0,u),Xn(M,d=e,d)),Io(e)&&(Xn(k,u=e,u),Xn(M,d=void 0,d)),v.write()},e=>{if(P(e))return`<div class="PinturaFillTile"><img src="${e}" alt="" width="48" height="64"/></div>`;if(Io(e)){const[t,o,i,n]=e.map(((e,t)=>t<3?Math.round(255*e):e));return`<div class="PinturaFillTile" data-transparent="${n<1}"><div style="background-color:rgba(${t},${o},${i},${n})"></div></div>`}return"<div></div>"},I,"fill",$,y,s,l,c,d,u,h,function(t){Fr.call(this,e,t)}]}var cb={util:["fill",class extends $a{constructor(e){super(),ga(this,e,lb,sb,Dn,{name:13,isActive:0,stores:14,locale:1,fillOptions:15},null,[-1,-1])}get name(){return this.$$.ctx[13]}get isActive(){return this.$$.ctx[0]}set isActive(e){this.$$set({isActive:e}),Gr()}get stores(){return this.$$.ctx[14]}set stores(e){this.$$set({stores:e}),Gr()}get locale(){return this.$$.ctx[1]}set locale(e){this.$$set({locale:e}),Gr()}get fillOptions(){return this.$$.ctx[15]}set fillOptions(e){this.$$set({fillOptions:e}),Gr()}},({duration:e})=>!e]};const db='<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"></path></path></g>',ub='<path fill="none" d="M9 15 L12 9 L15 15 M10 13.5 h3" stroke="currentColor" stroke-width=".125em"/>';var hb={labelReset:"Reset",labelDefault:"Default",labelAuto:"Auto",labelNone:"None",labelEdit:"Edit",labelClose:"Close",labelSupportError:e=>e.join(", ")+" not supported on this browser",labelColor:"Color",labelWidth:"Width",labelSize:"Size",labelOffset:"Offset",labelAmount:"Amount",labelInset:"Inset",labelRadius:"Radius",labelColorPalette:"Color palette",labelSizeExtraSmall:"Extra small",labelSizeSmall:"Small",labelSizeMediumSmall:"Medium small",labelSizeMedium:"Medium",labelSizeMediumLarge:"Medium large",labelSizeLarge:"Large",labelSizeExtraLarge:"Extra large",labelButtonCancel:"Cancel",labelButtonUndo:"Undo",labelButtonRedo:"Redo",labelButtonRevert:"Revert",labelButtonExport:"Done",labelZoomIn:"Zoom in",labelZoomOut:"Zoom out",labelZoomFit:"Fit to view",labelZoomActual:"Actual size",iconZoomIn:'<path stroke="currentColor" stroke-width=".125em" d="M8 12 h8 M12 8 v8" />',iconZoomOut:'<path stroke="currentColor" stroke-width=".125em" d="M9 12 h6" />',iconSupportError:'<g fill="none" stroke="currentColor" stroke-width="2"><path d="M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><g><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></g>',iconButtonClose:db,iconButtonRevert:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M7.388 18.538a8 8 0 10-2.992-9.03"/><path fill="currentColor" d="M2.794 11.696L2.37 6.714l5.088 3.18z"/><path d="M12 8v4M12 12l4 2"/></g>',iconButtonUndo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M10 8h4c2.485 0 5 2 5 5s-2.515 5-5 5h-4"/><path fill="currentColor" d="M5 8l4-3v6z"/></g>',iconButtonRedo:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M14 8h-4c-2.485 0-5 2-5 5s2.515 5 5 5h4"/><path fill="currentColor" d="M19 8l-4-3v6z"/></g>',iconButtonExport:'<polyline points="20 6 9 17 4 12" fill="none" stroke="currentColor" stroke-width=".125em"></polyline>',statusLabelButtonClose:"Close",statusIconButtonClose:db,statusLabelLoadImage:e=>e&&e.task?e.error?"IMAGE_TOO_SMALL"===e.error.code?"Minimum image size is {minWidth} &times; {minHeight}":"Error loading image":"blob-to-bitmap"===e.task?"Preparing image&hellip;":"Loading image&hellip;":"Waiting for image",statusLabelProcessImage:e=>{if(e&&e.task)return"store"===e.task?e.error?"Error uploading image":"Uploading image&hellip;":e.error?"Error processing image":"Processing image&hellip;"}};const pb={shapeLabelButtonSelectSticker:"Select image",shapeIconButtonSelectSticker:'<g fill="none" stroke="currentColor" stroke-width="0.0625em"><path d="M8 21 L15 11 L19 15"/><path d="M15 2 v5 h5"/><path d="M8 2 h8 l4 4 v12 q0 4 -4 4 h-8 q-4 0 -4 -4 v-12 q0 -4 4 -4z"/></g><circle fill="currentColor" cx="10" cy="8" r="1.5"/>',shapeIconButtonFlipHorizontal:'<g stroke="currentColor" stroke-width=".125em"><path fill="none" d="M6 6.5h5v11H6z"/><path fill="currentColor" d="M15 6.5h3v11h-3z"/><path d="M11 4v16" fill="currentColor"/></g>',shapeIconButtonFlipVertical:'<g stroke="currentColor" stroke-width=".125em"><rect x="7" y="8" width="11" height="5" fill="none"/><rect x="7" y="17" width="11" height="2" fill="currentColor"/><line x1="5" y1="13" x2="20" y2="13"/></g>',shapeIconButtonRemove:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M7.5 7h9z"/><path d="M7.916 9h8.168a1 1 0 01.99 1.14l-.972 6.862a2 2 0 01-1.473 1.653c-.877.23-1.753.345-2.629.345-.876 0-1.752-.115-2.628-.345a2 2 0 01-1.473-1.653l-.973-6.862A1 1 0 017.916 9z" fill="currentColor"/><rect fill="currentColor" x="10" y="5" width="4" height="3" rx="1"/></g>',shapeIconButtonDuplicate:'<g fill="none" fill-rule="evenodd"><path d="M15 13.994V16a2 2 0 01-2 2H8a2 2 0 01-2-2v-5a2 2 0 012-2h2.142" stroke="currentColor" stroke-width=".125em"/><path d="M15 9V8a1 1 0 00-2 0v1h-1a1 1 0 000 2h1v1a1 1 0 002 0v-1h1a1 1 0 000-2h-1zm-4-4h6a2 2 0 012 2v6a2 2 0 01-2 2h-6a2 2 0 01-2-2V7a2 2 0 012-2z" fill="currentColor"/></g>',shapeIconButtonMoveToFront:'<g fill="none" fill-rule="evenodd"><rect fill="currentColor" x="11" y="13" width="8" height="2" rx="1"/><rect fill="currentColor" x="9" y="17" width="10" height="2" rx="1"/><path d="M11.364 8H10a5 5 0 000 10M12 6.5L14.5 8 12 9.5z" stroke="currentColor" stroke-width=".125em" stroke-linecap="round"/></g>',shapeIconButtonTextLayoutAutoWidth:""+ub,shapeIconButtonTextLayoutAutoHeight:'<g fill="currentColor"><circle cx="4" cy="12" r="1.5"/><circle cx="20" cy="12" r="1.5"/></g>'+ub,shapeIconButtonTextLayoutFixedSize:'<g fill="currentColor"><circle cx="5" cy="6" r="1.5"/><circle cx="19" cy="6" r="1.5"/><circle cx="19" cy="19" r="1.5"/><circle cx="5" cy="19" r="1.5"/></g>'+ub,shapeTitleButtonTextLayoutAutoWidth:"Auto width",shapeTitleButtonTextLayoutAutoHeight:"Auto height",shapeTitleButtonTextLayoutFixedSize:"Fixed size",shapeTitleButtonFlipHorizontal:"Flip Horizontal",shapeTitleButtonFlipVertical:"Flip Vertical",shapeTitleButtonRemove:"Remove",shapeTitleButtonDuplicate:"Duplicate",shapeTitleButtonMoveToFront:"Move to front",shapeLabelInputText:"Edit text",shapeIconInputCancel:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M18 6L6 18M6 6l12 12"/></g>',shapeIconInputConfirm:'<g fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><polyline points="20 6 9 17 4 12"/></g>',shapeLabelInputCancel:"Cancel",shapeLabelInputConfirm:"Confirm",shapeLabelStrokeNone:"No outline",shapeLabelFontStyleNormal:"Normal",shapeLabelFontStyleBold:"Bold",shapeLabelFontStyleItalic:"Italic",shapeLabelFontStyleItalicBold:"Bold Italic",shapeTitleBackgroundColor:"Fill color",shapeTitleCornerRadius:"Corner radius",shapeTitleFontFamily:"Font",shapeTitleFontSize:"Font size",shapeTitleFontStyle:"Font style",shapeTitleLineHeight:"Line height",shapeTitleLineStart:"Start",shapeTitleLineEnd:"End",shapeTitleStrokeWidth:"Line width",shapeTitleStrokeColor:"Line color",shapeTitleLineDecorationBar:"Bar",shapeTitleLineDecorationCircle:"Circle",shapeTitleLineDecorationSquare:"Square",shapeTitleLineDecorationArrow:"Arrow",shapeTitleLineDecorationCircleSolid:"Circle solid",shapeTitleLineDecorationSquareSolid:"Square solid",shapeTitleLineDecorationArrowSolid:"Arrow solid",shapeIconLineDecorationBar:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M16,8 V16"/></g>',shapeIconLineDecorationCircle:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="none" stroke-width=".125em" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquare:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="none" stroke-width=".125em" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrow:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16 M13,7 l6,5 l-6,5" fill="none"/></g>',shapeIconLineDecorationCircleSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><circle fill="currentColor" cx="16" cy="12" r="4"/></g>',shapeIconLineDecorationSquareSolid:'<g stroke="currentColor" stroke-linecap="round"><path stroke-width=".125em" d="M5,12 H12"/><rect fill="currentColor" x="12" y="8" width="8" height="8"/></g>',shapeIconLineDecorationArrowSolid:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H16"/><path d="M13,7 l6,5 l-6,5z" fill="currentColor"/></g>',shapeTitleColorTransparent:"Transparent",shapeTitleColorWhite:"White",shapeTitleColorSilver:"Silver",shapeTitleColorGray:"Gray",shapeTitleColorBlack:"Black",shapeTitleColorNavy:"Navy",shapeTitleColorBlue:"Blue",shapeTitleColorAqua:"Aqua",shapeTitleColorTeal:"Teal",shapeTitleColorOlive:"Olive",shapeTitleColorGreen:"Green",shapeTitleColorYellow:"Yellow",shapeTitleColorOrange:"Orange",shapeTitleColorRed:"Red",shapeTitleColorMaroon:"Maroon",shapeTitleColorFuchsia:"Fuchsia",shapeTitleColorPurple:"Purple",shapeTitleTextColor:"Font color",shapeTitleTextAlign:"Text align",shapeTitleTextAlignLeft:"Left align text",shapeTitleTextAlignCenter:"Center align text",shapeTitleTextAlignRight:"Right align text",shapeIconTextAlignLeft:'<g stroke-width=".125em" stroke="currentColor"><line x1="5" y1="8" x2="15" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="14" y2="16"/></g>',shapeIconTextAlignCenter:'<g stroke-width=".125em" stroke="currentColor"><line x1="7" y1="8" x2="17" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="8" y1="16" x2="16" y2="16"/></g>',shapeIconTextAlignRight:'<g stroke-width=".125em" stroke="currentColor"><line x1="9" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="11" y1="16" x2="19" y2="16"/></g>',shapeLabelToolMove:"Move",shapeLabelToolView:"View",shapeLabelToolSharpie:"Sharpie",shapeLabelToolEraser:"Eraser",shapeLabelToolPath:"Path",shapeLabelToolRectangle:"Rectangle",shapeLabelToolEllipse:"Ellipse",shapeLabelToolArrow:"Arrow",shapeLabelToolLine:"Line",shapeLabelToolText:"Text",shapeLabelToolPreset:"Stickers",shapeIconToolView:'<g stroke-width=".125em" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M10.98 9.703V2.567c0-1.19 1.19-1.785 1.784-1.785.595 0 1.784.595 1.784 1.785v3.568"/><path d="M14.548 9.703V4.35c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.594 1.784 1.784v2.973"/><path d="M18.116 10.244V7.271c0-1.19 1.19-1.784 1.784-1.784.595 0 1.785.595 1.785 1.784 0 1.19 0 8.92-1.19 12.488-1.19 3.569-10.704 4.758-13.678 0-2.973-4.757-2.973-4.757-4.163-6.541-1.189-1.784-1.153-2.974-.594-3.568.558-.595 1.784-1.19 2.973.594 1.277 1.916 2.07 2.907 2.379 2.974V5.487c0-1.19 1.19-1.784 1.784-1.784.595 0 1.784.595 1.784 1.784V8.46"/></g>',shapeIconToolMove:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M6 2 L6 19 L18 13 Z M13 18 L16 24" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSharpie:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M2.025 5c5.616-2.732 8.833-3.857 9.65-3.374C12.903 2.351.518 12.666 2.026 14 3.534 15.334 16.536.566 17.73 2.566 18.924 4.566 3.98 17.187 4.831 18c.851.813 9.848-6 11.643-6 1.087 0-2.53 5.11-2.92 7-.086.41 3.323-1.498 4.773-1 .494.17.64 2.317 1.319 3 .439.443 1.332.776 2.679 1" stroke="currentColor" stroke-width=".125em" fill="none" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolEraser:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" fill="none"><g transform="translate(3, 15) rotate(-45)"><rect x="0" y="0" width="18" height="10" rx="3"/></g><line x1="11" y1="21" x2="18" y2="21"/><line x1="20" y1="21" x2="22" y2="21"/></g>',shapeIconToolPath:'<g stroke-width=".125em" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" fill="none"><circle cx="21" cy="3" r="2"/><circle cx="9" cy="9" r="2"/><circle cx="3" cy="21" r="2"/><path d="M19 4 11 8 M8 11 4 19"/></g>',shapeIconToolRectangle:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="2" y="2" width="20" height="20" rx="3"/></g>',shapeIconToolEllipse:'<g stroke-width=".125em" stroke="currentColor" fill="none"><circle cx="12" cy="12" r="11"/></g>',shapeIconToolArrow:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/><path d="m10 6 L21.5 1 L20 13.5" fill="currentColor" stroke="none"/></g>',shapeIconToolLine:'<g stroke-width=".125em" stroke="currentColor" fill="none"><line x1="20" y1="3" x2="6" y2="21"/></g>',shapeIconToolText:'<g stroke="none" fill="currentColor" transform="translate(6,0)"><path d="M8.14 20.085c.459 0 .901-.034 1.329-.102a8.597 8.597 0 001.015-.21v1.984c-.281.135-.695.247-1.242.336a9.328 9.328 0 01-1.477.133c-3.312 0-4.968-1.745-4.968-5.235V6.804H.344v-1.25l2.453-1.078L3.89.819h1.5v3.97h4.97v2.015H5.39v10.078c0 1.031.245 1.823.735 2.375s1.161.828 2.015.828z"/>',shapeIconToolPreset:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"></path><path d="M20 17c-3 3-5 5-8 5"></path></g>'};var mb={cropLabel:"Crop",cropIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M23 17H9a2 2 0 0 1-2-2v-5m0-3V1 M1 7h14a2 2 0 0 1 2 2v7m0 4v3"/></g>',cropIconButtonRecenter:'<path stroke="currentColor" fill="none" stroke-width="2" stroke-linejoin="bevel" d="M1.5 7.5v-6h6M1.5 16.5v6h6M22.5 16.5v6h-6M22.5 7.5v-6h-6"/><circle cx="12" cy="12" r="3.5" fill="currentColor" stroke="none"/>',cropIconButtonRotateLeft:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><rect x="3" rx="1" height="12" width="12" y="9"/><path d="M15 5h-1a5 5 0 015 5 1 1 0 002 0 7 7 0 00-7-7h-1.374l.747-.747A1 1 0 0011.958.84L9.603 3.194a1 1 0 000 1.415l2.355 2.355a1 1 0 001.415-1.414l-.55-.55H15z"/></g>',cropIconButtonRotateRight:'<g stroke="none" fill="currentColor"><path fill="none" d="M-1-1h582v402H-1z"/><path d="M11.177 5H10a5 5 0 00-5 5 1 1 0 01-2 0 7 7 0 017-7h1.374l-.747-.747A1 1 0 0112.042.84l2.355 2.355a1 1 0 010 1.415l-2.355 2.354a1 1 0 01-1.415-1.414l.55-.55z"/><rect rx="1" height="12" width="12" y="9" x="9"/></g>',cropIconButtonFlipVertical:'<g stroke="none" fill="currentColor"><path d="M19.993 12.143H7a1 1 0 0 1-1-1V5.994a1 1 0 0 1 1.368-.93l12.993 5.15a1 1 0 0 1-.368 1.93z"/><path d="M19.993 14a1 1 0 0 1 .368 1.93L7.368 21.078A1 1 0 0 1 6 20.148V15a1 1 0 0 1 1-1h12.993z" opacity=".6"/></g>',cropIconButtonFlipHorizontal:'<g stroke="none" fill="currentColor"><path d="M11.93 7.007V20a1 1 0 0 1-1 1H5.78a1 1 0 0 1-.93-1.368l5.15-12.993a1 1 0 0 1 1.929.368z"/><path d="M14 7.007V20a1 1 0 0 0 1 1h5.149a1 1 0 0 0 .93-1.368l-5.15-12.993A1 1 0 0 0 14 7.007z" opacity=".6"/></g>',cropIconSelectPreset:(e,t)=>{const[o,i,n]=t?[t<1?1:.3,1===t?.85:.5,t>1?1:.3]:[.2,.3,.4];return`<g fill="currentColor">\n <rect opacity="${o}" x="2" y="4" width="10" height="18" rx="1"/>\n <rect opacity="${i}" x="4" y="8" width="14" height="14" rx="1"/>\n <rect opacity="${n}" x="6" y="12" width="17" height="10" rx="1"/>\n </g>`},cropIconCropBoundary:(e,t)=>{const[o,i,n,r]=t?[.3,1,0,0]:[0,0,.3,1];return`<g fill="currentColor">\n <rect opacity="${o}" x="2" y="3" width="20" height="20" rx="1"/>\n <rect opacity="${i}" x="7" y="8" width="10" height="10" rx="1"/>\n <rect opacity="${n}" x="4" y="8" width="14" height="14" rx="1"/>\n <rect opacity="${r}" x="12" y="4" width="10" height="10" rx="1"/>\n </g>`},cropLabelButtonRecenter:"Recenter",cropLabelButtonRotateLeft:"Rotate left",cropLabelButtonRotateRight:"Rotate right",cropLabelButtonFlipHorizontal:"Flip horizontal",cropLabelButtonFlipVertical:"Flip vertical",cropLabelSelectPreset:"Crop shape",cropLabelCropBoundary:"Crop boundary",cropLabelCropBoundaryEdge:"Edge of image",cropLabelCropBoundaryNone:"None",cropLabelTabRotation:"Rotation",cropLabelTabZoom:"Scale"},gb={fillLabel:"Fill",fillIcon:'\n <g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">\n <g transform="rotate(60, 12, 12)">\n <rect x="4" y="4" width="14" height="16" rx="3"/>\n </g>\n <path d="M21 13 L21 21"></path>\n <path d="M4.5 12.5 L19 12.5"></path>\n </g>\n '},$b={frameLabel:"Frame",frameIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em">\n <rect x="2" y="2" width="20" height="20" rx="4"/>\n <rect x="6" y="6" width="12" height="12" rx="1"/>\n </g>',frameLabelMatSharp:"Mat",frameLabelMatRound:"Bevel",frameLabelLineSingle:"Line",frameLabelLineMultiple:"Zebra",frameLabelEdgeSeparate:"Inset",frameLabelEdgeOverlap:"Plus",frameLabelEdgeCross:"Lumber",frameLabelCornerHooks:"Hook",frameLabelPolaroid:"Polaroid"},fb={redactLabel:"Redact",redactIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M 4 5 l 1 -1"/><path d="M 4 10 l 6 -6"/><path d="M 4 15 l 11 -11"/><path d="M 4 20 l 16 -16"/><path d="M 9 20 l 11 -11"/><path d="M 14 20 l 6 -6"/><path d="M 19 20 l 1 -1"/></g>'},yb=(e,t)=>{const o=Object.getOwnPropertyDescriptors(e);Object.keys(o).forEach((i=>{o[i].get?Object.defineProperty(t,i,{get:()=>e[i],set:t=>e[i]=t}):t[i]=e[i]}))},bb=e=>{const t={},{sub:o,pub:i}=Ho();u()&&null!==document.doctype||console.warn("Browser is in quirks mode, add <!DOCTYPE html> to page to fix render issues");const n=os();yb(n,t);const r=((e,t)=>{const o={},i=new tp({target:e,props:{stores:t,pluginComponents:Array.from(lp)}});let n=!1;const r=()=>{n||(u()&&window.removeEventListener("pagehide",r),i&&(n=!0,i.$destroy()))};rp||(rp=new Set(kc(tp).filter((e=>!ip.includes(e))))),rp.forEach((e=>{Object.defineProperty(o,e,{get:()=>i[e],set:np.includes(e)?t=>{i[e]={...i[e],...t}}:t=>i[e]=t})})),Object.defineProperty(o,"previewImageData",{get:()=>i.imagePreviewCurrent}),ap.forEach((e=>{const t=sp[e],n=t[0];Object.defineProperty(o,e,{get:()=>i.pluginInterface[n][e],set:o=>{const n=t.reduce(((t,n)=>(t[n]={...i.pluginOptions[n],[e]:o},t)),{});i.pluginOptions={...i.pluginOptions,...n}}})})),Object.defineProperty(o,"element",{get:()=>i.root,set:()=>{}});const a=i.history;return Aa(o,{on:(e,t)=>{if(n)return()=>{};if(/undo|redo|revert|writehistory/.test(e))return a.on(e,t);const o=[i.sub(e,t),i.$on(e,(e=>t(e instanceof CustomEvent&&!e.detail?void 0:e)))].filter(Boolean);return()=>o.forEach((e=>e()))},updateImagePreview:e=>{i.imagePreviewSrc=e},close:()=>!n&&i.pub("close"),destroy:r}),Object.defineProperty(o,"history",{get:()=>({undo:()=>a.undo(),redo:()=>a.redo(),revert:()=>a.revert(),get:()=>a.get(),getCollapsed:()=>a.get().splice(0,a.index+1),set:e=>a.set(e),write:e=>a.write(e),get length(){return a.length()},get index(){return a.index},set index(e){a.index=e}})}),u()&&window.addEventListener("pagehide",r),o})(e,n.stores);yb(r,t);const s=["loadImage","processImage","abortProcessImage","abortLoadImage"].map((e=>r.on(e,(t=>{const o=n[e](t&&t.detail);o instanceof Promise&&o.catch(a)})))),l=(e,t)=>{const i=o(e,t),a=n.on(e,t),s=r.on(e,t);return()=>{i(),a(),s()}};t.handleEvent=a;const c=dp.map((e=>l(e,(o=>t.handleEvent(e,o)))));return Aa(t,{on:l,updateImage:e=>new Promise(((o,i)=>{const r=t.history.get(),a=t.history.index,s=t.imageState;n.loadImage(e).then((e=>{t.history.set(r),t.history.index=a,t.imageState=s,o(e)})).catch(i)})),close:()=>{i("close")},destroy:()=>{[...s,...c].forEach((e=>e())),r.destroy(),n.destroy(),i("destroy")}}),setTimeout((()=>i("init",t)),0),t};const xb="pintura-editor";var vb=()=>new Promise((e=>{if(!wb)return e([]);var t;t=xb,document.createElement(t).constructor===HTMLElement&&customElements.define(xb,wb),customElements.whenDefined(xb).then((()=>e(document.querySelectorAll(xb))))}));const wb=u()&&class extends HTMLElement{constructor(){super(),this._editor=void 0,this._unsubs=void 0}static get observedAttributes(){return["src"]}attributeChangedCallback(e,t,o){this[e]=o}connectedCallback(){this._editor=bb(this),yb(this._editor,this),this._editor.src=this.getAttribute("src"),this._unsubs=up(this._editor,this)}disconnectedCallback(){this._editor.destroy(),this._unsubs.forEach((e=>e()))}},Sb="pintura-editor";var kb=(e,t={})=>{const o=P(e)?document.querySelector(e):e;if(!zt(o))return;t.class=t.class?"pintura-editor "+t.class:Sb;const i=bb(o);return Object.assign(i,t)};const{document:Mb,window:Cb}=ra;function Tb(e){let t,o,i,n;return Hr(e[27]),{c(){t=cr(),o=ar("div"),mr(o,"class",e[4]),mr(o,"style",e[5])},m(r,a){nr(r,t,a),nr(r,o,a),e[28](o),i||(n=[ur(Cb,"keydown",e[10]),ur(Cb,"orientationchange",e[11]),ur(Cb,"resize",e[27]),ur(Mb.body,"focusin",(function(){zn(!e[1]&&e[7])&&(!e[1]&&e[7]).apply(this,arguments)})),ur(Mb.body,"focusout",(function(){zn(e[2]&&e[8])&&(e[2]&&e[8]).apply(this,arguments)})),ur(o,"wheel",e[9],{passive:!1})],i=!0)},p(t,i){e=t,16&i[0]&&mr(o,"class",e[4]),32&i[0]&&mr(o,"style",e[5])},i:Rn,o:Rn,d(r){r&&rr(t),r&&rr(o),e[28](null),i=!1,Fn(n)}}}function Pb(e,t,o){let i,n,r,a,s,l,c,d;const h=Ar();let{root:p}=t,{preventZoomViewport:m=!0}=t,{preventScrollBodyIfNeeded:$=!0}=t,{preventFooterOverlapIfNeeded:f=!0}=t,{class:y}=t,b=!0,x=!1,v=!1,w=u()&&document.documentElement,S=u()&&document.body,k=u()&&document.head;const M=Fl(0,{precision:.001,damping:.5});_n(e,M,(e=>o(26,d=e)));const C=M.subscribe((e=>{v&&e>=1?(o(19,v=!1),o(1,b=!1),h("show")):x&&e<=0&&(o(18,x=!1),o(1,b=!0),h("hide"))}));let T=!1,P=void 0,R=void 0,I=void 0;const A=()=>document.querySelector("meta[name=viewport]"),E=()=>Array.from(document.querySelectorAll("meta[name=theme-color]"));let L;const F=(e,t)=>{const o=()=>{e()?t():requestAnimationFrame(o)};requestAnimationFrame(o)};let z,D,B=0,O=void 0;const _=()=>{D||(D=g("div",{style:"position:fixed;height:100vh;top:0"}),S.append(D))};Pr((()=>{f&&ho()&&_()})),Rr((()=>{D&&(o(21,O=D.offsetHeight),D.remove(),D=void 0)}));let W=void 0;const V=()=>w.style.setProperty("--pintura-document-height",window.innerHeight+"px");return Ir((()=>{w.classList.remove("PinturaModalBodyLock"),C()})),e.$$set=e=>{"root"in e&&o(0,p=e.root),"preventZoomViewport"in e&&o(12,m=e.preventZoomViewport),"preventScrollBodyIfNeeded"in e&&o(13,$=e.preventScrollBodyIfNeeded),"preventFooterOverlapIfNeeded"in e&&o(14,f=e.preventFooterOverlapIfNeeded),"class"in e&&o(15,y=e.class)},e.$$.update=()=>{67895298&e.$$.dirty[0]&&o(25,i=v||x?d:b?0:1),4096&e.$$.dirty[0]&&(n="width=device-width,height=device-height,initial-scale=1"+(m?",maximum-scale=1,user-scalable=0":"")),786434&e.$$.dirty[0]&&o(22,r=!v&&!b&&!x),12&e.$$.dirty[0]&&(T||o(20,z=B)),2097160&e.$$.dirty[0]&&o(24,a=To(O)?"--viewport-pad-footer:"+(O>B?0:1):""),51380224&e.$$.dirty[0]&&o(5,s=`opacity:${i};height:${z}px;--editor-modal:1;${a}`),32768&e.$$.dirty[0]&&o(4,l=ic(["pintura-editor","PinturaModal",y])),8192&e.$$.dirty[0]&&o(23,c=$&&ho()&&/15_/.test(navigator.userAgent)),12582912&e.$$.dirty[0]&&c&&(e=>{e?(W=window.scrollY,w.classList.add("PinturaDocumentLock"),V(),window.addEventListener("resize",V)):(window.removeEventListener("resize",V),w.classList.remove("PinturaDocumentLock"),To(W)&&window.scrollTo(0,W),W=void 0)})(r)},[p,b,T,B,l,s,M,e=>{nh(e.target)&&(o(2,T=!0),L=B)},e=>{if(nh(e.target))if(clearTimeout(undefined),L===B)o(2,T=!1);else{const e=B;F((()=>B!==e),(()=>o(2,T=!1)))}},e=>{e.target&&/PinturaStage/.test(e.target.className)&&e.preventDefault()},e=>{const{key:t}=e;if(!/escape/i.test(t))return;const o=e.target;if(o&&/input|textarea/i.test(o.nodeName))return;const i=document.querySelectorAll(".PinturaModal");i[i.length-1]===p&&h("close")},_,m,$,f,y,()=>{if(v||!b)return;o(19,v=!0);const e=A()||g("meta",{name:"viewport"});P=!P&&e.getAttribute("content"),e.setAttribute("content",n+(/cover/.test(P)?",viewport-fit=cover":"")),e.parentNode||k.append(e);const t=getComputedStyle(p).getPropertyValue("--color-background"),i=E();if(i.length)R=i.map((e=>e.getAttribute("content")));else{const e=g("meta",{name:"theme-color"});k.append(e),i.push(e)}i.forEach((e=>e.setAttribute("content",`rgb(${t})`))),clearTimeout(I),I=setTimeout((()=>M.set(1)),250)},()=>{if(x||b)return;clearTimeout(I),o(18,x=!0);const e=A();P?e.setAttribute("content",P):e.remove();const t=E();R?t.forEach(((e,t)=>{e.setAttribute("content",R[t])})):t.forEach((e=>e.remove())),M.set(0)},x,v,z,O,r,c,a,i,d,function(){o(3,B=Cb.innerHeight)},function(e){Dr[e?"unshift":"push"]((()=>{p=e,o(0,p)}))}]}class Rb extends $a{constructor(e){super(),ga(this,e,Pb,Tb,Dn,{root:0,preventZoomViewport:12,preventScrollBodyIfNeeded:13,preventFooterOverlapIfNeeded:14,class:15,show:16,hide:17},null,[-1,-1])}get root(){return this.$$.ctx[0]}set root(e){this.$$set({root:e}),Gr()}get preventZoomViewport(){return this.$$.ctx[12]}set preventZoomViewport(e){this.$$set({preventZoomViewport:e}),Gr()}get preventScrollBodyIfNeeded(){return this.$$.ctx[13]}set preventScrollBodyIfNeeded(e){this.$$set({preventScrollBodyIfNeeded:e}),Gr()}get preventFooterOverlapIfNeeded(){return this.$$.ctx[14]}set preventFooterOverlapIfNeeded(e){this.$$set({preventFooterOverlapIfNeeded:e}),Gr()}get class(){return this.$$.ctx[15]}set class(e){this.$$set({class:e}),Gr()}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[17]}}const Ib=(e,t,o,i)=>{const n=ue(t.x-e.x,t.y-e.y),r=ye(n),a=5*o;let s;s=i?.5*a:Math.ceil(.5*(a-1));const l=Me(me(r),s);return{anchor:me(e),offset:l,normal:r,solid:i,size:a,sizeHalf:s}},Ab=({anchor:e,solid:t,normal:o,offset:i,size:n,sizeHalf:r,strokeWidth:a,strokeColor:s},l)=>{const c=e.x,d=e.y,u=Me(me(o),n),h=ue(c+u.x,d+u.y);if(Me(u,.55),t){we(l,i);const e=Me(me(o),.5*r);return[{points:[ue(c-e.x,d-e.y),ue(h.x-u.y,h.y+u.x),ue(h.x+u.y,h.y-u.x)],pathClose:!0,backgroundColor:s}]}{const e=Me((e=>{const t=e.x;return e.x=-e.y,e.y=t,e})(me(o)),.5),t=ue(c-e.x,d-e.y),i=ue(c+e.x,d+e.y);return[{points:[ue(h.x+u.y,h.y-u.x),t,ue(c,d),i,ue(h.x-u.y,h.y+u.x)],pathClose:!1,strokeWidth:a,strokeColor:s}]}},Eb=({anchor:e,solid:t,offset:o,normal:i,sizeHalf:n,strokeWidth:r,strokeColor:a},s)=>(we(s,o),t&&we(s,ge(me(i))),[{x:e.x,y:e.y,rx:n,ry:n,backgroundColor:t?a:void 0,strokeWidth:t?void 0:r,strokeColor:t?void 0:a}]),Lb=({anchor:e,offset:t,strokeWidth:o,strokeColor:i})=>[{points:[ue(e.x-t.y,e.y+t.x),ue(e.x+t.y,e.y-t.x)],strokeWidth:o,strokeColor:i}],Fb=({anchor:e,solid:t,offset:o,normal:i,sizeHalf:n,strokeWidth:r,strokeColor:a},s)=>{return we(s,o),[{x:e.x-n,y:e.y-n,width:2*n,height:2*n,rotation:(l=i,Math.atan2(l.y,l.x)),backgroundColor:t?a:void 0,strokeWidth:t?void 0:r,strokeColor:t?void 0:a}];var l},zb=(e={})=>t=>{if(!Ro(t,"lineStart")&&!Ro(t,"lineEnd"))return;const o=[],{lineStart:i,lineEnd:n,strokeWidth:r,strokeColor:a}=t,s=ue(t.x1,t.y1),l=ue(t.x2,t.y2),c=[s,l];if(i){const[t,n]=i.split("-"),c=e[t];if(c){const e=Ib(s,l,r,!!n);o.push(...c({...e,strokeColor:a,strokeWidth:r},s))}}if(n){const[t,i]=n.split("-"),c=e[t];if(c){const e=Ib(l,s,r,!!i);o.push(...c({...e,strokeColor:a,strokeWidth:r},l))}}return[{points:c,strokeWidth:r,strokeColor:a},...o]},Db=()=>({arrow:Ab,circle:Eb,square:Fb,bar:Lb}),Bb=(e,t)=>{const o=parseFloat(e)*t;return P(e)?o+"%":o},Ob=(e,t)=>P(e)?Xi(e,t):e,_b=e=>[{...e,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:e.frameSize?Bb(e.frameSize,2):"2.5%",frameRadius:e.frameRound?Bb(e.frameSize,2):0}],Wb=({width:e,height:t,frameImage:o,frameSize:i="15%",frameOutset:n=0,frameSlices:r={x1:.15,y1:.15,x2:.85,y2:.85}},{isPreview:a})=>{if(!o)return[];const s=Math.sqrt(e*t),l=Ob(i,s),c=a?l:Math.round(l),d=c,u=Ob(n,s),h=2*u,{x1:p,x2:m,y1:g,y2:$}=r,f={x0:0,y0:0,x1:c,y1:d,x2:e-c,y2:t-d,x3:e,y3:t,cw:c,ch:d,ew:e-c-c,eh:t-d-d},y=a?1:0,b=2*y,x=u>0,v={expandsCanvas:x,width:f.cw,height:f.ch,backgroundImage:o};return[{expandsCanvas:x,x:f.x1-y-u,y:f.y0-u,width:f.ew+b+h,height:f.ch,backgroundCorners:[{x:p,y:0},{x:m,y:0},{x:m,y:g},{x:p,y:g}],backgroundImage:o},{expandsCanvas:x,x:f.x1-y-u,y:f.y2+u,width:f.ew+b+h,height:f.ch,backgroundCorners:[{x:p,y:$},{x:m,y:$},{x:m,y:1},{x:p,y:1}],backgroundImage:o},{expandsCanvas:x,x:f.x0-u,y:f.y1-y-u,width:f.cw,height:f.eh+b+h,backgroundCorners:[{x:0,y:g},{x:p,y:g},{x:p,y:$},{x:0,y:$}],backgroundImage:o},{expandsCanvas:x,x:f.x2+u,y:f.y1-y-u,width:f.cw,height:f.eh+b+h,backgroundCorners:[{x:m,y:g},{x:1,y:g},{x:1,y:$},{x:m,y:$}],backgroundImage:o},{...v,x:f.x0-u,y:f.y0-u,backgroundCorners:[{x:0,y:0},{x:p,y:0},{x:p,y:g},{x:0,y:g}]},{...v,x:f.x2+u,y:f.y0-u,backgroundCorners:[{x:m,y:0},{x:1,y:0},{x:1,y:g},{x:m,y:g}]},{...v,x:f.x2+u,y:f.y2+u,backgroundCorners:[{x:m,y:$},{x:1,y:$},{x:1,y:1},{x:m,y:1}]},{...v,x:f.x0-u,y:f.y2+u,backgroundCorners:[{x:0,y:$},{x:p,y:$},{x:p,y:1},{x:0,y:1}]}]},Vb=({x:e,y:t,width:o,height:i,frameInset:n="3.5%",frameSize:r=".25%",frameColor:a=[1,1,1],frameOffset:s="5%",frameAmount:l=1,frameRadius:c=0,expandsCanvas:d=!1},{isPreview:u})=>{const h=Math.sqrt(o*i);let p=Ob(r,h);const m=Ob(n,h),g=Ob(s,h);let $=0;u||(p=Math.max(1,Math.round(p)),$=p%2==0?0:.5);const f=Ob(Bb(c,l),h);return new Array(l).fill(void 0).map(((n,r)=>{const s=g*r;let l=e+m+s,c=t+m+s,h=e+o-m-s,y=t+i-m-s;u||(l=Math.round(l),c=Math.round(c),h=Math.round(h),y=Math.round(y));return{x:l+$,y:c+$,width:h-l,height:y-c,cornerRadius:f>0?f-s:0,strokeWidth:p,strokeColor:a,expandsCanvas:d}}))},Nb=({x:e,y:t,width:o,height:i,frameSize:n=".25%",frameOffset:r=0,frameInset:a="2.5%",frameColor:s=[1,1,1]},{isPreview:l})=>{const c=Math.sqrt(o*i);let d=Ob(n,c),u=Ob(a,c),h=Ob(r,c),p=0;l||(d=Math.max(1,Math.round(d)),u=Math.round(u),h=Math.round(h),p=d%2==0?0:.5);const m=h-u,g=e+u+p,$=t+u+p,f=e+o-u-p,y=t+i-u-p;return[{points:[ue(g+m,$),ue(f-m,$)]},{points:[ue(f,$+m),ue(f,y-m)]},{points:[ue(f-m,y),ue(g+m,y)]},{points:[ue(g,y-m),ue(g,$+m)]}].map((e=>(e.strokeWidth=d,e.strokeColor=s,e)))},Hb=({x:e,y:t,width:o,height:i,frameSize:n=".25%",frameInset:r="2.5%",frameLength:a="2.5%",frameColor:s=[1,1,1]},{isPreview:l})=>{const c=Math.sqrt(o*i);let d=Ob(n,c),u=Ob(r,c),h=Ob(a,c),p=0;l||(d=Math.max(1,Math.round(d)),u=Math.round(u),h=Math.round(h),p=d%2==0?0:.5);const m=e+u+p,g=t+u+p,$=e+o-u-p,f=t+i-u-p;return[{points:[ue(m,g+h),ue(m,g),ue(m+h,g)]},{points:[ue($-h,g),ue($,g),ue($,g+h)]},{points:[ue($,f-h),ue($,f),ue($-h,f)]},{points:[ue(m+h,f),ue(m,f),ue(m,f-h)]}].map((e=>(e.strokeWidth=d,e.strokeColor=s,e)))},jb=({x:e,y:t,width:o,height:i,frameColor:n=[1,1,1]},{isPreview:r})=>{const a=Math.sqrt(o*i),s=.1*a;let l=.2*a,c=0;const d=.5*s;return r?c=1:l=Math.ceil(l),n.length=3,[{id:"border",x:e-d+c,y:t-d+c,width:o+s-2*c,height:i+l-2*c,frameStyle:"line",frameInset:0,frameOffset:0,frameSize:s,frameColor:n,expandsCanvas:!0},{id:"chin",x:e-d,y:i-c,width:o+s,height:l,backgroundColor:n,expandsCanvas:!0}].filter(Boolean)},Ub=(e={})=>(t,o)=>{if(!Ro(t,"frameStyle"))return;const i=t.frameStyle,n=e[i];if(!n)return;const{frameStyle:r,...a}=t;return n(a,o)},Zb=()=>({solid:_b,hook:Hb,line:Vb,edge:Nb,polaroid:jb,nine:Wb}),Xb=e=>{const t=(o,i={isPreview:!0})=>{const n=e.map((e=>{const n=e(o,i);if(n)return n.map((e=>t(e,i)))})).filter(Boolean).flat();return n.length?n.flat():o};return t};(e=>{if(!e)return;const[t,o,i,n]=["bG9jYXRpb24","UmVnRXhw","dGVzdA","cHFpbmFcLm5s"].map(window[[(!1+"")[1],(!0+"")[0],(1+{})[2],(1+{})[3]].join("")]);e._y63ry6f=new e[o](n)[i](e[t])})(window);const Gb=Ds,Yb=Os,qb=(e,...t)=>(o,i)=>{var n;n=e,(Array.isArray(n)||R(n))&&(t=[e,...t]);const r=M(e)?e:{};t=Array.isArray(t)?t.reduce(((e,t)=>[...e,...Array.isArray(t)?[...t]:[t]]),[]):t;for(let e=0;e<t.length;e++){const n=t[e](o,i,r);if(Array.isArray(n))return n}},Kb=()=>({read:c,apply:k}),Jb=(e={})=>{const{blurAmount:t,dataSizeScalar:o,scrambleAmount:i,backgroundColor:n}=e;return(e,r)=>(async(e,t={})=>{if(!e)return;const{width:o,height:i}=e,{dataSize:n=96,dataSizeScalar:r=1,scrambleAmount:a=4,blurAmount:s=6,outputFormat:l="canvas",backgroundColor:c=[0,0,0]}=t,d=Math.round(n*r),u=Math.min(d/o,d/i),h=Math.floor(o*u),p=Math.floor(i*u),m=g("canvas",{width:h,height:p}),$=m.getContext("2d",{willReadFrequently:!0});if(c.length=3,$.fillStyle=Oo(c),$.fillRect(0,0,h,p),y(e)){const t=g("canvas",{width:o,height:i});t.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),$.drawImage(t,0,0,h,p),f(t)}else $.drawImage(e,0,0,h,p);const b=$.getImageData(0,0,h,p),x=[];if(a>0&&x.push([Tl,{amount:a}]),s>0)for(let e=0;e<s;e++)x.push([wo,{matrix:Pl}]);let v;if(x.length){const e=(t,o)=>`(err, imageData) => {\n(${t[o][0].toString()})(Object.assign({ imageData: imageData }, filterInstructions[${o}]), \n${t[o+1]?e(t,o+1):"done"})\n}`,t=`function (options, done) {\nconst filterInstructions = options.filterInstructions;\nconst imageData = options.imageData;\n(${e(x,0)})(null, imageData)\n}`,o=await z(t,[{imageData:b,filterInstructions:x.map((e=>e[1]))}],[b.data.buffer]);v=bo(o)}else v=b;return"canvas"===l?($.putImageData(v,0,0),m):v})(e,{blurAmount:t,scrambleAmount:i,backgroundColor:n,...r,dataSizeScalar:o||r.dataSizeScalar})},Qb=os,ex=zm,tx=Lm,ox=fg,ix={markupEditorToolbar:zm(),markupEditorToolStyles:Lm(),markupEditorShapeStyleControls:fg()},nx=cp,rx=R$,ax=D$,sx=H$,lx=Ry,cx=Ey,dx=zy,ux=Vy,hx=ob,px=Qy,mx=cb,gx=Yp,$x=Fp,fx=rm,yx=hb,bx=pb,xx=mb,vx=gb,wx={filterLabel:"Filter",filterIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M18.347 9.907a6.5 6.5 0 1 0-1.872 3.306M3.26 11.574a6.5 6.5 0 1 0 2.815-1.417 M10.15 17.897A6.503 6.503 0 0 0 16.5 23a6.5 6.5 0 1 0-6.183-8.51"/></g>',filterLabelChrome:"Chrome",filterLabelFade:"Fade",filterLabelCold:"Cold",filterLabelWarm:"Warm",filterLabelPastel:"Pastel",filterLabelMonoDefault:"Mono",filterLabelMonoNoir:"Noir",filterLabelMonoWash:"Wash",filterLabelMonoStark:"Stark",filterLabelSepiaDefault:"Sepia",filterLabelSepiaBlues:"Blues",filterLabelSepiaRust:"Rust",filterLabelSepiaColor:"Color"},Sx={finetuneLabel:"Finetune",finetuneIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M4 1v5.5m0 3.503V23M12 1v10.5m0 3.5v8M20 1v15.5m0 3.5v3M2 7h4M10 12h4M18 17h4"/></g>',finetuneLabelBrightness:"Brightness",finetuneLabelContrast:"Contrast",finetuneLabelSaturation:"Saturation",finetuneLabelExposure:"Exposure",finetuneLabelTemperature:"Temperature",finetuneLabelGamma:"Gamma",finetuneLabelClarity:"Clarity",finetuneLabelVignette:"Vignette"},kx={resizeLabel:"Resize",resizeIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><rect x="2" y="12" width="10" height="10" rx="2"/><path d="M4 11.5V4a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5.5"/><path d="M14 10l3.365-3.365M14 6h4v4"/></g>',resizeLabelFormCaption:"Image output size",resizeLabelInputWidth:"w",resizeTitleInputWidth:"Width",resizeLabelInputHeight:"h",resizeTitleInputHeight:"Height",resizeTitleButtonMaintainAspectRatio:"Maintain aspectratio",resizeIconButtonMaintainAspectRatio:(e,t)=>`<defs><mask id="mask1" x="0" y="0" width="24" height="24" ><rect x="0" y="0" width="24" height="10" fill="#fff" stroke="none"/></mask></defs><g fill="none" fill-rule="evenodd"><g mask="url(#mask1)"><path transform="translate(0 ${3*(t-1)})" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" d="M9.401 10.205v-.804a2.599 2.599 0 0 1 5.198 0V17"/></g><rect fill="currentColor" x="7" y="10" width="10" height="7" rx="1.5"/></g>`},Mx={decorateLabel:"Decorate",decorateIcon:'<g fill="none" fill-rule="evenodd"><path stroke="currentColor" stroke-width=".125em" stroke-linecap="round" stroke-linejoin="round" d="M12 18.5l-6.466 3.4 1.235-7.2-5.23-5.1 7.228-1.05L12 2l3.233 6.55 7.229 1.05-5.231 5.1 1.235 7.2z"/></g>'},Cx={annotateLabel:"Annotate",annotateIcon:'<g stroke-width=".125em" stroke="currentColor" fill="none"><path d="M17.086 2.914a2.828 2.828 0 1 1 4 4l-14.5 14.5-5.5 1.5 1.5-5.5 14.5-14.5z"/></g>'},Tx={stickerLabel:"Sticker",stickerIcon:'<g fill="none" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor" stroke-width=".125em"><path d="M12 22c2.773 0 1.189-5.177 3-7 1.796-1.808 7-.25 7-3 0-5.523-4.477-10-10-10S2 6.477 2 12s4.477 10 10 10z"/><path d="M20 17c-3 3-5 5-8 5"/></g>'},Px=$b,Rx=fb,Ix=(e,t,o={})=>(P(t)?Array.from(document.querySelectorAll(t)):t).filter(Boolean).map((t=>e(t,T(o)))),Ax=kb,Ex=(e={},t)=>{const{sub:o,pub:i}=Ho(),n={},r=((e={},t)=>new Rb({target:t||document.body,props:{class:e.class,preventZoomViewport:e.preventZoomViewport,preventScrollBodyIfNeeded:e.preventScrollBodyIfNeeded,preventFooterOverlapIfNeeded:e.preventFooterOverlapIfNeeded}}))(e,t),s=()=>{r.hide&&r.hide()},l=()=>{r.show&&r.show()},c=bb(r.root);yb(c,n),n.handleEvent=a,c.handleEvent=(e,t)=>{if("init"===e)return n.handleEvent(e,n);n.handleEvent(e,t)},c.on("close",(async()=>{const{willClose:t}=e;if(!t)return s();await t()&&s()}));const d=(e,t)=>/show|hide/.test(e)?o(e,t):c.on(e,t),u=["show","hide"].map((e=>d(e,(t=>n.handleEvent(e,t))))),h=()=>{u.forEach((e=>e())),s(),r.$destroy(),c.destroy()};return Aa(n,{on:d,destroy:h,hide:s,show:l}),Object.defineProperty(n,"modal",{get:()=>r.root,set:()=>{}}),r.$on("close",c.close),r.$on("show",(()=>i("show"))),r.$on("hide",(()=>{i("hide"),!1!==e.enableAutoDestroy&&h()})),!1!==e.enableAutoHide&&c.on("process",s),c.on("loadstart",l),!1!==e.enableButtonClose&&(e.enableButtonClose=!0),delete e.class,Object.assign(n,e),n},Lx=(e,t)=>kb(e,{...t,layout:"overlay"}),Fx=Xb,zx=(e=[])=>Xb([Ub(Zb()),zb(Db()),...e]),Dx=(e={})=>{let t,o=void 0;Array.isArray(e.imageReader)||(o=e.imageReader,delete e.imageReader),Array.isArray(e.imageWriter)?t=Yb():(t=R(e.imageWriter)?e.imageWriter:Yb(e.imageWriter),delete e.imageWriter);let i=void 0;return R(e.imageScrambler)||(i=e.imageScrambler,delete e.imageScrambler),{imageReader:Gb(o),imageWriter:t,imageOrienter:Kb(),imageScrambler:Jb(i)}},Bx=(e={})=>{cp(...[rx,ax,sx,lx,cx,dx,ux,hx,px,mx].filter(Boolean));const t=["trim","crop","filter","finetune","annotate","decorate",e.stickers&&"sticker",e.fillOptions&&"fill","frame","redact","resize"].filter(Boolean),o=Dx(e),i={...yx,...bx,...xx,...vx,...wx,...Sx,...Px,...Rx,...kx,...Mx,...Cx,...Tx,...e.locale};delete e.locale;const n="function"==typeof e.shapePreprocessor?e.shapePreprocessor:zx(e.shapePreprocessor);return delete e.shapePreprocessor,va([{...o,shapePreprocessor:n,utils:t,...gx,...$x,...fx,...ix,stickerStickToImage:!0,locale:i},e])},Ox=async(e={})=>{const t=await vb();return t.forEach((t=>Object.assign(t,T(e)))),t},_x=(e,t)=>Ax(e,Bx(t));return e.appendDefaultEditor=_x,e.appendDefaultEditors=(e,t)=>Ix(_x,e,t),e.appendEditor=Ax,e.appendEditors=(e,t)=>Ix(Ax,e,t),e.appendNode=(e,t)=>{if(pp(t))return t.push(e);t[3]=[...gp(t),e]},e.blobToFile=j,e.colorStringToColorArray=uh,e.createDefaultColorOptions=Dm,e.createDefaultFontFamilyOptions=Hm,e.createDefaultFontScaleOptions=_m,e.createDefaultFontSizeOptions=Bm,e.createDefaultFontStyleOptions=Um,e.createDefaultFrameStyles=Zb,e.createDefaultImageOrienter=Kb,e.createDefaultImageReader=Gb,e.createDefaultImageScrambler=Jb,e.createDefaultImageWriter=Yb,e.createDefaultLineEndStyleOptions=Nm,e.createDefaultLineEndStyles=Db,e.createDefaultLineHeightOptions=Om,e.createDefaultLineHeightScaleOptions=Wm,e.createDefaultMediaWriter=qb,e.createDefaultShapePreprocessor=zx,e.createDefaultStrokeScaleOptions=Vm,e.createDefaultStrokeWidthOptions=()=>[1,2,3,4,6,8,12,16,20,24,32,48,64],e.createDefaultTextAlignOptions=jm,e.createEditor=Qb,e.createFrameStyleProcessor=Ub,e.createLineEndProcessor=zb,e.createMarkupEditorBackgroundColorControl=ag,e.createMarkupEditorColorControl=og,e.createMarkupEditorColorOptions=Zm,e.createMarkupEditorFontColorControl=hg,e.createMarkupEditorFontFamilyControl=rg,e.createMarkupEditorFontFamilyOptions=qm,e.createMarkupEditorFontScaleOptions=Xm,e.createMarkupEditorFontSizeControl=mg,e.createMarkupEditorFontSizeOptions=e=>e.map(Cm),e.createMarkupEditorFontStyleControl=pg,e.createMarkupEditorFontStyleOptions=Km,e.createMarkupEditorLineEndStyleControl=ug,e.createMarkupEditorLineEndStyleOptions=Jm,e.createMarkupEditorLineHeightControl=$g,e.createMarkupEditorLineHeightOptions=e=>e.map(Cm),e.createMarkupEditorLineHeightScaleOptions=Gm,e.createMarkupEditorLineStartStyleControl=dg,e.createMarkupEditorShapeStyleControls=ox,e.createMarkupEditorStrokeColorControl=sg,e.createMarkupEditorStrokeScaleOptions=Ym,e.createMarkupEditorStrokeWidthControl=lg,e.createMarkupEditorStrokeWidthOptions=e=>e.map(Cm),e.createMarkupEditorTextAlignControl=gg,e.createMarkupEditorToolStyle=Em,e.createMarkupEditorToolStyles=tx,e.createMarkupEditorToolbar=ex,e.createNode=function(e,t,o,i){return Array.isArray(o)&&(i=o,o={}),[e,t,o||{},i||[]]},e.createShapePreprocessor=Fx,e.defineCustomElements=Ox,e.defineDefaultCustomElements=e=>Ox(Bx(e)),e.degToRad=nl,e.dispatchEditorEvents=up,e.effectBrightness=Vp,e.effectClarity=Xp,e.effectContrast=Np,e.effectExposure=jp,e.effectGamma=Up,e.effectSaturation=Hp,e.effectTemperature=Gp,e.effectVignette=Zp,e.filterChrome=vp,e.filterCold=kp,e.filterFade=wp,e.filterInvert=()=>[-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],e.filterMonoDefault=Mp,e.filterMonoNoir=Cp,e.filterMonoStark=Pp,e.filterMonoWash=Tp,e.filterPastel=xp,e.filterSepiaBlues=Ip,e.filterSepiaColor=Ep,e.filterSepiaDefault=Rp,e.filterSepiaRust=Ap,e.filterWarm=Sp,e.findNode=yp,e.frameEdgeCross=tm,e.frameEdgeOverlap=om,e.frameEdgeSeparate=em,e.frameHook=im,e.frameLineMultiple=Qp,e.frameLineSingle=Jp,e.framePolaroid=nm,e.frameSolidRound=Kp,e.frameSolidSharp=qp,e.getEditorDefaults=Bx,e.getEditorProps=()=>(()=>{const e=Qa.map(es),t=Ra.map((([e])=>e)).filter((e=>!Ja.includes(e)));return e.concat(t)})().concat((rp=new Set(kc(tp).filter((e=>!ip.includes(e)))),[...rp,...ap])),e.imageStateToCanvas=(e,t,o)=>{const{targetCanvas:i,targetSize:n,disableDraw:r=!1,shapePreprocessor:a}=o||{},s=i||document.createElement("canvas"),{crop:l,colorMatrix:c,convolutionMatrix:d}=t,u=Yt(e),h={width:u?e.videoWidth:e.width,height:u?e.videoHeight:e.height},{upscale:p=!1,fit:m="contain",width:$,height:f}=n||{};let y=1;"contain"===m?y=Math.min(($||Number.MAX_SAFE_INTEGER)/l.width,(f||Number.MAX_SAFE_INTEGER)/l.height):"cover"===m&&(y=Math.max(($||l.width)/l.width,(f||l.height)/l.height)),p||(y=Math.min(y,1));const b=Math.floor(l.width*y),x=Math.floor(l.height*y),v=u?Cl(b):b,w=u?Cl(x):x,S=Ml(s,{alpha:!0});S.resize(v,w,1);const k=S.textureCreate();let M;S.setCanvasColor([0,0,0,0]),S.drawToCanvas(),S.disableMask(),S.disablePreviewStencil();{const e=Object.values(c||{}).filter(Boolean);e.length&&(M=Tn(e))}const C={x:0,y:0,width:v,height:w},{origin:T,translation:P,rotation:R,scale:I}=_s(C,C,h,l,{x:0,y:0,width:v,height:w},y,{x:0,y:0},1,t.rotation,t.flipX,t.flipY),A=[h,T.x,T.y,P.x,P.y,R.x,R.y,R.z,I,M,1,d&&d.clarity,To(t.gamma)?t.gamma:1,t.vignette||0,[1,0,1,0,1,w,1,v],void 0,void 0,void 0,void 0,!1];let E=!1;const L=t.decoration.length||t.annotation.length,F=L&&S.textureCreate(),z=()=>{S.textureUpdate(k,e,{filter:S.textureFilterLinear})},D=()=>{z(),S.drawImage(k,...A),L&&E&&S.drawRect(C,0,!1,!1,[0,0,0,0],void 0,F)};return z(),!r&&D(),{canvas:s,prepare:async()=>{if(!L)return;const{dest:e}=await is(g("canvas",h),{shapePreprocessor:a,imageReader:[[async(e,t,o)=>{const{src:i}=e,n=parseInt(i.width,10),r=parseInt(i.height,10),a=await B(i);return{...e,dest:a,size:{width:n,height:r}}},"read-canvas"]],imageWriter:Os({format:"canvas"}),imageState:{...t,redaction:[],frame:void 0,gamma:void 0,convolutionMatrix:void 0,colorMatrix:void 0,backgroundColor:[0,0,0,0],backgroundImage:void 0,trim:void 0,vignette:void 0,volume:void 0}});S.textureUpdate(F,e,{filter:S.textureFilterLinear}),E=!0,!r&&D()},redraw:D,destroy:()=>{S.release()}}},e.insertNodeAfter=(e,t,o)=>$p(e,t,o,(e=>e+1)),e.insertNodeBefore=(e,t,o)=>$p(e,t,o),e.isSupported=()=>(null===Wp&&(Wp=u()&&!("[object OperaMini]"===Object.prototype.toString.call(window.operamini))&&"visibilityState"in document&&"Promise"in window&&"File"in window&&"URL"in window&&"createObjectURL"in window.URL&&"performance"in window),Wp),e.legacyDataToImageState=(e,t,o={})=>{const i={};if(!((e={})=>{if("markup"in e||"color"in e||"filter"in e)return!0;const{crop:t}=e;return!(!t||!("flip"in t||"center"in t||"aspectRatio"in t||"rotation"in t))})(o))return o;if(o.crop&&Object.assign(i,_p(t,o.crop)),o.markup){const e=Array.isArray(o.markup)?o.markup:Object.values(o.markup);i.decoration=e.map((e=>((e,t,o)=>{const i=Object.keys(o).reduce(((t,i)=>{let n=o[i];return i=zp[i]||i,/px$/.test(n)?n=Dp(n):/^(?:x|y|left|right|top|bottom|width|height|fontSize|borderWidth|strokeWidth)$/.test(i)&&"number"==typeof n&&("strokeWidth"!==i&&"borderWidth"!==i&&"fontSize"!==i||(n=Math.min(e.width,e.height)*n+"px"),n=Dp(n)),/color/i.test(i)&&n&&(n=uh(n)),null===n&&(n=void 0),t[i]=n,t}),{});if("line"===t&&(i.lineDecoration.length>=1&&(i.lineEnd="arrow"),2===i.lineDecoration.length&&(i.lineStart="arrow"),i.x1=i.x,i.y1=i.y,i.x2=Bp(i.x,i.width),i.y2=Bp(i.y,i.height),delete i.x,delete i.y,delete i.width,delete i.height,delete i.lineDecoration,delete i.lineStyle),"text"===t){if(!To(i.y)){const t=Math.min(e.width,e.height);i.y=t*(parseFloat(i.y)/100)}i.y=i.y-i.fontSize,delete i.width,delete i.height,delete i.borderStyle,i.lineHeight=i.lineHeight||"120%"}if("ellipse"===t){let t,o;if(/%$/.test(i.width)){t=parseFloat(i.width)/100,o=parseFloat(i.height)/100;const n=t*e.width,r=o*e.height;t=n/e.width*100,o=r/e.height*100}else t=i.width,o=i.height;i.rx=.5*t,i.ry=.5*o,/%$/.test(i.width)&&(i.rx+="%",i.ry+="%"),i.x=Bp(i.x,i.rx),i.y=Bp(i.y,i.ry),delete i.width,delete i.height,delete i.borderStyle}if("rect"===t&&delete i.borderStyle,"path"===t){let e,t=[];for(const o of i.points)e?Pe(e,o)<1e-9||(t.push(o),e=o,e=o):(t.push(o),e=o);i.points=t.map((e=>({x:Dp(e.x),y:Dp(e.y)})))}return i})(i.crop||t,e[0],e[1])))}if(o.color||o.colors){const e=o.color||o.colors;Object.keys(e).filter((t=>e[t])).map((t=>[t,Array.isArray(e[t].matrix)?e[t].matrix:Object.values(e[t].matrix)])).forEach((([e,t])=>{i.colorMatrix||(i.colorMatrix={}),i.colorMatrix[e]=t}))}if(o.filter||o.filters){const t=o.filters||o.filter;i.colorMatrix||(i.colorMatrix={});const n=e?e.filterFunctions:Lp;i.colorMatrix.filter="string"==typeof t&&n[t]?n[t]():t.matrix}const n=o.size?o.size:!!o.resize&&o.resize.size;return n&&n.width&&n.height&&(i.targetSize={width:n.width,height:n.height}),i},e.locale_en_gb=yx,e.markup_editor_defaults=ix,e.markup_editor_locale_en_gb=bx,e.naturalAspectRatioToNumber=e=>{if(void 0===e||To(e))return e;if(!P(e))return!1;const t=e;if(!t.length)return;const[o,i]=t.split(/\/|:/g).map((e=>parseFloat(e.replace(/,/,".")))).filter(Boolean);return!!o&&(i?Math.abs(o/i):o)},e.openDefaultEditor=(e,t)=>Ex(Bx(e),t),e.openEditor=Ex,e.overlayDefaultEditor=(e,t)=>Lx(e,Bx(t)),e.overlayEditor=Lx,e.plugin_annotate=lx,e.plugin_annotate_locale_en_gb=Cx,e.plugin_crop=rx,e.plugin_crop_locale_en_gb=xx,e.plugin_decorate=cx,e.plugin_decorate_locale_en_gb=Mx,e.plugin_fill=mx,e.plugin_fill_locale_en_gb=vx,e.plugin_filter=ax,e.plugin_filter_defaults=$x,e.plugin_filter_locale_en_gb=wx,e.plugin_finetune=sx,e.plugin_finetune_defaults=gx,e.plugin_finetune_locale_en_gb=Sx,e.plugin_frame=ux,e.plugin_frame_defaults=fx,e.plugin_frame_locale_en_gb=Px,e.plugin_redact=hx,e.plugin_redact_locale_en_gb=Rx,e.plugin_resize=px,e.plugin_resize_locale_en_gb=kx,e.plugin_sticker=dx,e.plugin_sticker_locale_en_gb=Tx,e.processDefaultImage=(e,t={})=>{const o=Dx(t),i="function"==typeof t.shapePreprocessor?t.shapePreprocessor:zx(t.shapePreprocessor);return delete t.shapePreprocessor,t=va([{...o,shapePreprocessor:i,stickerStickToImage:!0},t]),is(e,t)},e.processImage=is,e.removeNode=fp,e.setPlugins=nx,e.shapeGetCenter=sn,e.shapeGetLength=e=>{if(e.x1)return Re(ue(e.x1,e.y1),ue(e.x2,e.y2))},e.shapeGetLevel=(e,t)=>{let o=!1;t.flipX&&e.flipX?o=!0:!t.flipX&&e.flipX?o=!1:t.flipX&&!e.flipX&&(o=!0);let i=!1;t.flipY&&e.flipY?i=!0:!t.flipY&&e.flipY?i=!1:t.flipY&&!e.flipY&&(i=!0);let n=-t.rotation;return!o&&!i||o&&i||(n=-n),{flipX:o,flipY:i,rotation:n}},e.supportsWebGL=ph,e.updateNode=(e,t)=>{const[,,o]=e;Object.assign(o,t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});