@dreamcommerce/aurora 2.16.7 → 2.16.8-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js +191 -0
  2. package/build/cjs/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  3. package/build/cjs/external/@pqina/pintura/pintura.css.js +11 -0
  4. package/build/cjs/external/@pqina/pintura/pintura.css.js.map +1 -0
  5. package/build/cjs/external/@pqina/pintura/pintura.js +121 -0
  6. package/build/cjs/external/@pqina/pintura/pintura.js.map +1 -0
  7. package/build/cjs/external/@pqina/react-pintura/PinturaEditor.js +83 -0
  8. package/build/cjs/external/@pqina/react-pintura/PinturaEditor.js.map +1 -0
  9. package/build/cjs/external/@pqina/react-pintura/PinturaEditorModal.js +95 -0
  10. package/build/cjs/external/@pqina/react-pintura/PinturaEditorModal.js.map +1 -0
  11. package/build/cjs/external/@pqina/react-pintura/PinturaEditorOverlay.js +83 -0
  12. package/build/cjs/external/@pqina/react-pintura/PinturaEditorOverlay.js.map +1 -0
  13. package/build/cjs/external/@pqina/react-pintura/events.js +46 -0
  14. package/build/cjs/external/@pqina/react-pintura/events.js.map +1 -0
  15. package/build/cjs/packages/aurora/src/assets/icon_image.js +32 -0
  16. package/build/cjs/packages/aurora/src/assets/icon_image.js.map +1 -0
  17. package/build/cjs/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js +4 -2
  18. package/build/cjs/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js.map +1 -1
  19. package/build/cjs/packages/aurora/src/components/dropdown/components/content.js +1 -1
  20. package/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js +6 -2
  21. package/build/cjs/packages/aurora/src/components/file_picker/use_file_picker.js.map +1 -1
  22. package/build/cjs/packages/aurora/src/components/image_picker/css_classes.js +2 -0
  23. package/build/cjs/packages/aurora/src/components/image_picker/css_classes.js.map +1 -1
  24. package/build/cjs/packages/aurora/src/components/image_picker/index.js +25 -4
  25. package/build/cjs/packages/aurora/src/components/image_picker/index.js.map +1 -1
  26. package/build/cjs/packages/aurora/src/components/modal/hoc/absolute_modal/index.js +5 -5
  27. package/build/cjs/packages/aurora/src/components/modal/hoc/absolute_modal/index.js.map +1 -1
  28. package/build/cjs/packages/aurora/src/components/modal/hoc/relative_modal/index.js +5 -5
  29. package/build/cjs/packages/aurora/src/components/modal/hoc/relative_modal/index.js.map +1 -1
  30. package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal.js +112 -0
  31. package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal.js.map +1 -0
  32. package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js +21 -0
  33. package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map +1 -0
  34. package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js +31 -0
  35. package/build/cjs/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map +1 -0
  36. package/build/cjs/packages/aurora/src/components/modal_new/components/modals_wrapper.js +66 -0
  37. package/build/cjs/packages/aurora/src/components/modal_new/components/modals_wrapper.js.map +1 -0
  38. package/build/cjs/packages/aurora/src/components/modal_new/constants.js +25 -0
  39. package/build/cjs/packages/aurora/src/components/modal_new/constants.js.map +1 -0
  40. package/build/cjs/packages/aurora/src/components/modal_new/context.js +21 -0
  41. package/build/cjs/packages/aurora/src/components/modal_new/context.js.map +1 -0
  42. package/build/cjs/packages/aurora/src/components/modal_new/css_classes.js +42 -0
  43. package/build/cjs/packages/aurora/src/components/modal_new/css_classes.js.map +1 -0
  44. package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals.js +119 -0
  45. package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals.js.map +1 -0
  46. package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals_context.js +19 -0
  47. package/build/cjs/packages/aurora/src/components/modal_new/hooks/use_modals_context.js.map +1 -0
  48. package/build/cjs/packages/aurora/src/components/modal_new/index.js +45 -0
  49. package/build/cjs/packages/aurora/src/components/modal_new/index.js.map +1 -0
  50. package/build/cjs/packages/aurora/src/components/pintura/index.js +51 -0
  51. package/build/cjs/packages/aurora/src/components/pintura/index.js.map +1 -0
  52. package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js +52 -9
  53. package/build/cjs/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
  54. package/build/cjs/packages/aurora/src/css/image_picker/main.module.less.js +3 -1
  55. package/build/cjs/packages/aurora/src/css/image_picker/main.module.less.js.map +1 -1
  56. package/build/cjs/packages/aurora/src/css/modal_new/main.module.less.js +34 -0
  57. package/build/cjs/packages/aurora/src/css/modal_new/main.module.less.js.map +1 -0
  58. package/build/cjs/packages/aurora/src/index.js +57 -49
  59. package/build/cjs/packages/aurora/src/index.js.map +1 -1
  60. package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js +0 -5
  61. package/build/cjs/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js.map +1 -1
  62. package/build/esm/_virtual/_rollupPluginBabelHelpers.js +181 -1
  63. package/build/esm/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  64. package/build/esm/external/@pqina/pintura/pintura.css.js +7 -0
  65. package/build/esm/external/@pqina/pintura/pintura.css.js.map +1 -0
  66. package/build/esm/external/@pqina/pintura/pintura.js +15 -0
  67. package/build/esm/external/@pqina/pintura/pintura.js.map +1 -0
  68. package/build/esm/external/@pqina/react-pintura/PinturaEditor.js +75 -0
  69. package/build/esm/external/@pqina/react-pintura/PinturaEditor.js.map +1 -0
  70. package/build/esm/external/@pqina/react-pintura/PinturaEditorModal.js +87 -0
  71. package/build/esm/external/@pqina/react-pintura/PinturaEditorModal.js.map +1 -0
  72. package/build/esm/external/@pqina/react-pintura/PinturaEditorOverlay.js +75 -0
  73. package/build/esm/external/@pqina/react-pintura/PinturaEditorOverlay.js.map +1 -0
  74. package/build/esm/external/@pqina/react-pintura/events.js +41 -0
  75. package/build/esm/external/@pqina/react-pintura/events.js.map +1 -0
  76. package/build/esm/packages/aurora/src/assets/icon_image.d.ts +4 -0
  77. package/build/esm/packages/aurora/src/assets/icon_image.js +24 -0
  78. package/build/esm/packages/aurora/src/assets/icon_image.js.map +1 -0
  79. package/build/esm/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js +4 -2
  80. package/build/esm/packages/aurora/src/components/controls/hoc/control_xhr_image_picker/index.js.map +1 -1
  81. package/build/esm/packages/aurora/src/components/controls/types.d.ts +1 -0
  82. package/build/esm/packages/aurora/src/components/dropdown/components/content.js +1 -1
  83. package/build/esm/packages/aurora/src/components/file_picker/types.d.ts +1 -0
  84. package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js +6 -2
  85. package/build/esm/packages/aurora/src/components/file_picker/use_file_picker.js.map +1 -1
  86. package/build/esm/packages/aurora/src/components/gallery/index.js +3 -3
  87. package/build/esm/packages/aurora/src/components/image_picker/css_classes.d.ts +2 -0
  88. package/build/esm/packages/aurora/src/components/image_picker/css_classes.js +2 -0
  89. package/build/esm/packages/aurora/src/components/image_picker/css_classes.js.map +1 -1
  90. package/build/esm/packages/aurora/src/components/image_picker/index.js +25 -4
  91. package/build/esm/packages/aurora/src/components/image_picker/index.js.map +1 -1
  92. package/build/esm/packages/aurora/src/components/image_picker/types.d.ts +3 -1
  93. package/build/esm/packages/aurora/src/components/image_picker/types.js.map +1 -1
  94. package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.d.ts +1 -1
  95. package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.js +5 -5
  96. package/build/esm/packages/aurora/src/components/modal/hoc/absolute_modal/index.js.map +1 -1
  97. package/build/esm/packages/aurora/src/components/modal/hoc/relative_modal/index.js +5 -5
  98. package/build/esm/packages/aurora/src/components/modal/hoc/relative_modal/index.js.map +1 -1
  99. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.d.ts +3 -0
  100. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.js +103 -0
  101. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal.js.map +1 -0
  102. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.d.ts +3 -0
  103. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.js +13 -0
  104. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_footer.js.map +1 -0
  105. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.d.ts +3 -0
  106. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.js +23 -0
  107. package/build/esm/packages/aurora/src/components/modal_new/components/modal/modal_header.js.map +1 -0
  108. package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.d.ts +6 -0
  109. package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.js +57 -0
  110. package/build/esm/packages/aurora/src/components/modal_new/components/modals_wrapper.js.map +1 -0
  111. package/build/esm/packages/aurora/src/components/modal_new/constants.d.ts +14 -0
  112. package/build/esm/packages/aurora/src/components/modal_new/constants.js +17 -0
  113. package/build/esm/packages/aurora/src/components/modal_new/constants.js.map +1 -0
  114. package/build/esm/packages/aurora/src/components/modal_new/context.d.ts +3 -0
  115. package/build/esm/packages/aurora/src/components/modal_new/context.js +17 -0
  116. package/build/esm/packages/aurora/src/components/modal_new/context.js.map +1 -0
  117. package/build/esm/packages/aurora/src/components/modal_new/css_classes.d.ts +18 -0
  118. package/build/esm/packages/aurora/src/components/modal_new/css_classes.js +21 -0
  119. package/build/esm/packages/aurora/src/components/modal_new/css_classes.js.map +1 -0
  120. package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.d.ts +12 -0
  121. package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.js +115 -0
  122. package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals.js.map +1 -0
  123. package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.d.ts +2 -0
  124. package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.js +15 -0
  125. package/build/esm/packages/aurora/src/components/modal_new/hooks/use_modals_context.js.map +1 -0
  126. package/build/esm/packages/aurora/src/components/modal_new/index.d.ts +6 -0
  127. package/build/esm/packages/aurora/src/components/modal_new/index.js +37 -0
  128. package/build/esm/packages/aurora/src/components/modal_new/index.js.map +1 -0
  129. package/build/esm/packages/aurora/src/components/modal_new/types.d.ts +35 -0
  130. package/build/esm/packages/aurora/src/components/modal_new/types.js +3 -0
  131. package/build/esm/packages/aurora/src/components/modal_new/types.js.map +1 -0
  132. package/build/esm/packages/aurora/src/components/pintura/index.d.ts +10 -0
  133. package/build/esm/packages/aurora/src/components/pintura/index.js +43 -0
  134. package/build/esm/packages/aurora/src/components/pintura/index.js.map +1 -0
  135. package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js +54 -11
  136. package/build/esm/packages/aurora/src/components/xhr_image_picker/index.js.map +1 -1
  137. package/build/esm/packages/aurora/src/components/xhr_image_picker/types.d.ts +2 -1
  138. package/build/esm/packages/aurora/src/css/image_picker/main.module.less.js +3 -1
  139. package/build/esm/packages/aurora/src/css/image_picker/main.module.less.js.map +1 -1
  140. package/build/esm/packages/aurora/src/css/modal_new/main.module.less.js +30 -0
  141. package/build/esm/packages/aurora/src/css/modal_new/main.module.less.js.map +1 -0
  142. package/build/esm/packages/aurora/src/index.d.ts +5 -1
  143. package/build/esm/packages/aurora/src/index.js +4 -0
  144. package/build/esm/packages/aurora/src/index.js.map +1 -1
  145. package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js +0 -5
  146. package/build/esm/packages/star_core/build/esm/packages/star_core/src/classes/axios_http_client/axios_http_client.js.map +1 -1
  147. package/package.json +3 -1
@@ -0,0 +1,15 @@
1
+ import { defineProperty as _defineProperty, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, inherits as _inherits, createClass as _createClass, typeof as _typeof, toConsumableArray as _toConsumableArray, wrapNativeSuper as _wrapNativeSuper, objectWithoutProperties as _objectWithoutProperties, createForOfIteratorHelper as _createForOfIteratorHelper, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime, toArray as _toArray, classCallCheck as _classCallCheck, possibleConstructorReturn as _possibleConstructorReturn, getPrototypeOf as _getPrototypeOf, assertThisInitialized as _assertThisInitialized } from '../../../_virtual/_rollupPluginBabelHelpers.js';
2
+
3
+ var _excluded=["textOutlineWidth","textShadowX","textShadowY","textShadowBlur","textShadowColor","outline","blur"],_excluded2=["controls"],_excluded3=["textContent","innerHTML"],_excluded4=["width"],_excluded5=["strokeWidth","strokeColor","strokeJoin","strokeCap"],_excluded6=["strokeWidth","strokeColor"],_excluded7=["strokeWidth","strokeColor","strokeJoin","strokeCap"],_excluded8=["strokeWidth","strokeColor"],_excluded9=["frameStyle"];function _callSuper(_this,derived,args){function isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){return false;}}derived=_getPrototypeOf(derived);return _possibleConstructorReturn(_this,isNativeReflectConstruct()?Reflect.construct(derived,args||[],_getPrototypeOf(_this).constructor):derived.apply(_this,args));}/*!
4
+ * Pintura v8.81.1 - Test version
5
+ * (c) 2018-2024 PQINA Inc. - All Rights Reserved
6
+ * License: https://pqina.nl/pintura/license/
7
+ *
8
+ * This version of Pintura is for testing purposes only.
9
+ * Visit https://pqina.nl/pintura/ to obtain a commercial license.
10
+ */ /* eslint-disable */var e=[{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 t=function t(_t2){if(65496!==_t2.getUint16(0))return;var o=_t2.byteLength;var i,n=2,r=void 0;for(;n<o&&255===_t2.getUint8(n);){i=_t2.getUint16(n);var _o2=e.find(function(e){return e.value===i&&(!e.subvalue||e.subvalue===_t2.getUint16(n+2+2));});if(_o2){var _e2=_o2.name;r||(r={}),r[_e2]||(r[_e2]={offset:n,size:_t2.getUint16(n+2)});}if(65498===i)break;n+=2+_t2.getUint16(n+2);}return r;};var o=function o(e,_o3,i){if(!e)return;var n=new DataView(e),r=t(n);if(!r||!r.exif)return;var a=function(e,t){if(65505!==e.getUint16(t))return;var o=e.getUint16(t+2);if(t+=4,1165519206!==e.getUint32(t))return;t+=6;var i=e.getUint16(t);if(18761!==i&&19789!==i)return;var n=18761===i;if(t+=2,42!==e.getUint16(t,n))return;t+=e.getUint32(t+2,n);var r=function r(i){var r=[];var a=t;var s=Math.min(e.byteLength,t+o-16);for(;a<s;a+=12){var _t3=a;e.getUint16(_t3,n)===i&&r.push(_t3);}return r;};return {read:function read(t){var o=r(t);if(o.length)return e.getUint16(o[0]+8,n);},write:function write(t,o){var i=r(t);return !!i.length&&(i.forEach(function(t){return e.setUint16(t+8,o,n);}),!0);}};}(n,r.exif.offset);return a?void 0===i?a.read(_o3):a.write(_o3,i):void 0;};var i=function i(e){return window.__pqina_webapi__?window.__pqina_webapi__[e]:window[e];},n=function n(){};var r={ArrayBuffer:"readAsArrayBuffer"};var a=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e){var t,o,_args=arguments;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:t=_args.length>1&&_args[1]!==undefined?_args[1]:[0,e.size];o=_args.length>2?_args[2]:undefined;_context.next=4;return function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:n;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return new Promise(function(n,a){var _o$dataFormat=o.dataFormat,s=_o$dataFormat===void 0?r.ArrayBuffer:_o$dataFormat,l=new(i("FileReader"))();l.onload=function(){return n(l.result);},l.onerror=function(){return a(l.error);},l.onprogress=t,l[s](e);});}(e.slice.apply(e,_toConsumableArray(t)),o);case 4:return _context.abrupt("return",_context.sent);case 5:case"end":return _context.stop();}},_callee);}));return function a(_x2){return _ref.apply(this,arguments);};}(),s=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e,t){var i;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return a(e,[0,262144],t);case 2:i=_context2.sent;return _context2.abrupt("return",o(i,274)||1);case 4:case"end":return _context2.stop();}},_callee2);}));return function s(_x3,_x4){return _ref2.apply(this,arguments);};}();var l=null;var c=function c(){return null===l&&(l="undefined"!=typeof window&&void 0!==window.document),l;};var d=null;var u=function u(){return new Promise(function(e){if(null===d){var _t4="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/4QA6RXhpZgAATU0AKgAAAAgAAwESAAMAAAABAAYAAAEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAD/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAIBASIA/8QAJgABAAAAAAAAAAAAAAAAAAAAAxABAAAAAAAAAAAAAAAAAAAAAP/aAAgBAQAAPwBH/9k=";var _o4=c()?new Image():{};return _o4.onload=function(){d=1===_o4.naturalWidth,_o4=void 0,e(d);},void(_o4.src=_t4);}return e(d);});},h=function h(e){return e.getContext("2d").getImageData(0,0,e.width,e.height);},p=function p(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var i=document.createElement(e),n=Object.getOwnPropertyDescriptors(i.__proto__);for(var _e4 in t)"style"===_e4?i.style.cssText=t[_e4]:n[_e4]&&n[_e4].set||/textContent|innerHTML/.test(_e4)||"function"==typeof t[_e4]?i[_e4]=t[_e4]:i.setAttribute(_e4,t[_e4]);return o.forEach(function(e){return i.appendChild(e);}),i;};var m={1:function _(){return [1,0,0,1,0,0];},2:function _(e){return [-1,0,0,1,e,0];},3:function _(e,t){return [-1,0,0,-1,e,t];},4:function _(e,t){return [1,0,0,-1,0,t];},5:function _(){return [0,1,1,0,0,0];},6:function _(e,t){return [0,1,-1,0,t,0];},7:function _(e,t){return [0,-1,-1,0,t,e];},8:function _(e){return [0,-1,1,0,0,e];}};var $=function $(e){e.width=1,e.height=1;var t=e.getContext("2d");t&&t.clearRect(0,0,1,1);},g=function g(e){return "data"in e;},f=function f(e){return c()?RegExp(e).test(window.navigator.userAgent):void 0;};var y=null;var b=function b(){return null===y&&(y=f(/Android/)),y;},x=function x(e,t){var o=p("canvas",{width:e.width,height:e.height});return o.getContext("2d",t).drawImage(e,0,0),o;},v=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e){var t,o,_ref4,_ref5,i,n,r,a,_t5,_args3=arguments;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:t=_args3.length>1&&_args3[1]!==undefined?_args3[1]:1;_context3.next=3;return u();case 3:o=_context3.sent;_ref4=o||t<5?[e.width,e.height]:[e.height,e.width];_ref5=_slicedToArray(_ref4,2);i=_ref5[0];n=_ref5[1];r=p("canvas",{width:i,height:n});a=r.getContext("2d",{willReadFrequently:!0});if(g(e)&&!o&&t>1){_t5=p("canvas",{width:e.width,height:e.height});_t5.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),e=_t5;}if(!(!o&&t>1&&a.transform.apply(a,function(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return -1===o&&(o=1),m[o](e,t);}(e.width,e.height,t)),g(e))){_context3.next=16;break;}if(!(a.putImageData(e,0,0),b())){_context3.next=14;break;}return _context3.abrupt("return",x(r));case 14:_context3.next=17;break;case 16:a.drawImage(e,0,0);case 17:return _context3.abrupt("return",(e instanceof HTMLCanvasElement&&$(e),r));case 18:case"end":return _context3.stop();}},_callee3);}));return function v(_x5){return _ref3.apply(this,arguments);};}(),w=/*#__PURE__*/function(){var _ref6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(e){var t,_args4=arguments;return _regeneratorRuntime().wrap(function _callee4$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:t=_args4.length>1&&_args4[1]!==undefined?_args4[1]:1;_context4.t0=1===t;if(_context4.t0){_context4.next=6;break;}_context4.next=5;return u();case 5:_context4.t0=_context4.sent;case 6:if(!_context4.t0){_context4.next=10;break;}_context4.t1=e;_context4.next=15;break;case 10:_context4.t2=h;_context4.next=13;return v(e,t);case 13:_context4.t3=_context4.sent;_context4.t1=(0, _context4.t2)(_context4.t3);case 15:return _context4.abrupt("return",_context4.t1);case 16:case"end":return _context4.stop();}},_callee4);}));return function w(_x6){return _ref6.apply(this,arguments);};}(),S=function S(e){return "object"==_typeof(e);};var k=function k(e){return e instanceof HTMLElement?e:S(e)?C(e):e;},C=function C(e){var t;return Array.isArray(e)?(t=[],e.forEach(function(e,o){t[o]=k(e);})):(t={},null!==e&&Object.keys(e).forEach(function(o){var i=e[o];t[o]=k(i);})),t;};var T=function T(e){return "string"==typeof e;},M=function M(e){return "function"==typeof e;},R=function R(e,t){return new Promise(function(o,i){var n=function n(){return o(function(e,_ref7){var t=_ref7.width,o=_ref7.height,i=_ref7.canvasMemoryLimit,n=_ref7.contextOptions;var r=t||e.naturalWidth,a=o||e.naturalHeight;r||a||(r=300,a=150);var s=r*a;if(i&&s>i){var _e5=Math.sqrt(i)/Math.sqrt(s);r=Math.floor(r*_e5),a=Math.floor(a*_e5);}var l=p("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=function(){return i(new Error("Failed to load image"));});});},P=function P(){return "createImageBitmap"in window;},E=function E(e){return /svg/.test(e.type);},I=function I(){return Math.random().toString(36).substring(2,9);};var A=new Map();var L=function L(e,t,o){return new Promise(function(i,n){var r=e.toString();var a=A.get(r);if(!a){var _t6=function(e){return "function () {self.onmessage = function (message) {(".concat(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),_o5=URL.createObjectURL(function(e){return new Blob(["(","function"==typeof e?e.toString():e,")()"],{type:"application/javascript"});}(_t6)),_i2=new Map(),_n2=new Worker(_o5);a={url:_o5,worker:_n2,messages:_i2,terminationTimeout:void 0,terminate:function terminate(){clearTimeout(a.terminationTimeout),a.worker.terminate(),URL.revokeObjectURL(_o5),A.delete(r);}},_n2.onmessage=function(e){var _e$data=e.data,t=_e$data.id,o=_e$data.content,n=_e$data.error;if(clearTimeout(a.terminationTimeout),a.terminationTimeout=setTimeout(function(){_i2.size>0||a.terminate();},500),!_i2.has(t))return;var r=_i2.get(t);_i2.delete(t),null!=n?r.reject(n):r.resolve(o);},A.set(r,a);}var s=I();a.messages.set(s,{resolve:i,reject:n}),a.worker.postMessage({id:s,content:t},o);});};var z=null;var F=function F(){return null===z&&(z=f(/Firefox/)),z;};var D=/*#__PURE__*/function(){var _ref8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(e,t){var o,i;return _regeneratorRuntime().wrap(function _callee6$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:_context6.next=2;return function(){var _ref9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(e,t){var o,i;return _regeneratorRuntime().wrap(function _callee5$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:o=p("img",{src:URL.createObjectURL(e)});_context5.next=3;return R(o,t);case 3:i=_context5.sent;return _context5.abrupt("return",(URL.revokeObjectURL(o.src),i));case 5:case"end":return _context5.stop();}},_callee5);}));return function(_x9,_x10){return _ref9.apply(this,arguments);};}()(e,{canvasMemoryLimit:t,contextOptions:{willReadFrequently:!0}});case 2:o=_context6.sent;i=h(o);return _context6.abrupt("return",($(o),i));case 5:case"end":return _context6.stop();}},_callee6);}));return function D(_x7,_x8){return _ref8.apply(this,arguments);};}();var O=/*#__PURE__*/function(){var _ref10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(e,t){var o;return _regeneratorRuntime().wrap(function _callee7$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:if(!(b()&&!F())){_context7.next=4;break;}_context7.next=3;return D(e,t);case 3:return _context7.abrupt("return",_context7.sent);case 4:if(!(P()&&!E(e)&&"OffscreenCanvas"in window)){_context7.next=13;break;}_context7.prev=5;_context7.next=8;return L(function(e,t,o){createImageBitmap(e).then(function(e){var i=e.width,n=e.height;var r=i*n;if(t&&r>t){var _e6=Math.sqrt(t)/Math.sqrt(r);i=Math.floor(i*_e6),n=Math.floor(n*_e6);}var a=new OffscreenCanvas(i,n),s=a.getContext("2d",{willReadFrequently:!0});s.drawImage(e,0,0,i,n);var l=s.getImageData(0,0,a.width,a.height);o(null,l);}).catch(function(e){o(e);});},[e,t]);case 8:o=_context7.sent;_context7.next=13;break;case 11:_context7.prev=11;_context7.t0=_context7["catch"](5);case 13:if(!(o&&o.width)){_context7.next=17;break;}_context7.t1=o;_context7.next=20;break;case 17:_context7.next=19;return D(e,t);case 19:_context7.t1=_context7.sent;case 20:return _context7.abrupt("return",_context7.t1);case 21:case"end":return _context7.stop();}},_callee7,null,[[5,11]]);}));return function O(_x11,_x12){return _ref10.apply(this,arguments);};}(),B=function B(e,t,o){return new Promise(function(i,n){try{e.toBlob(function(e){if(!e)return n(new Error("Failed to create blob"));i(e);},t,o);}catch(e){n(e);}});},W=/*#__PURE__*/function(){var _ref11=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(e,t,o){var i,n;return _regeneratorRuntime().wrap(function _callee8$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:_context8.next=2;return v(e);case 2:i=_context8.sent;_context8.next=5;return B(i,t,o);case 5:n=_context8.sent;return _context8.abrupt("return",($(i),n));case 7:case"end":return _context8.stop();}},_callee8);}));return function W(_x13,_x14,_x15){return _ref11.apply(this,arguments);};}();var V={matroska:"mkv"};var _=function _(e){var t=(e.match(/\/([a-z0-9]+)/)||[])[1];if(/^x/.test(t)){var _e$split3=e.split("/x-"),_e$split4=_slicedToArray(_e$split3,2),_e$split2$2=_e$split4[1],_t7=_e$split2$2===void 0?"":_e$split2$2;return V[_t7];}return t;},N=function N(e){return e.substr(0,e.lastIndexOf("."))||e;};var H=/avif|bmp|gif|jpg|jpeg|jpe|jif|jfif|png|svg|tiff|webp/;var j=function j(e){return e&&(t=(o=e,o.split(".").pop()).toLowerCase(),H.test(t)?"image/"+(/jfif|jif|jpe|jpg/.test(t)?"jpeg":"svg"===t?"svg+xml":t):"");var t,o;},U=function U(e,t,o){var n=new Date().getTime(),r=e.type.length&&!/null|text/.test(e.type),a=r?e.type:o,s=function(e,t){var o=j(e);if(o===t)return e;var i=_(t)||o;return "".concat(N(e),".").concat(i);}(t,a);try{return new(i("File"))([e],s,{lastModified:n,type:r?e.type:a});}catch(t){var _o6=r?e.slice():e.slice(0,e.size,a);return _o6.lastModified=n,_o6.name=s,_o6;}},G=function G(e,t){return e/t;},Z=function Z(e){return e;};var X=Math.PI,Y=Math.PI/2,q=Y/2;var K=function K(e){var t=Math.abs(e)%Math.PI;return t>q&&t<Math.PI-q;};var J={Top:"t",Right:"r",Bottom:"b",Left:"l",TopLeft:"tl",TopRight:"tr",BottomRight:"br",BottomLeft:"bl"},Q=J.Top,ee=J.Right,te=J.Bottom,oe=J.Left,ie=J.TopLeft,ne=J.TopRight,re=J.BottomRight,ae=J.BottomLeft;var se=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Q,[.5,0]),ee,[1,.5]),te,[.5,1]),oe,[0,.5]),ie,[0,0]),ne,[1,0]),re,[1,1]),ae,[0,1]),le=function le(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:12;return parseFloat(e.toFixed(t));};var ce=function ce(e,t,o){return o+(e-o)*t;},de=function de(e){return {x:e.x+.5*e.width,y:e.y+.5*e.height,rx:.5*e.width,ry:.5*e.height};},ue=function ue(){return he(0,0);},he=function he(e,t){return {x:e,y:t};},pe=function pe(e){return he(e.pageX,e.pageY);},me=function me(e){return he(e.x,e.y);},$e=function $e(e){return e.x=-e.x,e.y=-e.y,e;},ge=function ge(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:ue();var 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=function fe(e){return Math.sqrt(e.x*e.x+e.y*e.y);},ye=function ye(e){var t=Math.sqrt(e.x*e.x+e.y*e.y);return 0===t?ue():(e.x/=t,e.y/=t,e);},be=function be(e,t){return Math.atan2(t.y-e.y,t.x-e.x);},xe=function xe(e,t){return e.x===t.x&&e.y===t.y;},ve=function ve(e,t){return e.x=t(e.x),e.y=t(e.y),e;},we=function we(e,t){return e.x+=t.x,e.y+=t.y,e;},Se=function Se(e,t){return e.x-=t.x,e.y-=t.y,e;},ke=function ke(e,t){return e.x/=t,e.y/=t,e;},Ce=function Ce(e,t){return e.x*=t,e.y*=t,e;},Te=function Te(e,t){return e.x*t.x+e.y*t.y;},Me=function Me(e,t){return e.x*t.y-e.y*t.x;},Re=function Re(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ue();var o=e.x-t.x,i=e.y-t.y;return o*o+i*i;},Pe=function Pe(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:ue();return Math.sqrt(Re(e,t));},Ee=function Ee(e,t,o){return e.x=ce(e.x,t,o.x),e.y=ce(e.y,t,o.y),e;},Ie=function Ie(e){var t=0,o=0;return e.forEach(function(e){t+=e.x,o+=e.y;}),he(t/e.length,o/e.length);},Ae=function Ae(e,t,o,i,n){return e.forEach(function(e){e.x=t?i-(e.x-i):e.x,e.y=o?n-(e.y-n):e.y;}),e;},Le=function Le(e,t,o,i){var n=Math.sin(t),r=Math.cos(t);return e.forEach(function(e){e.x-=o,e.y-=i;var t=e.x*r-e.y*n,a=e.x*n+e.y*r;e.x=o+t,e.y=i+a;}),e;},ze=function ze(e,t){return {width:e,height:t};},Fe=function Fe(e){return ze(e.width,e.height);},De=function De(e){return ze(e.width,e.height);},Oe=function Oe(e){return ze(e.width,e.height);},Be=function Be(e){return ze(e[0],e[1]);},We=function We(e){return /img/i.test(e.nodeName)?ze((t=e).naturalWidth,t.naturalHeight):De(e);var t;},Ve=function Ve(e,t){return ze(e,t);},_e=function _e(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Z;return o(e.width)===o(t.width)&&o(e.height)===o(t.height);},Ne=function Ne(e,t){return e.width*=t,e.height*=t,e;},He=function He(e){return he(.5*e.width,.5*e.height);},je=function je(e,t){var o=Math.abs(t),i=Math.abs(Math.cos(o)),n=Math.abs(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=function Ue(e,t){return e.width>=t.width&&e.height>=t.height;},Ge=function Ge(e,t){return e.width=t(e.width),e.height=t(e.height),e;},Ze=function Ze(e,t){return {start:e,end:t};},Xe=function Xe(e){return Ze(me(e.start),me(e.end));},Ye=function Ye(e,t){if(0===t)return e;var o=he(e.start.x-e.end.x,e.start.y-e.end.y),i=ye(o),n=Ce(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=[he(-1,-1),he(-1,1),he(1,1),he(1,-1)],Ke=function Ke(e,t,o,i){return {x:e,y:t,width:o,height:i};},Je=function Je(e){return Ke(e.x,e.y,e.width,e.height);},Qe=function Qe(){return Ke(0,0,0,0);},et=function et(e){return Ke(0,0,e.width,e.height);},tt=function tt(e){return Ke(e[3],e[0],e[1]-e[3],e[2]-e[0]);},ot=function ot(e){return Ke(e.x||0,e.y||0,e.width||0,e.height||0);},it=function it(e){var t=e[0].x,o=e[0].x,i=e[0].y,n=e[0].y;return e.forEach(function(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);},nt=function nt(e){return at(e.x-e.rx,e.y-e.ry,2*e.rx,2*e.ry);},rt=function rt(e,t){return Ke(e.x-.5*t.width,e.y-.5*t.height,t.width,t.height);},at=function at(e,t,o,i){return Ke(e,t,o,i);},st=function st(e){return he(e.x+.5*e.width,e.y+.5*e.height);},lt=function lt(e,t){return e.x+=t.x,e.y+=t.y,e;},ct=function ct(e,t,o){return o=o||st(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;},dt=function dt(e,t,o,i){var n=(i.x-e.x)/e.width,r=(i.y-e.y)/e.height;var 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;},ut=function ut(e,t){var _se$t=_slicedToArray(se[t],2),o=_se$t[0],i=_se$t[1],n=o*e.width,r=i*e.height;return he(e.x+n,e.y+r);},ht=function ht(e,t){return e.x*=t,e.y*=t,e.width*=t,e.height*=t,e;},pt=function pt(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:Z;return o(e.x)===o(t.x)&&o(e.y)===o(t.y)&&o(e.width)===o(t.width)&&o(e.height)===o(t.height);},mt=function mt(e){return G(e.width,e.height);},$t=function $t(e,t,o,i,n){return e.x=t,e.y=o,e.width=i,e.height=n,e;},gt=function gt(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e;},ft=function ft(e,t,o){return o||(o=st(e)),St(e).map(function(e){return ge(e,t,o);});},yt=function yt(e,t){return Ke(.5*e.width-.5*t.width,.5*e.height-.5*t.height,t.width,t.height);},bt=function bt(e,t){return !(t.x<e.x)&&!(t.y<e.y)&&!(t.x>e.x+e.width)&&!(t.y>e.y+e.height);},xt=function xt(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:ue();if(0===e.width||0===e.height)return Qe();var i=mt(e);t||(t=i);var 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);},vt=function vt(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:mt(e);var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:ue();if(0===e.width||0===e.height)return Qe();var 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);},wt=function wt(e){return [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)];},St=function St(e){return [he(e.x,e.y),he(e.x+e.width,e.y),he(e.x+e.width,e.y+e.height),he(e.x,e.y+e.height)];},kt=function kt(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;},Ct=function Ct(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:st(e);return St(e).map(function(e,i){var n=qe[i];return he(ce(e.x,1+n.x*t.x,o.x),ce(e.y,1+n.y*t.y,o.y));});},Tt=function Tt(e){return e.x=0,e.y=0,e;},Mt=function Mt(e){var t=e[0],o=e[e.length-1];e=xe(t,o)?e:[].concat(_toConsumableArray(e),[t]);var i=t.x,n=t.y;var r,a,s,l=0,c=0,d=0,u=0;var 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,he(i+d/s,n+u/s);},Rt=function Rt(e,t){return Pt(e.start,e.end,t.start,t.end);},Pt=function Pt(e,t,o,i){var n=(i.y-o.y)*(t.x-e.x)-(i.x-o.x)*(t.y-e.y);if(0===n)return;var 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:he(e.x+r*(t.x-e.x),e.y+r*(t.y-e.y));},Et=function Et(e,t){var _ref12=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref12$ignoreIdentica=_ref12.ignoreIdenticalLines,o=_ref12$ignoreIdentica===void 0?!1:_ref12$ignoreIdentica,_ref12$breakOnInterse=_ref12.breakOnIntersection,i=_ref12$breakOnInterse===void 0?!1:_ref12$breakOnInterse;var n=t.length,r=[];for(var _a3=0;_a3<n-1;_a3++){if(o&&(xe(e.start,t[_a3])||xe(e.start,t[_a3+1])||xe(e.end,t[_a3])||xe(e.end,t[_a3+1])))continue;var _n3=Pt(e.start,e.end,t[_a3],t[_a3+1]);if(_n3){if(i)return [_n3];r.push(_n3);}}return r.length?r:void 0;},It=function It(e,t){var o=0,i=0,n=!1;var 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=function At(e){var t=[];for(var _o8=0;_o8<e.length;_o8++){var _i3=_o8+1;_i3===e.length&&(_i3=0),t.push(Ze(me(e[_o8]),me(e[_i3])));}return t;},Lt=function Lt(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return At(e).map(function(e){return Ye(e,t);});},zt=function zt(e,t,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:!1;var r=arguments.length>5&&arguments[5]!==undefined?arguments[5]:!1;var a=arguments.length>6&&arguments[6]!==undefined?arguments[6]:12;var s=[];for(var _i5=0;_i5<a;_i5++)s.push(he(e.x+t*Math.cos(_i5*(2*Math.PI)/a),e.y+o*Math.sin(_i5*(2*Math.PI)/a)));return (n||r)&&Ae(s,n,r,e.x,e.y),i&&Le(s,i,e.x,e.y),s;},Ft=function Ft(e,t,o,i){var n=he(e.x-o.x,e.y-o.y),r=he(i.x-o.x,i.y-o.y),a=Te(r,r);var s=Te(n,r)/a;s=s<0?0:s,s=s>1?1:s;var l=he(r.x*s+o.x-e.x,r.y*s+o.y-e.y);return Te(l,l)<=t*t;},Dt=function Dt(e,t,o){var i=o.length;for(var _n5=0;_n5<i-1;_n5++)if(Ft(e,t,o[_n5],o[_n5+1]))return !0;return !1;},Ot=function Ot(e,t,o){return !!It(e,o)||!!Dt(e,t,o)||Ft(e,t,o[0],o[o.length-1]);},Bt=function Bt(e,t,o,i,n){return Ot(e,t,ft(o,i,n||st(o)));};var Wt=function Wt(e,t){var o=et(e),i=st(o),n=ft(o,t,i);return Tt(it(n));},Vt=function Vt(e,t){return e instanceof HTMLElement&&(!t||new RegExp("^".concat(t,"$"),"i").test(e.nodeName));},_t=function _t(e){return e instanceof File;},Nt=/*#__PURE__*/function(){var _ref13=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(e,t,o){var i;return _regeneratorRuntime().wrap(function _callee9$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:_context9.next=2;return B(e,t,o);case 2:i=_context9.sent;return _context9.abrupt("return",U(i,"canvas"));case 4:case"end":return _context9.stop();}},_callee9);}));return function Nt(_x16,_x17,_x18){return _ref13.apply(this,arguments);};}(),Ht=function Ht(e){return e.split("/").pop().split(/\?|\#/).shift();};var jt=c()&&!!Node.prototype.replaceChildren?function(e,t){return e.replaceChildren(t);}:function(e,t){for(;e.lastChild;)e.removeChild(e.lastChild);void 0!==t&&e.append(t);},Ut=c()&&p("div",{class:"PinturaMeasure",style:"position:absolute;left:0;top:0;width:99999px;height:0;pointer-events:none;contain:strict;margin:0;padding:0;"});var Gt;var Zt=function Zt(e){return jt(Ut,e),Ut.parentNode||document.body.append(Ut),clearTimeout(Gt),Gt=setTimeout(function(){Ut.remove();},500),e;};var Xt=null;var Yt=function Yt(){return null===Xt&&(Xt=c()&&/^((?!chrome|android).)*(safari|iphone|ipad)/i.test(navigator.userAgent)),Xt;},qt=function qt(e){return new Promise(function(t,o){var i=!1;!e.parentNode&&Yt()&&(i=!0,e.style.cssText="position:absolute;visibility:hidden;pointer-events:none;left:0;top:0;width:0;height:0;",Zt(e));var n=function n(){var o=e.naturalWidth,n=e.naturalHeight;o&&n&&(i&&e.remove(),clearInterval(r),t({width:o,height:n}));};e.onerror=function(e){clearInterval(r),o(e);};var r=setInterval(n,1);n();});},Kt=function Kt(e){return new Promise(function(t,o){var i=function i(){t({width:e.videoWidth,height:e.videoHeight});};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=function(){return o(e.error);};});},Jt=function Jt(e){return /^image/.test(e.type);},Qt=function Qt(e){return new Promise(function(t){var o=T(e)?e:URL.createObjectURL(e),i=function i(){var e=new Image();e.src=o,t(e);};if(e instanceof Blob&&Jt(e))return i();var n=document.createElement("video");n.preload="metadata",n.onloadedmetadata=function(){return t(n);},n.onerror=i,n.src=o;});},eo=function eo(e){return "VIDEO"===e.nodeName;},to=/*#__PURE__*/function(){var _ref14=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(e){var t,o;return _regeneratorRuntime().wrap(function _callee10$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:if(!e.src){_context10.next=4;break;}_context10.t0=e;_context10.next=7;break;case 4:_context10.next=6;return Qt(e);case 6:_context10.t0=_context10.sent;case 7:t=_context10.t0;_context10.prev=8;if(!eo(t)){_context10.next=15;break;}_context10.next=12;return Kt(t);case 12:_context10.t1=_context10.sent;_context10.next=18;break;case 15:_context10.next=17;return qt(t);case 17:_context10.t1=_context10.sent;case 18:o=_context10.t1;case 19:_context10.prev=19;_t(e)&&URL.revokeObjectURL(t.src);return _context10.finish(19);case 22:return _context10.abrupt("return",o);case 23:case"end":return _context10.stop();}},_callee10,null,[[8,,19,22]]);}));return function to(_x19){return _ref14.apply(this,arguments);};}();var oo=/*#__PURE__*/function(){var _ref15=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e){var t,o,i,n;return _regeneratorRuntime().wrap(function _callee11$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:_context11.next=2;return to(e);case 2:t=_context11.sent;_context11.next=5;return function(e){return new Promise(function(t,o){if(e.complete)return t(e);e.onload=function(){return t(e);},e.onerror=function(){return o(new Error("Failed to load image"));};});}(e);case 5:o=_context11.sent;i=p("canvas",t);i.getContext("2d",{willReadFrequently:!0}).drawImage(o,0,0);_context11.next=10;return B(i);case 10:n=_context11.sent;return _context11.abrupt("return",U(n,Ht(o.src)));case 12:case"end":return _context11.stop();}},_callee11);}));return function oo(_x20){return _ref15.apply(this,arguments);};}(),io=function io(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return new(i("ProgressEvent"))("progress",{loaded:100*e,total:100,lengthComputable:t});},no=function no(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(e){return e;};return e.getAllResponseHeaders().indexOf(t)>=0?o(e.getResponseHeader(t)):void 0;},ro=function ro(e){if(!e)return null;var t=e.split(/filename=|filename\*=.+''/).splice(1).map(function(e){return e.trim().replace(/^["']|[;"']{0,2}$/g,"");}).filter(function(e){return e.length;});return t.length?decodeURI(t[t.length-1]):null;};var ao="URL_REQUEST";var so=/*#__PURE__*/function(_Error){function so(e,t,o){var _this2;_classCallCheck(this,so);_this2=_callSuper(this,so,[e]),_this2.name="EditorError",_this2.code=t,_this2.metadata=o;return _this2;}_inherits(so,_Error);return _createClass(so);}(/*#__PURE__*/_wrapNativeSuper(Error));var lo=function lo(e,t){var _ref16=t||{},_ref16$headers=_ref16.headers,o=_ref16$headers===void 0?{}:_ref16$headers,i=_ref16.credentials;Object.entries(o).forEach(function(_ref17){var _ref18=_slicedToArray(_ref17,2),t=_ref18[0],o=_ref18[1];return e.setRequestHeader(t,o);}),i&&(e.withCredentials="omit"!==i);},co=function co(e,t,o){return /^data:/.test(e)?function(){var _ref19=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e){var t,o,i,r,a,s,_args7=arguments;return _regeneratorRuntime().wrap(function _callee12$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:t=_args7.length>1&&_args7[1]!==undefined?_args7[1]:"data-uri";o=_args7.length>2&&_args7[2]!==undefined?_args7[2]:n;o(io(0));_context12.next=5;return fetch(e);case 5:i=_context12.sent;o(io(.33));_context12.next=9;return i.blob();case 9:r=_context12.sent;Jt(r)||(a="image/"+(e.includes(",/9j/")?"jpeg":"png")),o(io(.66));s=U(r,t,a);return _context12.abrupt("return",(o(io(1)),s));case 13:case"end":return _context12.stop();}},_callee12);}));return function(_x21){return _ref19.apply(this,arguments);};}()(e,void 0,t):function(e,t,o){return new Promise(function(i,n){var r=function r(){return n(new so("Error fetching image",ao,a));},a=new XMLHttpRequest();a.onprogress=t,a.onerror=r,a.onload=function(){if(!a.response||a.status>=300||a.status<200)return r();var t=no(a,"Content-Type"),o=no(a,"Content-Disposition",ro)||Ht(e);i(U(a.response,o,t||j(o)));};var s=o.willRequest;Promise.resolve(s&&s(e,{resourceType:"image"})).then(function(t){if(!1===t)return n("Image load rejected");a.open("GET",e,!0),lo(a,t),a.responseType="blob",a.send();}).catch(console.error);});}(e,t,o);},uo=function uo(e){return e instanceof Blob&&!(e instanceof File);},ho=function ho(e){return "close"in e;},po=/*#__PURE__*/function(){var _ref20=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(e,t,o){return _regeneratorRuntime().wrap(function _callee13$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:if(!(_t(e)||uo(e))){_context13.next=2;break;}return _context13.abrupt("return",e);case 2:if(!T(e)){_context13.next=6;break;}_context13.next=5;return co(e,t,o);case 5:return _context13.abrupt("return",_context13.sent);case 6:if(!Vt(e,"canvas")){_context13.next=10;break;}_context13.next=9;return Nt(e);case 9:return _context13.abrupt("return",_context13.sent);case 10:if(!Vt(e,"img")){_context13.next=14;break;}_context13.next=13;return oo(e);case 13:return _context13.abrupt("return",_context13.sent);case 14:if(!(g(e)||ho(e))){_context13.next=22;break;}_context13.t0=Nt;_context13.next=18;return v(e);case 18:_context13.t1=_context13.sent;_context13.next=21;return (0, _context13.t0)(_context13.t1);case 21:return _context13.abrupt("return",_context13.sent);case 22:throw new so("Invalid image source","invalid-image-source");case 23:case"end":return _context13.stop();}},_callee13);}));return function po(_x22,_x23,_x24){return _ref20.apply(this,arguments);};}();var mo=null;var $o=function $o(){return null===mo&&(mo=c()&&/^mac/i.test(navigator.platform)),mo;};var go=null;var fo=function fo(){return null===go&&(go=c()&&(f(/iPhone|iPad|iPod/)||$o()&&navigator.maxTouchPoints>=1)),go;},yo=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee14(e){var t,_args9=arguments;return _regeneratorRuntime().wrap(function _callee14$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:t=_args9.length>1&&_args9[1]!==undefined?_args9[1]:1;_context14.next=3;return u();case 3:_context14.t1=_context14.sent;if(_context14.t1){_context14.next=6;break;}_context14.t1=fo();case 6:_context14.t0=_context14.t1;if(_context14.t0){_context14.next=9;break;}_context14.t0=t<5;case 9:if(!_context14.t0){_context14.next=13;break;}_context14.t2=e;_context14.next=14;break;case 13:_context14.t2=Ve(e.height,e.width);case 14:return _context14.abrupt("return",_context14.t2);case 15:case"end":return _context14.stop();}},_callee14);}));return function yo(_x25){return _ref21.apply(this,arguments);};}(),bo=function bo(e){return /jpeg/.test(e.type);},xo=function xo(e){return "object"!=_typeof(t=e)||t.constructor!=Object?e:JSON.stringify(e);var t;},vo=function vo(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var o=arguments.length>2?arguments[2]:undefined;return 0===t||(e.translate(o.x,o.y),e.rotate(t),e.translate(-o.x,-o.y)),e;},wo=function wo(e,t,o){return e.scale(t,o),e;},So=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee15(e){var t,o,i,n,r,a,s,l,c,d,u,h,m,_e3,_e7,_t8,_args10=arguments;return _regeneratorRuntime().wrap(function _callee15$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:t=_args10.length>1&&_args10[1]!==undefined?_args10[1]:{};o=t.flipX,i=t.flipY,n=t.rotation,r=t.crop,a=De(e),s=o||i,l=!!n,c=r&&(r.x||r.y||r.width||r.height),d=c&&pt(r,et(a)),u=c&&!d;if(!(!s&&!l&&!u)){_context15.next=4;break;}return _context15.abrupt("return",e);case 4:m=p("canvas",{width:e.width,height:e.height});if(m.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),s){_e3=p("canvas",{width:m.width,height:m.height}).getContext("2d",{willReadFrequently:!0});wo(_e3,o?-1:1,i?-1:1),_e3.drawImage(m,o?-m.width:0,i?-m.height:0),_e3.restore(),$(m),m=_e3.canvas;}if(!l){_context15.next=11;break;}_e7=Ge(Oe(it(ft(ot(m),n))),Math.floor),_t8=p("canvas",{width:r.width,height:r.height}).getContext("2d",{willReadFrequently:!0});(function(e,t,o){e.translate(t,o);})(_t8,-r.x,-r.y),vo(_t8,n,He(_e7)),_t8.drawImage(m,.5*(_e7.width-m.width),.5*(_e7.height-m.height)),_t8.restore(),$(m),m=_t8.canvas;_context15.next=13;break;case 11:if(!u){_context15.next=13;break;}return _context15.abrupt("return",(h=m.getContext("2d",{willReadFrequently:!0}).getImageData(r.x,r.y,r.width,r.height),$(m),h));case 13:return _context15.abrupt("return",(h=m.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,m.width,m.height),$(m),h));case 14:case"end":return _context15.stop();}},_callee15);}));return function So(_x26){return _ref22.apply(this,arguments);};}(),ko=function ko(e,t){var o=e.imageData,i=e.width,n=e.height,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(var _e9=0;_e9<l;_e9++)for(var _t10=0;_t10<s;_t10++){var _o9=4*(_t10+_e9*s);var _i6=0,_n6=0,_a4=0,_l2=0,_$2=0,_g2=0,_f2=0;var _y2=(_e9+.5)*h;for(var _o11=Math.floor(_e9*h);_o11<(_e9+1)*h;_o11++){var _e10=Math.abs(_y2-(_o11+.5))/m,_s2=(_t10+.5)*u,_d2=_e10*_e10;for(var _e12=Math.floor(_t10*u);_e12<(_t10+1)*u;_e12++){var _t11=Math.abs(_s2-(_e12+.5))/p;var _u2=Math.sqrt(_d2+_t11*_t11);if(_u2<-1||_u2>1)continue;if(_i6=2*_u2*_u2*_u2-3*_u2*_u2+1,_i6<=0)continue;_t11=4*(_e12+_o11*r);var _h2=c[_t11+3];_f2+=_i6*_h2,_a4+=_i6,_h2<255&&(_i6=_i6*_h2/250),_l2+=_i6*c[_t11],_$2+=_i6*c[_t11+1],_g2+=_i6*c[_t11+2],_n6+=_i6;}}d[_o9]=_l2/_n6,d[_o9+1]=_$2/_n6,d[_o9+2]=_g2/_n6,d[_o9+3]=_f2/_a4;}t(null,{data:d,width:s,height:l});},Co=function Co(e){if(e instanceof ImageData)return e;var t;try{t=new ImageData(e.width,e.height);}catch(o){t=p("canvas").getContext("2d").createImageData(e.width,e.height);}return t.data.set(e.data),t;},To=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee16(e){var t,o,i,n,r,a,s,l,_t12,_o12,_i7,_args11=arguments;return _regeneratorRuntime().wrap(function _callee16$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:t=_args11.length>1&&_args11[1]!==undefined?_args11[1]:{};o=_args11.length>2?_args11[2]:undefined;i=t.width,n=t.height,r=t.fit,a=t.upscale;if(!(!i&&!n)){_context16.next=5;break;}return _context16.abrupt("return",e);case 5:s=i,l=n;if(!(i?n||(l=i):s=n,"force"!==r)){_context16.next=12;break;}_t12=s/e.width,_o12=l/e.height;_i7=1;if(!("cover"===r?_i7=Math.max(_t12,_o12):"contain"===r&&(_i7=Math.min(_t12,_o12)),_i7>1&&!1===a)){_context16.next=11;break;}return _context16.abrupt("return",e);case 11:s=Math.round(e.width*_i7),l=Math.round(e.height*_i7);case 12:s=Math.max(s,1);l=Math.max(l,1);if(!(e.width===s&&e.height===l)){_context16.next=18;break;}_context16.t0=e;_context16.next=27;break;case 18:if(!o){_context16.next=22;break;}_context16.t1=o(e,s,l);_context16.next=26;break;case 22:_context16.next=24;return L(ko,[{imageData:e,width:s,height:l}],[e.data.buffer]);case 24:e=_context16.sent;_context16.t1=Co(e);case 26:_context16.t0=_context16.t1;case 27:return _context16.abrupt("return",_context16.t0);case 28:case"end":return _context16.stop();}},_callee16);}));return function To(_x27){return _ref23.apply(this,arguments);};}(),Mo=function Mo(e,t){var o=e.imageData,i=e.matrix;if(!i)return t(null,o);var 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],$=i[8],g=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],C=i[18],T=i[19];var M=0,R=0,P=0,E=0,I=0,A=0,L=0,z=0,F=0,D=0,O=0,B=0;for(;M<a;M+=4)R=r[M]/255,P=r[M+1]/255,E=r[M+2]/255,I=r[M+3]/255,A=R*s+P*l+E*c+I*d+u,L=R*h+P*p+E*m+I*$+g,z=R*f+P*y+E*b+I*x+v,F=R*w+P*S+E*k+I*C+T,D=Math.max(0,A*F)+(1-F),O=Math.max(0,L*F)+(1-F),B=Math.max(0,z*F)+(1-F),n[M]=255*Math.max(0,Math.min(1,D)),n[M+1]=255*Math.max(0,Math.min(1,O)),n[M+2]=255*Math.max(0,Math.min(1,B)),n[M+3]=255*I;t(null,{data:n,width:o.width,height:o.height});},Ro=function Ro(e,t){var o=e.imageData,i=e.matrix;if(!i)return t(null,o);var n=i.reduce(function(e,t){return e+t;});n=n<=0?1:n;var r=o.width,a=o.height,s=o.data;var l=0,c=0,d=0;var u=Math.round(Math.sqrt(i.length)),h=Math.floor(u/2);var p=0,m=0,$=0,g=0,f=0,y=0,b=0,x=0,v=0,w=0;var S=new Uint8ClampedArray(r*a*4);for(d=0;d<a;d++)for(c=0;c<r;c++){for(p=0,m=0,$=0,g=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,$+=s[v+2]*w,g+=s[v+3]*w;S[l]=p/n,S[l+1]=m/n,S[l+2]=$/n,S[l+3]=g/n,l+=4;}t(null,{data:S,width:r,height:a});},Po=function Po(e,t){var o=e.imageData,i=e.strength;if(!i)return t(null,o);var n=new Uint8ClampedArray(o.width*o.height*4),r=o.width,a=o.height,s=o.data,l=function l(e,t){return c=e-w,d=t-S,Math.sqrt(c*c+d*d);};var 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++)C=4*(x+v*r),T=s,M=n,R=l(x,v)*i/k,m=T[C]/255,$=T[C+1]/255,g=T[C+2]/255,f=T[C+3]/255,y=1-R,b=y*f+R,M[C]=(y*f*m+R*u)/b*255,M[C+1]=(y*f*$+R*h)/b*255,M[C+2]=(y*f*g+R*p)/b*255,M[C+3]=255*b;var C,T,M,R;t(null,{data:n,width:o.width,height:o.height});},Eo=function Eo(e,t){var o=e.imageData,i=e.level,_e$monochrome=e.monochrome,n=_e$monochrome===void 0?!1:_e$monochrome;if(!i)return t(null,o);var r=new Uint8ClampedArray(o.width*o.height*4),a=o.data,s=a.length;var l,c,d,u=0;var h=function h(){return 255*(2*Math.random()-1)*i;},p=n?function(){var e=h();return [e,e,e];}:function(){return [h(),h(),h()];};for(;u<s;u+=4){var _p2,_p3;(_p2=p(),_p3=_slicedToArray(_p2,3),l=_p3[0],c=_p3[1],d=_p3[2]),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});},Io=function Io(e,t){var o=e.imageData,i=e.level;if(!i)return t(null,o);var n=new Uint8ClampedArray(o.width*o.height*4),r=o.data,a=r.length;var 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});},Ao=/*#__PURE__*/function(){var _ref24=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee17(e){var t,o,i,n,r,a,s,l,c,_args12=arguments;return _regeneratorRuntime().wrap(function _callee17$(_context17){while(1)switch(_context17.prev=_context17.next){case 0:t=_args12.length>1&&_args12[1]!==undefined?_args12[1]:{};o=t.colorMatrix,i=t.convolutionMatrix,n=t.gamma,r=t.noise,a=t.vignette,s=[];if(!(i&&s.push([Ro,{matrix:i.clarity}]),n>0&&s.push([Io,{level:1/n}]),o&&!function(e){var t=e.length;var o;var i=t>=20?6:t>=16?5:3;for(var _n8=0;_n8<t;_n8++){if(o=e[_n8],1===o&&_n8%i!=0)return !1;if(0!==o&&1!==o)return !1;}return !0;}(o)&&s.push([Mo,{matrix:o}]),(r>0||r<0)&&s.push([Eo,{level:r}]),(a>0||a<0)&&s.push([Po,{strength:a}]),!s.length)){_context17.next=4;break;}return _context17.abrupt("return",e);case 4:l=function l(e,t){return "(err, imageData) => {\n (".concat(e[t][0].toString(),")(Object.assign({ imageData: imageData }, filterInstructions[").concat(t,"]), \n ").concat(e[t+1]?l(e,t+1):"done",")\n }");},c="function (options, done) {\n const filterInstructions = options.filterInstructions;\n const imageData = options.imageData;\n (".concat(l(s,0),")(null, imageData)\n }");_context17.next=7;return L(c,[{imageData:e,filterInstructions:s.map(function(e){return e[1];})}],[e.data.buffer]);case 7:e=_context17.sent;return _context17.abrupt("return",Co(e));case 9:case"end":return _context17.stop();}},_callee17);}));return function Ao(_x28){return _ref24.apply(this,arguments);};}(),Lo=function Lo(e){return "number"==typeof e;},zo=function zo(e){return T(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);},Fo=function Fo(e,t){return e.hasOwnProperty(t);},Do=function Do(e){return Array.isArray(e);};var Oo=64,Bo=102,Wo=112,Vo=!1;var _o=function _o(e,t){return !Vo&&c()&&(/^win/i.test(navigator.platform)&&(Bo=103),(fo()||$o())&&(Oo=63.5,Bo=110,Wo=123),Vo=!0),"<svg".concat(t?" aria-label=\"".concat(t,"\""):""," width=\"128\" height=\"128\" viewBox=\"0 0 128 128\" preserveAspectRatio=\"xMinYMin meet\" xmlns=\"http://www.w3.org/2000/svg\"><text x=\"").concat(Oo,"\" y=\"").concat(Bo,"\" alignment-baseline=\"text-top\" dominant-baseline=\"text-top\" text-anchor=\"middle\" font-size=\"").concat(Wo,"px\">").concat(e,"</text></svg>");},No=function No(e){return e instanceof Blob;},Ho=function Ho(e,t){return e/t*100+"%";},jo=function jo(e){return "rgba(".concat(Math.round(255*e[0]),", ").concat(Math.round(255*e[1]),", ").concat(Math.round(255*e[2]),", ").concat(Lo(e[3])?e[3]:1,")");},Uo=function Uo(e){return Object.values(e).join("_");};var Go=/*#__PURE__*/function(){var _ref25=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee18(e){var t,o,_args13=arguments;return _regeneratorRuntime().wrap(function _callee18$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:t=_args13.length>1&&_args13[1]!==undefined?_args13[1]:0;o=p("canvas",{width:80,height:80}).getContext("2d");_context18.next=4;return function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return new Promise(function(t){setTimeout(t,e);});}(t);case 4:o.drawImage(e,0,0,80,80);_context18.t0=!(function(e){return !new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data.buffer).some(function(e){return 0!==e;});}(o)&&t<=256);if(_context18.t0){_context18.next=10;break;}_context18.next=9;return Go(e,t+16);case 9:_context18.t0=_context18.sent;case 10:return _context18.abrupt("return",_context18.t0);case 11:case"end":return _context18.stop();}},_callee18);}));return function Go(_x29){return _ref25.apply(this,arguments);};}(),Zo=new Map();var Xo=function Xo(e){return new Promise(function(t,o){var i=new FileReader();i.onerror=function(){return o(i.error);},i.onload=function(){return t(i.result);},i.readAsDataURL(e);});},Yo=function Yo(){var e=[];return {sub:function sub(t,o){return e.push({event:t,callback:o}),function(){return e=e.filter(function(e){return e.event!==t||e.callback!==o;});};},pub:function pub(t,o){e.filter(function(e){return e.event===t;}).forEach(function(e){return e.callback(o);});}};};var qo=32,Ko=function Ko(_ref26){var _ref26$color=_ref26.color,e=_ref26$color===void 0?[0,0,0]:_ref26$color,_ref26$fontSize=_ref26.fontSize,t=_ref26$fontSize===void 0?16:_ref26$fontSize,_ref26$fontFamily=_ref26.fontFamily,o=_ref26$fontFamily===void 0?"sans-serif":_ref26$fontFamily,_ref26$fontVariant=_ref26.fontVariant,i=_ref26$fontVariant===void 0?"normal":_ref26$fontVariant,_ref26$fontWeight=_ref26.fontWeight,n=_ref26$fontWeight===void 0?"normal":_ref26$fontWeight,_ref26$fontStyle=_ref26.fontStyle,r=_ref26$fontStyle===void 0?"normal":_ref26$fontStyle,_ref26$textAlign=_ref26.textAlign,a=_ref26$textAlign===void 0?"left":_ref26$textAlign,_ref26$letterSpacing=_ref26.letterSpacing,s=_ref26$letterSpacing===void 0?"normal":_ref26$letterSpacing,_ref26$lineHeight=_ref26.lineHeight,l=_ref26$lineHeight===void 0?20:_ref26$lineHeight;var c=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return "font-size:".concat(t*c,"px;font-style:").concat(r,";font-weight:").concat(n,";font-family:").concat(o,";font-variant:").concat(i,";line-height:").concat(l*c,"px;text-align:").concat(a,";letter-spacing:").concat(Lo(s)?s+"px":"normal",";color:").concat(jo(e),";");},Jo=function Jo(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var i=t.width,n=t.height,r=t.disableNewline,a=!i,s=!1===r?function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";return e.split("\n").length;}(e):void 0,l=a?"normal":"break-word",c=a&&!s?"nowrap":"pre-line";return "max-width:none;min-width:auto;width:".concat(a?"auto":i*o+"px",";height:").concat(n?n*o+"px":"auto",";margin-top:0;margin-bottom:0;padding-top:").concat(function(){var _ref27=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref27$fontSize=_ref27.fontSize,e=_ref27$fontSize===void 0?16:_ref27$fontSize,_ref27$lineHeight=_ref27.lineHeight,t=_ref27$lineHeight===void 0?20:_ref27$lineHeight;return .5*Math.max(0,e-t);}(t)*o,"px;word-break:").concat(l,";word-wrap:normal;white-space:").concat(c,";");},Qo=new Map(),ei=function ei(e){var t=[];for(var _i8=0,_Array$from=Array.from(e.childNodes);_i8<_Array$from.length;_i8++){var o=_Array$from[_i8];o.nodeType===Node.TEXT_NODE?t.push(oi(o)):t.push.apply(t,_toConsumableArray(ei(o)));}return t;},ti="pointer-events:none;visibility:hidden;position:absolute;left:0;top:0;",oi=function oi(e){var t=e.nodeValue;if(!t)return [];var o=t.length,i=document.createRange();i.selectNodeContents(e);var n=[];for(var _r3=0;_r3<o;_r3++){i.setStart(e,0),i.setEnd(e,_r3+1);var _o13=i.getClientRects().length-1,a=t.charAt(_r3);n[_o13]?n[_o13]+=a:n.push(a);}var r=i.getClientRects();return n.map(function(e,t){return {rect:r[t],text:e};});},ii=new Map(),ni=function ni(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var t=arguments.length>1?arguments[1]:undefined;var _t$width=t.width,o=_t$width===void 0?0:_t$width,_t$height=t.height,i=_t$height===void 0?0:_t$height;if(o&&i)return Ve(o,i);var _t$fontSize=t.fontSize,n=_t$fontSize===void 0?16:_t$fontSize,r=t.fontFamily,_t$lineHeight=t.lineHeight,a=_t$lineHeight===void 0?20:_t$lineHeight,s=t.fontWeight,l=t.fontStyle,c=t.fontVariant,d=t.letterSpacing;var u=Uo({text:e,fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,letterSpacing:d,lineHeight:a,width:o});var h=ii.get(u);if(h)return h;var m=1;n>1e3&&F()&&(m=n/1e3,n=1e3,a/=m);var $=Zt(p("pre",{contenteditable:"true",spellcheck:"false",style:"".concat(ti).concat(Ko(_objectSpread2(_objectSpread2({},t),{},{fontSize:n,lineHeight:a})),";").concat(Jo(e,t),"\""),innerHTML:e})).getBoundingClientRect();return h=De($),h=Ge(h,function(e){return e*m;}),o&&(h.width=o),ii.set(u,h),h;},ri=new Map(),ai=function ai(e,t){return new Promise(function(o,i){var n=ri.get(e);void 0===n&&(n=function(e,t){var _Yo=Yo(),o=_Yo.sub,i=_Yo.pub;var n,r;return Promise.resolve(t&&t(e,{resourceType:"stylesheet"})).then(function(t){if(!1===t)return r="requestPrevented",i("error",r);var _ref28=t||{},o=_ref28.headers,a=_ref28.credentials;fetch(e,{headers:o,credentials:a}).then(function(e){return e.text();}).then(function(e){n=e,i("load",n);}).catch(function(e){r=e,i("error",r);});}),{sub:function sub(e,t){return "load"===e&&n?t(n):"error"===e&&r?t(r):void o(e,t);}};}(e,t),ri.set(e,n)),n.sub("load",o),n.sub("error",i);});},si=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee19(e,t,o){var i,n,r,a;return _regeneratorRuntime().wrap(function _callee19$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_context19.prev=0;_context19.next=3;return ai(e,t);case 3:i=_context19.sent;_context19.next=9;break;case 6:_context19.prev=6;_context19.t0=_context19["catch"](0);return _context19.abrupt("return",[]);case 9:n={innerHTML:i,id:I()};o&&(n.nonce=o);r=p("style",n);document.head.append(r);a=Array.from(document.styleSheets).find(function(e){return e.ownerNode.id===r.id;});return _context19.abrupt("return",(r.remove(),Array.from(a.cssRules)));case 15:case"end":return _context19.stop();}},_callee19,null,[[0,6]]);}));return function si(_x30,_x31,_x32){return _ref29.apply(this,arguments);};}(),li=new Map(),ci=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee20(e,t,o){var i,_iterator,_step,_e13,_n9,_e14,_r4,_r5;return _regeneratorRuntime().wrap(function _callee20$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:if(!li.has(e.href)){_context20.next=2;break;}return _context20.abrupt("return",li.get(e.href));case 2:_context20.prev=2;i=Array.from(e.cssRules);_iterator=_createForOfIteratorHelper(function(e){return e.filter(function(e){return e instanceof CSSImportRule;});}(i));_context20.prev=5;_iterator.s();case 7:if((_step=_iterator.n()).done){_context20.next=20;break;}_e13=_step.value;_n9=_e13.href;if(!li.has(_n9)){_context20.next=14;break;}_e14=li.get(_n9);i=[].concat(_toConsumableArray(i),_toConsumableArray(_e14));return _context20.abrupt("continue",18);case 14:_context20.next=16;return si(_n9,t,o);case 16:_r4=_context20.sent;li.set(_n9,_r4),i=[].concat(_toConsumableArray(i),_toConsumableArray(_r4));case 18:_context20.next=7;break;case 20:_context20.next=25;break;case 22:_context20.prev=22;_context20.t0=_context20["catch"](5);_iterator.e(_context20.t0);case 25:_context20.prev=25;_iterator.f();return _context20.finish(25);case 28:_context20.next=37;break;case 30:_context20.prev=30;_context20.t1=_context20["catch"](2);_r5=e.href;_context20.next=35;return si(_r5,t,o);case 35:i=_context20.sent;li.set(_r5,i);case 37:return _context20.abrupt("return",function(e){return e.filter(function(e){return e instanceof CSSFontFaceRule;});}(i));case 38:case"end":return _context20.stop();}},_callee20,null,[[2,30],[5,22,25,28]]);}));return function ci(_x33,_x34,_x35){return _ref30.apply(this,arguments);};}(),di=function di(e,t){return e.style.getPropertyValue(t);},ui=function ui(e,t){if(!e.style)return !1;return di(e,"font-family").replace(/^"|"$/g,"")==t;},hi=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee22(e,t,o){var i;return _regeneratorRuntime().wrap(function _callee22$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:_context22.t0=function(e,t){var o=[];var _iterator2=_createForOfIteratorHelper(e),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _i9=_step2.value;ui(_i9,t)&&o.push(_i9);}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}return o;};_context22.next=3;return function(){var _ref32=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee21(e,t){var o,i,n;return _regeneratorRuntime().wrap(function _callee21$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:o=Array.from(document.styleSheets).map(function(o){return ci(o,e,t);});_context21.next=3;return Promise.all(o);case 3:i=_context21.sent;n=[];return _context21.abrupt("return",(i.forEach(function(e){return n.push.apply(n,_toConsumableArray(e));}),n));case 6:case"end":return _context21.stop();}},_callee21);}));return function(_x39,_x40){return _ref32.apply(this,arguments);};}()(t,o);case 3:_context22.t1=_context22.sent;_context22.t2=e;i=(0, _context22.t0)(_context22.t1,_context22.t2);return _context22.abrupt("return",i.length?i.map(function(e){var t=e.parentStyleSheet.href&&new URL(e.parentStyleSheet.href),o=t?t.origin+function(e){return e.pathname.split("/").slice(0,-1).join("/");}(t)+"/":"",i=e.style.getPropertyValue("src").match(/url\("?(.*?)"?\)/)[1],n=Array.from(e.style).filter(function(e){return "src"!=e;}).reduce(function(t,o){return t+=o+":"+di(e,o)+";";},"");return [/^http/.test(i)?i:o+i,n];}):[]);case 7:case"end":return _context22.stop();}},_callee22);}));return function hi(_x36,_x37,_x38){return _ref31.apply(this,arguments);};}(),pi=new Map(),mi=new Map();var $i=/*#__PURE__*/function(){var _ref33=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee24(){var e,t,o,_t$imageWidth,i,_t$imageHeight,n,_t$paddingTop,r,_t$paddingRight,a,_t$paddingBottom,s,_t$paddingLeft,l,c,d,_t$pixelRatio,u,h,p,m,$,g,f,y,b,x,v,w,S,k,C,T,M,_e16,_args19=arguments;return _regeneratorRuntime().wrap(function _callee24$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:e=_args19.length>0&&_args19[0]!==undefined?_args19[0]:"";t=_args19.length>1?_args19[1]:undefined;if(e.length){_context24.next=4;break;}return _context24.abrupt("return");case 4:o=t.color,_t$imageWidth=t.imageWidth,i=_t$imageWidth===void 0?300:_t$imageWidth,_t$imageHeight=t.imageHeight,n=_t$imageHeight===void 0?150:_t$imageHeight,_t$paddingTop=t.paddingTop,r=_t$paddingTop===void 0?0:_t$paddingTop,_t$paddingRight=t.paddingRight,a=_t$paddingRight===void 0?qo:_t$paddingRight,_t$paddingBottom=t.paddingBottom,s=_t$paddingBottom===void 0?0:_t$paddingBottom,_t$paddingLeft=t.paddingLeft,l=_t$paddingLeft===void 0?qo:_t$paddingLeft,c=t.fontFamily,d=t.fontSize,_t$pixelRatio=t.pixelRatio,u=_t$pixelRatio===void 0?1:_t$pixelRatio,h=t.willRequest,p=t.outline,m=t.blur,$=t.styleNonce,g=1,f="";d>1e3&&F()&&(g=d/1e3,f="transform-origin:0 0;transform:scale(".concat(g,")"));y=u/g;b=(i+l+a)*u;x=(n+s+r)*u;_context24.next=11;return function(){var _ref34=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee23(e,t,o){var i,_r6,_a5,_iterator3,_step3,_step3$value2,_e15,_t13,_o14,_i10,_r7,n;return _regeneratorRuntime().wrap(function _callee23$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:if(!pi.get(e)){_context23.next=2;break;}return _context23.abrupt("return");case 2:i=mi.get(e);if(i){_context23.next=34;break;}_context23.next=6;return hi(e,t,o);case 6:_r6=_context23.sent;if(_r6.length){_context23.next=9;break;}return _context23.abrupt("return",void pi.set(e,!0));case 9:_a5=[];_iterator3=_createForOfIteratorHelper(_r6);_context23.prev=11;_iterator3.s();case 13:if((_step3=_iterator3.n()).done){_context23.next=25;break;}_step3$value2=_slicedToArray(_step3.value,2),_e15=_step3$value2[0],_t13=_step3$value2[1];_context23.next=17;return fetch(_e15).then(function(e){return e.blob();});case 17:_o14=_context23.sent;_i10=!(n=_o14.type)||/woff2/.test(n)?"woff2":/woff/.test(n)?"woff":/ttf|truetype/.test(n)?"truetype":/otf|opentype/.test(n)?"opentype":/svg/.test(n)?"svg":"woff2";_context23.next=21;return Xo(_o14);case 21:_r7=_context23.sent;_a5.push("@font-face { src:url(".concat(_r7,") format('").concat(_i10,"');").concat(_t13,";font-display:block; }"));case 23:_context23.next=13;break;case 25:_context23.next=30;break;case 27:_context23.prev=27;_context23.t0=_context23["catch"](11);_iterator3.e(_context23.t0);case 30:_context23.prev=30;_iterator3.f();return _context23.finish(30);case 33:i=_a5.join(""),mi.set(e,i);case 34:return _context23.abrupt("return",i);case 35:case"end":return _context23.stop();}},_callee23,null,[[11,27,30,33]]);}));return function(_x41,_x42,_x43){return _ref34.apply(this,arguments);};}()(c,h,$);case 11:v=_context24.sent;w="";v&&(w="<style".concat($?" nonce=\"".concat($,"\""):"",">").concat(v,"</style>"));S=e.replace(/%/g,"%25").replace(/#/g,"%23").replace(/&nbsp;/g," ").replace(/&(?!#\d{4};|[a-z]+;)/gi,"&amp;").replace(/<br>|\n/g,"<br/>"),k="top:".concat(r*y,"px;right:").concat(a*y,"px;bottom:").concat(s*y,"px;left:").concat(l*y,"px");C=o,T="",M="";if(p||m){_e16=jo(o);p&&(C=[0,0,0,0],T="-webkit-text-stroke: ".concat(2*p*y,"px ").concat(_e16)),m&&(Yt()?M="filter:blur(".concat(m*y*.4,"px)"):(C=[0,0,0,0],M="text-shadow: 0 0 ".concat(m*y,"px ").concat(_e16)));}return _context24.abrupt("return",function(e){var _ref35=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref35$safariCacheKey=_ref35.safariCacheKey,t=_ref35$safariCacheKey===void 0?"*":_ref35$safariCacheKey;return new Promise(function(o,i){var n=new Image();n.onerror=function(){return i(new Error("Failed to load SVG"));},n.onload=function(){if(!Yt()||!e.includes("@font-face")||Zo.has(t))return o(n);Go(n).then(function(){Zo.set(t,!0),o(n);});},n.src="data:image/svg+xml,"+e;});}("<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"".concat(b,"\" height=\"").concat(x,"\" viewBox=\"0 0 ").concat(b," ").concat(x,"\"><foreignObject x=\"0\" y=\"0\" width=\"").concat(b,"\" height=\"").concat(x,"\"><div xmlns=\"http://www.w3.org/1999/xhtml\">").concat(w,"<pre contenteditable=\"true\" spellcheck=\"false\" style=\"position:absolute;").concat(k,";").concat(Ko(_objectSpread2(_objectSpread2({},t),{},{color:C,fontSize:d}),y),";").concat(Jo(e,t,y),";").concat(f,";").concat(T,";").concat(M,"\">").concat(S,"</pre></div></foreignObject></svg>"),{safariCacheKey:c}));case 18:case"end":return _context24.stop();}},_callee24);}));return function $i(){return _ref33.apply(this,arguments);};}();var gi=function gi(e){var t=_objectSpread2({},e);return C(t);},fi=function fi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=mt(e);var i,n;var r=t.width||t.rx,a=t.height||t.ry;if(r&&a)return Fe(t);if(r||a){i=parseFloat(r||Number.MAX_SAFE_INTEGER),n=parseFloat(a||Number.MAX_SAFE_INTEGER);var _e17=Math.min(i,n);T(r)||T(a)?(i=_e17+"%",n=_e17*o+"%"):(i=_e17,n=_e17);}else {var _e18=10;i=_e18+"%",n=_e18*o+"%";}return _defineProperty(_defineProperty({},(t.width?"width":t.rx?"rx":void 0)||"width",i),(t.width?"height":t.rx?"ry":void 0)||"height",n);},yi=function yi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return _objectSpread2(_objectSpread2({width:void 0,height:void 0},t),{},{aspectRatio:1,backgroundImage:(o=_o(e),"data:image/svg+xml,"+o.replace("<","%3C").replace(">","%3E"))});var o;},bi=function bi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return _objectSpread2(_objectSpread2(_objectSpread2({backgroundColor:[0,0,0,0]},Mi(t)?{}:{width:void 0,height:void 0,aspectRatio:void 0}),t),{},{backgroundImage:T(e)?e:No(e)?URL.createObjectURL(e):e});},xi=function xi(e,t){var o;if(T(e)||No(e)){var i=_objectSpread2(_objectSpread2({},fi(t)),{},{backgroundSize:"contain"});o=zo(e)?yi(e,i):bi(e,i);}else if(e.src){var _i11=fi(t,e.shape||e),n=_objectSpread2(_objectSpread2({},e.shape),_i11);if(e.width&&e.height&&!Fo(n,"aspectRatio")){var _e19=yn(_i11,"width",t),_o15=yn(_i11,"height",t);n.aspectRatio=G(_e19,_o15);}n.backgroundSize||e.shape||e.width&&e.height||(n.backgroundSize="contain"),o=zo(e.src)?yi(e.src,n):bi(e.src,n);}else e.shape&&(o=gi(e.shape));return Fo(o,"backgroundImage")&&(Fo(o,"backgroundColor")||(o.backgroundColor=[0,0,0,0]),Fo(o,"disableStyle")||(o.disableStyle=["cornerRadius","backgroundColor","strokeColor","strokeWidth"])),t?gn(o,t):o;},vi=function vi(e){return he(e.x1,e.y1);},wi=function wi(e){return he(e.x2,e.y2);},Si=function Si(e){return Fo(e,"text");},ki=function ki(e){return Si(e)&&!(Oi(e)||Fo(e,"width"));},Ci=function Ci(e){return Si(e)&&(Oi(e)||Fo(e,"width"));},Ti=function Ti(e){return !Si(e)&&Bi(e);},Mi=function Mi(e){return Fo(e,"rx");},Ri=function Ri(e){return Fo(e,"x1");},Pi=function Pi(e){return Fo(e,"points");},Ei=function Ei(e){return Si(e)&&e.isEditing;},Ii=function Ii(e){return !Fo(e,"opacity")||e.opacity>0;},Ai=function Ai(e){return e.isSelected;},Li=function Li(e){return e.isEditing;},zi=function zi(e){return e._isDraft;},Fi=function Fi(e){return Fo(e,"width")&&Fo(e,"height");},Di=function Di(e){var t=Fo(e,"right"),o=Fo(e,"bottom");return t||o;},Oi=function Oi(e){return (Fo(e,"x")||Fo(e,"left"))&&Fo(e,"right")||(Fo(e,"y")||Fo(e,"top"))&&Fo(e,"bottom");},Bi=function Bi(e){return Fi(e)||Oi(e);},Wi=function Wi(e){return e._isDraft=!0,e;},Vi=function Vi(e){return e._isDraft=!1,e;},_i=function _i(e,t){return !0!==e.disableStyle&&(!Do(e.disableStyle)||!t||!e.disableStyle.includes(t));},Ni=function Ni(e){return !0!==e.disableSelect;},Hi=function Hi(e){return !0!==e.disableRemove;},ji=function ji(e){return !0!==e.disableDuplicate&&Ki(e);},Ui=function Ui(e){return !e.disableFlip&&!zi(e)&&!Di(e)&&function(e){return Fo(e,"backgroundImage")||Fo(e,"text");}(e);},Gi=function Gi(e,t){return !!Si(e)&&!0!==e.disableInput&&(M(e.disableInput)?e.disableInput(null!=t?t:e.text):t||!0);},Zi=function Zi(e,t){return !0!==e.disableTextLayout&&(!Do(e.disableTextLayout)||!t||!e.disableTextLayout.includes(t));},Xi=function Xi(e){return Yi(e)&&e.points.length>3;},Yi=function Yi(e){return !!Pi(e)&&void 0!==e.disableAddPoints&&!0!==e.disableAddPoints;},qi=function qi(e){return !0!==e.disableManipulate&&!zi(e)&&!Di(e);},Ki=function Ki(e){return qi(e)&&!0!==e.disableMove;},Ji=function Ji(e){return delete e.left,delete e.right,delete e.top,delete e.bottom,e;},Qi=function Qi(e){return delete e.rotation,e;},en=function en(e){return e.strokeWidth=e.strokeWidth||1,e.strokeColor=e.strokeColor||[0,0,0],e;},tn=function tn(e){return e.backgroundColor=e.backgroundColor?e.backgroundColor:e.strokeWidth||e.backgroundImage?void 0:[0,0,0],e;},on=function on(e){var t=e.text;t=t.replace(/&(#[0-9]+|[a-z]+);/gi,function(e,t){return "___".concat(t,"___");}),t=t.replace(/&/,"&amp;"),e.text=t.replace(/___(#[0-9]+|[a-z]+)___/gi,function(e,t){return "&".concat(t,";");});},nn=function nn(e){if(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],e.format="html"===e.format?"html":"text",e.textShadow){var _e$textShadow2=_slicedToArray(e.textShadow,4),t=_e$textShadow2[0],o=_e$textShadow2[1],i=_e$textShadow2[2],n=_e$textShadow2[3];e.textShadowX=t,e.textShadowY=o,e.textShadowBlur=i,e.textShadowColor=n,delete e.textShadow;}if(e.textOutline){var _e$textOutline2=_slicedToArray(e.textOutline,2),_t14=_e$textOutline2[0],_o16=_e$textOutline2[1];e.textOutlineWidth=_t14,e.textOutlineColor=_o16,delete e.textOutline;}return "html"===e.format?on(e):function(e){on(e);var t=e.text;t=t.replace(/</g,"&gt;"),t=t.replace(/>/g,"&lt;"),e.text=t;}(e),ki(e)?rn(e):an(e);},rn=function rn(e){return !1!==e.disableNewline&&(delete e.textAlign,e.text=e.text.replace(/\n/g," ")),Ji(e);},an=function an(e){return e.textAlign=e.textAlign||"left",e;},sn=function sn(e){return function(e){T(e.id)||(e.id=I()),Fo(e,"rotation")||(e.rotation=0),Fo(e,"opacity")||(e.opacity=1),Fo(e,"disableErase")||(e.disableErase=!0);}(e),Si(e)?nn(e):Ti(e)?function(e){e.cornerRadius=e.cornerRadius||0,e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],tn(e);}(e):Pi(e)?function(e){en(e),Qi(e),Fo(e,"pathClose")||(e.disableResize=!0,Fo(e,"disableMove")||(e.disableMove=!0)),Ji(e);}(e):Ri(e)?function(e){en(e),e.lineStart=e.lineStart||void 0,e.lineEnd=e.lineEnd||void 0,Qi(e),Ji(e);}(e):Mi(e)&&function(e){e.strokeWidth=e.strokeWidth||0,e.strokeColor=e.strokeColor||[0,0,0],tn(e);}(e),e;},ln=function ln(e){return Si(e)?"text":Ti(e)?"rectangle":Pi(e)?"path":Ri(e)?"line":Mi(e)?"ellipse":void 0;},cn=function cn(e,t){return parseFloat(e)/100*t;},dn=new RegExp(/^x|left|right|^width|rx|fontSize|eraseRadius|feather|cornerRadius|strokeWidth|strokeDash/,"i"),un=new RegExp(/^y|top|bottom|^height|ry/,"i"),hn=function hn(e,t,_ref37){var o=_ref37.width,i=_ref37.height;if(Array.isArray(t))return t.map(function(t){return S(t)&&$n(t,{width:o,height:i}),T(t)&&(t=hn(e,t,{width:o,height:i})),t;});if("string"!=typeof t)return t;if(!t.endsWith("%"))return t;var n=parseFloat(t)/100;return dn.test(e)?le(o*n,6):un.test(e)?le(i*n,6):t;},pn=hn,mn=["lineHeight","textOutlineWidth","textShadowX","textShadowY","textShadowBlur"],$n=function $n(e,t){Object.entries(e).map(function(_ref38){var _ref39=_slicedToArray(_ref38,2),o=_ref39[0],i=_ref39[1];e[o]=hn(o,i,t);}),e.text&&mn.filter(function(t){return T(e[t]);}).forEach(function(t){var o,i;e[t]=(o=e[t],i=e.fontSize,Math.round(i*(parseFloat(o)/100)));});},gn=function gn(e,t){return $n(e,t),Sn(e,t),e;},fn=function fn(e,t){var o;return /^x|width|rx|fontSize|strokeWidth|cornerRadius/.test(e)?o=t.width:/^y|height|ry/.test(e)&&(o=t.height),o;},yn=function yn(e,t,o){return Array.isArray(e[t])?e[t].map(function(e){return Object.entries(e).reduce(function(e,_ref40){var _ref41=_slicedToArray(_ref40,2),t=_ref41[0],i=_ref41[1];return e[t]=T(i)?cn(i,fn(t,o)):i,e;},{});}):T(e[t])?cn(e[t],fn(t,o)):e[t];},bn=function bn(e,t,o){return t.reduce(function(t,i){var n=yn(e,i,o);return t[i]=n,t;},{});},xn=function xn(e,t,o){return Object.keys(t).forEach(function(i){return function(e,t,o,i){if(!T(e[t]))return e[t]=o,e;var n=fn(t,i);return e[t]=void 0===n?o:Ho(o,n),e;}(e,i,t[i],o);}),e;},vn=function vn(e,t){var o=e.filter(function(e){return e.x<0||e.y<0||e.x1<0||e.y1<0;}).reduce(function(e,t){var _ref42=function(e){var t=Qe(),o=e.strokeWidth||0;if(Ti(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(Ri(e)){var _i12=e.x1,_n10=e.y1,_r8=e.x2,a=e.y2,_s3=Math.abs(Math.min(_i12,_r8)),_l3=Math.abs(Math.max(_i12,_r8)),_c2=Math.abs(Math.min(_n10,a)),_d3=Math.abs(Math.min(_n10,a));t.x=_s3+.5*o,t.y=_l3+.5*o,t.width=_l3-_s3+o,t.height=_d3-_c2+o;}else Mi(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&&Fo(e,"rotation")&&ft(t,e.rotation),wt(t);}(t),_ref43=_slicedToArray(_ref42,4),o=_ref43[0],i=_ref43[1],n=_ref43[2],r=_ref43[3];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;},wn=function wn(e,t,o){var i=gi(e);gn(i,t);var n=o(i);return Array.isArray(n)?n:[n];},Sn=function Sn(e,t){if(Fo(e,"left")&&(e.x=e.left),Fo(e,"right")&&!T(e.right)){var o=t.width-e.right;Fo(e,"left")?(e.x=e.left,e.width=Math.max(0,o-e.left)):Fo(e,"width")&&(e.x=o-e.width);}if(Fo(e,"top")&&(e.y=e.top),Fo(e,"bottom")&&!T(e.bottom)){var _o17=t.height-e.bottom;Fo(e,"top")?(e.y=e.top,e.height=Math.max(0,_o17-e.top)):Fo(e,"height")&&(e.y=_o17-e.height);}return e;},kn=function kn(e,t){return Pi(e)&&e.points.filter(function(e){return Lo(e.x);}).forEach(function(e){e.x*=t,e.y*=t;}),Ri(e)&&Lo(e.x1)&&(e.x1*=t,e.y1*=t,e.x2*=t,e.y2*=t),Lo(e.x)&&Lo(e.y)&&(e.x*=t,e.y*=t),Lo(e.width)&&Lo(e.height)&&(e.width*=t,e.height*=t),Lo(e.rx)&&Lo(e.ry)&&(e.rx*=t,e.ry*=t),function(e){return Lo(e.strokeWidth)&&e.strokeWidth>0;}(e)&&(e.strokeWidth*=t),Si(e)&&(e._scale=t,Lo(e.fontSize)&&(e.fontSize*=t),Lo(e.lineHeight)&&(e.lineHeight*=t),Lo(e.width)&&!Lo(e.height)&&(e.width*=t)),Fo(e,"cornerRadius")&&Lo(e.cornerRadius)&&(e.cornerRadius*=t),e;},Tn=function Tn(e){if(Ti(e))return he(e.x+.5*e.width,e.y+.5*e.height);if(Mi(e))return he(e.x,e.y);if(e.text){if(Ci(e)){var _t15=e.height||ni(e.text,e).height;return he(e.x+.5*e.width,e.y+.5*_t15);}var t=ni(e.text,e);return he(e.x+.5*t.width,e.y+.5*t.height);}return Pi(e)?Ie(e.points):Ri(e)?Ie([vi(e),wi(e)]):void 0;};var Rn=function Rn(e){return /canvas/i.test(e.nodeName);},Pn=function Pn(e,t){return new Promise(function(o,i){var n=e,r=!1;var a=function a(){r||(r=!0,M(t)&&Promise.resolve().then(function(){return t(Ve(n.naturalWidth,n.naturalHeight));}));};if(n.src||(n=new Image(),T(e)&&new URL(e,location.href).origin!==location.origin&&(n.crossOrigin="anonymous"),n.src=T(e)?e:URL.createObjectURL(e)),n.complete)return a(),o(n);M(t)&&qt(n).then(a).catch(i),n.onload=function(){a(),o(n);},n.onerror=function(){return i(new Error("Failed to load image"));};});};var En=new Map([]),In=function In(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(o,i){var _t$onMetadata=t.onMetadata,r=_t$onMetadata===void 0?n:_t$onMetadata,_t$onLoad=t.onLoad,a=_t$onLoad===void 0?o:_t$onLoad,_t$onError=t.onError,s=_t$onError===void 0?i:_t$onError,_t$onComplete=t.onComplete,l=_t$onComplete===void 0?n:_t$onComplete;var c=En.get(e);if(c||(c={loading:!1,complete:!1,error:!1,image:void 0,size:void 0,bus:Yo()},En.set(e,c)),c.bus.sub("meta",r),c.bus.sub("load",a),c.bus.sub("error",s),c.bus.sub("complete",l),Rn(e)){var _t16=e,_o18=_t16.cloneNode();c.complete=!0,c.image=_o18,c.size=We(_t16);}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=Yo());c.loading||(c.loading=!0,Pn(e,function(e){c.size=e,c.bus.pub("meta",{size:e});}).then(function(e){c.image=e,c.bus.pub("load",e);}).catch(function(e){c.error=e,c.bus.pub("error",e);}).finally(function(){c.complete=!0,c.loading=!1,c.bus.pub("complete"),c.bus=Yo();}));});},An=function An(e,t,o,i){return e.drawImage(t,o.x,o.x,o.width,o.height,i.x,i.y,i.width,i.height);};var Ln=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(e,t,o,i){var n,r,_args20=arguments;return _regeneratorRuntime().wrap(function _callee25$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:n=_args20.length>4&&_args20[4]!==undefined?_args20[4]:An;r=_args20.length>5?_args20[5]:undefined;e.save();e.clip();_context25.next=6;return n(e,t,o,i,r);case 6:e.restore();case 7:case"end":return _context25.stop();}},_callee25);}));return function Ln(_x44,_x45,_x46,_x47){return _ref44.apply(this,arguments);};}();var zn=function zn(e,t,o,i,n){var r=Je(e);if(i){var _e20=kt(it(i),le);return _e20.x*=o.width,_e20.width*=o.width,_e20.y*=o.height,_e20.height*=o.height,{srcRect:_e20,destRect:r};}var a=at(0,0,o.width,o.height);if("contain"===t){var _t17=vt(e,mt(a));r.width=_t17.width,r.height=_t17.height,n?(r.x+=n.x,r.y+=n.y):(r.x+=_t17.x,r.y+=_t17.y);}else if("cover"===t){var _e21=xt(r,a.width/a.height);r.width=_e21.width,r.height=_e21.height,n?(r.x+=n.x,r.y+=n.y):(r.x+=_e21.x,r.y+=_e21.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};},Fn=function Fn(e,t){return t.cornerRadius>0?function(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;},Dn=function Dn(e,t){return t.backgroundColor&&e.fill(),e;},On=function On(e,t){return t.strokeWidth&&e.stroke(),e;};var Bn=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(e,t){var o,i,_o19,_n11,_zn2,_r9,a,_s4,_l4,_c3,_zn4,_n12,_r10,_args21=arguments;return _regeneratorRuntime().wrap(function _callee26$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:o=_args21.length>2&&_args21[2]!==undefined?_args21[2]:{};i=o.drawImage;if(!(e.lineWidth=t.strokeWidth?t.strokeWidth:1,e.strokeStyle=t.strokeColor?jo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?jo(t.backgroundColor):"none",e.globalAlpha=t.opacity,t.backgroundImage)){_context26.next=27;break;}if(!Rn(t.backgroundImage)){_context26.next=7;break;}_context26.t0=t.backgroundImage;_context26.next=10;break;case 7:_context26.next=9;return In(t.backgroundImage);case 9:_context26.t0=_context26.sent;case 10:_o19=_context26.t0;Fn(e,t);Dn(e,t);if(!("repeat"===t.backgroundRepeat)){_context26.next=23;break;}_n11=t.backgroundPosition||{x:0,y:0},_zn2=zn(t,t.backgroundSize||We(_o19),We(_o19),t.backgroundCorners,{x:0,y:0}),_r9=_zn2.srcRect,a=_zn2.destRect,_s4=document.createElement("canvas");_s4.width=a.width,_s4.height=a.height;_l4=_s4.getContext("2d",{willReadFrequently:!1,desynchronized:!0});_context26.next=19;return i(_l4,_o19,_r9,_objectSpread2(_objectSpread2({},a),{},{x:0,y:0}));case 19:_c3=e.createPattern(_s4,"repeat");e.fillStyle=_c3,e.save(),e.beginPath(),e.rect(t.x+_n11.x,t.y+_n11.y,t.width-_n11.x,t.height-_n11.y),e.clip(),e.translate(a.x+_n11.x,a.y+_n11.y),e.fill(),$(_s4),e.restore();_context26.next=26;break;case 23:_zn4=zn(t,t.backgroundSize,We(_o19),t.backgroundCorners,t.backgroundPosition),_n12=_zn4.srcRect,_r10=_zn4.destRect;_context26.next=26;return Ln(e,_o19,_n12,_r10,i,{feather:t.feather});case 26:return _context26.abrupt("return",(e.beginPath(),Fn(e,t),On(e,t),[]));case 27:return _context26.abrupt("return",(Fn(e,t),Dn(e,t),On(e,t),[]));case 28:case"end":return _context26.stop();}},_callee26);}));return function Bn(_x48,_x49){return _ref45.apply(this,arguments);};}(),Wn=/*#__PURE__*/function(){var _ref46=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(e,t){var o,_args23=arguments;return _regeneratorRuntime().wrap(function _callee28$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:o=_args23.length>2&&_args23[2]!==undefined?_args23[2]:{};return _context28.abrupt("return",new Promise(/*#__PURE__*/function(){var _ref47=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(i,n){var r,_o20,a,_zn6,_s5,_l5;return _regeneratorRuntime().wrap(function _callee27$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:r=o.drawImage;if(!(e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?jo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?jo(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)){_context27.next=18;break;}_context27.prev=2;_context27.next=5;return In(t.backgroundImage);case 5:_o20=_context27.sent;_context27.next=11;break;case 8:_context27.prev=8;_context27.t0=_context27["catch"](2);n(_context27.t0);case 11:a=at(t.x-t.rx,t.y-t.ry,2*t.rx,2*t.ry),_zn6=zn(a,t.backgroundSize,We(_o20),t.backgroundCorners,t.backgroundPosition),_s5=_zn6.srcRect,_l5=_zn6.destRect;_context27.next=14;return Ln(e,_o20,_s5,_l5,r);case 14:t.strokeWidth&&e.stroke();i([]);_context27.next=19;break;case 18:t.strokeWidth&&e.stroke(),i([]);case 19:case"end":return _context27.stop();}},_callee27,null,[[2,8]]);}));return function(_x52,_x53){return _ref47.apply(this,arguments);};}()));case 2:case"end":return _context28.stop();}},_callee28);}));return function Wn(_x50,_x51){return _ref46.apply(this,arguments);};}(),Vn=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(e,t,o){var i,n,_t$textOutlineWidth,r,_t$textShadowX,a,_t$textShadowY,s,_t$textShadowBlur,l,c,h,p,_i13,_i14;return _regeneratorRuntime().wrap(function _callee29$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:i=t.width&&t.height?De(t):ni(t.text,t),n={x:t.x,y:t.y,width:i.width,height:i.height};if(!(Bn(e,_objectSpread2(_objectSpread2(_objectSpread2({},t),n),{},{options:o})),!t.text.length)){_context29.next=3;break;}return _context29.abrupt("return",[]);case 3:_t$textOutlineWidth=t.textOutlineWidth,r=_t$textOutlineWidth===void 0?0:_t$textOutlineWidth,_t$textShadowX=t.textShadowX,a=_t$textShadowX===void 0?0:_t$textShadowX,_t$textShadowY=t.textShadowY,s=_t$textShadowY===void 0?0:_t$textShadowY,_t$textShadowBlur=t.textShadowBlur,l=_t$textShadowBlur===void 0?0:_t$textShadowBlur,c=t.textShadowColor,t.outline,t.blur,h=_objectWithoutProperties(t,_excluded),p=!!t.height;if(!(p&&(e.rect(n.x-r+Math.min(a,0),n.y-r+Math.min(s,0),n.width+r+r+Math.abs(a)+l,n.height+r+Math.abs(s)+l),e.save(),e.clip()),a||s||l)){_context29.next=11;break;}e.save(),e.translate(a,s);_i13=_objectSpread2({},n);p||(_i13.height+=qo+l);_context29.next=10;return _n(e,_i13,t,_objectSpread2(_objectSpread2({},o),{},{paddingLeft:qo+l,paddingRight:qo+l,paddingTop:l,paddingBottom:l+p?-1*s:t.fontSize,shapeExtendedProps:{color:c,blur:l}}));case 10:e.restore();case 11:if(!r){_context29.next=16;break;}_i14=_objectSpread2({},n);p||(_i14.height+=qo+r);_context29.next=16;return _n(e,_i14,t,_objectSpread2(_objectSpread2({},o),{},{paddingLeft:qo+r,paddingRight:qo+r,paddingTop:r,paddingBottom:r+p?0:t.fontSize,shapeExtendedProps:{color:t.textOutlineColor,outline:r}}));case 16:p&&e.restore();_context29.next=19;return _n(e,n,h,_objectSpread2(_objectSpread2({},o),{},{paddingLeft:qo,paddingRight:qo,paddingTop:0,paddingBottom:p?0:t.fontSize}));case 19:return _context29.abrupt("return",[]);case 20:case"end":return _context29.stop();}},_callee29);}));return function Vn(_x54,_x55,_x56){return _ref48.apply(this,arguments);};}();var _n=/*#__PURE__*/function(){var _ref49=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(e,t,o,i){var n,r,a,s,l,c,d,u;return _regeneratorRuntime().wrap(function _callee30$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:n=i.willRequest;r=i.shapeExtendedProps;a=i.paddingLeft;s=i.paddingRight;l=i.paddingTop;c=i.paddingBottom;d=i.styleNonce;_context30.next=9;return $i(o.text,_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},o),r),t),{},{paddingLeft:a,paddingRight:s,paddingTop:l,paddingBottom:c,imageWidth:t.width,imageHeight:t.height,willRequest:n,styleNonce:d}));case 9:u=_context30.sent;e.drawImage(u,o.x-a,o.y-l,u.width,u.height);case 11:case"end":return _context30.stop();}},_callee30);}));return function _n(_x57,_x58,_x59,_x60){return _ref49.apply(this,arguments);};}();var Nn=/*#__PURE__*/function(){var _ref50=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(e,t){return _regeneratorRuntime().wrap(function _callee32$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:return _context32.abrupt("return",new Promise(/*#__PURE__*/function(){var _ref51=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(o){var i,n;return _regeneratorRuntime().wrap(function _callee31$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?jo(t.strokeColor):"none",e.globalAlpha=t.opacity;i=vi(t),n=wi(t);e.moveTo(i.x,i.y),e.lineTo(n.x,n.y),t.strokeWidth&&e.stroke(),o([]);case 3:case"end":return _context31.stop();}},_callee31);}));return function(_x63){return _ref51.apply(this,arguments);};}()));case 1:case"end":return _context32.stop();}},_callee32);}));return function Nn(_x61,_x62){return _ref50.apply(this,arguments);};}(),Hn=/*#__PURE__*/function(){var _ref52=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(e,t){return _regeneratorRuntime().wrap(function _callee33$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:return _context33.abrupt("return",new Promise(function(o,i){if(t.bitmap&&1===t.points.length)return void Wn(e,{x:t.points[0].x,y:t.points[0].y,rx:.5*t.strokeWidth,ry:.5*t.strokeWidth,backgroundColor:t.strokeColor}).then(function(){return o([]);});e.lineWidth=t.strokeWidth||1,e.strokeStyle=t.strokeColor?jo(t.strokeColor):"none",e.fillStyle=t.backgroundColor?jo(t.backgroundColor):"none",e.globalAlpha=t.opacity;var n=t.points;e.lineCap=t.strokeCap,e.lineJoin=t.strokeJoin,e.setLineDash(t.strokeDash||[]),t.pathClose&&e.beginPath(),e.moveTo(n[0].x,n[0].y);var r=n.length;for(var _t19=1;_t19<r;_t19++)e.lineTo(n[_t19].x,n[_t19].y);t.pathClose&&e.closePath(),t.strokeWidth&&e.stroke(),t.backgroundColor&&e.fill(),o([]);}));case 1:case"end":return _context33.stop();}},_callee33);}));return function Hn(_x64,_x65){return _ref52.apply(this,arguments);};}(),jn=function jn(e,t,o,i){return t||o?(e.translate(i.x,i.y),e.scale(t?-1:1,o?-1:1),e.translate(-i.x,-i.y),e):e;};var Un=/*#__PURE__*/function(){var _ref53=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(e,t,o){var i,n,_i15;return _regeneratorRuntime().wrap(function _callee34$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:e.globalCompositeOperation="subtract"===t.drawMode?"destination-out":"source-over";i=Tn(t);if(!(vo(e,t.rotation,i),jn(e,t.flipX,t.flipY,i),Ti(t)?n=Bn:Mi(t)?n=Wn:Ri(t)?n=Nn:Pi(t)?n=Hn:Si(t)&&(n=Vn),n)){_context34.next=15;break;}_context34.next=5;return n(e,t,o);case 5:_i15=_context34.sent;if(_i15.length){_context34.next=8;break;}return _context34.abrupt("return",[]);case 8:_context34.t0=[t];_context34.t1=_toConsumableArray;_context34.next=12;return Gn(e,_i15,o);case 12:_context34.t2=_context34.sent;_context34.t3=(0, _context34.t1)(_context34.t2);return _context34.abrupt("return",_context34.t0.concat.call(_context34.t0,_context34.t3));case 15:return _context34.abrupt("return",[]);case 16:case"end":return _context34.stop();}},_callee34);}));return function Un(_x66,_x67,_x68){return _ref53.apply(this,arguments);};}();var Gn=/*#__PURE__*/function(){var _ref54=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(e,t,o){var i,_iterator4,_step4,_n13;return _regeneratorRuntime().wrap(function _callee35$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:i=[];_iterator4=_createForOfIteratorHelper(t);_context35.prev=2;_iterator4.s();case 4:if((_step4=_iterator4.n()).done){_context35.next=19;break;}_n13=_step4.value;e.save();e.beginPath();_context35.t0=[];_context35.t1=_toConsumableArray(i);_context35.t2=_toConsumableArray;_context35.next=13;return Un(e,_n13,o);case 13:_context35.t3=_context35.sent;_context35.t4=(0, _context35.t2)(_context35.t3);i=_context35.t0.concat.call(_context35.t0,_context35.t1,_context35.t4);e.restore();case 17:_context35.next=4;break;case 19:_context35.next=24;break;case 21:_context35.prev=21;_context35.t5=_context35["catch"](2);_iterator4.e(_context35.t5);case 24:_context35.prev=24;_iterator4.f();return _context35.finish(24);case 27:return _context35.abrupt("return",i);case 28:case"end":return _context35.stop();}},_callee35,null,[[2,21,24,27]]);}));return function Gn(_x69,_x70,_x71){return _ref54.apply(this,arguments);};}(),Zn=/*#__PURE__*/function(){var _ref55=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(e){var t,_t$shapes,o,_t$contextBounds,i,_t$transform,r,a,s,l,c,_t$computeShape,d,_t$preprocessShape,u,h,m,g,f,_args31=arguments;return _regeneratorRuntime().wrap(function _callee36$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:t=_args31.length>1&&_args31[1]!==undefined?_args31[1]:{};_t$shapes=t.shapes,o=_t$shapes===void 0?[]:_t$shapes,_t$contextBounds=t.contextBounds,i=_t$contextBounds===void 0?e:_t$contextBounds,_t$transform=t.transform,r=_t$transform===void 0?n:_t$transform,a=t.drawImage,s=t.willRequest,l=t.styleNonce,c=t.canvasMemoryLimit,_t$computeShape=t.computeShape,d=_t$computeShape===void 0?Z:_t$computeShape,_t$preprocessShape=t.preprocessShape,u=_t$preprocessShape===void 0?Z:_t$preprocessShape;if(o.length){_context36.next=4;break;}return _context36.abrupt("return",e);case 4:h=p("canvas");h.width=i.width,h.height=i.height;m=h.getContext("2d",{willReadFrequently:!0});m.putImageData(e,i.x||0,i.y||0);g=o.map(gi).map(d).map(u).flat();r(m);_context36.next=12;return Gn(m,g,{drawImage:a,canvasMemoryLimit:c,willRequest:s,styleNonce:l});case 12:f=m.getImageData(0,0,h.width,h.height);return _context36.abrupt("return",($(h),f));case 14:case"end":return _context36.stop();}},_callee36);}));return function Zn(_x72){return _ref55.apply(this,arguments);};}(),Xn=/*#__PURE__*/function(){var _ref56=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e){var t,o,i,n,r,a,_t20,_zn8,_o21,_n14,s,_args32=arguments;return _regeneratorRuntime().wrap(function _callee37$(_context37){while(1)switch(_context37.prev=_context37.next){case 0:t=_args32.length>1&&_args32[1]!==undefined?_args32[1]:{};o=t.backgroundColor,i=t.backgroundImage,n=!(!o||o&&0===o[3]);if(!(!i&&!n)){_context37.next=4;break;}return _context37.abrupt("return",e);case 4:r=p("canvas");r.width=e.width,r.height=e.height;a=r.getContext("2d",{willReadFrequently:!0});if(!(a.putImageData(e,0,0),a.globalCompositeOperation="destination-over",n&&(a.fillStyle=jo(o),a.fillRect(0,0,r.width,r.height)),i)){_context37.next=18;break;}if(!Rn(i)){_context37.next=12;break;}_context37.t0=i;_context37.next=15;break;case 12:_context37.next=14;return In(i);case 14:_context37.t0=_context37.sent;case 15:_t20=_context37.t0;_zn8=zn({x:0,y:0,width:e.width,height:e.height},"cover",{width:_t20.width,height:_t20.height}),_o21=_zn8.srcRect,_n14=_zn8.destRect;a.drawImage(_t20,_o21.x,_o21.y,_o21.width,_o21.height,_n14.x,_n14.y,_n14.width,_n14.height);case 18:s=a.getImageData(0,0,r.width,r.height);return _context37.abrupt("return",($(r),s));case 20:case"end":return _context37.stop();}},_callee37);}));return function Xn(_x73){return _ref56.apply(this,arguments);};}(),Yn=function Yn(e){return e.length?e.reduce(function(e,t){return function(e,t){var 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;}(_toConsumableArray(e),t);},e.shift()):[];},qn=function qn(e,t){var o=e.width*e.height,i=t.reduce(function(e,t){return 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 function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;return Math.round(e*t)/t;}(Math.max(.5,.5+(1-n/o)/2),5);};function Kn(){}var Jn=function Jn(e){return e;};function Qn(e,t){for(var o in t)e[o]=t[o];return e;}function er(e){return e();}function tr(){return Object.create(null);}function or(e){e.forEach(er);}function ir(e){return "function"==typeof e;}function nr(e,t){return e!=e?t==t:e!==t||e&&"object"==_typeof(e)||"function"==typeof e;}function rr(e){if(null==e)return Kn;for(var _len=arguments.length,t=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){t[_key-1]=arguments[_key];}var o=e.subscribe.apply(e,t);return o.unsubscribe?function(){return o.unsubscribe();}:o;}function ar(e){var t;return rr(e,function(e){return t=e;})(),t;}function sr(e,t,o){e.$$.on_destroy.push(rr(t,o));}function lr(e,t,o,i){if(e){var _n15=cr(e,t,o,i);return e[0](_n15);}}function cr(e,t,o,i){return e[1]&&i?Qn(o.ctx.slice(),e[1](i(t))):o.ctx;}function dr(e,t,o,i){if(e[2]&&i){var _n16=e[2](i(o));if(void 0===t.dirty)return _n16;if("object"==_typeof(_n16)){var _e22=[],_o22=Math.max(t.dirty.length,_n16.length);for(var _i17=0;_i17<_o22;_i17+=1)_e22[_i17]=t.dirty[_i17]|_n16[_i17];return _e22;}return t.dirty|_n16;}return t.dirty;}function ur(e,t,o,i,n,r){if(n){var a=cr(t,o,i,r);e.p(a,n);}}function hr(e){if(e.ctx.length>32){var t=[],o=e.ctx.length/32;for(var _e24=0;_e24<o;_e24++)t[_e24]=-1;return t;}return -1;}function pr(e){var t={};for(var o in e)"$"!==o[0]&&(t[o]=e[o]);return t;}function mr(e,t){var o={};t=new Set(t);for(var i in e)t.has(i)||"$"===i[0]||(o[i]=e[i]);return o;}function $r(e,t,o){return e.set(o),t;}function gr(e){return e&&ir(e.destroy)?e.destroy:Kn;}var fr="undefined"!=typeof window;var yr=fr?function(){return window.performance.now();}:function(){return Date.now();},br=fr?function(e){return requestAnimationFrame(e);}:Kn;var xr=new Set();function vr(e){xr.forEach(function(t){t.c(e)||(xr.delete(t),t.f());}),0!==xr.size&&br(vr);}function wr(e){var t;return 0===xr.size&&br(vr),{promise:new Promise(function(o){xr.add(t={c:e,f:o});}),abort:function abort(){xr.delete(t);}};}function Sr(e,t){e.appendChild(t);}function kr(e){if(!e)return document;var t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument;}function Cr(e){var t=Rr("style");return function(e,t){Sr(e.head||e,t),t.sheet;}(kr(e),t),t.sheet;}function Tr(e,t,o){e.insertBefore(t,o||null);}function Mr(e){e.parentNode.removeChild(e);}function Rr(e){return document.createElement(e);}function Pr(e){return document.createElementNS("http://www.w3.org/2000/svg",e);}function Er(e){return document.createTextNode(e);}function Ir(){return Er(" ");}function Ar(){return Er("");}function Lr(e,t,o,i){return e.addEventListener(t,o,i),function(){return e.removeEventListener(t,o,i);};}function zr(e){return function(t){return t.preventDefault(),e.call(this,t);};}function Fr(e){return function(t){return t.stopPropagation(),e.call(this,t);};}function Dr(e,t,o){null==o?e.removeAttribute(t):e.getAttribute(t)!==o&&e.setAttribute(t,o);}function Or(e,t){var o=Object.getOwnPropertyDescriptors(e.__proto__);for(var 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]:Dr(e,i,t[i]);}function Br(e,t){Object.keys(t).forEach(function(o){!function(e,t,o){t in e?e[t]="boolean"==typeof e[t]&&""===o||o:Dr(e,t,o);}(e,o,t[o]);});}function Wr(e,t){t=""+t,e.wholeText!==t&&(e.data=t);}function Vr(e,t){e.value=null==t?"":t;}function _r(e,t){var _ref57=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref57$bubbles=_ref57.bubbles,o=_ref57$bubbles===void 0?!1:_ref57$bubbles,_ref57$cancelable=_ref57.cancelable,i=_ref57$cancelable===void 0?!1:_ref57$cancelable;var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,o,i,t),n;}var Nr=/*#__PURE__*/function(){function Nr(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;_classCallCheck(this,Nr);this.is_svg=!1,this.is_svg=e,this.e=this.n=null;}return _createClass(Nr,[{key:"c",value:function c(e){this.h(e);}},{key:"m",value:function m(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;this.e||(this.is_svg?this.e=Pr(t.nodeName):this.e=Rr(t.nodeName),this.t=t,this.c(e)),this.i(o);}},{key:"h",value:function h(e){this.e.innerHTML=e,this.n=Array.from(this.e.childNodes);}},{key:"i",value:function i(e){for(var t=0;t<this.n.length;t+=1)Tr(this.t,this.n[t],e);}},{key:"p",value:function p(e){this.d(),this.h(e),this.i(this.a);}},{key:"d",value:function d(){this.n.forEach(Mr);}}]);}();function Hr(e,t){return new e(t);}var jr=new Map();var Ur,Gr=0;function Zr(e,t,o,i,n,r,a){var s=arguments.length>7&&arguments[7]!==undefined?arguments[7]:0;var l=16.666/i;var c="{\n";for(var _e26=0;_e26<=1;_e26+=l){var _i18=t+(o-t)*r(_e26);c+=100*_e26+"%{".concat(a(_i18,1-_i18),"}\n");}var d=c+"100% {".concat(a(o,1-o),"}\n}"),u="__svelte_".concat(function(e){var t=5381,o=e.length;for(;o--;)t=(t<<5)-t^e.charCodeAt(o);return t>>>0;}(d),"_").concat(s),h=kr(e),_ref58=jr.get(h)||function(e,t){var o={stylesheet:Cr(t),rules:{}};return jr.set(e,o),o;}(h,e),p=_ref58.stylesheet,m=_ref58.rules;m[u]||(m[u]=!0,p.insertRule("@keyframes ".concat(u," ").concat(d),p.cssRules.length));var $=e.style.animation||"";return e.style.animation="".concat($?$+", ":"").concat(u," ").concat(i,"ms linear ").concat(n,"ms 1 both"),Gr+=1,u;}function Xr(e,t){var o=(e.style.animation||"").split(", "),i=o.filter(t?function(e){return e.indexOf(t)<0;}:function(e){return -1===e.indexOf("__svelte");}),n=o.length-i.length;n&&(e.style.animation=i.join(", "),Gr-=n,Gr||br(function(){Gr||(jr.forEach(function(e){var t=e.stylesheet.ownerNode;t&&Mr(t);}),jr.clear());}));}function Yr(e){Ur=e;}function qr(){if(!Ur)throw new Error("Function called outside component initialization");return Ur;}function Kr(e){qr().$$.on_mount.push(e);}function Jr(e){qr().$$.after_update.push(e);}function Qr(e){qr().$$.on_destroy.push(e);}function ea(){var e=qr();return function(t,o){var _ref59=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},_ref59$cancelable=_ref59.cancelable,i=_ref59$cancelable===void 0?!1:_ref59$cancelable;var n=e.$$.callbacks[t];if(n){var _r11=_r(t,o,{cancelable:i});return n.slice().forEach(function(t){t.call(e,_r11);}),!_r11.defaultPrevented;}return !0;};}function ta(e,t){return qr().$$.context.set(e,t),t;}function oa(e){return qr().$$.context.get(e);}function ia(e,t){var _this3=this;var o=e.$$.callbacks[t.type];o&&o.slice().forEach(function(e){return e.call(_this3,t);});}var na=[],ra=[],aa=[],sa=[],la=Promise.resolve();var ca=!1;function da(){ca||(ca=!0,la.then(fa));}function ua(){return da(),la;}function ha(e){aa.push(e);}function pa(e){sa.push(e);}var ma=new Set();var $a,ga=0;function fa(){var e=Ur;do{for(;ga<na.length;){var _e27=na[ga];ga++,Yr(_e27),ya(_e27.$$);}for(Yr(null),na.length=0,ga=0;ra.length;)ra.pop()();for(var _e29=0;_e29<aa.length;_e29+=1){var t=aa[_e29];ma.has(t)||(ma.add(t),t());}aa.length=0;}while(na.length);for(;sa.length;)sa.pop()();ca=!1,ma.clear(),Yr(e);}function ya(e){if(null!==e.fragment){e.update(),or(e.before_update);var t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ha);}}function ba(e,t,o){e.dispatchEvent(_r("".concat(t?"intro":"outro").concat(o)));}var xa=new Set();var va;function wa(){va={r:0,c:[],p:va};}function Sa(){va.r||or(va.c),va=va.p;}function ka(e,t){e&&e.i&&(xa.delete(e),e.i(t));}function Ca(e,t,o,i){if(e&&e.o){if(xa.has(e))return;xa.add(e),va.c.push(function(){xa.delete(e),i&&(o&&e.d(1),i());}),e.o(t);}else i&&i();}var Ta={duration:0};function Ma(e,t,o,i){var n=t(e,o),r=i?0:1,a=null,s=null,l=null;function c(){l&&Xr(e,l);}function d(e,t){var 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){var _ref60=n||Ta,_ref60$delay=_ref60.delay,o=_ref60$delay===void 0?0:_ref60$delay,_ref60$duration=_ref60.duration,i=_ref60$duration===void 0?300:_ref60$duration,_ref60$easing=_ref60.easing,u=_ref60$easing===void 0?Jn:_ref60$easing,_ref60$tick=_ref60.tick,h=_ref60$tick===void 0?Kn:_ref60$tick,p=_ref60.css,m={start:yr()+o,b:t};t||(m.group=va,va.r+=1),a||s?s=m:(p&&(c(),l=Zr(e,r,t,i,o,u,p)),t&&h(0,1),a=d(m,i),ha(function(){return ba(e,t,"start");}),wr(function(t){if(s&&t>s.start&&(a=d(s,i),s=null,ba(e,a.b,"start"),p&&(c(),l=Zr(e,r,a.b,a.duration,0,u,n.css))),a)if(t>=a.end)h(r=a.b,1-r),ba(e,a.b,"end"),s||(a.b?c():--a.group.r||or(a.group.c)),a=null;else if(t>=a.start){var _e30=t-a.start;r=a.a+a.d*u(_e30/a.duration),h(r,1-r);}return !(!a&&!s);}));}return {run:function run(e){ir(n)?($a||($a=Promise.resolve(),$a.then(function(){$a=null;})),$a).then(function(){n=n(),u(e);}):u(e);},end:function end(){c(),a=s=null;}};}var Ra="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function Pa(e,t){e.d(1),t.delete(e.key);}function Ea(e,t){Ca(e,1,1,function(){t.delete(e.key);});}function Ia(e,t,o,i,n,r,a,s,l,c,d,u){var h=e.length,p=r.length,m=h;var $={};for(;m--;)$[e[m].key]=m;var g=[],f=new Map(),y=new Map();for(m=p;m--;){var _e31=u(n,r,m),_s6=o(_e31);var _l6=a.get(_s6);_l6?i&&_l6.p(_e31,t):(_l6=c(_s6,_e31),_l6.c()),f.set(_s6,g[m]=_l6),_s6 in $&&y.set(_s6,Math.abs(m-$[_s6]));}var b=new Set(),x=new Set();function v(e){ka(e,1),e.m(s,d),a.set(e.key,e),d=e.first,p--;}for(;h&&p;){var _t21=g[p-1],_o23=e[h-1],_i19=_t21.key,_n17=_o23.key;_t21===_o23?(d=_t21.first,h--,p--):f.has(_n17)?!a.has(_i19)||b.has(_i19)?v(_t21):x.has(_n17)?h--:y.get(_i19)>y.get(_n17)?(x.add(_i19),v(_t21)):(b.add(_n17),h--):(l(_o23,a),h--);}for(;h--;){var _t22=e[h];f.has(_t22.key)||l(_t22,a);}for(;p;)v(g[p-1]);return g;}function Aa(e,t){var o={},i={},n={$$scope:1};var r=e.length;for(;r--;){var a=e[r],_s7=t[r];if(_s7){for(var _e33 in a)_e33 in _s7||(i[_e33]=1);for(var _e35 in _s7)n[_e35]||(o[_e35]=_s7[_e35],n[_e35]=1);e[r]=_s7;}else for(var _e37 in a)n[_e37]=1;}for(var _e39 in i)_e39 in o||(o[_e39]=void 0);return o;}function La(e){return "object"==_typeof(e)&&null!==e?e:{};}function za(e,t,o){var i=e.$$.props[t];void 0!==i&&(e.$$.bound[i]=o,o(e.$$.ctx[i]));}function Fa(e){e&&e.c();}function Da(e,t,o,i){var _e$$$=e.$$,n=_e$$$.fragment,r=_e$$$.after_update;n&&n.m(t,o),i||ha(function(){var _e$$$$on_destroy;var t=e.$$.on_mount.map(er).filter(ir);e.$$.on_destroy?(_e$$$$on_destroy=e.$$.on_destroy).push.apply(_e$$$$on_destroy,_toConsumableArray(t)):or(t),e.$$.on_mount=[];}),r.forEach(ha);}function Oa(e,t){var o=e.$$;null!==o.fragment&&(or(o.on_destroy),o.fragment&&o.fragment.d(t),o.on_destroy=o.fragment=null,o.ctx=[]);}function Ba(e,t,o,i,n,r,a){var s=arguments.length>7&&arguments[7]!==undefined?arguments[7]:[-1];var l=Ur;Yr(e);var c=e.$$={fragment:null,ctx:[],props:r,update:Kn,not_equal:n,bound:tr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:tr(),dirty:s,skip_bound:!1,root:t.target||l.$$.root};a&&a(c.root);var d=!1;if(c.ctx=o?o(e,t.props||{},function(t,o){var r=(arguments.length<=2?0:arguments.length-2)?arguments.length<=2?undefined:arguments[2]: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]&&(na.push(e),da(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31;}(e,t)),o;}):[],c.update(),d=!0,or(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){var _e40=function(e){return Array.from(e.childNodes);}(t.target);c.fragment&&c.fragment.l(_e40),_e40.forEach(Mr);}else c.fragment&&c.fragment.c();t.intro&&ka(e.$$.fragment),Da(e,t.target,t.anchor,t.customElement),fa();}Yr(l);}var Wa=/*#__PURE__*/function(){function Wa(){_classCallCheck(this,Wa);}return _createClass(Wa,[{key:"$destroy",value:function $destroy(){Oa(this,1),this.$destroy=Kn;}},{key:"$on",value:function $on(e,t){if(!ir(t))return Kn;var o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(t),function(){var e=o.indexOf(t);-1!==e&&o.splice(e,1);};}},{key:"$set",value:function $set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1);}}]);}();var Va=[];function _a(e,t){return {subscribe:Na(e,t).subscribe};}function Na(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Kn;var o;var i=new Set();function n(t){if(nr(e,t)&&(e=t,o)){var _t23=!Va.length;var _iterator5=_createForOfIteratorHelper(i),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var _t24=_step5.value;_t24[1](),Va.push(_t24,e);}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}if(_t23){for(var _e42=0;_e42<Va.length;_e42+=2)Va[_e42][0](Va[_e42+1]);Va.length=0;}}}return {set:n,update:function update(t){n(t(e));},subscribe:function subscribe(r){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Kn;var s=[r,a];return i.add(s),1===i.size&&(o=t(n)||Kn),r(e),function(){i.delete(s),0===i.size&&(o(),o=null);};}};}function Ha(e,t,o){var i=!Array.isArray(e),n=i?[e]:e,r=t.length<2;return _a(o,function(e){var o=!1;var a=[];var s=0,l=Kn;var c=function c(){if(s)return;l();var o=t(i?a[0]:a,e);r?e(o):l=ir(o)?o:Kn;},d=n.map(function(e,t){return rr(e,function(e){a[t]=e,s&=~(1<<t),o&&c();},function(){s|=1<<t;});});return o=!0,c(),function(){or(d),l();};});}var ja=function ja(e){return e.reduce(function(e,t){return Object.assign(e,t);},{});};var Ua=function Ua(e){return {updateValue:e};},Ga=function Ga(e){return {defaultValue:e};},Za=function Za(e){return {store:e};},Xa=function Xa(e){return {store:function store(t,o){return Ha.apply(void 0,_toConsumableArray(e(o)));}};},Ya=function Ya(e){return {store:function store(t,o){var _e43=e(o),_e44=_slicedToArray(_e43,3),i=_e44[0],n=_e44[1],_e44$=_e44[2],r=_e44$===void 0?function(){return !1;}:_e44$;var a,s=!0;return Ha(i,function(e,t){n(e,function(e){!s&&r(a,e)||(a=e,s=!1,t(e));});});}};},qa=function qa(e){return {store:function store(t,o){var _e45=e(o),_e46=_slicedToArray(_e45,3),i=_e46[0],_e46$=_e46[1],n=_e46$===void 0?{}:_e46$,r=_e46[2];var a=[];var s={},l=function l(e){return i(e,s);},c=function c(e){(a.length||e.length)&&(a=e,d());},d=function d(){var e=a.map(l);r&&e.sort(r),a=_toConsumableArray(e),h(e);};Object.entries(n).map(function(_ref61){var _ref62=_slicedToArray(_ref61,2),e=_ref62[0],t=_ref62[1];return t.subscribe(function(t){s[e]=t,t&&d();});});var _Na=Na(t||[]),u=_Na.subscribe,h=_Na.set;return {set:c,update:function update(e){return c(e(a));},subscribe:u};}};};var Ka=function Ka(e){var t={},o={};return e.forEach(function(_ref63){var _ref64=_toArray(_ref63),e=_ref64[0],i=_ref64.slice(1);var r=ja(i),a=t[e]=function(e,t,o){var _o$store=o.store,i=_o$store===void 0?function(e){return Na(e);}:_o$store,_o$defaultValue=o.defaultValue,r=_o$defaultValue===void 0?n:_o$defaultValue,a=o.updateValue,s=i(r(),t,e),l=s.subscribe,_s$update=s.update,c=_s$update===void 0?n:_s$update;var d;var u=function u(e){var t=!0;d&&d(),d=l(function(o){if(t)return t=!1;e(o),d(),d=void 0;});},h=a?a(e):Z;return s.set=function(e){return c(function(t){return h(e,t,u);});},s.defaultValue=r,s;}(o,t,r),s={get:function get(){return ar(a);},set:a.set};Object.defineProperty(o,e,s);}),{stores:t,accessors:o};};var Ja=[["src",Za(function(){var e;var _Na2=Na(),t=_Na2.subscribe,o=_Na2.set,i=function i(t){e!==t&&(e=t,o(e));};return {set:i,subscribe:t,update:function update(t){return i(t(e));}};})],["imageReader"],["imageWriter"],["imageScrambler"],["imageRedactionRendering",Ga(function(){return "pixelated";})],["images",Ga(function(){return [];})],["shapePreprocessor"],["willRequestResource"],["willRequest"],["csp"]],Qa=function Qa(e){return e.charAt(0).toUpperCase()+e.slice(1);},es=function es(e,t){Object.keys(t).forEach(function(o){var i=M(t[o])?{value:t[o],writable:!1}:t[o];Object.defineProperty(e,o,i);});};var ts=function ts(e,t){var o,i,n,r,a,s,l,c,d,u;var 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;};var os=function os(e,t){var o=At(t),i=ue();St(e).forEach(function(e){we(e,i),ts(e,t)||o.forEach(function(t){var o=Math.atan2(t.start.y-t.end.y,t.start.x-t.end.x),n=1e4*Math.sin(Math.PI-o),r=1e4*Math.cos(Math.PI-o),a=he(e.x+n,e.y+r),s=Ye(Xe(t),1e4),l=Rt(Ze(e,a),s);l&&we(i,Se(me(l),e));});});var n=Je(e);we(n,i);return !!St(n).every(function(e){return ts(e,t);})&&(gt(e,n),!0);},is=function is(e,t){var o=St(e),i=Lt(t,5),n=st(e),r=[];o.forEach(function(e){var t=function(e,t){if(0===t)return e;var o=he(e.start.x-e.end.x,e.start.y-e.end.y),i=ye(o),n=Ce(i,t);return e.end.x+=n.x,e.end.y+=n.y,e;}(Ze(me(n),me(e)),1e6);var o=!1;i.map(Xe).forEach(function(e){var i=Rt(t,e);i&&!o&&(r.push(i),o=!0);});});var a=Pe(r[0],r[2])<Pe(r[1],r[3])?[r[0],r[2]]:[r[1],r[3]],s=it(a);return s.width<e.width&&(gt(e,s),!0);},ns=function ns(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{x:0,y:0};var i=et(e),n=st(i),r=Ct(i,o,n).map(function(e){return ge(e,t,n);}),a=it(r);return r.map(function(e){return Se(e,a);});},rs=function rs(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:mt(e);var i,n;if(0!==t){var _r12=Math.atan2(1,o),a=Math.sign(t)*t,_s8=a%Math.PI,_l7=a%Y;var _c4;_c4=_s8>q&&_s8<Y+q?_l7>q?a:Y-_l7:_l7>q?Y-_l7:a;var _d4=Math.min(Math.abs(e.height/Math.sin(_r12+_c4)),Math.abs(e.width/Math.cos(_r12-_c4)));i=Math.cos(_r12)*_d4,n=i/o;}else i=e.width,n=i/o,n>e.height&&(n=e.height,i=n*o);return Ve(i,n);},as=function as(e,t,o,i,n,r,a,s){var l=Fe(a),c=Fe(s),d=le(Math.max(t.width/c.width,t.height/c.height)),u=le(Math.min(t.width/l.width,t.height/l.height)),h=Je(t);if(u<1||d>1){var _o24=st(e),_i20=st(t),_n18=u<1?u:d,_r13=(_i20.x+_o24.x)/2,_a6=(_i20.y+_o24.y)/2,_s9=h.width/_n18,_l8=h.height/_n18;$t(h,_r13-.5*_s9,_a6-.5*_l8,_s9,_l8);}return r?(function(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:ue();var n=arguments.length>4?arguments[4]:undefined;if(Lo(o)&&0!==o||i.x||i.y){var _n19=mt(e),_r14=ns(t,o,i),_a7=rs(t,o,_n19);if(!(e.width<_a7.width&&e.height<_a7.height)){var _t25=.5*e.width-.5*_a7.width,_o25=.5*e.height-.5*_a7.height;e.width>_a7.width&&(e.width=_a7.width,e.x+=_t25),e.height>_a7.height&&(e.height=_a7.height,e.y+=_o25);}os(e,_r14),is(e,_r14)&&os(e,_r14);}else {var _o26=mt(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);var _i21=st(e),_r15=vt(e,_o26);_r15.width=Math.max(n.width,_r15.width),_r15.height=Math.max(n.height,_r15.height),_r15.x=_i21.x-.5*_r15.width,_r15.y=_i21.y-.5*_r15.height,gt(e,_r15);}}(h,o,i,n,l),{crop:h}):{crop:h};},ss=function ss(e,t,o){var i=et(e),n=st(i),r=ft(i,o,n),a=st(Tt(it(r))),s=st(t),l=ge(s,-o,a),c=Se(l,a),d=ve(we(n,c),le);return at(d.x-.5*t.width,d.y-.5*t.height,t.width,t.height);},ls=function ls(e,t,o){return Math.max(t,Math.min(e,o));};var cs=["cropLimitToImage","cropMinSize","cropMaxSize","cropAspectRatio","flipX","flipY","rotation","crop","colorMatrix","convolutionMatrix","gamma","vignette","manipulation","redaction","annotation","decoration","selection","frame","backgroundColor","backgroundImage","targetSize","metadata","trim","volume","minDuration","maxDuration","currentTime"],ds=function ds(e){return Do(e)?e.map(ds):uo(e)||_t(e)?e:S(e)?_objectSpread2({},e):e;},us=function us(e){return e.map(function(e){return Object.entries(e).reduce(function(e,_ref65){var _ref66=_slicedToArray(_ref65,2),t=_ref66[0],o=_ref66[1];return t.startsWith("_")||(e[t]=o),e;},{});});};var hs=function hs(e,t){return e===t;};var ps=function ps(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:hs;if(e.length!==t.length)return !1;for(var i=0;i<e.length;i++)if(!o(e[i],t[i]))return !1;return !0;};var ms=function ms(e,t,o){var i=ve(st(e),function(e){return le(e,8);}),n=et(t),r=st(n),a=ft(n,o,r),s=ve(He(it(a)),function(e){return le(e,8);}),l=Math.abs(s.x-i.x),c=Math.abs(s.y-i.y);return l<1&&c<1;},$s=function $s(e,t,o,i,n){if(!n)return [-1/0,1/0];var r=Math.max(o.width/i.width,o.height/i.height),a=Ve(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];var 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];var m=Number.isNaN(h)?p:Number.isNaN(p)?h:Math.min(h,p);return [-m,m];},gs=function gs(e,t){var o=t.context,i=t.props;return e._isFormatted||((e=sn(e))._isFormatted=!0,Object.assign(e,i)),e._isDraft||!Oi(e)||e._context&&pt(o,e._context)||(Sn(e,o),e._context=_objectSpread2({},o)),e;},fs=function fs(e,t){return e._isFormatted||(e.disableMove=!0,e.disableSelect=!0,e.disableResize=!0,e.disableRotate=!0),gs(e,t);};var ys=[["file"],["size"],["loadState"],["processState"],["aspectRatio",Xa(function(_ref67){var e=_ref67.size;return [e,function(e){return e?mt(e):void 0;}];})],["perspectiveX",Ga(function(){return 0;})],["perspectiveY",Ga(function(){return 0;})],["perspective",Xa(function(_ref68){var e=_ref68.perspectiveX,t=_ref68.perspectiveY;return [[e,t],function(_ref69){var _ref70=_slicedToArray(_ref69,2),e=_ref70[0],t=_ref70[1];return {x:e,y:t};}];})],["rotation",Ga(function(){return 0;}),Ua(function(e){return function(t,o,i){if(t===o)return t;var n=e.loadState,r=e.size,a=e.rotationRange,s=e.cropMinSize,l=e.cropMaxSize,c=e.crop,d=e.perspective,u=e.cropLimitToImage,h=e.cropOrigin;if(!c||!n||!n.beforeComplete)return t;var p=u&&function(e,t,o){var i=rs(t,o,mt(e));return _e(Ge(i,Math.round),Ge(Fe(e),Math.round));}(c,r,o),m=u&&ms(c,r,o),$=function(e,t,o,i,n,r,a,s,l,c){var d=Fe(l),u=Fe(c);a&&(u.width=Math.min(c.width,n.width),u.height=Math.min(c.height,n.height));var h=!1;var p=function p(t,o){var l=ss(n,i,t),c=et(n),m=st(c),$=Ct(c,r,m),g=Se(me(m),Mt($)),f=ge(st(l),o,m),y=Se(me(m),f);$.forEach(function(e){return ge(e,o,m);});var b=it($),x=Mt($),v=we(Se(Se(x,y),b),g),w=at(v.x-.5*l.width,v.y-.5*l.height,l.width,l.height);if(s&&ct(w,s.width/w.width),a){var _e47=ns(n,o,r);is(w,_e47);}var S=le(Math.min(w.width/d.width,w.height/d.height),8),k=le(Math.max(w.width/u.width,w.height/u.height),8);return (S<1||k>1)&&le(Math.abs(o-t))===le(Math.PI/2)&&!h?(h=!0,p(e,e+Math.sign(o-t)*Math.PI)):{rotation:o,crop:kt(w,function(e){return le(e,8);})};},m=Math.sign(t)*Math.round(Math.abs(t)/Y)*Y,$=ls(t,m+o[0],m+o[1]);return p(e,$);}(o,t,a,c,r,d,u,h,s,l);if(p&&m){var _e48=rs(r,t,mt($.crop));$.crop.x+=.5*$.crop.width,$.crop.y+=.5*$.crop.height,$.crop.x-=.5*_e48.width,$.crop.y-=.5*_e48.height,$.crop.width=_e48.width,$.crop.height=_e48.height;}return i(function(){e.crop=kt($.crop,function(e){return le(e,8);});}),$.rotation;};})],["flipX",Ga(function(){return !1;})],["flipY",Ga(function(){return !1;})],["flip",Xa(function(_ref71){var e=_ref71.flipX,t=_ref71.flipY;return [[e,t],function(_ref72){var _ref73=_slicedToArray(_ref72,2),e=_ref73[0],t=_ref73[1];return {x:e,y:t};}];})],["isRotatedSideways",Ya(function(_ref74){var e=_ref74.rotation;return [[e],function(_ref75,t){var _ref76=_slicedToArray(_ref75,1),e=_ref76[0];return t(K(e));},function(e,t){return e!==t;}];})],["crop",Ua(function(e){return function(t){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:t;var i=e.loadState,n=e.size,r=e.cropMinSize,a=e.cropMaxSize,s=e.cropLimitToImage,l=e.cropAspectRatio,c=e.rotation,d=e.perspective;if(!t&&!o||!i||!i.beforeComplete)return t;t||(t=et(rs(n,c,l||mt(n))));var u=as(o,t,n,c,d,s,r,a),h=kt(u.crop,function(e){return le(e,8);});return pt(o,h)?o:h;};})],["cropAspectRatio",Ua(function(e){return function(t,o){var i=e.loadState,n=e.crop,r=e.size,a=e.rotation,s=e.cropLimitToImage,l=function(e){if(e){if(/:/.test(e)){var _e$split5=e.split(":"),_e$split6=_slicedToArray(_e$split5,2),_t26=_e$split6[0],_o27=_e$split6[1];return _t26/_o27;}return parseFloat(e);}}(t);if(!l)return;if(!n||!i||!i.beforeComplete)return l;var c=o?Math.abs(t-o):1;if(ms(n,r,a)&&s&&c>=.1){var _o28=function(e,t){var o=e.width,i=e.height;return K(t)&&(e.width=i,e.height=o),e;}(Fe(r),a);e.crop=kt(vt(et(_o28),t),le);}else {var _t27={width:n.height*l,height:n.height},_o29=.5*(n.width-_t27.width),_i22=.5*(n.height-_t27.height);e.crop=kt(at(n.x+_o29,n.y+_i22,_t27.width,_t27.height),le);}return l;};})],["cropOrigin"],["cropMinSize",Ga(function(){return {width:1,height:1};})],["cropMaxSize",Ga(function(){return {width:32768,height:32768};})],["cropLimitToImage",Ga(function(){return !0;}),Ua(function(e){return function(t,o,i){var n=e.crop;return n?(!o&&t&&i(function(){return e.crop=Je(e.crop);}),t):t;};})],["cropSize",Ya(function(_ref77){var e=_ref77.crop;return [[e],function(_ref78,t){var _ref79=_slicedToArray(_ref78,1),e=_ref79[0];e&&t(Ve(e.width,e.height));},function(e,t){return _e(e,t);}];})],["cropRectAspectRatio",Xa(function(_ref80){var e=_ref80.cropSize;return [[e],function(_ref81,t){var _ref82=_slicedToArray(_ref81,1),e=_ref82[0];e&&t(le(mt(e),5));}];})],["cropRange",Ya(function(_ref83){var e=_ref83.size,t=_ref83.rotation,o=_ref83.cropRectAspectRatio,i=_ref83.cropMinSize,n=_ref83.cropMaxSize,r=_ref83.cropLimitToImage;return [[e,t,o,i,n,r],function(_ref84,a){var _ref85=_slicedToArray(_ref84,6),e=_ref85[0],t=_ref85[1],o=_ref85[2],i=_ref85[3],n=_ref85[4],r=_ref85[5];if(!e)return;a(function(e,t,o,i,n,r){var a=Fe(i),s=Fe(n);return r?[a,Ge(rs(e,t,o),Math.round)]:[a,s];}(e,t,o,i,n,r));},function(e,t){return ps(e,t);}];})],["rotationRange",Ya(function(_ref86){var e=_ref86.size,t=_ref86.isRotatedSideways,o=_ref86.cropMinSize,i=_ref86.cropSize,n=_ref86.cropLimitToImage;return [[e,t,o,i,n],function(_ref87,r){var _ref88=_slicedToArray(_ref87,5),e=_ref88[0],t=_ref88[1],o=_ref88[2],i=_ref88[3],n=_ref88[4];if(!e||!i)return;r($s(e,t,o,i,n));},function(e,t){return ps(e,t);}];})],["backgroundColor",Ua(function(){return function(e){return function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[0,0,0,0];var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return 4===e.length?e:[].concat(_toConsumableArray(e),[t]);}(e);};})],["backgroundImage"],["targetSize"],["colorMatrix"],["convolutionMatrix"],["gamma"],["noise"],["vignette"],["duration"],["currentTime"],["minDuration",Ga(function(){return 1/24;})],["maxDuration",Ga(function(){return 1/0;})],["volume",Ga(function(){return 1;})],["trim"],["redaction",qa(function(_ref89){var e=_ref89.size;return [gs,{context:e}];})],["manipulation",qa(function(_ref90){var e=_ref90.size;return [gs,{context:e}];})],["annotation",qa(function(_ref91){var e=_ref91.size;return [gs,{context:e}];})],["decoration",qa(function(_ref92){var e=_ref92.crop;return [gs,{context:e}];})],["selection",qa(function(_ref93){var e=_ref93.size;return [fs,{context:e}];})],["frame",Ua(function(){return function(e){if(!e)return;var t={frameStyle:void 0,x:0,y:0,width:"100%",height:"100%",disableStyle:["backgroundColor","strokeColor","strokeWidth"]};return T(e)?t.frameStyle=e:Object.assign(t,e),t;};})],["metadata"],["state",Za(function(e,t,o){var i=cs.map(function(e){return t[e];});var n=!1;var r=Na({}),_Ha=Ha([].concat(_toConsumableArray(i),[r]),function(e,t){if(n)return;var o=cs.reduce(function(t,o,i){return t[o]=ds(e[i]),t;},{});o.crop&&kt(o.crop,Math.round),o.manipulation=o.manipulation&&us(o.manipulation),o.redaction=o.redaction&&us(o.redaction),o.annotation=o.annotation&&us(o.annotation),o.decoration=o.decoration&&us(o.decoration),o.selection=o.selection&&us(o.selection),t(o);}),a=_Ha.subscribe,s=function s(e){e&&(n=!0,o.cropOrigin=void 0,cs.filter(function(t){return Fo(e,t);}).forEach(function(t){var i=e[t];o[t]=null===i?void 0:ds(i);}),n=!1,r.set({}));};return {set:s,update:function update(e){return s(e(null));},subscribe:a};})]],bs=/*#__PURE__*/function(){var _ref94=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(e,t){var o,i,r,a,s,l,c,d,_iterator6,_step6,_loop,_ret,_args34=arguments;return _regeneratorRuntime().wrap(function _callee38$(_context39){while(1)switch(_context39.prev=_context39.next){case 0:o=_args34.length>2&&_args34[2]!==undefined?_args34[2]:{};i=_args34.length>3?_args34[3]:undefined;r=i.ontaskstart,a=i.ontaskprogress,s=i.ontaskend,l=i.token;c=!1;d={cancel:n};l.cancel=function(){c=!0,d.cancel();};_iterator6=_createForOfIteratorHelper(t.entries());_context39.prev=7;_loop=/*#__PURE__*/_regeneratorRuntime().mark(function _loop(){var _step6$value,i,n,_n20,t,l;return _regeneratorRuntime().wrap(function _loop$(_context38){while(1)switch(_context38.prev=_context38.next){case 0:_step6$value=_slicedToArray(_step6.value,2),i=_step6$value[0],n=_step6$value[1];if(!c){_context38.next=3;break;}return _context38.abrupt("return",{v:void 0});case 3:_n20=_slicedToArray(n,2),t=_n20[0],l=_n20[1];r(i,l);_context38.prev=5;_context38.next=8;return t(e,_objectSpread2(_objectSpread2({},o),{},{taskCancelToken:d}),function(e){return a(i,l,e);});case 8:e=_context38.sent;_context38.next=14;break;case 11:_context38.prev=11;_context38.t0=_context38["catch"](5);throw c=!0,_context38.t0;case 14:s(i,l);case 15:case"end":return _context38.stop();}},_loop,null,[[5,11]]);});_iterator6.s();case 10:if((_step6=_iterator6.n()).done){_context39.next=17;break;}return _context39.delegateYield(_loop(),"t0",12);case 12:_ret=_context39.t0;if(!_ret){_context39.next=15;break;}return _context39.abrupt("return",_ret.v);case 15:_context39.next=10;break;case 17:_context39.next=22;break;case 19:_context39.prev=19;_context39.t1=_context39["catch"](7);_iterator6.e(_context39.t1);case 22:_context39.prev=22;_iterator6.f();return _context39.finish(22);case 25:return _context39.abrupt("return",e);case 26:case"end":return _context39.stop();}},_callee38,null,[[7,19,22,25]]);}));return function bs(_x74,_x75){return _ref94.apply(this,arguments);};}();var xs=["loadstart","loadabort","loaderror","loadprogress","load","processstart","processabort","processerror","processprogress","process"],vs=["flip","cropOrigin","isRotatedSideways","perspective","perspectiveX","perspectiveY","cropRange"],Ss=ys.map(function(_ref95){var _ref96=_slicedToArray(_ref95,1),e=_ref96[0];return e;}).filter(function(e){return !vs.includes(e);}),ks=function ks(e){return "image"+Qa(e);},Cs=function Cs(e){return Fo(e,"crop");};var Ts=function Ts(){var _Ka=Ka(Ja),e=_Ka.stores,t=_Ka.accessors,_Yo2=Yo(),o=_Yo2.sub,i=_Yo2.pub,r=function r(){return t.images?t.images[0]:{};};var a={};var s={};Ss.forEach(function(e){Object.defineProperty(t,ks(e),{get:function get(){var t=r();if(t)return t.accessors[e];},set:function set(t){a[ks(e)]=t,s[ks(e)]=t;var o=r();o&&(o.accessors[e]=t);}});});var l=function l(){return t.images&&t.images[0];},c=e.src.subscribe(function(e){if(!e)return t.images=[];t.imageReader&&(t.images.length&&(a={}),u(e));}),d=e.imageReader.subscribe(function(e){e&&(t.images.length||t.src&&u(t.src));}),u=function u(e){Promise.resolve().then(function(){return p(e,a);}).catch(function(){});};var h;var p=function p(e){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return new Promise(function(r,c){var d=l();var u=!(!1===o.cropLimitToImage||!1===o.imageCropLimitToImage||!1===s.imageCropLmitedToImage),p=o.cropMinSize||o.imageCropMinSize||s.imageCropMinSize,m=u?p:d&&d.accessors.cropMinSize,g=o.minDuration||o.imageMinDuration;d&&$(),d=function(){var _ref97=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref97$minSize=_ref97.minSize,e=_ref97$minSize===void 0?{width:1,height:1}:_ref97$minSize,_ref97$minDuration=_ref97.minDuration,t=_ref97$minDuration===void 0?0:_ref97$minDuration;var _Ka2=Ka(ys),o=_Ka2.stores,i=_Ka2.accessors,_Yo3=Yo(),r=_Yo3.pub,a=_Yo3.sub,s=function s(e,t){var o=function o(){return i[e]||{};},n=function n(t){i[e]=_objectSpread2(_objectSpread2(_objectSpread2({},o()),t),{},{timeStamp:Date.now()});},a=function a(){return o().error;},s=function s(e){a()||(n({error:e}),r(t+"error",_objectSpread2({},o())));};return {start:function start(){r(t+"start");},onabort:function onabort(){n({abort:!0}),r(t+"abort",_objectSpread2({},o()));},ontaskstart:function ontaskstart(e,i){a()||(n({index:e,task:i,taskProgress:void 0,taskLengthComputable:void 0}),r(t+"taskstart",_objectSpread2({},o())));},ontaskprogress:function ontaskprogress(e,i,s){a()||(n({index:e,task:i,taskProgress:s.loaded/s.total,taskLengthComputable:s.lengthComputable}),r(t+"taskprogress",_objectSpread2({},o())),r(t+"progress",_objectSpread2({},o())));},ontaskend:function ontaskend(e,i){a()||(n({index:e,task:i}),r(t+"taskend",_objectSpread2({},o())));},ontaskerror:function ontaskerror(e){s(e);},error:function error(e){s(e);},beforeComplete:function beforeComplete(e){a()||(n({beforeComplete:!0}),r("before"+t,e));},complete:function complete(e){a()||(n({complete:!0}),r(t,e));}};};return es(i,{read:function read(o,_ref98){var r=_ref98.reader;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(!r)return;Object.assign(i,{file:void 0,size:void 0,loadState:void 0});var l={cancel:n},c=!1;var d=s("loadState","load"),u=_objectSpread2({token:l},d),h={src:o,size:void 0,dest:void 0,duration:void 0};return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(){var _o30,_ref101,_n21,_s10,_p4;return _regeneratorRuntime().wrap(function _callee39$(_context40){while(1)switch(_context40.prev=_context40.next){case 0:_context40.prev=0;if(!(d.start(),c)){_context40.next=3;break;}return _context40.abrupt("return",d.onabort());case 3:_context40.next=5;return bs(h,r,a,u);case 5:_o30=_context40.sent;if(!c){_context40.next=8;break;}return _context40.abrupt("return",d.onabort());case 8:_ref101=_o30||{},_n21=_ref101.size,_s10=_ref101.duration,_p4=_ref101.dest;if(!(!_n21||!_n21.width||!_n21.height)){_context40.next=11;break;}throw new so("Image size missing","IMAGE_SIZE_MISSING",_o30);case 11:if(!(_s10>0&&_s10<t)){_context40.next=13;break;}throw new so("Video too short","VIDEO_TOO_SHORT",_objectSpread2(_objectSpread2({},_o30),{},{minDuration:t}));case 13:if(!(_n21.width<e.width||_n21.height<e.height)){_context40.next=15;break;}throw new so("Image too small","IMAGE_TOO_SMALL",_objectSpread2(_objectSpread2({},_o30),{},{minWidth:e.width,minHeight:e.height}));case 15:Object.assign(i,{file:_p4,size:_n21,duration:_s10}),d.beforeComplete(_o30),d.complete(_o30);_context40.next=21;break;case 18:_context40.prev=18;_context40.t0=_context40["catch"](0);d.error(_context40.t0);case 21:_context40.prev=21;l=void 0;return _context40.finish(21);case 24:case"end":return _context40.stop();}},_callee39,null,[[0,18,21,24]]);}))),function(){c=!0,l&&l.cancel(),d.onabort();};},write:function write(e,t){if(!i.loadState.complete)return;i.processState=void 0;var o=s("processState","process"),r={src:i.file,imageState:i.state,dest:void 0};if(M(e)&&(e=e(i.file,i.state)),!e)return o.start(),void o.complete(r);var a={cancel:n},l=!1;var c=t,d=_objectSpread2({token:a},o);return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(){var _t28;return _regeneratorRuntime().wrap(function _callee40$(_context41){while(1)switch(_context41.prev=_context41.next){case 0:_context41.prev=0;if(!(o.start(),l)){_context41.next=3;break;}return _context41.abrupt("return",o.onabort());case 3:_context41.next=5;return bs(r,e,c,d);case 5:_t28=_context41.sent;if(!l){_context41.next=8;break;}return _context41.abrupt("return",o.onabort());case 8:o.complete(_t28);_context41.next=14;break;case 11:_context41.prev=11;_context41.t0=_context41["catch"](0);o.error(_context41.t0);case 14:_context41.prev=14;a=void 0;return _context41.finish(14);case 17:case"end":return _context41.stop();}},_callee40,null,[[0,11,14,17]]);}))),function(){l=!0,a&&a.cancel();};},on:a}),{accessors:i,stores:o};}({minSize:m,minDuration:g}),xs.map(function(e){return d.accessors.on(e,(t=e,function(e){return i(t,e);}));var t;});var f=function f(){a={},y.forEach(function(e){return e();});},y=[];y.push(d.accessors.on("loaderror",function(e){f(),c(e);})),y.push(d.accessors.on("loadabort",function(){f(),c({name:"AbortError"});})),y.push(d.accessors.on("load",function(e){h=void 0,f(),r(e);})),y.push(d.accessors.on("beforeload",function(){return function(e,o){if(Cs(o))return void(t.imageState=o);if(!o.imageCrop){var _t29=e.accessors.size,_i23=o.imageRotation||0,_n22=je(Fe(_t29),_i23),_r16=et(_n22);_r16.width=le(Math.abs(_r16.width),6),_r16.height=le(Math.abs(_r16.height),6);var _a8=o.imageCropAspectRatio||(o.imageCropLimitToImage?mt(_t29):mt(_r16));var _s11;o.imageCropLimitToImage?_s11=vt(_r16,_a8):(_s11=xt(_r16,_a8),_s11.x=(_t29.width-_s11.width)/2,_s11.y=(_t29.height-_s11.height)/2),o.imageCrop=_s11;}if(e.accessors.duration&&!o.imageTrim&&o.imageMaxDuration){var _t30=e.accessors.duration;o.imageTrim=[[0,Math.min(o.imageMaxDuration/_t30,1)]];}var i=["imageCropLimitToImage","imageCrop","imageCropAspectRatio","imageRotation"];i.filter(function(e){return Fo(o,e);}).forEach(function(e){t[e]=o[e],delete o[e];});var n=Object.keys(o).filter(function(e){return !i.includes(e);}).reduce(function(e,t){return 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});});};var m;var $=function $(){var e=l();e&&(h&&h(),e.accessors.loadState=void 0,t.images=[]);};return Object.defineProperty(t,"stores",{get:function get(){return e;}}),es(t,{on:o,loadImage:p,abortLoadImage:function abortLoadImage(){h&&h(),t.images=[];},editImage:function editImage(e,o){return new Promise(function(i,n){p(e,o).then(function(){var e=t.images,o=e[0],r=function r(){a(),s();},a=o.accessors.on("processerror",function(e){r(),n(e);}),s=o.accessors.on("process",function(e){r(),i(e);});}).catch(n);});},removeImage:$,processImage:function processImage(e,o){return new Promise(function(i,n){try{var _r17=[],_a9=function _a9(){m=void 0,_r17.forEach(function(e){return e();});};_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(){var s;return _regeneratorRuntime().wrap(function _callee41$(_context42){while(1)switch(_context42.prev=_context42.next){case 0:if(!function(e){return T(e)||No(e)||Vt(e);}(e)){_context42.next=11;break;}_context42.prev=1;_context42.next=4;return p(e,o);case 4:_context42.next=9;break;case 6:_context42.prev=6;_context42.t0=_context42["catch"](1);n(_context42.t0);case 9:_context42.next=12;break;case 11:e&&(Cs(e)?t.imageState=e:Object.assign(t,e));case 12:s=l();if(s){_context42.next=15;break;}return _context42.abrupt("return",n("no image"));case 15:_r17.push(s.accessors.on("processerror",function(e){_a9(),n(e);})),_r17.push(s.accessors.on("processabort",function(){_a9(),n({name:"AbortError"});})),_r17.push(s.accessors.on("process",function(e){_a9(),i(e);})),m=s.accessors.write(t.imageWriter,{redactionRenderStyle:t.imageRedactionRendering,shapePreprocessor:t.shapePreprocessor||Z,imageScrambler:t.imageScrambler,willRequest:t.willRequest,csp:t.csp||{},willRequestResource:t.willRequestResource});case 16:case"end":return _context42.stop();}},_callee41,null,[[1,6]]);}))();}catch(e){n(e);}});},abortProcessImage:function abortProcessImage(){var e=l();e&&(m&&m(),e.accessors.processState=void 0);},destroy:function destroy(){c&&c(),d&&d();}}),t;};var Ms=function Ms(e,t){var _Ts=Ts(),o=_Ts.processImage;return o(e,t);};var Rs=function Rs(){return Yt()?fo()?/15_|16_/.test(navigator.userAgent)?14745600:16777216:/15_/.test(navigator.userAgent)?16777216:1/0:1/0;},Ps=function Ps(e,t){return Object.keys(e).filter(function(e){return !t.includes(e);}).reduce(function(t,o){return t[o]=e[o],t;},{});},Es=function Es(e){return new Promise(function(t){if(e.duration===1/0)return e.ontimeupdate=function(){e.ontimeupdate=void 0,t(e);},void(e.currentTime=Number.MAX_SAFE_INTEGER);t(e);});};var Is=function Is(e){return new Promise(function(t){var o=new FileReader();o.onload=function(){return t(o.result);},o.readAsArrayBuffer(e);});},As=function As(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.byteLength;var i=[],n=t+o;for(;t<n;){var _o31=e.getUint32(t);if(_o31<0)break;var _n23=e.getUint32(t+4);if(i.push({type:_n23,size:_o31,offset:t,bodyOffset:t+8,bodySize:_o31-8}),_o31<8)break;t+=_o31;}return i;},Ls=function Ls(e){var _ref104=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},_ref104$limit=_ref104.limit,t=_ref104$limit===void 0?1024:_ref104$limit;var o=0;o+=4;if(1718909296!==e.getUint32(o))return 0;o+=4;var i=e.getUint32(o);return 1836069938===i?function(e,t,o){var i=!1,n=-1;for(var _r19=t;_r19<o;_r19++)if(i||1953653099!==e.getUint32(_r19)||(i=!0,_r19+=4),i&&64==e.getUint8(_r19)){n=_r19;break;}if(n<0)return 0;var 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;}(e,o,t):1903435808===i?function(e){var t=As(e).find(function(e){return 1836019574===e.type;});if(!t)return 0;var o=As(e,t.bodyOffset,t.bodySize);o.filter(function(e){return 1953653099===e.type;}).forEach(function(t){o.push.apply(o,_toConsumableArray(As(e,t.bodyOffset,t.bodySize)));});var i=[1836476516,1953196132],n=o.filter(function(e){return i.includes(e.type);});var _iterator7=_createForOfIteratorHelper(n),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _step7$value2=_step7.value,_t31=_step7$value2.type,_o32=_step7$value2.bodyOffset;var _i24=e.getUint8(_o32);var _n24=_o32+4;_n24+=1836476516===_t31?32:36,_n24+=1===_i24?12:0;var _r20=e.getInt32(_n24),a=e.getInt32(_n24+4);if(0===_r20&&a>0)return 90;if(_r20<0&&0===a)return 180;if(0===_r20&&a<0)return 270;}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}return 0;}(e):0;};var zs=function zs(e){return new Promise(function(t,o){(F()?function(){var _ref105=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(e){var t,o;return _regeneratorRuntime().wrap(function _callee42$(_context43){while(1)switch(_context43.prev=_context43.next){case 0:_context43.next=2;return Is(e);case 2:t=_context43.sent;o=new DataView(t);return _context43.abrupt("return",Ls(o));case 5:case"end":return _context43.stop();}},_callee42);}));return function(_x76){return _ref105.apply(this,arguments);};}()(e):Promise.resolve(0)).then(function(i){var n=document.createElement("video");n.onerror=function(){return o(n.error);},n.playsInline=!0,n.preload="auto",n.onseeked=function(){n.onseeked=void 0,t(n);},n.onloadeddata=function(){n.onloadeddata=void 0,n.dataset.rotation=i?""+i:"0",Es(n).then(t),n.currentTime=0;},n.src=URL.createObjectURL(e),function(e){fo()&&(e.load(),e.play().catch(function(){}),e.pause());}(n);});});},Fs=function Fs(e,t){return new Promise(function(o){if(e.currentTime===t)return o(e);var i=e.onseeked;e.onseeked=function(){e.onseeked=i,o(e);},e.currentTime=ls(t,0,e.duration);});},Ds=function Ds(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return new Promise(function(o,i){zs(e).then(function(e){Fs(e,t).then(function(e){var t=p("canvas");Kt(e).then(function(_ref106){var i=_ref106.width,n=_ref106.height;t.width=i,t.height=n;var r=t.getContext("2d",{willReadFrequently:!0}),a=function a(){r.drawImage(e,0,0,t.width,t.height);var i=r.getImageData(0,0,t.width,t.height);$(t),URL.revokeObjectURL(e.src),o(i);};Yt()?setTimeout(a,16):a();});});});});},Os=function Os(e){return /video/.test(e.type);};var Bs=function Bs(){var _ref107=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=_ref107.imageDataResizer,t=_ref107.canvasMemoryLimit;return/*#__PURE__*/function(){var _ref108=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(o,i,n,r,a){var _yield$Ms,s,_ref109,_ref109$feather,l,_e49,_t32,_o33,_i25,_e50,_n25;return _regeneratorRuntime().wrap(function _callee43$(_context44){while(1)switch(_context44.prev=_context44.next){case 0: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);_context44.next=3;return Ms(i,{imageReader:pl(),imageWriter:$l({format:"canvas",targetSize:_objectSpread2(_objectSpread2({},r),{},{upscale:!0}),imageDataResizer:e,canvasMemoryLimit:t}),imageCrop:n});case 3:_yield$Ms=_context44.sent;s=_yield$Ms.dest;_ref109=a||{};_ref109$feather=_ref109.feather;l=_ref109$feather===void 0?0:_ref109$feather;if(l>0){_e49=p("canvas");_e49.width=s.width,_e49.height=s.height;_t32=_e49.getContext("2d",{willReadFrequently:!0}),_o33=1/l;_i25=0;for(_i25=0;_i25<l;_i25++){_e50=_i25*_o33;_t32.strokeStyle="rgba(0,0,0,".concat(_e50*_e50,")"),_t32.strokeRect(_i25+.5,_i25+.5,s.width-2*_i25-1,s.height-2*_i25-1);}_t32.fillStyle="#000",_t32.fillRect(_i25,_i25,s.width+.5-2*_i25,s.height+.5-2*_i25);_n25=s.getContext("2d");_n25.globalCompositeOperation="destination-in",_n25.drawImage(_e49,0,0),$(_e49);}o.drawImage(s,r.x,r.y,r.width,r.height),$(s);case 10:case"end":return _context44.stop();}},_callee43);}));return function(_x77,_x78,_x79,_x80,_x81){return _ref108.apply(this,arguments);};}();},Ws=function Ws(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){for(var _len2=arguments.length,e=new Array(_len2),_key2=0;_key2<_len2;_key2++){e[_key2]=arguments[_key2];}return e;};var o=arguments.length>2?arguments[2]:undefined;return/*#__PURE__*/function(){var _ref110=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee44(i,n,r){var a,s;return _regeneratorRuntime().wrap(function _callee44$(_context45){while(1)switch(_context45.prev=_context45.next){case 0:r(io(0,!1));a=!1;_context45.next=4;return e.apply(void 0,_toConsumableArray(t(i,n,function(e){a=!0,r(e);})));case 4:s=_context45.sent;return _context45.abrupt("return",(o&&o(i,s),a||r(io(1,!1)),i));case 6:case"end":return _context45.stop();}},_callee44);}));return function(_x82,_x83,_x84){return _ref110.apply(this,arguments);};}();},Vs=function Vs(){var _ref111=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=_ref111.willRequest,_ref111$srcProp=_ref111.srcProp,t=_ref111$srcProp===void 0?"src":_ref111$srcProp,_ref111$destProp=_ref111.destProp,o=_ref111$destProp===void 0?"dest":_ref111$destProp;return [Ws(po,function(o,i,n){return [o[t],n,_objectSpread2(_objectSpread2({},i),{},{willRequest:e})];},function(e,t){return e[o]=t;}),"any-to-file"];},_s=function _s(){var _ref112=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref112$srcProp=_ref112.srcProp,e=_ref112$srcProp===void 0?"dest":_ref112$srcProp,_ref112$destProp=_ref112.destProp,t=_ref112$destProp===void 0?"dest":_ref112$destProp;return [Ws(/*#__PURE__*/function(){var _ref113=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee45(e){var _t33,o,i;return _regeneratorRuntime().wrap(function _callee45$(_context46){while(1)switch(_context46.prev=_context46.next){case 0:if(!/octet-stream/.test(e.type)){_context46.next=9;break;}console.warn("Pintura: File has unknown mime type \"".concat(e.type,"\", make sure your server sets the correct Content-Type header."));_t33="image";_context46.next=5;return Qt(e);case 5:o=_context46.sent;/video/i.test(o.nodeName)&&(_t33="video");i={type:_t33+"/unknown"};return _context46.abrupt("return",_t(e)?new File([e],e.name,_objectSpread2(_objectSpread2({},i),{},{lastModified:e.lastModified})):new Blob([e],i));case 9:return _context46.abrupt("return",e);case 10:case"end":return _context46.stop();}},_callee45);}));return function(_x85){return _ref113.apply(this,arguments);};}(),function(t){return [t[e]];},function(e,o){return e[t]=o;}),"any-to-file"];},Ns=function Ns(){var _ref114=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref114$srcProp=_ref114.srcProp,e=_ref114$srcProp===void 0?"src":_ref114$srcProp,_ref114$destProp=_ref114.destProp,t=_ref114$destProp===void 0?"size":_ref114$destProp;return [Ws(to,function(t){return [t[e]];},function(e,o){return e[t]=o;}),"read-image-size"];},Hs=/*#__PURE__*/function(){var _ref115=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee46(e){var t;return _regeneratorRuntime().wrap(function _callee46$(_context47){while(1)switch(_context47.prev=_context47.next){case 0:_context47.next=2;return Qt(e);case 2:t=_context47.sent;if(!eo(t)){_context47.next=7;break;}_context47.next=6;return function(e){return new Promise(function(t,o){var i=function i(){Es(e).then(function(){t(e.duration);});};if(e.readyState>=1)return i();e.onloadedmetadata=i,e.onerror=function(){return o(e.error);};});}(t);case 6:return _context47.abrupt("return",_context47.sent);case 7:case"end":return _context47.stop();}},_callee46);}));return function Hs(_x86){return _ref115.apply(this,arguments);};}(),js=function js(){var _ref116=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref116$srcProp=_ref116.srcProp,e=_ref116$srcProp===void 0?"src":_ref116$srcProp,_ref116$destProp=_ref116.destProp,t=_ref116$destProp===void 0?"duration":_ref116$destProp;return [Ws(Hs,function(t){return [t[e]];},function(e,o){return e[t]=o;}),"read-media-duration"];},Us=function Us(){var _ref117=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref117$srcSize=_ref117.srcSize,e=_ref117$srcSize===void 0?"size":_ref117$srcSize,_ref117$srcOrientatio=_ref117.srcOrientation,t=_ref117$srcOrientatio===void 0?"orientation":_ref117$srcOrientatio,_ref117$destSize=_ref117.destSize,o=_ref117$destSize===void 0?"size":_ref117$destSize;return [Ws(yo,function(o){return [o[e],o[t]];},function(e,t){return e[o]=t;}),"image-size-match-orientation"];},Gs=function Gs(){var _ref118=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref118$srcProp=_ref118.srcProp,e=_ref118$srcProp===void 0?"src":_ref118$srcProp,_ref118$destProp=_ref118.destProp,t=_ref118$destProp===void 0?"head":_ref118$destProp;return [Ws(function(e,t){return bo(e)?a(e,t):void 0;},function(t){return [t[e],[0,262144],onprogress];},function(e,o){return e[t]=o;}),"read-image-head"];},Zs=function Zs(){var _ref119=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref119$srcProp=_ref119.srcProp,e=_ref119$srcProp===void 0?"head":_ref119$srcProp,_ref119$destProp=_ref119.destProp,t=_ref119$destProp===void 0?"orientation":_ref119$destProp;return [Ws(o,function(t){return [t[e],274];},function(e){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return e[t]=o;}),"read-exif-orientation-tag"];},Xs=function Xs(){var _ref120=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref120$srcProp=_ref120.srcProp,e=_ref120$srcProp===void 0?"head":_ref120$srcProp;return [Ws(o,function(t){return [t[e],274,1];}),"clear-exif-orientation-tag"];},Ys=function Ys(){var _ref121=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref121$srcImageSize=_ref121.srcImageSize,e=_ref121$srcImageSize===void 0?"size":_ref121$srcImageSize,_ref121$srcCanvasSize=_ref121.srcCanvasSize,t=_ref121$srcCanvasSize===void 0?"imageData":_ref121$srcCanvasSize,_ref121$srcImageState=_ref121.srcImageState,o=_ref121$srcImageState===void 0?"imageState":_ref121$srcImageState,_ref121$destImageSize=_ref121.destImageSize,i=_ref121$destImageSize===void 0?"size":_ref121$destImageSize,_ref121$destScalar=_ref121.destScalar,n=_ref121$destScalar===void 0?"scalar":_ref121$destScalar;return [Ws(function(e,t){return [Math.min(t.width/e.width,t.height/e.height),De(t)];},function(i){return [i[e],i[t],i[o]];},function(e,_ref122){var _ref123=_slicedToArray(_ref122,2),t=_ref123[0],o=_ref123[1];e[n]=t,e[i]=o;}),"calculate-canvas-scalar"];},qs=function qs(){var _ref124=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref124$srcProp=_ref124.srcProp,e=_ref124$srcProp===void 0?"src":_ref124$srcProp,_ref124$destProp=_ref124.destProp,t=_ref124$destProp===void 0?"imageData":_ref124$destProp,o=_ref124.canvasMemoryLimit,_ref124$srcImageState=_ref124.srcImageState,i=_ref124$srcImageState===void 0?"imageState":_ref124$srcImageState;return [Ws(function(e,t,o){return Os(e)?Ds(e,o.currentTime):O(e,t);},function(t){return [t[e],o,t[i]];},function(e,o){return e[t]=o;}),"blob-to-image-data"];},Ks=function Ks(){var _ref125=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref125$srcImageData=_ref125.srcImageData,e=_ref125$srcImageData===void 0?"imageData":_ref125$srcImageData,_ref125$srcOrientatio=_ref125.srcOrientation,t=_ref125$srcOrientatio===void 0?"orientation":_ref125$srcOrientatio;return [Ws(w,function(o){return [o[e],o[t]];},function(e,t){return e.imageData=t;}),"image-data-match-orientation"];},Js=function Js(){var _ref126=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref126$srcImageData=_ref126.srcImageData,e=_ref126$srcImageData===void 0?"imageData":_ref126$srcImageData,_ref126$srcImageState=_ref126.srcImageState,t=_ref126$srcImageState===void 0?"imageState":_ref126$srcImageState;return [Ws(Xn,function(o){return [o[e],{backgroundColor:o[t].backgroundColor,backgroundImage:o[t].backgroundImage}];},function(e,t){return e.imageData=t;}),"image-data-fill"];},Qs=function Qs(){var _ref127=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref127$srcImageData=_ref127.srcImageData,e=_ref127$srcImageData===void 0?"imageData":_ref127$srcImageData,_ref127$srcImageState=_ref127.srcImageState,t=_ref127$srcImageState===void 0?"imageState":_ref127$srcImageState,_ref127$destScalar=_ref127.destScalar,o=_ref127$destScalar===void 0?"scalar":_ref127$destScalar;return [Ws(So,function(i){var n=i[o];var r=i[t].crop;return r&&1!==n&&(r=ct(Je(r),n,ue())),[i[e],{crop:r,rotation:i[t].rotation,flipX:i[t].flipX,flipY:i[t].flipY}];},function(e,t){return e.imageData=t;}),"image-data-crop"];},el=function el(_ref128){var _ref128$targetSize=_ref128.targetSize,e=_ref128$targetSize===void 0?{width:void 0,height:void 0,fit:void 0,upscale:void 0}:_ref128$targetSize,t=_ref128.imageDataResizer,_ref128$srcProp=_ref128.srcProp,o=_ref128$srcProp===void 0?"imageData":_ref128$srcProp,_ref128$srcImageState=_ref128.srcImageState,i=_ref128$srcImageState===void 0?"imageState":_ref128$srcImageState,_ref128$destImageScal=_ref128.destImageScaledSize,n=_ref128$destImageScal===void 0?"imageScaledSize":_ref128$destImageScal;return [Ws(To,function(n){var 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;},function(e,t){_e(e.imageData,t)||(e[n]=De(t)),e.imageData=t;}),"image-data-resize"];},tl=function tl(){var _ref129=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref129$srcImageData=_ref129.srcImageData,e=_ref129$srcImageData===void 0?"imageData":_ref129$srcImageData,_ref129$srcImageState=_ref129.srcImageState,t=_ref129$srcImageState===void 0?"imageState":_ref129$srcImageState,_ref129$destImageData=_ref129.destImageData,o=_ref129$destImageData===void 0?"imageData":_ref129$destImageData;return [Ws(Ao,function(o){var i=o[t].colorMatrix,n=i&&Object.keys(i).map(function(e){return i[e];}).filter(Boolean);return [o[e],{colorMatrix:n&&Yn(n),convolutionMatrix:o[t].convolutionMatrix,gamma:o[t].gamma,noise:o[t].noise,vignette:o[t].vignette}];},function(e,t){return e[o]=t;}),"image-data-filter"];},ol=function ol(){var _ref130=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref130$srcImageData=_ref130.srcImageData,e=_ref130$srcImageData===void 0?"imageData":_ref130$srcImageData,_ref130$srcImageState=_ref130.srcImageState,t=_ref130$srcImageState===void 0?"imageState":_ref130$srcImageState,_ref130$destImageData=_ref130.destImageData,o=_ref130$destImageData===void 0?"imageData":_ref130$destImageData,_ref130$destScalar=_ref130.destScalar,i=_ref130$destScalar===void 0?"scalar":_ref130$destScalar;return [Ws(/*#__PURE__*/function(){var _ref131=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee47(e,t,o,i,n,r){var a,_n26,s,l,_t34,c,d;return _regeneratorRuntime().wrap(function _callee47$(_context48){while(1)switch(_context48.prev=_context48.next){case 0:if(!(!t||!i.length)){_context48.next=2;break;}return _context48.abrupt("return",e);case 2:_context48.prev=2;_n26={dataSizeScalar:qn(e,i)};o&&o[3]>0&&(_n26.backgroundColor=_toConsumableArray(o));_context48.next=7;return t(e,_n26);case 7:a=_context48.sent;_context48.next=12;break;case 10:_context48.prev=10;_context48.t0=_context48["catch"](2);case 12:s=p("canvas");s.width=e.width,s.height=e.height;l=s.getContext("2d",{willReadFrequently:!0});if(l.putImageData(e,0,0),"auto"===r){_t34=Math.sqrt(e.width*e.height);l.filter="blur(".concat(Math.round(_t34/100),"px)");}c=new Path2D();i.forEach(function(e){var t=at(e.x,e.y,e.width,e.height);ht(t,n);var o=ft(Je(t),e.rotation),i=new Path2D();o.forEach(function(e,t){if(0===t)return i.moveTo(e.x,e.y);i.lineTo(e.x,e.y);}),c.addPath(i);}),l.clip(c,"nonzero"),l.imageSmoothingEnabled=!1,l.drawImage(a,0,0,s.width,s.height),$(a);d=l.getImageData(0,0,s.width,s.height);return _context48.abrupt("return",($(s),d));case 20:case"end":return _context48.stop();}},_callee47,null,[[2,10]]);}));return function(_x87,_x88,_x89,_x90,_x91,_x92){return _ref131.apply(this,arguments);};}(),function(o,_ref132){var n=_ref132.imageScrambler,r=_ref132.redactionRenderStyle;return [o[e],n,o[t].backgroundColor,o[t].redaction,o[i],r];},function(e,t){return e[o]=t;}),"image-data-redact"];},il=function il(){var _ref133=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref133$srcImageData=_ref133.srcImageData,e=_ref133$srcImageData===void 0?"imageData":_ref133$srcImageData,_ref133$srcSize=_ref133.srcSize,t=_ref133$srcSize===void 0?"size":_ref133$srcSize,_ref133$srcImageState=_ref133.srcImageState,o=_ref133$srcImageState===void 0?"imageState":_ref133$srcImageState,_ref133$srcShapes=_ref133.srcShapes,i=_ref133$srcShapes===void 0?"annotation":_ref133$srcShapes,_ref133$destImageData=_ref133.destImageData,n=_ref133$destImageData===void 0?"imageData":_ref133$destImageData,_ref133$destImageScal=_ref133.destImageScaledSize,r=_ref133$destImageScal===void 0?"imageScaledSize":_ref133$destImageScal,_ref133$destScalar=_ref133.destScalar,a=_ref133$destScalar===void 0?"scalar":_ref133$destScalar,s=_ref133.imageDataResizer,l=_ref133.canvasMemoryLimit,_ref133$shapeFilter=_ref133.shapeFilter,c=_ref133$shapeFilter===void 0?Z:_ref133$shapeFilter,_ref133$shapeClip=_ref133.shapeClip,d=_ref133$shapeClip===void 0?!0:_ref133$shapeClip,_ref133$destImageCont=_ref133.destImageContext,u=_ref133$destImageCont===void 0?"imageContext":_ref133$destImageCont;return [Ws(Zn,function(n,_ref134){var h=_ref134.shapePreprocessor,p=_ref134.willRequestResource,m=_ref134.csp,$=_ref134.willRequest;var g=n[o][i].filter(c);if(!g.length)return [n[e]];var f=n[a],y=n[o].crop,b=n[t];var x=f;var v=n[r];v&&(x=Math.min(v.width/y.width,v.height/y.height));var w={width:b.width/f,height:b.height/f};return [n[e],{shapes:g,computeShape:function computeShape(e){return e=gn(e,w),e=Ps(e,["left","right","top","bottom"]),e=kn(e,x);},transform:function transform(e){var i=n[t],_n$o=n[o],_n$o$rotation=_n$o.rotation,s=_n$o$rotation===void 0?0:_n$o$rotation,l=_n$o.flipX,c=_n$o.flipY,h=_n$o.cropLimitToImage,p=n[a],_n$o$crop=n[o].crop,m=_n$o$crop===void 0?et(i):_n$o$crop,$=n[r],g=$?Math.min($.width/m.width,$.height/m.height):1,f={width:i.width/p*g,height:i.height/p*g},y=Wt(f,s),b=y.width,x=y.height,v=.5*f.width-.5*b,w=.5*f.height-.5*x,S=He(f);e.translate(-v,-w),e.translate(-m.x*g,-m.y*g),e.translate(S.x,S.y),e.rotate(s),e.translate(-S.x,-S.y);var k=n[u]||{x:0,y:0};e.translate(k.x,k.y),e.scale(l?-1:1,c?-1:1),e.translate(l?-f.width*p:0,c?-f.height*p:0),h&&d&&(e.rect(0,0,f.width,f.height),e.clip());},drawImage:Bs({imageDataResizer:s,canvasMemoryLimit:l}),preprocessShape:function preprocessShape(e){return h(e,_objectSpread2({isPreview:!1},n[o]));},canvasMemoryLimit:l,willRequest:$||p,styleNonce:m.styleNonce}];},function(e,t){return e[n]=t;}),"image-data-annotate"];},nl=function nl(){var _ref135=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref135$srcImageData=_ref135.srcImageData,e=_ref135$srcImageData===void 0?"imageData":_ref135$srcImageData,_ref135$srcImageState=_ref135.srcImageState,t=_ref135$srcImageState===void 0?"imageState":_ref135$srcImageState,_ref135$destImageData=_ref135.destImageData,o=_ref135$destImageData===void 0?"imageData":_ref135$destImageData,_ref135$destImageScal=_ref135.destImageScaledSize,i=_ref135$destImageScal===void 0?"imageScaledSize":_ref135$destImageScal,n=_ref135.imageDataResizer,r=_ref135.canvasMemoryLimit,_ref135$destScalar=_ref135.destScalar,a=_ref135$destScalar===void 0?"scalar":_ref135$destScalar,_ref135$shapeFilter=_ref135.shapeFilter,s=_ref135$shapeFilter===void 0?Z:_ref135$shapeFilter,_ref135$destImageCont=_ref135.destImageContext,l=_ref135$destImageCont===void 0?"imageContext":_ref135$destImageCont;return [Ws(Zn,function(o,_ref136){var c=_ref136.shapePreprocessor,d=_ref136.willRequestResource,u=_ref136.willRequest,h=_ref136.csp;var p=o[t].decoration.filter(s);if("undefined"!=typeof window&&function(e){if(e&&e._4pf3wm7)return;var _map=[[85,110,108,105,99,101,110,115,101,100,32,80,105,110,116,117,114,97,32,105,110,115,116,97,110,99,101,32]].map(function(e){return e.map(function(e){return String.fromCharCode(e);}).join("");}),_map2=_slicedToArray(_map,1),i=_map2[0],_o$t$crop=o[t].crop,n=_o$t$crop.width,r=_o$t$crop.height,a=r/15;p=[].concat(_toConsumableArray(p),[{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),!p.length)return [o[e]];var m=o[a];var $=o[t].crop,g=o[i];if(g){var _e51=Math.min(g.width/$.width,g.height/$.height);m=_e51;}return [o[e],{shapes:p,drawImage:Bs({imageDataResizer:n,canvasMemoryLimit:r}),computeShape:function computeShape(e){return e=gn(e,$),e=Ps(e,["left","right","top","bottom"]),e=kn(e,m);},preprocessShape:function preprocessShape(e){return c(e,_objectSpread2({isPreview:!1},o[t]));},canvasMemoryLimit:r,willRequest:u||d,styleNonce:h.styleNonce,transform:function transform(e){var t=o[l]||{x:0,y:0};e.translate(t.x,t.y);}}];},function(e,t){return e[o]=t;}),"image-data-decorate"];},rl=function rl(){var _ref137=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref137$srcImageData=_ref137.srcImageData,e=_ref137$srcImageData===void 0?"imageData":_ref137$srcImageData,_ref137$srcImageState=_ref137.srcImageState,t=_ref137$srcImageState===void 0?"imageState":_ref137$srcImageState,_ref137$destImageData=_ref137.destImageData,o=_ref137$destImageData===void 0?"imageData":_ref137$destImageData,_ref137$destImageScal=_ref137.destImageScaledSize,i=_ref137$destImageScal===void 0?"imageScaledSize":_ref137$destImageScal,n=_ref137.imageDataResizer,r=_ref137.canvasMemoryLimit,_ref137$destScalar=_ref137.destScalar,a=_ref137$destScalar===void 0?"scalar":_ref137$destScalar,_ref137$destImageCont=_ref137.destImageContext,s=_ref137$destImageCont===void 0?"imageContext":_ref137$destImageCont;return [Ws(function(e,t){return new Promise(function(o){if(!t)return o([e]);Zn(e,t).then(function(e){o([e,t.contextBounds]);});});},function(o,_ref138){var s=_ref138.shapePreprocessor,l=_ref138.willRequestResource,c=_ref138.willRequest,d=_ref138.csp;var u=o[t].frame;if(!u)return [o[e]];var h=o[a];var p=o[t].crop;p&&1!==h&&(p=ct(Je(p),h,ue()));var m=_objectSpread2({},p),$=vn(wn(u,m,s),m);m.x=Math.abs($.left),m.y=Math.abs($.top),m.width+=Math.abs($.left)+Math.abs($.right),m.height+=Math.abs($.top)+Math.abs($.bottom);var g=o[i],f=g?Math.min(g.width/p.width,g.height/p.height):1;return ht(m,f),m.x=Math.floor(m.x),m.y=Math.floor(m.y),m.width=Math.floor(m.width),m.height=Math.floor(m.height),[o[e],{shapes:[u],contextBounds:m,computeShape:function computeShape(t){return gn(t,o[e]);},transform:function transform(e){e.translate(m.x,m.y);},drawImage:Bs({imageDataResizer:n,canvasMemoryLimit:r}),preprocessShape:function preprocessShape(e){return s(e,_objectSpread2({isPreview:!1},o[t]));},canvasMemoryLimit:r,willRequest:c||l,styleNonce:d.styleNonce}];},function(e,_ref139){var _ref140=_slicedToArray(_ref139,2),t=_ref140[0],i=_ref140[1];e[s]=i,e[o]=t;}),"image-data-frame"];},al=function al(){var _ref141=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=_ref141.mimeType,t=_ref141.quality,_ref141$srcImageData=_ref141.srcImageData,o=_ref141$srcImageData===void 0?"imageData":_ref141$srcImageData,_ref141$srcFile=_ref141.srcFile,i=_ref141$srcFile===void 0?"src":_ref141$srcFile,_ref141$destBlob=_ref141.destBlob,n=_ref141$destBlob===void 0?"blob":_ref141$destBlob;return [Ws(W,function(n){return [n[o],e||j(n[i].name)||n[i].type,t];},function(e,t){return e[n]=t;}),"image-data-to-blob"];},sl=function sl(){var _ref142=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},_ref142$srcImageData=_ref142.srcImageData,e=_ref142$srcImageData===void 0?"imageData":_ref142$srcImageData,_ref142$srcOrientatio=_ref142.srcOrientation,t=_ref142$srcOrientatio===void 0?"orientation":_ref142$srcOrientatio,_ref142$destCanvas=_ref142.destCanvas,o=_ref142$destCanvas===void 0?"dest":_ref142$destCanvas;return [Ws(v,function(o){return [o[e],o[t]];},function(e,t){return e[o]=t;}),"image-data-to-canvas"];},ll=/*#__PURE__*/function(){var _ref143=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee48(e,o){var i,n,r;return _regeneratorRuntime().wrap(function _callee48$(_context49){while(1)switch(_context49.prev=_context49.next){case 0:if(!(!bo(e)||!o)){_context49.next=2;break;}return _context49.abrupt("return",e);case 2:i=new DataView(o),n=t(i);if(!(!n||!n.exif)){_context49.next=5;break;}return _context49.abrupt("return",e);case 5:r=["exif","mpf","xmp"].reduce(function(e,t){return n[t]?Math.max(e,n[t].offset+n[t].size):e;},0);return _context49.abrupt("return",function(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[0,e.size];return t?new Blob([t,e.slice.apply(e,_toConsumableArray(o))],{type:e.type}):e;}(e,o.slice(0,r+2),[20]));case 7:case"end":return _context49.stop();}},_callee48);}));return function ll(_x93,_x94){return _ref143.apply(this,arguments);};}(),cl=function cl(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"blob";var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"head";var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"blob";return [Ws(ll,function(o){return [o[e],o[t]];},function(e,t){return e[o]=t;}),"blob-write-image-head"];},dl=function dl(){var _ref144=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},e=_ref144.renameFile,_ref144$srcBlob=_ref144.srcBlob,t=_ref144$srcBlob===void 0?"blob":_ref144$srcBlob,_ref144$srcFile=_ref144.srcFile,o=_ref144$srcFile===void 0?"src":_ref144$srcFile,_ref144$destFile=_ref144.destFile,i=_ref144$destFile===void 0?"dest":_ref144$destFile,n=_ref144.defaultFilename;return [Ws(U,function(i){return [i[t],e?e(i[o]):i[o].name||"".concat(n,".").concat(_(i[t].type))];},function(e,t){return e[i]=t;}),"blob-to-file"];},ul=function ul(_ref145){var _ref145$url=_ref145.url,e=_ref145$url===void 0?"./":_ref145$url,_ref145$dataset=_ref145.dataset,t=_ref145$dataset===void 0?function(e){return [["dest",e.dest,e.dest.name],["imageState",e.imageState]];}:_ref145$dataset,_ref145$destStore=_ref145.destStore,o=_ref145$destStore===void 0?"store":_ref145$destStore,i=_ref145.credentials,_ref145$headers=_ref145.headers,r=_ref145$headers===void 0?{}:_ref145$headers;return [Ws(/*#__PURE__*/function(){var _ref146=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee49(t,o){return _regeneratorRuntime().wrap(function _callee49$(_context50){while(1)switch(_context50.prev=_context50.next){case 0:_context50.next=2;return function(e,t,o){return new Promise(function(i,r){var _o$token=o.token,a=_o$token===void 0?{}:_o$token,_o$beforeSend=o.beforeSend,s=_o$beforeSend===void 0?n:_o$beforeSend,_o$onprogress=o.onprogress,l=_o$onprogress===void 0?n:_o$onprogress;a.cancel=function(){return c.abort();};var c=new XMLHttpRequest();c.upload.onprogress=l,c.onload=function(){return c.status>=200&&c.status<300?i(c):r(c);},c.onerror=function(){return r(c);},c.ontimeout=function(){return r(c);},c.open("POST",encodeURI(e)),s(c),c.send(t instanceof FormData?t:t.reduce(function(e,t){return e.append.apply(e,_toConsumableArray(t.map(xo))),e;},new FormData()));});}(e,t,{onprogress:o,beforeSend:function beforeSend(e){return lo(e,{headers:r,credentials:i});}});case 2:return _context50.abrupt("return",_context50.sent);case 3:case"end":return _context50.stop();}},_callee49);}));return function(_x95,_x96){return _ref146.apply(this,arguments);};}(),function(e,o,i){return [t(e),i];},function(e,t){return e[o]=t;}),"store"];},hl=function hl(e){return [Ws(function(t){return e&&e.length?(Object.keys(t).forEach(function(o){e.includes(o)||delete t[o];}),t):t;}),"prop-filter"];},pl=function pl(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _e$orientImage=e.orientImage,t=_e$orientImage===void 0?!0:_e$orientImage,_e$outputProps=e.outputProps,o=_e$outputProps===void 0?["src","dest","size","duration"]:_e$outputProps,i=e.preprocessImageFile,_e$request=e.request,n=_e$request===void 0?{}:_e$request;return [Vs({willRequest:function willRequest(){return n;}}),_s(),i&&[Ws(i,function(e,t,o){return [e.dest,t,o];},function(e,t){return e.dest=t;}),"preprocess-image-file"],Ns({srcProp:"dest"}),js({srcProp:"dest"}),t&&Gs({srcProp:"dest"}),t&&Zs(),t&&Us(),hl(o)].filter(Boolean);},ml=function ml(e){return e&&(T(e)?ul({url:e}):M(e)?[e,"store"]:ul(e));},$l=function $l(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(t,o){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _e$i=_objectSpread2(_objectSpread2({},e),i),_e$i$canvasMemoryLimi=_e$i.canvasMemoryLimit,n=_e$i$canvasMemoryLimi===void 0?Rs():_e$i$canvasMemoryLimi,_e$i$orientImage=_e$i.orientImage,r=_e$i$orientImage===void 0?!0:_e$i$orientImage,_e$i$copyImageHead=_e$i.copyImageHead,a=_e$i$copyImageHead===void 0?!0:_e$i$copyImageHead,s=_e$i.mimeType,l=_e$i.quality,c=_e$i.renameFile,d=_e$i.targetSize,u=_e$i.imageDataResizer,h=_e$i.store,_e$i$format=_e$i.format,p=_e$i$format===void 0?"file":_e$i$format,_e$i$outputProps=_e$i.outputProps,m=_e$i$outputProps===void 0?["src","dest","imageState","store"]:_e$i$outputProps,$=_e$i.preprocessImageSource,g=_e$i.preprocessImageState,f=_e$i.postprocessImageData,y=_e$i.postprocessImageBlob,_e$i$testSrcSupport=_e$i.testSrcSupport,b=_e$i$testSrcSupport===void 0?!1:_e$i$testSrcSupport;if(!b||Jt(t))return "blob"===p&&(p="file"),[$&&[Ws($,function(e,t,o){return [e.src,t,o,e.imageState];},function(e,t){return e.src=t;}),"preprocess-image-source"],(r||a)&&Gs(),r&&Zs(),Ns(),g&&[Ws(g,function(e,t,o,i){return [e.imageState,t,o,{size:e.size,orientation:e.orientation}];},function(e,t){return e.imageState=t;}),"preprocess-image-state"],qs({canvasMemoryLimit:n}),r&&Us(),r&&Ks(),Ys(),ol(),Qs(),el({imageDataResizer:u,targetSize:d}),il({imageDataResizer:u,canvasMemoryLimit:n,srcShapes:"manipulation"}),tl(),Js(),il({imageDataResizer:u,canvasMemoryLimit:n,srcShapes:"annotation",shapeFilter:function shapeFilter(e){return !e.aboveFrame;}}),nl({imageDataResizer:u,canvasMemoryLimit:n,shapeFilter:function shapeFilter(e){return !e.aboveFrame;}}),rl({imageDataResizer:u,canvasMemoryLimit:n}),il({imageDataResizer:u,canvasMemoryLimit:n,srcShapes:"annotation",shapeFilter:function shapeFilter(e){return e.aboveFrame;},shapeClip:!1}),nl({imageDataResizer:u,canvasMemoryLimit:n,shapeFilter:function shapeFilter(e){return e.aboveFrame;}}),f&&[Ws(f,function(e,t,o){return [e.imageData,t,o];},function(e,t){return e.imageData=t;}),"postprocess-image-data"],"file"===p?al({mimeType:s,quality:l}):"canvas"===p?sl():[function(e){return e.dest=e.imageData,e;}],"file"===p&&r&&Xs(),"file"===p&&a&&cl(),y&&[Ws(y,function(_ref147,i,n){var e=_ref147.blob,t=_ref147.imageData,o=_ref147.src;return [{blob:e,imageData:t,src:o},i,n];},function(e,t){return e.blob=t;}),"postprocess-image-file"],"file"===p&&dl({defaultFilename:"image",renameFile:c}),"file"===p?ml(h):M(h)&&[h,"store"],hl(m)].filter(Boolean);};};var gl=function gl(e,t,o,i,n,r,a,s,l,c,d){if(!(e&&t&&o&&i&&s))return;s*=r;var u=Tt(Je(t)),h=st(u),p=st(e),m=et(o),$=st(m),g=ss(o,i,l),f=st(g),y=Se(me($),f),b=Se(me(p),h);y.x+=b.x,y.y+=b.y;var x=$e(me(y));x.x+=b.x,x.y+=b.y;var v=st(lt(lt(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};};var fl=null;var yl=function yl(){if(null===fl)if("WebGL2RenderingContext"in window){var _e52;try{_e52=p("canvas"),fl=!!_e52.getContext("webgl2");}catch(e){fl=!1;}_e52&&$(_e52),_e52=void 0;}else fl=!1;return fl;},bl=function bl(e){return 0==(e&e-1);},xl=function xl(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"";var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"";return Object.keys(t).filter(function(e){return !S(t[e]);}).reduce(function(e,n){return e.replace(new RegExp(o+n+i),t[n]);},e);};var vl={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);"},wl={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(uRepeat.y,vTexCoord.y))*step(0.0,vTexCoord.y)*(1.0-step(uRepeat.x,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;",rectaa:"\nvec2 scaledPoint=vec2(vRectCoord.x*uSize.x,vRectCoord.y*uSize.y);a*=smoothstep(0.0,uEdgeFeather,uSize.x-scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,uSize.y-scaledPoint.y);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.x);a*=smoothstep(0.0,uEdgeFeather,scaledPoint.y);",cornerradius:"\nvec2 s=(uSize-2.0)*.5;vec2 r=(vRectCoord*uSize)-1.0;vec2 p=r-s;float cornerRadius=uCornerRadius[0];bool left=r.x<s.x;bool top=r.y<s.y;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));"},Sl=function Sl(e,t,o){var i=e.createShader(o),n=function(e,t,o){return t=xl(t,o===e.VERTEX_SHADER?vl:wl,"##").trim(),yl()?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;},kl=function kl(e,t,o,i,n){var r=Sl(e,t,e.VERTEX_SHADER),a=Sl(e,o,e.FRAGMENT_SHADER),s=e.createProgram();e.attachShader(s,r),e.attachShader(s,a),e.linkProgram(s);var l={};return i.forEach(function(t){l[t]=e.getAttribLocation(s,t);}),n.forEach(function(t){l[t]=e.getUniformLocation(s,t);}),{program:s,locations:l,destroy:function destroy(){e.detachShader(s,r),e.detachShader(s,a),e.deleteShader(r),e.deleteShader(a),e.deleteProgram(s);}};},Cl=function Cl(e){return "VIDEO"!==e.nodeName&&(!!yl()||bl(e.width)&&bl(e.height));},Tl=function Tl(e,t,o,i){return e.bindTexture(e.TEXTURE_2D,t),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,o),function(e,t,o){e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,Cl(t)?e.LINEAR_MIPMAP_LINEAR:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o.filterParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,o.wrapParam),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,o.wrapParam),Cl(t)&&e.generateMipmap(e.TEXTURE_2D);}(e,o,i),e.bindTexture(e.TEXTURE_2D,null),t;},Ml=function Ml(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return e?[e[0],e[1],e[2],Lo(e[3])?t*e[3]:t]:[0,0,0,0];},Rl=function Rl(){var e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e;},Pl=function Pl(e,t,o,i,n,r,a){var 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;},El=function El(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];},Il=function Il(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;},Al=function Al(e,t){var 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;},Ll=function Ll(e,t){var 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;},zl=function zl(e,t){var 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 Fl=function Fl(e){return e*Math.PI/180;},Dl=function Dl(e,t){return yl()?e.getContext("webgl2",t):e.getContext("webgl",t)||e.getContext("experimental-webgl",t);};var Ol=function Ol(e,t){var o=e.length;return t>=o?e[t%o]:t<0?e[t%o+o]:e[t];},Bl=function Bl(e,t,o,i){var n=he(o.x-t.x,o.y-t.y),r=he(i.x-o.x,i.y-o.y),a=he(t.x-i.x,t.y-i.y),s=he(e.x-t.x,e.y-t.y),l=he(e.x-o.x,e.y-o.y),c=he(e.x-i.x,e.y-i.y),d=Me(n,s),u=Me(r,l),h=Me(a,c);return d<=0&&u<=0&&h<=0;},Wl=function Wl(e){if(e.length<3)return [];if(function(e){var t=e.length;for(var _o35=0;_o35<t;_o35++){var _t35=Ze(e[_o35],Ol(e,_o35+1));if(Et(_t35,e,{ignoreIdenticalLines:!0,breakOnIntersection:!0}))return !0;}return !1;}(e))return [];(function(e){var t,o,i,n,r,a=0;var 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();var t=e.length,o=_toConsumableArray(Array(t).keys()),i=[];var n,r,a,s,l,c,d,u,h,p,m,$,g=1024;for(;o.length>3;){if(g<=0)return [];for(g--,n=0;n<o.length;n++)if(a=o[n],s=Ol(o,n-1),l=Ol(o,n+1),c=e[a],d=e[s],u=e[l],h=he(d.x-c.x,d.y-c.y),p=he(u.x-c.x,u.y-c.y),!(Me(h,p)<0)){for(m=!0,r=0;r<t;r++)if(r!==a&&r!==s&&r!==l&&($=e[r],Bl($,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;},Vl=function Vl(e,t,o,i,n){var r=ye(he(i.x-o.x,i.y-o.y)),a=ye(he(n.x-i.x,n.y-i.y)),s=ye(he(r.x+a.x,r.y+a.y)),l=he(-s.y,s.x),c=he(-r.y,r.x),d=Math.min(1/Te(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;},_l=function _l(e){var 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;},Nl=function Nl(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var o=arguments.length>2?arguments[2]:undefined;var i=arguments.length>3?arguments[3]:undefined;var n=St(e),r=e.x+.5*e.width,a=e.y+.5*e.height;return (o||i)&&Ae(n,o,i,r,a),0!==t&&Le(n,t,r,a),n;},Hl=function Hl(e,t,o,i,n){var r=Math.min(20,Math.max(4,Math.round(i/2)));var a=0,s=0,l=0,c=0,d=0;for(;d<r;d++)a=d/r,s=n*Y+a*Y,l=i*Math.cos(s),c=i*Math.sin(s),e.push(he(t+l,o+c));};var jl=null;var Ul=function Ul(){if(null!==jl)return jl;var e=p("canvas");var t=Dl(e);return jl=t?t.getParameter(t.MAX_TEXTURE_SIZE):void 0,$(e),e=void 0,jl;},Gl=function Gl(){return c()&&!!window.chrome;};var Zl=new Float32Array([0,1,0,0,1,1,1,0]),Xl=new Float32Array([1,0,0,0,1,1,0,1]),Yl=c()&&F(),ql=[0,0,0,0,1,0,0,0,0],Kl=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],Jl=[0,0,0,0],Ql=[0,0,0,0],ec=function ec(e,t,o,i,n){if(!o||!i)return Zl;var r=i.x/o.width,a=i.y/o.height,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 tc=function tc(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _t$alpha=t.alpha,o=_t$alpha===void 0?!1:_t$alpha,i={width:0,height:0},n={width:0,height:0},r=Ul()||1024;var a,s,l;var c=Rl(),d=Rl();var u,h,p,m,g,f,y,b,x,v=0,w=0,S=0,k=1;var C=new Map([]),T=function T(){P.stencilOp(P.KEEP,P.KEEP,P.KEEP),P.stencilFunc(P.ALWAYS,1,255),P.stencilMask(255);},M=Fl(30),R=Math.tan(M/2),P=Dl(e,{alpha:o,antialias:!1,premultipliedAlpha:!0,stencil:!0});if(!P)return;P.getExtension("OES_standard_derivatives"),P.disable(P.DEPTH_TEST),P.enable(P.STENCIL_TEST),P.enable(P.BLEND),P.blendFunc(P.ONE,P.ONE_MINUS_SRC_ALPHA),P.pixelStorei(P.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!(!o&&F())),T();var E=P.createTexture();P.bindTexture(P.TEXTURE_2D,E),P.texImage2D(P.TEXTURE_2D,0,P.RGBA,1,1,0,P.RGBA,P.UNSIGNED_BYTE,new Uint8Array(Jl)),C.set(0,E);var I=P.createTexture();C.set(2,I);var A=P.createFramebuffer(),L=P.createTexture();C.set(1,L);var z=P.createFramebuffer(),D=kl(P,"\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){vec4 res=(c*m)+(o*c.a);res=clamp(res,0.0,1.0);return res;}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 blendPremultipliedAlpha(vec4 back,vec4 front){return front+(back*(1.0-front.a));}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;}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"]),O=P.createBuffer(),B=P.createBuffer();P.bindBuffer(P.ARRAY_BUFFER,B),P.bufferData(P.ARRAY_BUFFER,Zl,P.STATIC_DRAW);var W=P.createBuffer();P.bindBuffer(P.ARRAY_BUFFER,W),P.bufferData(P.ARRAY_BUFFER,Xl,P.STATIC_DRAW);var V=kl(P,"#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"]),_=P.createBuffer();Gl()&&(P.bindBuffer(P.ARRAY_BUFFER,_),P.bufferData(P.ARRAY_BUFFER,1,P.DYNAMIC_DRAW));var N=function N(e,t,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var n=V.program,r=V.locations;P.useProgram(n),P.enableVertexAttribArray(r.aPosition),P.enableVertexAttribArray(r.aNormal),P.enableVertexAttribArray(r.aMiter);var a=function(e,t){var o,i,n,r=0;var 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:he(i.x+(i.x-n.x),i.y+(i.y-n.y))),n||(n=t?l:he(i.x+(i.x-o.x),i.y+(i.y-o.y))),Vl(s,10*r,o,i,n);return t&&Vl(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;P.uniform1f(r.uWidth,t),P.uniform1f(r.uSharpness,l),P.uniform4fv(r.uColor,o),P.uniformMatrix4fv(r.uMatrix,!1,u),P.uniform4f(r.uCanvasColor,v,w,S,k),P.uniform1fv(r.uMaskBounds,y),P.uniform1f(r.uMaskOpacity,f),P.bindBuffer(P.ARRAY_BUFFER,_),P.bufferData(P.ARRAY_BUFFER,a,P.STATIC_DRAW),P.vertexAttribPointer(r.aPosition,2,P.FLOAT,!1,s,0),P.vertexAttribPointer(r.aNormal,2,P.FLOAT,!1,s,c),P.vertexAttribPointer(r.aMiter,1,P.FLOAT,!1,s,d),P.drawArrays(P.TRIANGLE_STRIP,0,a.length/5),P.disableVertexAttribArray(r.aPosition),P.disableVertexAttribArray(r.aNormal),P.disableVertexAttribArray(r.aMiter);},H=kl(P,"\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"]),j=P.createBuffer(),U=kl(P,"\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 vec2 uRepeat;uniform vec4 uColor;uniform float uCornerRadius[4];uniform vec2 uSize;uniform vec2 uPosition;uniform vec4 uCanvasColor;uniform int uInverted;uniform float uEdgeFeather;void main(){\n##init\n##colorize\n##rectaa\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","uRepeat","uPosition","uSize","uMaskBounds","uMaskOpacity","uMaskFeather","uCornerRadius","uInverted","uEdgeFeather"]),Z=P.createBuffer(),X=P.createBuffer(),Y=P.createBuffer(),q=kl(P,"\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 uRepeat;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","uRepeat","uColor","uCanvasColor","uMatrix","uRadius","uInverted","uMaskBounds","uMaskOpacity"]),K=P.createBuffer(),J=P.createBuffer(),Q=new Map(),ee={2:{width:0,height:0},1:{width:0,height:0}},te=function te(e,t,o){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1;var 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);_e(o,ee[e])?P.bindFramebuffer(P.FRAMEBUFFER,t):(P.bindTexture(P.TEXTURE_2D,C.get(e)),P.texImage2D(P.TEXTURE_2D,0,P.RGBA,l,c,0,P.RGBA,P.UNSIGNED_BYTE,null),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_MIN_FILTER,P.LINEAR),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_S,P.CLAMP_TO_EDGE),P.texParameteri(P.TEXTURE_2D,P.TEXTURE_WRAP_T,P.CLAMP_TO_EDGE),P.bindFramebuffer(P.FRAMEBUFFER,t),P.framebufferTexture2D(P.FRAMEBUFFER,P.COLOR_ATTACHMENT0,P.TEXTURE_2D,C.get(e),0),ee[e]=o);var h=o.width*s,p=o.height*s;var m,$;Pl(d,0,h,p,0,-1,1),El(d,0,p,0),$=1,(m=d)[0]*=$,m[1]*=$,m[2]*=$,m[3]*=$,function(e,t){e[4]*=t,e[5]*=t,e[6]*=t,e[7]*=t;}(d,-1),u=d,P.viewport(0,0,l,c),P.colorMask(!0,!0,!0,!0),P.clearColor(0,0,0,0),P.clear(P.COLOR_BUFFER_BIT),x=[1,0,1,0,1,Math.max(i.width,o.width),1,Math.max(i.width,o.width)];},oe=function oe(e,t){var _ref148=t||{},_ref148$forceRelease=_ref148.forceRelease,o=_ref148$forceRelease===void 0?!1:_ref148$forceRelease,_Q$get=Q.get(e),i=_Q$get.src;i instanceof HTMLCanvasElement&&(o||i.dataset.retain||$(i)),Q.delete(e),P.deleteTexture(e);},ie=function ie(e){return Q.get(e).isRotatedVideo;};return {drawPath:function drawPath(e){var n=arguments.length>4?arguments[4]:undefined;var r=arguments.length>5?arguments[5]:undefined;var a=arguments.length>6?arguments[6]:undefined;var l=arguments.length>7?arguments[7]:undefined;var c=arguments.length>8?arguments[8]:undefined;if(e.length<2)return;var d=e.map(function(e){return {x:e.x*s,y:e.y*s};}),h=n*s;if(h>0&&N(d,h,Ml(r,c),a),d.length<3||!l||0===l[3]||!a)return;var p=Wl(d),m=new Float32Array(6*p.length);p.forEach(function(_ref149,i){var _ref150=_slicedToArray(_ref149,3),e=_ref150[0],t=_ref150[1],o=_ref150[2];var 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;}),function(e,t){var o=H.program,i=H.locations;P.useProgram(o),P.enableVertexAttribArray(i.aPosition),P.uniform4fv(i.uColor,t),P.uniformMatrix4fv(i.uMatrix,!1,u),P.uniform1fv(i.uMaskBounds,y),P.uniform1f(i.uMaskOpacity,f),P.uniform4f(i.uCanvasColor,v,w,S,k),P.bindBuffer(P.ARRAY_BUFFER,j),P.bufferData(P.ARRAY_BUFFER,e,P.STATIC_DRAW),P.vertexAttribPointer(i.aPosition,2,P.FLOAT,!1,0,0),P.drawArrays(P.TRIANGLES,0,e.length/2),P.disableVertexAttribArray(i.aPosition);}(m,Ml(l,c));},drawRect:function drawRect(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var n=arguments.length>4?arguments[4]:undefined;var r=arguments.length>5?arguments[5]:undefined;var a=arguments.length>6?arguments[6]:undefined;var l=arguments.length>7?arguments[7]:undefined;var c=arguments.length>8?arguments[8]:undefined;var d=arguments.length>9&&arguments[9]!==undefined?arguments[9]:!1;var h=arguments.length>10?arguments[10]:undefined;var p=arguments.length>11?arguments[11]:undefined;var m=arguments.length>12?arguments[12]:undefined;var $=arguments.length>13?arguments[13]:undefined;var g=arguments.length>14?arguments[14]:undefined;var b=arguments.length>15&&arguments[15]!==undefined?arguments[15]:1/s;var C=arguments.length>16?arguments[16]:undefined;var T=arguments.length>17?arguments[17]:undefined;var M=ht(Je(e),s),R=n.map(function(t){return function(e,t){return Math.floor(ls(e,0,Math.min(.5*(t.width-1),.5*(t.height-1))));}(t||0,e);}).map(function(e){return e*s;});if(r||a){var _e53=Je(M);_e53.x-=.5,_e53.y-=.5,_e53.width+=1,_e53.height+=1;var _n27=Nl(_e53,t,o,i),_p5=_l(_n27);var _m2;C&&(_m2=Ml(C),0===_m2[3]&&(_m2[3]=.001));var _I=l&&d?[_e53.width/l.width,_e53.height/l.height]:[1,1];(function(e,t,o,i,n){var r=arguments.length>5&&arguments[5]!==undefined?arguments[5]:E;var a=arguments.length>6?arguments[6]:undefined;var l=arguments.length>7&&arguments[7]!==undefined?arguments[7]:1;var c=arguments.length>8&&arguments[8]!==undefined?arguments[8]:Jl;var d=arguments.length>9&&arguments[9]!==undefined?arguments[9]:Zl;var h=arguments.length>10&&arguments[10]!==undefined?arguments[10]:x;var p=arguments.length>11&&arguments[11]!==undefined?arguments[11]:1;var m=arguments.length>12?arguments[12]:undefined;var $=U.program,g=U.locations;P.useProgram($),P.enableVertexAttribArray(g.aPosition),P.enableVertexAttribArray(g.aTexCoord),P.enableVertexAttribArray(g.aRectCoord),P.uniform4fv(g.uColor,n),P.uniform2fv(g.uSize,[t,o]),P.uniform2fv(g.uPosition,[e[2],e[3]]),P.uniform2fv(g.uRepeat,a),P.uniform1i(g.uInverted,m?1:0),P.uniform1fv(g.uCornerRadius,i),P.uniform4f(g.uCanvasColor,v,w,S,k),P.uniform1fv(g.uMaskFeather,h.map(function(e,t){return t%2==0?e:e*s;})),P.uniform1fv(g.uMaskBounds,y),P.uniform1f(g.uMaskOpacity,f),P.uniform1f(g.uEdgeFeather,Math.max(0,p)),P.uniformMatrix4fv(g.uMatrix,!1,u),P.uniform1i(g.uTexture,4),P.uniform4fv(g.uTextureColor,c),P.uniform1f(g.uTextureOpacity,l),P.activeTexture(P.TEXTURE0+4),P.bindTexture(P.TEXTURE_2D,r),P.bindBuffer(P.ARRAY_BUFFER,X),P.bufferData(P.ARRAY_BUFFER,d,P.STATIC_DRAW),P.vertexAttribPointer(g.aTexCoord,2,P.FLOAT,!1,0,0),P.bindBuffer(P.ARRAY_BUFFER,Y),P.bufferData(P.ARRAY_BUFFER,Zl,P.STATIC_DRAW),P.vertexAttribPointer(g.aRectCoord,2,P.FLOAT,!1,0,0),P.bindBuffer(P.ARRAY_BUFFER,Z),P.bufferData(P.ARRAY_BUFFER,e,P.STATIC_DRAW),P.vertexAttribPointer(g.aPosition,2,P.FLOAT,!1,0,0),P.drawArrays(P.TRIANGLE_STRIP,0,e.length/2),P.disableVertexAttribArray(g.aPosition),P.disableVertexAttribArray(g.aTexCoord),P.disableVertexAttribArray(g.aRectCoord);})(_p5,_e53.width,_e53.height,R,Ml(r,$),a,_I,$,_m2,h?new Float32Array(h):ec(_e53.width,_e53.height,l,c,s),g,b*s,T);}p&&(p=Math.min(p,M.width,M.height),N(function(e,t,o,i,n,r,a,s){var l=[];if(r.every(function(e){return 0===e;}))l.push(he(e,t),he(e+o,t),he(e+o,t+i),he(e,t+i));else {var _r22=_slicedToArray(r,4),_n28=_r22[0],_a10=_r22[1],_s12=_r22[2],_c5=_r22[3],_d5=e,_u3=e+o,_h3=t,_p6=t+i;l.push(he(_d5+_n28,_h3)),Hl(l,_u3-_a10,_h3+_a10,_a10,-1),l.push(he(_u3,_h3+_a10)),Hl(l,_u3-_c5,_p6-_c5,_c5,0),l.push(he(_u3-_c5,_p6)),Hl(l,_d5+_s12,_p6-_s12,_s12,1),l.push(he(_d5,_p6-_s12)),Hl(l,_d5+_n28,_h3+_n28,_n28,2);}return (a||s)&&Ae(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,R,o,i),p*s,Ml(m,$),!0));},drawEllipse:function drawEllipse(e,t,o,i,n,r,a,l,c,d,h,p,m,$,g){var b=ht(at(e.x-t,e.y-o,2*t,2*o),s);if(a||l){var _e54=Je(b);g||(_e54.x-=.5,_e54.y-=.5,_e54.width+=1,_e54.height+=1);var _t36=Nl(_e54,i,n,r);(function(e,t,o,i){var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:E;var r=arguments.length>5&&arguments[5]!==undefined?arguments[5]:Zl;var a=arguments.length>6&&arguments[6]!==undefined?arguments[6]:1;var s=arguments.length>7&&arguments[7]!==undefined?arguments[7]:!1;var l=q.program,c=q.locations;P.useProgram(l),P.enableVertexAttribArray(c.aPosition),P.enableVertexAttribArray(c.aTexCoord),P.uniformMatrix4fv(c.uMatrix,!1,u),P.uniform2fv(c.uRadius,[.5*t,.5*o]),P.uniform1i(c.uInverted,s?1:0),P.uniform4fv(c.uColor,i),P.uniform4f(c.uCanvasColor,v,w,S,k),P.uniform2fv(c.uRepeat,[1,1]),P.uniform1fv(c.uMaskBounds,y),P.uniform1f(c.uMaskOpacity,f),P.uniform1i(c.uTexture,4),P.uniform1f(c.uTextureOpacity,a),P.activeTexture(P.TEXTURE0+4),P.bindTexture(P.TEXTURE_2D,n),P.bindBuffer(P.ARRAY_BUFFER,J),P.bufferData(P.ARRAY_BUFFER,r,P.STATIC_DRAW),P.vertexAttribPointer(c.aTexCoord,2,P.FLOAT,!1,0,0),P.bindBuffer(P.ARRAY_BUFFER,K),P.bufferData(P.ARRAY_BUFFER,e,P.STATIC_DRAW),P.vertexAttribPointer(c.aPosition,2,P.FLOAT,!1,0,0),P.drawArrays(P.TRIANGLE_STRIP,0,e.length/2),P.disableVertexAttribArray(c.aPosition),P.disableVertexAttribArray(c.aTexCoord);})(_l(_t36),_e54.width,_e54.height,Ml(a,$),l,h?new Float32Array(h):ec(_e54.width,_e54.height,c,d,s),$,g);}p&&N(function(e,t,o,i,n,r,a){var 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 zt(he(e+s,t+l),s,l,n,r,a,d);}(b.x,b.y,b.width,b.height,i,n,r),p*s,Ml(m,$),!0);},drawImage:function drawImage(e,t,o,n,r,l,c,d,u,h){var p=arguments.length>10&&arguments[10]!==undefined?arguments[10]:Kl;var m=arguments.length>11&&arguments[11]!==undefined?arguments[11]:1;var $=arguments.length>12?arguments[12]:undefined;var g=arguments.length>13&&arguments[13]!==undefined?arguments[13]:1;var x=arguments.length>14&&arguments[14]!==undefined?arguments[14]:0;var v=arguments.length>15&&arguments[15]!==undefined?arguments[15]:b;var w=arguments.length>16&&arguments[16]!==undefined?arguments[16]:Ql;var S=arguments.length>17&&arguments[17]!==undefined?arguments[17]:Jl;var k=arguments.length>18&&arguments[18]!==undefined?arguments[18]:!1;var T=arguments.length>19&&arguments[19]!==undefined?arguments[19]:!1;var E=arguments.length>20&&arguments[20]!==undefined?arguments[20]:!0;var I=t.width*s,A=t.height*s,L=-.5*I,z=.5*A,F=.5*I,V=-.5*A,_=new Float32Array([L,V,0,L,z,0,F,V,0,F,z,0]);P.bindBuffer(P.ARRAY_BUFFER,O),P.bufferData(P.ARRAY_BUFFER,_,P.STATIC_DRAW);var N=t.height/2/R*(i.height/t.height)*-1;r*=s,l*=s,o*=s,n*=s;var H=D.program,j=D.locations,U=Rl();(function(e,t,o,i,n){var 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,M,a,1,2*-N),El(U,r,-l,N),El(U,o,-n,0),zl(U,-u),Il(U,h),El(U,-o,n,0),Ll(U,d),Al(U,c),P.useProgram(H),P.enableVertexAttribArray(j.aPosition),P.enableVertexAttribArray(j.aTexCoord),P.uniform1i(j.uTexture,3),P.uniform2f(j.uTextureSize,t.width,t.height),P.activeTexture(P.TEXTURE0+3),P.bindTexture(P.TEXTURE_2D,e);var G=T?1:0,Z=C.get(G);P.uniform1i(j.uTextureBlend,G),P.activeTexture(P.TEXTURE0+G),P.bindTexture(P.TEXTURE_2D,Z);var X=k?2:0,Y=C.get(X);P.uniform1i(j.uTextureOverlay,X),P.activeTexture(P.TEXTURE0+X),P.bindTexture(P.TEXTURE_2D,Y),P.bindBuffer(P.ARRAY_BUFFER,O),P.vertexAttribPointer(j.aPosition,3,P.FLOAT,!1,0,0);var q=Yl&&ie(e);var K;P.bindBuffer(P.ARRAY_BUFFER,q?W:B),P.vertexAttribPointer(j.aTexCoord,2,P.FLOAT,!1,0,0),P.uniformMatrix4fv(j.uMatrix,!1,U),P.uniform4fv(j.uOverlayColor,S),!$||ps($,ql)?($=ql,K=-1):(K=$.reduce(function(e,t){return e+t;},0),K=K<=0?1:K),P.uniform1fv(j.uClarityKernel,$),P.uniform1f(j.uClarityKernelWeight,K),P.uniform1f(j.uColorGamma,1/g),P.uniform1f(j.uColorVignette,x),P.uniform1i(j.uAntialias,E?1:0),P.uniform4f(j.uColorOffset,p[4],p[9],p[14],p[19]),P.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]]),P.uniform1f(j.uOpacity,m),P.uniform1f(j.uMaskOpacity,f),P.uniform1fv(j.uMaskBounds,y),P.uniform1fv(j.uMaskCornerRadius,w.map(function(e){return e*s;})),P.uniform1fv(j.uMaskFeather,v.map(function(e,t){return t%2==0?e:e*s;})),P.drawArrays(P.TRIANGLE_STRIP,0,4),P.disableVertexAttribArray(j.aPosition),P.disableVertexAttribArray(j.aTexCoord);},textureFilterNearest:P.NEAREST,textureFilterLinear:P.LINEAR,textureClamp:P.CLAMP_TO_EDGE,textureRepeat:P.REPEAT,textureCreate:function textureCreate(){return P.createTexture();},textureUpdate:function textureUpdate(e,t,o){return Q.set(e,{src:t,options:o,isRotatedVideo:"VIDEO"===t.nodeName&&(t.dataset&&90==t.dataset.rotation||270==t.dataset.rotation)}),Tl(P,e,t,o);},textureGetSize:function textureGetSize(e){var _Q$get2=Q.get(e),t=_Q$get2.src,o=_Q$get2.options,i=De(t);return o.scalar?Ge(i,function(e){return e/o.scalar;}):i;},textureDelete:oe,enablePreviewStencil:function enablePreviewStencil(){P.stencilOp(P.KEEP,P.KEEP,P.REPLACE),P.stencilFunc(P.ALWAYS,1,255),P.stencilMask(255);},applyPreviewStencil:function applyPreviewStencil(){P.stencilFunc(P.EQUAL,1,255),P.stencilMask(0);},disablePreviewStencil:T,setCanvasColor:function setCanvasColor(e){v=e[0],w=e[1],S=e[2],k=o?e[3]:1,P.clear(P.COLOR_BUFFER_BIT);},resetCanvasMatrix:function resetCanvasMatrix(){Pl(c,0,i.width,i.height,0,-1,1);},updateCanvasMatrix:function updateCanvasMatrix(e,t,o,n,r){var 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,$=.5*l;ge(p,r.z,h),Ee(p,n,h);El(c,(p.x-m)*s,(p.y-$)*s,0),El(c,m*s,$*s,0),zl(c,r.z);var g=r.x>Math.PI/2;Al(c,g?Math.PI:0);var f=r.y>Math.PI/2;Ll(c,f?Math.PI:0),Il(c,n),El(c,-m*s,-$*s,0);},drawToCanvas:function drawToCanvas(){P.bindFramebuffer(P.FRAMEBUFFER,null),u=c,P.viewport(0,0,P.drawingBufferWidth,P.drawingBufferHeight),P.colorMask(!0,!0,!0,!0),P.clearColor(v,w,S,k),P.clear(P.COLOR_BUFFER_BIT),x=[1,0,1,0,1,i.width,1,i.width];},drawToImageBlendBuffer:function drawToImageBlendBuffer(e,t){te(1,z,e,t);},drawToImageOverlayBuffer:function drawToImageOverlayBuffer(e,t){te(2,A,e,t);},enableMask:function enableMask(e,t){var 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),f=1-t,y=[h,p,m,g];},disableMask:function disableMask(){g=0,p=i.width,h=i.height,m=0,f=1,y=[h,p,m,g];},resize:function resize(t,o,r){s=Math.max(1,r),l=1===s?.75:1,n.width=t,n.height=o,i.width=t*s,i.height=o*s,a=G(i.width,i.height),e.width=i.width,e.height=i.height,Pl(c,0,i.width,i.height,0,-1,1),b=[1,0,1,0,1,n.width,1,n.width];},release:function release(){Array.from(Q.keys()).forEach(function(e){return oe(e,{forceRelease:!0});}),Q.clear(),C.forEach(function(e){P.deleteTexture(e);}),C.clear(),D.destroy(),V.destroy(),H.destroy(),U.destroy(),q.destroy(),e.width=1,e.height=1,e=void 0;}};};var nc=function nc(e,t){var o=e.imageData,_e$amount=e.amount,i=_e$amount===void 0?1:_e$amount,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;var d,u,h,p,m,$=0,g=0,f=0;var 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,g=0,f=0,p<.5&&(g=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[$]=c[m],l[$+1]=c[m+1],l[$+2]=c[m+2],l[$+3]=c[m+3],$+=4;t(null,{data:l,width:o.width,height:o.height});};var rc=[.0625,.125,.0625,.125,.25,.125,.0625,.125,.0625];function ac(e){return Math.sqrt(1- --e*e);}function sc(e){return "[object Date]"===Object.prototype.toString.call(e);}function lc(e,t){if(e===t||e!=e)return function(){return e;};var 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)){var _o36=t.map(function(t,o){return lc(e[o],t);});return function(e){return _o36.map(function(t){return t(e);});};}if("object"===o){if(!e||!t)throw new Error("Object cannot be null");if(sc(e)&&sc(t)){e=e.getTime();var _o37=(t=t.getTime())-e;return function(t){return new Date(e+t*_o37);};}var _o38=Object.keys(t),i={};return _o38.forEach(function(o){i[o]=lc(e[o],t[o]);}),function(e){var t={};return _o38.forEach(function(o){t[o]=i[o](e);}),t;};}if("number"===o){var _o39=t-e;return function(t){return e+t*_o39;};}throw new Error("Cannot interpolate ".concat(o," values"));}function cc(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=Na(e);var i,n=e;function r(r,a){if(null==e)return o.set(e=r),Promise.resolve();n=r;var s=i,l=!1,_Qn=Qn(Qn({},t),a),_Qn$delay=_Qn.delay,c=_Qn$delay===void 0?0:_Qn$delay,_Qn$duration=_Qn.duration,d=_Qn$duration===void 0?400:_Qn$duration,_Qn$easing=_Qn.easing,u=_Qn$easing===void 0?Jn:_Qn$easing,_Qn$interpolate=_Qn.interpolate,h=_Qn$interpolate===void 0?lc:_Qn$interpolate;if(0===d)return s&&(s.abort(),s=null),o.set(e=n),Promise.resolve();var p=yr()+c;var m;return i=wr(function(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);var 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:function update(t,o){return r(t(n,e),o);},subscribe:o.subscribe};}function dc(e,t,o,i){if("number"==typeof o){var _n29=i-o,_r23=(o-t)/(e.dt||1/60),_a11=(_r23+(e.opts.stiffness*_n29-e.opts.damping*_r23)*e.inv_mass)*e.dt;return Math.abs(_a11)<e.opts.precision&&Math.abs(_n29)<e.opts.precision?i:(e.settled=!1,o+_a11);}if(Do(o))return o.map(function(n,r){return dc(e,t[r],o[r],i[r]);});if("object"==_typeof(o)){var _n30={};for(var _r25 in o)_n30[_r25]=dc(e,t[_r25],o[_r25],i[_r25]);return _n30;}throw new Error("Cannot spring ".concat(_typeof(o)," values"));}function uc(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=Na(e),_t$stiffness=t.stiffness,i=_t$stiffness===void 0?.15:_t$stiffness,_t$damping=t.damping,n=_t$damping===void 0?.8:_t$damping,_t$precision=t.precision,r=_t$precision===void 0?.01:_t$precision;var a,s,l,c=e,d=e,u=1,h=0,p=!1;function m(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};d=t;var n=l={};if(null==e||i.hard||$.stiffness>=1&&$.damping>=1)return p=!0,a=null,c=t,o.set(e=d),Promise.resolve();if(i.soft){var _e56=!0===i.soft?.5:+i.soft;h=1/(60*_e56),u=0;}if(!s){a=null,p=!1;var _t37={inv_mass:void 0,opts:$,settled:!0,dt:void 0};s=wr(function(i){if(null===a&&(a=i),p)return p=!1,s=null,!1;u=Math.min(u+h,1),_t37.inv_mass=u,_t37.opts=$,_t37.settled=!0,_t37.dt=60*(i-a)/1e3;var n=dc(_t37,c,e,d);return a=i,c=e,o.set(e=n),_t37.settled&&(s=null),!_t37.settled;});}return new Promise(function(e){s.promise.then(function(){n===l&&e();});});}var $={set:m,update:function update(t,o){return m(t(d,e),o);},subscribe:o.subscribe,stiffness:i,damping:n,precision:r};return $;}var hc=_a(!1,function(e){var t=window.matchMedia("(prefers-reduced-motion:reduce)"),o=function o(){return e(t.matches);};return o(),t.addListener(o),function(){return t.removeListener(o);};}),pc=function pc(){return "ResizeObserver"in window;};var mc=Qe(),$c=function $c(e,t,o,i,n){e.rect||(e.rect=Qe());var r=e.rect;$t(mc,t,o,i,n),pt(r,mc)||(gt(r,mc),e.dispatchEvent(new CustomEvent("measure",{detail:r})));},gc=Math.round,fc=function fc(e){var t=e.getBoundingClientRect();wc&&$c(e,gc(t.x),gc(t.y),gc(t.width),gc(t.height));},yc=function yc(e){wc&&$c(e,e.offsetLeft,e.offsetTop,e.offsetWidth,e.offsetHeight);},bc=[];var xc,vc,wc=void 0;function Sc(){bc.length?(bc.forEach(function(e){return e.measure(e);}),wc=requestAnimationFrame(Sc)):wc=void 0;}var kc=new Map([]),Cc=0,Tc=0;var Mc=function Mc(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _t$observePosition=t.observePosition,o=_t$observePosition===void 0?!1:_t$observePosition,_t$observeViewRect=t.observeViewRect,i=_t$observeViewRect===void 0?!1:_t$observeViewRect,_t$once=t.once,n=_t$once===void 0?!1:_t$once,_t$disabled=t.disabled,r=_t$disabled===void 0?!1:_t$disabled,_t$isMeasureRoot=t.isMeasureRoot,a=_t$isMeasureRoot===void 0?!1:_t$isMeasureRoot;if(pc()&&a&&(vc||(vc=new ResizeObserver(function(e){e.forEach(function(e){kc.set(e.target,e.contentRect);});var t=Array.from(kc.values()).some(function(_ref154){var e=_ref154.width,t=_ref154.height;return e>0&&t>0;});t?t&&!1===wc&&Sc():(wc&&cancelAnimationFrame(wc),wc=!1);})),vc.observe(e),Cc++),!r)return !pc()||o||i?(e.measure=i?fc:yc,bc.push(e),void 0===wc&&(wc=requestAnimationFrame(Sc)),e.measure(e),{destroy:function destroy(){a&&vc&&(kc.delete(e),vc.unobserve(e),Cc--,0===Cc&&(vc.disconnect(),vc=void 0));var t=bc.indexOf(e);bc.splice(t,1),delete e.measure;}}):(xc||(xc=new ResizeObserver(function(e){e.forEach(function(e){wc&&yc(e.target);});})),xc.observe(e),yc(e),n?xc.unobserve(e):Tc++,{destroy:function destroy(){a&&vc&&(kc.delete(e),vc.unobserve(e),Cc--,0===Cc&&(vc.disconnect(),vc=void 0)),n||(xc.unobserve(e),Tc--,0===Tc&&(xc.disconnect(),xc=void 0));}});},Rc=function Rc(e){var t=!1;var o={pointerdown:function pointerdown(){t=!1;},keydown:function keydown(){t=!0;},keyup:function keyup(){t=!1;},focus:function focus(e){t&&(e.target.dataset.focusVisible="");},blur:function blur(e){delete e.target.dataset.focusVisible;}};return Object.keys(o).forEach(function(t){return e.addEventListener(t,o[t],!0);}),{destroy:function destroy(){Object.keys(o).forEach(function(t){return e.removeEventListener(t,o[t],!0);});}};};var Pc=/*#__PURE__*/function(){var _ref155=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e){return _regeneratorRuntime().wrap(function _callee52$(_context53){while(1)switch(_context53.prev=_context53.next){case 0:return _context53.abrupt("return",new Promise(function(t){if("file"===e.kind)return t(e.getAsFile());e.getAsString(t);}));case 1:case"end":return _context53.stop();}},_callee52);}));return function Pc(_x100){return _ref155.apply(this,arguments);};}();var Ec=function Ec(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=function o(e){e.preventDefault();},i=/*#__PURE__*/function(){var _ref156=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee53(o){var _i26;return _regeneratorRuntime().wrap(function _callee53$(_context54){while(1)switch(_context54.prev=_context54.next){case 0:o.preventDefault(),o.stopPropagation();_context54.prev=1;_context54.next=4;return function(e){return new Promise(function(t,o){var i=e.dataTransfer.items;if(!i)return t([]);Promise.all(Array.from(i).map(Pc)).then(function(e){t(e.filter(function(e){return No(e)&&Jt(e)||/^http/.test(e);}));}).catch(o);});}(o);case 4:_i26=_context54.sent;e.dispatchEvent(new CustomEvent("dropfiles",_objectSpread2({detail:{event:o,resources:_i26}},t)));_context54.next=10;break;case 8:_context54.prev=8;_context54.t0=_context54["catch"](1);case 10:case"end":return _context54.stop();}},_callee53,null,[[1,8]]);}));return function i(_x101){return _ref156.apply(this,arguments);};}();return e.addEventListener("drop",i),e.addEventListener("dragover",o),{destroy:function destroy(){e.removeEventListener("drop",i),e.removeEventListener("dragover",o);}};};var Ic=null;var Ac=function Ac(){if(null===Ic)if(c()){var _e57=p("canvas");Ic=!Dl(_e57,{failIfMajorPerformanceCaveat:!0}),$(_e57);}else Ic=!1;return Ic;},Lc=function Lc(e){return e instanceof WebGLTexture;},zc=function zc(_ref157){var _ref158=_slicedToArray(_ref157,4),e=_ref158[0],t=_ref158[1],o=_ref158[2],i=_ref158[3];return [i.x,i.y,e.x,e.y,o.x,o.y,t.x,t.y];};function Fc(e){var t,o,i,n;return {c:function c(){t=Rr("div"),o=Rr("canvas"),Dr(t,"class","PinturaCanvas");},m:function m(r,a){Tr(r,t,a),Sr(t,o),e[37](o),i||(n=[Lr(o,"measure",e[38]),gr(Mc.call(null,o))],i=!0);},p:Kn,i:Kn,o:Kn,d:function d(o){o&&Mr(t),e[37](null),i=!1,or(n);}};}function Dc(e,t,o){var i,r,a,s,l,d,u;var h=[0,0,0,0],m=ue(),f=c()&&function(e){var t=.5*e,o=p("canvas",{"data-retain":!0,width:e,height:e}),i=o.getContext("2d");return i.fillStyle="#f0f",i.fillRect(0,0,t,t),i.fillRect(t,t,t,t),o;}(128),y=ea();var b,x=t.isAnimated,v=t.isTransparent,w=t.maskRect,_t$maskOpacity=t.maskOpacity,S=_t$maskOpacity===void 0?1:_t$maskOpacity,_t$maskFrameOpacity=t.maskFrameOpacity,k=_t$maskFrameOpacity===void 0?.95:_t$maskFrameOpacity,_t$maskMarkupOpacity=t.maskMarkupOpacity,C=_t$maskMarkupOpacity===void 0?1:_t$maskMarkupOpacity,_t$clipAnnotationsToI=t.clipAnnotationsToImage,M=_t$clipAnnotationsToI===void 0?!0:_t$clipAnnotationsToI,_t$pixelRatio2=t.pixelRatio,R=_t$pixelRatio2===void 0?1:_t$pixelRatio2,_t$textPixelRatio=t.textPixelRatio,P=_t$textPixelRatio===void 0?R:_t$textPixelRatio,E=t.backgroundColor,_t$willRender=t.willRender,I=_t$willRender===void 0?Z:_t$willRender,_t$didRender=t.didRender,A=_t$didRender===void 0?Z:_t$didRender,L=t.willRequest,z=t.csp,_t$loadImageData=t.loadImageData,D=_t$loadImageData===void 0?Z:_t$loadImageData,_t$enableGrid=t.enableGrid,O=_t$enableGrid===void 0?!1:_t$enableGrid,B=t.gridColors,W=t.gridSize,_t$gridOpacity=t.gridOpacity,V=_t$gridOpacity===void 0?0:_t$gridOpacity,_t$images=t.images,_=_t$images===void 0?[]:_t$images,_t$interfaceImages=t.interfaceImages,N=_t$interfaceImages===void 0?[]:_t$interfaceImages,H=t.selectionColor,j=null,U=null,X=null;var Y=function Y(e,t){return e.set(t,{hard:!x});},q={precision:1e-4*.01};var K=0;var J=cc(void 0,{duration:0});sr(e,J,function(e){return o(36,u=e);});var Q=uc(1,q);sr(e,Q,function(e){return o(35,l=e);});var ee=uc(1,q);sr(e,ee,function(e){return o(51,a=e);});var te=Na();sr(e,te,function(e){return o(53,d=e);});var oe=Na();sr(e,oe,function(e){return o(52,s=e);});var ie={},ne=function ne(e,t){var o=ie[e.id];var i=Math.min(1,2048/t.width);var n=o?o.element:p("canvas",{width:t.width*i,height:t.height*i,"data-retain":!0});if(!o||function(e,t){if(e.total!==t.length)return !0;var o=e.last,i=t[t.length-1];return o.drawMode!==i.drawMode||!(!Ti(o)||Ti(i)&&pt(o,i))||!(!Mi(o)||Mi(i)&&o.x===i.x&&o.y===i.y&&o.rx===i.rx&&o.ry===i.ry)||!(!Pi(o)||Pi(i)&&i.points.length===o.points.length);}(o,e.actions)){n=n.cloneNode(),function(e,t,o){var _ref159=o||{},_ref159$selectionColo=_ref159.selectionColor,i=_ref159$selectionColo===void 0?[1,1,1]:_ref159$selectionColo,_ref159$scalar=_ref159.scalar,n=_ref159$scalar===void 0?1:_ref159$scalar;var r=!1;var _iterator8=_createForOfIteratorHelper(t),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _o40=_step8.value;var _t38="subtract"===_o40.drawMode;if(_t38&&!r)continue;e.globalCompositeOperation=_t38?"destination-out":"source-over",e.save(),e.beginPath();var _a12=Tn(_o40);wo(e,n,n),vo(e,_o40.rotation,_a12),jn(e,_o40.flipX,_o40.flipY,_a12),_o40.width?Bn(e,_objectSpread2(_objectSpread2({},_o40),{},{backgroundColor:i})):_o40.points?Hn(e,Object.assign({},_o40,_o40.pathClose?{backgroundColor:i,strokeColor:[0,0,0,0]}:{strokeColor:i,strokeJoin:"round",strokeCap:"round"})):_o40.rx&&Wn(e,_objectSpread2(_objectSpread2({},_o40),{},{backgroundColor:i,strokeColor:[0,0,0,0],strokeJoin:"round",strokeCap:"round"})),e.restore(),r=!0;}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}(n.getContext("2d"),e.actions,{selectionColor:[1,0,1],scalar:i});var _t39=e.actions.length;ie[e.id]={total:_t39,last:_objectSpread2({},e.actions[_t39-1]),element:n};}return _objectSpread2(_objectSpread2({x:0,y:0},t),{},{fillColor:e.color||[1,1,1],backgroundImage:n});};var re;var ae=function ae(){cancelAnimationFrame(re),re=requestAnimationFrame(function(){Me=!0,_e=0,r();});},se=new Map([]),le=new Map([]),ce=function ce(e,t){return {filterParam:"pixelated"===e?j.textureFilterNearest:j.textureFilterLinear,wrapParam:"repeat"===t?j.textureRepeat:j.textureClamp};},de=function de(e,t,o){if(!se.has(e)){se.set(e,e);var _n31=ce(t,o);if(!T(i=e)&&(ho(i)||g(i)||Rn(i)||eo(i))){var _t40=j.textureCreate();j.textureUpdate(_t40,e,_n31),se.set(e,_t40);}else D(e).then(function(t){if(!j||!t)return;var o=j.textureCreate();j.textureUpdate(o,t,_n31),se.set(e,o),ae();}).catch(function(t){se.set(e,t);});}var i,n;if(eo(e)&&((n=e).currentTime>0&&!n.paused&&!n.ended&&n.readyState>2||"true"===e.dataset.redraw)){var _i27=se.get(e),_n32=ce(t,o);return j.textureUpdate(_i27,e,_n32),e.dataset.redraw=!1,_i27;}return se.get(e);},pe=function pe(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=t.id||e.id;if(e.width&&e.width<1||e.height&&e.height<1||!e.text.length)return void le.delete(o);var i=e.text,n=e.textAlign,r=e.fontFamily,_e$fontSize=e.fontSize,a=_e$fontSize===void 0?16:_e$fontSize,s=e.fontWeight,l=e.fontVariant,c=e.fontStyle,d=e.letterSpacing,_e$lineHeight=e.lineHeight,u=_e$lineHeight===void 0?a:_e$lineHeight,h=e.width,m=e.height,_t$outline=t.outline,$=_t$outline===void 0?0:_t$outline,_t$blur=t.blur,g=_t$blur===void 0?0:_t$blur,_t$paddingTop2=t.paddingTop,f=_t$paddingTop2===void 0?0:_t$paddingTop2,_t$paddingRight2=t.paddingRight,y=_t$paddingRight2===void 0?0:_t$paddingRight2,_t$paddingBottom2=t.paddingBottom,b=_t$paddingBottom2===void 0?0:_t$paddingBottom2,_t$paddingLeft2=t.paddingLeft,x=_t$paddingLeft2===void 0?0:_t$paddingLeft2;h=Lo(h)?Math.floor(h):h,m=Lo(m)?Math.floor(m):m;var _ref160=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"";var t=arguments.length>1?arguments[1]:undefined;var _t$width2=t.width,o=_t$width2===void 0?0:_t$width2,_t$height2=t.height,i=_t$height2===void 0?"auto":_t$height2,n=t.fontSize,r=t.fontFamily,a=t.lineHeight,s=t.fontWeight,l=t.fontStyle,c=t.fontVariant,d=t.letterSpacing;var u=Uo({text:e,fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,lineHeight:a,letterSpacing:d,width:o,height:i});var h=Qo.get(u);if(h)return h;var m=1;n>1e3&&F()&&(m=n/1e3,n=1e3,a*=m);var $=Zt(p("pre",{contenteditable:"true",spellcheck:"false",style:"".concat(ti).concat(Ko({fontFamily:r,fontWeight:s,fontStyle:l,fontVariant:c,fontSize:n,letterSpacing:d,lineHeight:a}),";").concat(Jo(e,t),"\""),innerHTML:e})),g=$.getBoundingClientRect();return h={signature:ei($).flat().map(function(e){return e.text;}).join("_;_"),textSize:Ge(De(g),function(e){return Math.ceil(e*m);})},Qo.set(u,h),$.remove(),h;}(i,_objectSpread2(_objectSpread2({},e),{},{width:h,height:void 0})),v=_ref160.textSize,w=_ref160.signature,S=Uo({text:i,textAlign:n,fontFamily:r,fontSize:a,fontWeight:s,fontVariant:l,fontStyle:c,lineHeight:u,letterSpacing:d,outline:$,blur:g,signature:w});if(!se.has(S)){se.set(S,i);var _e58=Math.ceil(v.width),_t41=Math.ceil(v.height);if(0===_e58||0===_t41)return;var _p7=Ul(),_w2=Math.min(1,(_p7-(x+y)*P)/(_e58*P),(_p7-(f+b)*P)/(_t41*P));$i(i,{fontSize:a,fontFamily:r,fontWeight:s,fontVariant:l,fontStyle:c,letterSpacing:d,textAlign:n,lineHeight:u,width:h,height:m,imageWidth:_e58,imageHeight:_t41,paddingLeft:x,paddingTop:f,paddingRight:y,paddingBottom:b,pixelRatio:P*_w2,willRequest:L,outline:$,blur:g,styleNonce:z.styleNonce,color:[1,0,1]}).then(function(e){if(!j)return;var t=j.textureCreate();j.textureUpdate(t,e,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp,scalar:_w2}),se.set(S,t),le.set(o,t),ae();}).catch(console.error);}var k=se.get(S);return Lc(k)?k:le.get(o);},me=new Map(),$e=function $e(e){var t;return e.backgroundImage?t=de(e.backgroundImage,e.backgroundImageRendering,"repeat"===e.backgroundRepeat?"repeat":void 0):e.bitmap&&e.points&&(t=function(e){var t=e.id,o=e.points,i=e.strokeWidth,n=e.strokeCap,r=e.strokeJoin,a=e.strokeColor;var s=se.get(t),l=me.get(t);var c=Uo({points:o.map(function(e){return "".concat(e.x,",").concat(e.y);}).join(","),strokeWidth:i,strokeCap:n,strokeJoin:r,strokeColor:a});if(l){var _l10=l,_e59=_l10.hash;if(se.has(t)){if(c===_e59)return se.get(t);}else l=void 0;}if(!l){var _o41=p("canvas",{width:1,height:1});l={canvas:_o41,hash:void 0},me.set(e.id,l),s=j.textureCreate(),j.textureUpdate(s,_o41,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp}),se.set(t,s);}var _l11=l,d=_l11.canvas,u=Math.ceil(e.strokeWidth),h=it(o),m=Math.floor(h.x)-.5*u,$=Math.floor(h.y)-.5*u,g=Math.ceil(h.width+u),f=Math.ceil(h.height+u);d.width=Math.max(g,1),d.height=Math.max(f,1);var y=d.getContext("2d");return y.clearRect(0,0,d.width,d.height),g>=1&&f>=1&&(y.translate(-m,-$),Hn(y,e),y.resetTransform()),j.textureUpdate(s,d,{filterParam:j.textureFilterLinear,wrapParam:j.textureClamp}),me.set(t,{canvas:d,hash:c}),se.get(t);}(e)),t;},fe=function fe(_ref161){var e=_ref161.texture,t=_ref161.size,o=_ref161.origin,i=_ref161.translation,n=_ref161.rotation,r=_ref161.scale,a=_ref161.colorMatrix,s=_ref161.opacity,l=_ref161.convolutionMatrix,c=_ref161.gamma,d=_ref161.vignette,u=_ref161.maskFeather,h=_ref161.maskCornerRadius,p=_ref161.overlayColor,m=_ref161.enableOverlay,$=_ref161.enableManipulation,g=_ref161.enableAntialiasing;var f=0,y=0;if(1===R){var _e60=Math.abs(1-r)<Number.EPSILON;f=_e60&&U%2!=0?.5:0,y=_e60&&X%2!=0?.5:0;}return j.drawImage(e,t,o.x,o.y,i.x+f,i.y+y,n.x,n.y,n.z,r,a,ls(s,0,1),l,c,d,u,h,p,m,$,g),e;},ye=function ye(e,t,o){var i=st(t),n=st(e),r=i.x-n.x,a=i.y-n.y,s=ge(i,o,n);return {x:s.x-n.x-r,y:s.y-n.y-a};},be=function be(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var t=arguments.length>1?arguments[1]:undefined;e.forEach(function(e){var o=$e(e);var i="complete"!==e.status&&("loading"===e.status||e.backgroundImage&&o===e.backgroundImage);i&&ae();var n="error"===e.status||e.backgroundImage&&o instanceof Error;var r=Lc(o)?o:void 0;var a=e._scale||1,s=e._translate||m,l=e.strokeWidth&&e.strokeWidth*a,c=e.cornerRadius?function(e,t){return [e,e,e,e].map(function(e){return e*t;});}(e.cornerRadius,a):h,d=!!e.width,u=T(e.text),p=Do(e.points),$=Mi(e);if(p){var _i28=e.points.map(function(e){return he(e.x*a+s.x,e.y*a+s.y);});if(e.bitmap){o&&t.push(o);var _n33=it(_i28),_s13=Math.ceil(e.strokeWidth*a);j.drawRect({x:Math.floor(_n33.x)-.5*_s13,y:Math.floor(_n33.y)-.5*_s13,width:Math.ceil(_n33.width+_s13),height:Math.ceil(_n33.height+_s13)},e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,r,void 0,void 0,void 0,void 0,void 0,void 0,e.opacity,void 0,void 0,!1,!1);}else j.drawPath(_i28,e.rotation,e.flipX,e.flipY,l,e.strokeColor,e.pathClose,e.backgroundColor,e.opacity);}else if($){var _c6=e.x,_d6=e.y;_c6*=a,_d6*=a,_c6+=s.x,_d6+=s.y;var _u4=he(_c6,_d6);j.drawEllipse(_u4,e.rx*a,e.ry*a,e.rotation,e.flipX,e.flipY,e.backgroundColor,r,void 0,void 0,e.backgroundCorners&&zc(e.backgroundCorners),l,e.strokeColor,e.opacity,e.inverted),o&&t.push(o),(i||n)&&(e.backgroundColor||e.strokeColor&&e.strokeWidth||j.drawEllipse(_u4,e.rx*a,e.ry*a,e.rotation,e.flipX,e.flipY,n?[1,0,0,.25*e.opacity]:[0,0,0,.25*e.opacity]),n&&Ce(_u4),i&&ke(_u4));}else if(u){var _e$fontSize3=e.fontSize,_o42=_e$fontSize3===void 0?16:_e$fontSize3,_i29=_o42>1e3&&F()?_o42/1e3:1,_n34=Math.max(16,Math.ceil(_o42/_i29*.25)),_r26=Math.abs(e.rotation)>0,_d7=ni(e.text,e),_u5={x:e.x*a+s.x,y:e.y*a+s.y,width:_d7.width*a,height:_d7.height*a};(e.backgroundColor||e.strokeColor)&&j.drawRect(_u5,e.rotation,e.flipX,e.flipY,c,e.backgroundColor,void 0,void 0,void 0,!1,void 0,l,e.strokeColor,e.opacity,void 0,void 0,void 0,e.inverted);var _p8=e.textShadowX,_m3=e.textShadowY,_$3=e.textShadowBlur;if(_p8||_m3||_$3){var _o43=Math.ceil(.5*_$3),_l12=Math.max(_n34,_o43),_c7=pe(e,{id:e.id+"shadow",blur:_$3,paddingTop:_l12,paddingRight:_l12,paddingBottom:_l12,paddingLeft:_l12});if(_c7&&!e._prerender){t.push(_c7);var _o44=j.textureGetSize(_c7),_l13={x:0,y:0},_h4={width:_o44.width/P*a,height:_o44.height/P*a},_$4=_n34*a/_i29,_g3={x:e.x*a+s.x-_$4,y:e.y*a+s.y-_$4,width:_h4.width,height:e.height?_d7.height+_$4-_m3:_h4.height};if(_r26){var _t42=ye(_u5,_g3,e.rotation);_g3.x+=_t42.x,_g3.y+=_t42.y;var _o45=ge(he(_p8,_m3),e.rotation);_g3.x+=_o45.x,_g3.y+=_o45.y;}else _g3.x+=_p8,_g3.y+=_m3;j.drawRect(_g3,e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,_c7,_h4,_l13,!1,void 0,void 0,void 0,e.opacity,void 0,0,e.textShadowColor);}}if(e.textOutlineWidth){var _o46=Math.ceil(.5*e.textOutlineWidth),_l14=_n34+_o46,_c8=pe(e,{id:e.id+"outline",outline:e.textOutlineWidth,paddingTop:_l14,paddingRight:_l14,paddingBottom:_l14,paddingLeft:_l14});if(_c8&&!e._prerender){t.push(_c8);var _l15=j.textureGetSize(_c8),_h5={x:0,y:0},_p9={width:_l15.width/P*a,height:_l15.height/P*a},_m4=(_n34+_o46)*a/_i29,_$5={x:e.x*a+s.x-_m4,y:e.y*a+s.y-_m4,width:_p9.width,height:e.height?_d7.height+_m4:_p9.height};if(_r26){var _t43=ye(_u5,_$5,e.rotation);_$5.x+=_t43.x,_$5.y+=_t43.y;}j.drawRect(_$5,e.rotation,e.flipX,e.flipY,[0,0,0,0],void 0,_c8,_p9,_h5,!1,void 0,void 0,void 0,e.opacity,void 0,0,e.textOutlineColor);}}var _g4=pe(e,{id:e.id+"text",paddingTop:_n34,paddingRight:_n34,paddingBottom:_n34,paddingLeft:_n34});if(_g4&&!e._prerender){t.push(_g4);var _o47=j.textureGetSize(_g4),_l16={x:0,y:0},_c9={width:_o47.width/P*a,height:_o47.height/P*a},_p10=_n34*a/_i29,_m5={x:e.x*a+s.x-_p10,y:e.y*a+s.y-_p10,width:_c9.width,height:e.height?_d7.height+_p10:_c9.height};if(_r26){var _t44=ye(_u5,_m5,e.rotation);_m5.x+=_t44.x,_m5.y+=_t44.y;}var _$6=e.color||[0,0,0];e._prerender&&(_$6[3]=0),j.drawRect(_m5,e.rotation,e.flipX,e.flipY,h,!1,_g4,_c9,_l16,!1,!1,void 0,void 0,e.opacity,void 0,e.feather,_$6,e.inverted);}}else if(d){o&&t.push(o);var _d8=ot(e);var _u6,_h6;a&&s&&(_d8.x*=a,_d8.y*=a,_d8.x+=s.x,_d8.y+=s.y,_d8.width*=a,_d8.height*=a);var _e$backgroundRepeat2=e.backgroundRepeat,_p11=_e$backgroundRepeat2===void 0?"no-repeat":_e$backgroundRepeat2,_m6=r&&j.textureGetSize(r);if(_m6&&e.backgroundImage&&(e.backgroundSize||e.backgroundPosition||e.backgroundRepeat)){var _t45=G(_m6.width,_m6.height);if("repeat"===e.backgroundRepeat&&(_u6=_objectSpread2({},_m6),_h6={x:0,y:0}),"contain"===e.backgroundSize){var _o48=vt(_d8,_t45,_d8);_u6=Oe(_o48),_h6=e.backgroundPosition?e.backgroundPosition:he(.5*(_d8.width-_u6.width),.5*(_d8.height-_u6.height));}else if("cover"===e.backgroundSize){var _o49=xt(_d8,_t45,_d8);_u6=Oe(_o49),e.backgroundPosition?_h6=e.backgroundPosition:(_h6=he(_o49.x,_o49.y),_h6=he(.5*(_d8.width-_u6.width),.5*(_d8.height-_u6.height)));}else e.backgroundSize?(_u6=e.backgroundSize,_h6=e.backgroundPosition||{x:0,y:0}):e.backgroundPosition&&(_u6=_objectSpread2({},_m6),_h6=e.backgroundPosition);}if(j.drawRect(_d8,e.rotation,e.flipX,e.flipY,c,e.backgroundColor,r,_u6,_h6,"repeat"===_p11,e.backgroundCorners&&zc(e.backgroundCorners),l,e.strokeColor,e.opacity,void 0,e.feather,e.fillColor,e.inverted),i||n){e.backgroundColor&&0!==e.backgroundColor[3]||e.strokeColor&&e.strokeWidth||j.drawRect(_d8,e.rotation,e.flipX,e.flipY,c,n?[1,.2549,.2118,.25*e.opacity]:[0,0,0,.25*e.opacity]);var _t46=st(_d8);n&&Ce(_t46),i&&ke(_t46);}}else o&&t.push(o);});};var xe=0;var ve=[{x:-5,y:-5},{x:5,y:5}],we=[{x:5,y:-5},{x:-5,y:5}],Se=zt({x:0,y:0},10,10,0,!1,!1,16);Se.length=9;var ke=function ke(e){xe=Date.now()/50,j.drawEllipse(e,15,15,0,!1,!1,[0,0,0,.5]);var t=Le(Se.map(function(t){return {x:t.x+e.x,y:t.y+e.y};}),xe,e.x,e.y);j.drawPath(t,0,!1,!1,2,[1,1,1]);},Ce=function Ce(e){j.drawEllipse(e,13,13,0,!1,!1,[1,.2549,.2118,.75]);var t=ve.map(function(t){return {x:t.x+e.x,y:t.y+e.y};}),o=we.map(function(t){return {x:t.x+e.x,y:t.y+e.y};});j.drawPath(t,0,!1,!1,3,[1,1,1]),j.drawPath(o,0,!1,!1,3,[1,1,1]);},Te=function Te(e,t,o,i,n,r){return j.drawRect(t,0,!1,!1,h,h,e,i,o,!0,void 0,0,void 0,r,void 0,void 0,n);};var Me=!1,Re=!0,Pe=!1;var Ee=[],Ie=[],Ae=[],ze=function ze(e){return !e.aboveFrame;},Fe=function Fe(e){return e.aboveFrame;},Be=function Be(){Ae.length=0;var e=_[0],_I2=I({opacity:e.opacity,rotation:e.rotation,scale:e.scale,images:_,size:Ve(U,X),backgroundColor:_toConsumableArray(u),selectionRect:d}),t=_I2.manipulationShapes,o=_I2.manipulationShapesDirty,i=_I2.annotationShapes,n=_I2.annotationShapesDirty,r=_I2.interfaceShapes,c=_I2.decorationShapes,p=_I2.frameShapes,m=_I2.selectionShapes,$=_toConsumableArray(u),g=d,y=ls(l,0,1),b=s,x=Math.abs(e.rotation.x/Math.PI*2-1),S=Math.abs(e.rotation.y/Math.PI*2-1),k=x<.99||S<.99,T=_objectSpread2({},e.size),R=e.backgroundColor,E=e.backgroundImage,L=t.length>0,z=i.length>0,F=i.filter(Fe).length>0,D=c.filter(Fe).length>0,G=R[3]>0,Z=!!M&&C>=1;if(y<1&&G){var _e61=$[0],_t47=$[1],_o50=$[2],_i30=1-y,_n35=R[0]*_i30,_r27=R[1]*_i30,_a13=R[2]*_i30,_s14=1-_i30;$[0]=_n35+_e61*_s14,$[1]=_r27+_t47*_s14,$[2]=_a13+_o50*_s14,$[3]=1;}j.setCanvasColor(v?h:$);L&&(o||Me)?(j.disableMask(),j.drawToImageBlendBuffer(T),Ee.length=0,be(t,Ee)):L||(Ee.length=0),Ae.push.apply(Ae,Ee),Re&&(j.drawToImageOverlayBuffer(T,P),Re=!1);if(k){if(z&&(n||Me)||!Pe){j.disableMask(),j.drawToImageOverlayBuffer(T,P),Ie.length=0;var _e62=F?i.filter(ze):i;be(_e62,Ie);}else z||(Ie.length=0);Pe=!0;}else Pe=!1;if(j.drawToCanvas(),j.enableMask(g,y),O&&W>=1&&2===B.length&&V&&function(e,t,o,i,n){var r=Ve(t,t),a=de(f,"pixelated","repeat"),s=he(-e.x%t,-e.y%t),l=he(s.x+.5*r.width,s.y);Te(a,e,s,r,o,n),Te(a,e,l,r,i,n);}(g,W,B[0],B[1],V),G&&j.drawRect(g,0,!1,!1,h,R),E){j.enableMask(g,1);var _e63=Math.max(w.width/E.width,w.height/E.height),_t48=E.width*_e63,_o51=E.height*_e63,_i31={x:w.x+.5*w.width-.5*_t48,y:w.y+.5*w.height-.5*_o51,width:_t48,height:_o51};j.drawRect(_i31,0,!1,!1,h,h,de(E,"linear")),j.enableMask(g,y);}if(Z&&j.enablePreviewStencil(),Ae.push.apply(Ae,_toConsumableArray(_toConsumableArray(_).reverse().map(function(e){return fe(_objectSpread2(_objectSpread2({},e),{},{texture:de(e.data),enableOverlay:k&&z,enableManipulation:L,enableAntialiasing:!0,mask:g,maskOpacity:y,overlayColor:b}));}))),j.enableMask(g,C),!k){Z&&j.applyPreviewStencil(),j.resetCanvasMatrix(),j.updateCanvasMatrix(T,e.origin,e.translation,e.scale,e.rotation),Ie.length=0;var _t49=F?i.filter(ze):i;be(_t49,Ie),Z&&j.disablePreviewStencil();}if(Ae.push.apply(Ae,Ie),j.resetCanvasMatrix(),j.enableMask(g,C),be(D?c.filter(ze):c,Ae),p.length){j.enableMask(g,1);var _e64=p.filter(function(e){return !e.expandsCanvas;}),_t50=p.filter(function(e){return e.expandsCanvas;});_e64.length&&be(_e64,Ae),_t50.length&&(j.enableMask({x:g.x+.5,y:g.y+.5,width:g.width-1,height:g.height-1},a),be(_t50,Ae));}if(F&&(j.resetCanvasMatrix(),j.updateCanvasMatrix(T,e.origin,e.translation,e.scale,e.rotation),be(i.filter(Fe),Ae),j.resetCanvasMatrix()),D&&(j.resetCanvasMatrix(),be(c.filter(Fe),Ae),j.resetCanvasMatrix()),H&&m.length&&!k){j.resetCanvasMatrix(),j.updateCanvasMatrix(T,e.origin,e.translation,e.scale,e.rotation);var _t51=_toConsumableArray(H);_t51[3]=.5;var _o52=[{id:"selection",color:_t51,actions:_toConsumableArray(m)}].map(function(e){return ne(e,T);});be(_o52,Ae),j.resetCanvasMatrix();}j.disableMask(),be(r,Ae),N.forEach(function(e){if(j.enableMask(e.mask,e.maskOpacity),e.backgroundColor){var _t52=E&&xt(_objectSpread2({},e.mask),E.width/E.height),_o53=E&&de(E,"linear");j.drawRect(e.mask,0,!1,!1,e.maskCornerRadius,e.backgroundColor,_o53,_t52,_t52,void 0,void 0,void 0,void 0,e.opacity,e.maskFeather),_o53&&Ae.push(_o53);}var t=fe(_objectSpread2(_objectSpread2({},e),{},{texture:de(e.data),enableAntialiasing:!1,translation:{x:e.translation.x+e.offset.x-.5*U,y:e.translation.y+e.offset.y-.5*X}}));Ae.push(t);}),j.disableMask(),function(e){se.forEach(function(t,o){!e.find(function(e){return e===t;})&&Lc(t)&&(Array.from(le.values()).includes(t)||(se.delete(o),j.textureDelete(t)));});}(Ae),A(),Me=!1;};var We,_e=0;var Ne=function Ne(){clearTimeout(We);var e=Date.now();e-_e<48?We=setTimeout(Ne,48):(_e=e,Be());};Jr(function(){return r();}),Kr(function(){return o(31,j=tc(b,{alpha:v}));}),Qr(function(){j&&(me.forEach(function(_ref162){var e=_ref162.canvas;return $(e);}),me.clear(),j.release(),o(31,j=void 0),o(0,b=void 0));});return e.$$set=function(e){"isAnimated"in e&&o(9,x=e.isAnimated),"isTransparent"in e&&o(10,v=e.isTransparent),"maskRect"in e&&o(11,w=e.maskRect),"maskOpacity"in e&&o(12,S=e.maskOpacity),"maskFrameOpacity"in e&&o(13,k=e.maskFrameOpacity),"maskMarkupOpacity"in e&&o(14,C=e.maskMarkupOpacity),"clipAnnotationsToImage"in e&&o(15,M=e.clipAnnotationsToImage),"pixelRatio"in e&&o(16,R=e.pixelRatio),"textPixelRatio"in e&&o(17,P=e.textPixelRatio),"backgroundColor"in e&&o(18,E=e.backgroundColor),"willRender"in e&&o(19,I=e.willRender),"didRender"in e&&o(20,A=e.didRender),"willRequest"in e&&o(21,L=e.willRequest),"csp"in e&&o(22,z=e.csp),"loadImageData"in e&&o(23,D=e.loadImageData),"enableGrid"in e&&o(24,O=e.enableGrid),"gridColors"in e&&o(25,B=e.gridColors),"gridSize"in e&&o(26,W=e.gridSize),"gridOpacity"in e&&o(27,V=e.gridOpacity),"images"in e&&o(28,_=e.images),"interfaceImages"in e&&o(29,N=e.interfaceImages),"selectionColor"in e&&o(30,H=e.selectionColor);},e.$$.update=function(){if(1&e.$$.dirty[0]&&b){var _e65=getComputedStyle(b).getPropertyValue("--color-transition-duration");o(32,K=function(e){var t=parseFloat(e);return /^[0-9]+s$/.test(e)?1e3*t:t;}(_e65));}262656&e.$$.dirty[0]|2&e.$$.dirty[1]&&E&&J.set(E,{duration:x?K:0}),4096&e.$$.dirty[0]&&Y(Q,Lo(S)?S:1),8192&e.$$.dirty[0]&&Y(ee,Lo(k)?k:1),2048&e.$$.dirty[0]&&w&&te.set(w),48&e.$$.dirty[1]&&u&&oe.set([u[0],u[1],u[2],ls(l,0,1)]),268435462&e.$$.dirty[0]|1&e.$$.dirty[1]&&o(34,i=!!(j&&U&&X&&_.length)),65542&e.$$.dirty[0]|1&e.$$.dirty[1]&&U&&X&&j&&(_e=0,j.resize(U,X,R)),8&e.$$.dirty[1]&&o(33,r=i?Ac()?Ne:Be:n),12&e.$$.dirty[1]&&i&&r&&r();},[b,U,X,y,J,Q,ee,te,oe,x,v,w,S,k,C,M,R,P,E,I,A,L,z,D,O,B,W,V,_,N,H,j,K,r,i,l,u,function(e){ra[e?"unshift":"push"](function(){b=e,o(0,b);});},function(e){o(1,U=e.detail.width),o(2,X=e.detail.height),y("measure",{width:U,height:X});}];}var Oc=/*#__PURE__*/function(_Wa){function Oc(e){var _this4;_classCallCheck(this,Oc);_this4=_callSuper(this,Oc),Ba(_assertThisInitialized(_this4),e,Dc,Fc,nr,{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,csp:22,loadImageData:23,enableGrid:24,gridColors:25,gridSize:26,gridOpacity:27,images:28,interfaceImages:29,selectionColor:30},null,[-1,-1,-1]);return _this4;}_inherits(Oc,_Wa);return _createClass(Oc);}(Wa);var Bc=function Bc(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Boolean;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:" ";return e.filter(t).join(o);};function Wc(e,t,o){var i=e.slice();return i[17]=t[o],i;}var Vc=function Vc(e){return {tab:4&e};},_c=function _c(e){return {tab:e[17]};};function Nc(e){var t,o,_i33,n=[],r=new Map(),a=e[2];var s=function s(e){return e[17].id;};for(var _t54=0;_t54<a.length;_t54+=1){var _o54=Wc(e,a,_t54),_i32=s(_o54);r.set(_i32,n[_t54]=Hc(_i32,_o54));}return {c:function c(){t=Rr("ul");for(var _e67=0;_e67<n.length;_e67+=1)n[_e67].c();Dr(t,"class",o=Bc(["PinturaTabList",e[0]])),Dr(t,"role","tablist"),Dr(t,"data-layout",e[1]);},m:function m(o,r){Tr(o,t,r);for(var _e69=0;_e69<n.length;_e69+=1)n[_e69].m(t,null);e[14](t),_i33=!0;},p:function p(e,l){1124&l&&(a=e[2],wa(),n=Ia(n,l,s,1,e,a,r,t,Ea,Hc,null,Wc),Sa()),(!_i33||1&l&&o!==(o=Bc(["PinturaTabList",e[0]])))&&Dr(t,"class",o),(!_i33||2&l)&&Dr(t,"data-layout",e[1]);},i:function i(e){if(!_i33){for(var _e71=0;_e71<a.length;_e71+=1)ka(n[_e71]);_i33=!0;}},o:function o(e){for(var _e73=0;_e73<n.length;_e73+=1)Ca(n[_e73]);_i33=!1;},d:function d(o){o&&Mr(t);for(var _e75=0;_e75<n.length;_e75+=1)n[_e75].d();e[14](null);}};}function Hc(e,t){var o,i,n,r,a,s,l,c,_d9,u;var h=t[11].default,_p12=lr(h,t,t[10],_c);function _m7(){var _t55;for(var _len3=arguments.length,e=new Array(_len3),_key3=0;_key3<_len3;_key3++){e[_key3]=arguments[_key3];}return (_t55=t)[12].apply(_t55,[t[17]].concat(e));}function $(){var _t56;for(var _len4=arguments.length,e=new Array(_len4),_key4=0;_key4<_len4;_key4++){e[_key4]=arguments[_key4];}return (_t56=t)[13].apply(_t56,[t[17]].concat(e));}return {key:e,first:null,c:function c(){o=Rr("li"),i=Rr("button"),_p12&&_p12.c(),r=Ir(),Dr(i,"type","button"),i.disabled=n=t[17].disabled,Dr(o,"role","tab"),Dr(o,"aria-controls",a=t[17].href.substr(1)),Dr(o,"id",s=t[17].tabId),Dr(o,"aria-selected",l=t[17].selected),this.first=o;},m:function m(e,t){Tr(e,o,t),Sr(o,i),_p12&&_p12.m(i,null),Sr(o,r),c=!0,_d9||(u=[Lr(i,"keydown",_m7),Lr(i,"click",$)],_d9=!0);},p:function p(e,r){t=e,_p12&&_p12.p&&(!c||1028&r)&&ur(_p12,h,t,t[10],c?dr(h,t[10],r,Vc):hr(t[10]),_c),(!c||4&r&&n!==(n=t[17].disabled))&&(i.disabled=n),(!c||4&r&&a!==(a=t[17].href.substr(1)))&&Dr(o,"aria-controls",a),(!c||4&r&&s!==(s=t[17].tabId))&&Dr(o,"id",s),(!c||4&r&&l!==(l=t[17].selected))&&Dr(o,"aria-selected",l);},i:function i(e){c||(ka(_p12,e),c=!0);},o:function o(e){Ca(_p12,e),c=!1;},d:function d(e){e&&Mr(o),_p12&&_p12.d(e),_d9=!1,or(u);}};}function jc(e){var t,o,_i34=e[4]&&Nc(e);return {c:function c(){_i34&&_i34.c(),t=Ar();},m:function m(e,n){_i34&&_i34.m(e,n),Tr(e,t,n),o=!0;},p:function p(e,_ref163){var _ref164=_slicedToArray(_ref163,1),o=_ref164[0];e[4]?_i34?(_i34.p(e,o),16&o&&ka(_i34,1)):(_i34=Nc(e),_i34.c(),ka(_i34,1),_i34.m(t.parentNode,t)):_i34&&(wa(),Ca(_i34,1,1,function(){_i34=null;}),Sa());},i:function i(e){o||(ka(_i34),o=!0);},o:function(_o55){function o(_x102){return _o55.apply(this,arguments);}o.toString=function(){return _o55.toString();};return o;}(function(e){Ca(_i34),o=!1;}),d:function d(e){_i34&&_i34.d(e),e&&Mr(t);}};}function Uc(e,t,o){var i,n,r,_t$$$slots=t.$$slots,a=_t$$$slots===void 0?{}:_t$$$slots,s=t.$$scope,l=t.class,c=t.name,d=t.selected,_t$tabs=t.tabs,u=_t$tabs===void 0?[]:_t$tabs,h=t.layout;var p=ea(),m=function m(e){var t=r.querySelectorAll('[role="tab"] button')[e];t&&t.focus();},$=function $(e,t){e.preventDefault(),e.stopPropagation(),p("select",t);},g=function g(_ref165,t){var e=_ref165.key;if(!/arrow/i.test(e))return;var o=u.findIndex(function(e){return 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=function(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=function(){896&e.$$.dirty&&o(2,i=u.map(function(e){var t=e.id===d;return _objectSpread2(_objectSpread2({},e),{},{tabId:"tab-".concat(c,"-").concat(e.id),href:"#panel-".concat(c,"-").concat(e.id),selected:t});})),4&e.$$.dirty&&o(4,n=i.length>1);},[l,h,i,r,n,$,g,c,d,u,s,a,function(e,t){return g(t,e.id);},function(e,t){return $(t,e.id);},function(e){ra[e?"unshift":"push"](function(){r=e,o(3,r);});}];}var Gc=/*#__PURE__*/function(_Wa2){function Gc(e){var _this5;_classCallCheck(this,Gc);_this5=_callSuper(this,Gc),Ba(_assertThisInitialized(_this5),e,Uc,jc,nr,{class:0,name:7,selected:8,tabs:9,layout:1});return _this5;}_inherits(Gc,_Wa2);return _createClass(Gc);}(Wa);var Zc=function Zc(e){return {panel:16&e};},Xc=function Xc(e){return {panel:e[4][0].id,panelIsActive:!0};};function Yc(e,t,o){var 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;}var qc=function qc(e){return {panel:16&e,panelIsActive:16&e};},Kc=function Kc(e){return {panel:e[14],panelIsActive:e[19]};};function Jc(e){var t,o,i,n,r,a;var s=e[11].default,l=lr(s,e,e[10],Xc);return {c:function c(){t=Rr("div"),o=Rr("div"),l&&l.c(),Dr(o,"class",i=Bc([e[1]])),Dr(t,"class",e[0]),Dr(t,"style",e[2]);},m:function m(i,s){Tr(i,t,s),Sr(t,o),l&&l.m(o,null),n=!0,r||(a=[Lr(t,"measure",e[13]),gr(Mc.call(null,t))],r=!0);},p:function p(e,r){l&&l.p&&(!n||1040&r)&&ur(l,s,e,e[10],n?dr(s,e[10],r,Zc):hr(e[10]),Xc),(!n||2&r&&i!==(i=Bc([e[1]])))&&Dr(o,"class",i),(!n||1&r)&&Dr(t,"class",e[0]),(!n||4&r)&&Dr(t,"style",e[2]);},i:function i(e){n||(ka(l,e),n=!0);},o:function o(e){Ca(l,e),n=!1;},d:function d(e){e&&Mr(t),l&&l.d(e),r=!1,or(a);}};}function Qc(e){var t,o,_i36,n,r,a=[],s=new Map(),l=e[4];var c=function c(e){return e[14];};for(var _t58=0;_t58<l.length;_t58+=1){var _o56=Yc(e,l,_t58),_i35=c(_o56);s.set(_i35,a[_t58]=td(_i35,_o56));}return {c:function c(){t=Rr("div");for(var _e77=0;_e77<a.length;_e77+=1)a[_e77].c();Dr(t,"class",o=Bc(["PinturaTabPanels",e[0]])),Dr(t,"style",e[2]);},m:function m(o,s){Tr(o,t,s);for(var _e79=0;_e79<a.length;_e79+=1)a[_e79].m(t,null);_i36=!0,n||(r=[Lr(t,"measure",e[12]),gr(Mc.call(null,t,{observePosition:!0}))],n=!0);},p:function p(e,n){1042&n&&(l=e[4],wa(),a=Ia(a,n,c,1,e,l,s,t,Ea,td,null,Yc),Sa()),(!_i36||1&n&&o!==(o=Bc(["PinturaTabPanels",e[0]])))&&Dr(t,"class",o),(!_i36||4&n)&&Dr(t,"style",e[2]);},i:function i(e){if(!_i36){for(var _e81=0;_e81<l.length;_e81+=1)ka(a[_e81]);_i36=!0;}},o:function o(e){for(var _e83=0;_e83<a.length;_e83+=1)Ca(a[_e83]);_i36=!1;},d:function d(e){e&&Mr(t);for(var _e85=0;_e85<a.length;_e85+=1)a[_e85].d();n=!1,or(r);}};}function ed(e){var t;var o=e[11].default,_i37=lr(o,e,e[10],Kc);return {c:function c(){_i37&&_i37.c();},m:function m(e,o){_i37&&_i37.m(e,o),t=!0;},p:function p(e,n){_i37&&_i37.p&&(!t||1040&n)&&ur(_i37,o,e,e[10],t?dr(o,e[10],n,qc):hr(e[10]),Kc);},i:function i(e){t||(ka(_i37,e),t=!0);},o:function o(e){Ca(_i37,e),t=!1;},d:function d(e){_i37&&_i37.d(e);}};}function td(e,t){var o,i,n,r,a,s,l,_c10,d,u=t[15]&&ed(t);return {key:e,first:null,c:function c(){o=Rr("div"),u&&u.c(),i=Ir(),Dr(o,"class",n=Bc(["PinturaTabPanel",t[1]])),o.hidden=r=t[20],Dr(o,"id",a=t[16]),Dr(o,"tabindex",s=t[17]),Dr(o,"aria-labelledby",l=t[18]),Dr(o,"data-inert",_c10=!t[3]),this.first=o;},m:function m(e,t){Tr(e,o,t),u&&u.m(o,null),Sr(o,i),d=!0;},p:function p(e,h){(t=e)[15]?u?(u.p(t,h),16&h&&ka(u,1)):(u=ed(t),u.c(),ka(u,1),u.m(o,i)):u&&(wa(),Ca(u,1,1,function(){u=null;}),Sa()),(!d||2&h&&n!==(n=Bc(["PinturaTabPanel",t[1]])))&&Dr(o,"class",n),(!d||16&h&&r!==(r=t[20]))&&(o.hidden=r),(!d||16&h&&a!==(a=t[16]))&&Dr(o,"id",a),(!d||16&h&&s!==(s=t[17]))&&Dr(o,"tabindex",s),(!d||16&h&&l!==(l=t[18]))&&Dr(o,"aria-labelledby",l),(!d||16&h&&_c10!==(_c10=!t[3]))&&Dr(o,"data-inert",_c10);},i:function i(e){d||(ka(u),d=!0);},o:function o(e){Ca(u),d=!1;},d:function d(e){e&&Mr(o),u&&u.d();}};}function od(e){var t,o,i,n;var r=[Qc,Jc],a=[];function s(e,t){return e[5]?0:1;}return t=s(e),o=a[t]=r[t](e),{c:function c(){o.c(),i=Ar();},m:function m(e,o){a[t].m(e,o),Tr(e,i,o),n=!0;},p:function p(e,_ref166){var _ref167=_slicedToArray(_ref166,1),n=_ref167[0];var l=t;t=s(e),t===l?a[t].p(e,n):(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa(),o=a[t],o?o.p(e,n):(o=a[t]=r[t](e),o.c()),ka(o,1),o.m(i.parentNode,i));},i:function i(e){n||(ka(o),n=!0);},o:function(_o57){function o(_x103){return _o57.apply(this,arguments);}o.toString=function(){return _o57.toString();};return o;}(function(e){Ca(o),n=!1;}),d:function d(e){a[t].d(e),e&&Mr(i);}};}function id(e,t,o){var i,n,_t$$$slots2=t.$$slots,r=_t$$$slots2===void 0?{}:_t$$$slots2,a=t.$$scope,s=t.class,l=t.name,c=t.selected,d=t.panelClass,_t$panels=t.panels,u=_t$panels===void 0?[]:_t$panels,h=t.visible,p=t.style;var m={};return e.$$set=function(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=function(){968&e.$$.dirty&&o(4,i=u.map(function(e){var t=e===c;t&&o(9,m[e]=!0,m);var i=h?-1!==h.indexOf(e):t;return {id:e,panelId:"panel-".concat(l,"-").concat(e),labelledBy:"tab-".concat(l,"-").concat(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){ia.call(this,e,t);},function(t){ia.call(this,e,t);}];}var nd=/*#__PURE__*/function(_Wa3){function nd(e){var _this6;_classCallCheck(this,nd);_this6=_callSuper(this,nd),Ba(_assertThisInitialized(_this6),e,id,od,nr,{class:0,name:6,selected:7,panelClass:1,panels:8,visible:3,style:2});return _this6;}_inherits(nd,_Wa3);return _createClass(nd);}(Wa);var rd=function rd(e){var t=Object.getOwnPropertyDescriptors(e.prototype);return Object.keys(t).filter(function(e){return !!t[e].get;});};function ad(e){var t,o,i,n;var r=[e[5],{locale:e[1]}];function a(t){e[22](t);}var s=e[10];function l(e){var t={};for(var _e87=0;_e87<r.length;_e87+=1)t=Qn(t,r[_e87]);return void 0!==e[3]&&(t.name=e[3]),{props:t};}return s&&(t=Hr(s,l(e)),ra.push(function(){return za(t,"name",a);}),e[23](t),t.$on("measure",e[11])),{c:function c(){t&&Fa(t.$$.fragment),i=Ar();},m:function m(e,o){t&&Da(t,e,o),Tr(e,i,o),n=!0;},p:function p(e,n){var c=34&n[0]?Aa(r,[32&n[0]&&La(e[5]),2&n[0]&&{locale:e[1]}]):{};if(!o&&8&n[0]&&(o=!0,c.name=e[3],pa(function(){return o=!1;})),s!==(s=e[10])){if(t){wa();var _e88=t;Ca(_e88.$$.fragment,1,0,function(){Oa(_e88,1);}),Sa();}s?(t=Hr(s,l(e)),ra.push(function(){return za(t,"name",a);}),e[23](t),t.$on("measure",e[11]),Fa(t.$$.fragment),ka(t.$$.fragment,1),Da(t,i.parentNode,i)):t=null;}else s&&t.$set(c);},i:function i(e){n||(t&&ka(t.$$.fragment,e),n=!0);},o:function o(e){t&&Ca(t.$$.fragment,e),n=!1;},d:function d(o){e[23](null),o&&Mr(i),t&&Oa(t,o);}};}function sd(e){var t,o,_i38,n=e[6]&&ad(e);return {c:function c(){t=Rr("div"),n&&n.c(),Dr(t,"data-util",e[3]),Dr(t,"class",o=Bc(["PinturaUtilPanel",e[2]])),Dr(t,"style",e[7]);},m:function m(o,r){Tr(o,t,r),n&&n.m(t,null),e[24](t),_i38=!0;},p:function p(e,r){e[6]?n?(n.p(e,r),64&r[0]&&ka(n,1)):(n=ad(e),n.c(),ka(n,1),n.m(t,null)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),(!_i38||8&r[0])&&Dr(t,"data-util",e[3]),(!_i38||4&r[0]&&o!==(o=Bc(["PinturaUtilPanel",e[2]])))&&Dr(t,"class",o),(!_i38||128&r[0])&&Dr(t,"style",e[7]);},i:function i(e){_i38||(ka(n),_i38=!0);},o:function o(e){Ca(n),_i38=!1;},d:function d(o){o&&Mr(t),n&&n.d(),e[24](null);}};}function ld(e,t,o){var i,n,r,a,s;var l=ea();var _t$isActive=t.isActive,c=_t$isActive===void 0?!0:_t$isActive,d=t.stores,u=t.view,h=t.props,p=t.component,m=t.locale,$=t.class;var g=oa("isAnimated");var f;sr(e,g,function(e){return o(21,s=e);});var y=uc(0),b=Ha(y,function(e){return ls(e,0,1);});sr(e,b,function(e){return o(20,a=e);});var x=!c;var v=Na(c),w={isActive:Ha(v,/*#__PURE__*/function(){var _ref168=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee54(e,t){return _regeneratorRuntime().wrap(function _callee54$(_context55){while(1)switch(_context55.prev=_context55.next){case 0:if(e){_context55.next=2;break;}return _context55.abrupt("return",t(e));case 2:_context55.next=4;return ua();case 4:t(e);case 5:case"end":return _context55.stop();}},_callee54);}));return function(_x104,_x105){return _ref168.apply(this,arguments);};}(),!1),isActiveFraction:Ha(b,function(e){return e;}),isVisible:Ha(b,function(e){return e>0;})},S=u,k=rd(S),C=Object.keys(h||{}).reduce(function(e,t){return k.includes(t)?(e[t]=h[t],e):e;},{}),T=Object.keys(w).reduce(function(e,t){return k.includes(t)?(e[t]=w[t],e):e;},{});var M,R;var P=function P(e){o(17,f=_objectSpread2({},e.detail)),I&&c&&l("measure",_objectSpread2({},f));};ta("measurable",Mc);var E=qr().$$.context;var I=!1;return Kr(function(){if(o(19,I=!0),r)return;o(0,p=new S({target:R,props:_objectSpread2(_objectSpread2({},n),{},{locale:m}),context:E})),o(3,M=p.name);var e=p.$on("measure",P);return function(){e(),p.$destroy();};}),e.$$set=function(e){"isActive"in e&&o(12,c=e.isActive),"stores"in e&&o(13,d=e.stores),"view"in e&&o(14,u=e.view),"props"in e&&o(15,h=e.props),"component"in e&&o(0,p=e.component),"locale"in e&&o(1,m=e.locale),"class"in e&&o(2,$=e.class);},e.$$.update=function(){135169&e.$$.dirty[0]&&f&&c&&p&&l("measure",f),2101248&e.$$.dirty[0]&&y.set(c?1:0,{hard:!1===s}),1310720&e.$$.dirty[0]&&(a<=0&&!x?o(18,x=!0):a>0&&x&&o(18,x=!1)),786432&e.$$.dirty[0]&&I&&l(x?"hide":"show"),1048576&e.$$.dirty[0]&&l("fade",a),1048576&e.$$.dirty[0]&&o(7,i=a<1?"opacity: "+a:void 0),4096&e.$$.dirty[0]&&v.set(c),8192&e.$$.dirty[0]&&o(5,n=_objectSpread2(_objectSpread2(_objectSpread2({},C),T),{},{stores:d}));},o(6,r=!k.includes("external")),[p,m,$,M,R,n,r,i,g,b,S,P,c,d,u,h,y,f,x,I,a,s,function(e){M=e,o(3,M);},function(e){ra[e?"unshift":"push"](function(){p=e,o(0,p);});},function(e){ra[e?"unshift":"push"](function(){R=e,o(4,R);});}];}var cd=/*#__PURE__*/function(_Wa4){function cd(e){var _this7;_classCallCheck(this,cd);_this7=_callSuper(this,cd),Ba(_assertThisInitialized(_this7),e,ld,sd,nr,{isActive:12,stores:13,view:14,props:15,component:0,locale:1,class:2,opacity:16},null,[-1,-1]);return _this7;}_inherits(cd,_Wa4);return _createClass(cd,[{key:"opacity",get:function get(){return this.$$.ctx[16];}}]);}(Wa);function dd(e){var t,o,_i39;var n=e[5].default,r=lr(n,e,e[4],null);return {c:function c(){t=Pr("svg"),r&&r.c(),Dr(t,"class",e[3]),Dr(t,"style",e[2]),Dr(t,"width",e[0]),Dr(t,"height",e[1]),Dr(t,"viewBox",o="0 0 "+e[0]+"\n "+e[1]),Dr(t,"xmlns","http://www.w3.org/2000/svg"),Dr(t,"aria-hidden","true"),Dr(t,"focusable","false"),Dr(t,"stroke-linecap","round"),Dr(t,"stroke-linejoin","round");},m:function m(e,o){Tr(e,t,o),r&&r.m(t,null),_i39=!0;},p:function p(e,_ref169){var _ref170=_slicedToArray(_ref169,1),a=_ref170[0];r&&r.p&&(!_i39||16&a)&&ur(r,n,e,e[4],_i39?dr(n,e[4],a,null):hr(e[4]),null),(!_i39||8&a)&&Dr(t,"class",e[3]),(!_i39||4&a)&&Dr(t,"style",e[2]),(!_i39||1&a)&&Dr(t,"width",e[0]),(!_i39||2&a)&&Dr(t,"height",e[1]),(!_i39||3&a&&o!==(o="0 0 "+e[0]+"\n "+e[1]))&&Dr(t,"viewBox",o);},i:function i(e){_i39||(ka(r,e),_i39=!0);},o:function o(e){Ca(r,e),_i39=!1;},d:function d(e){e&&Mr(t),r&&r.d(e);}};}function ud(e,t,o){var _t$$$slots3=t.$$slots,i=_t$$$slots3===void 0?{}:_t$$$slots3,n=t.$$scope,_t$width3=t.width,r=_t$width3===void 0?24:_t$width3,_t$height3=t.height,a=_t$height3===void 0?24:_t$height3,s=t.style,l=t.class;return e.$$set=function(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];}var hd=/*#__PURE__*/function(_Wa5){function hd(e){var _this8;_classCallCheck(this,hd);_this8=_callSuper(this,hd),Ba(_assertThisInitialized(_this8),e,ud,dd,nr,{width:0,height:1,style:2,class:3});return _this8;}_inherits(hd,_Wa5);return _createClass(hd);}(Wa);var pd=function pd(e,t){return t===e.target||t.contains(e.target);},md=function md(e,t,o){var i=T(t)?t:e;return o?"".concat(i," (").concat((n=o,n.map(function(e){return "CMD"===e?$o()?"⌘":"Ctrl":e;}).join("+")),")"):i;var n;};function $d(e){var t,o;return t=new hd({props:{class:"PinturaButtonIcon",$$slots:{default:[gd]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),o=!0;},p:function p(e,o){var i={};536870920&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){o||(ka(t.$$.fragment,e),o=!0);},o:function(_o58){function o(_x106){return _o58.apply(this,arguments);}o.toString=function(){return _o58.toString();};return o;}(function(e){Ca(t.$$.fragment,e),o=!1;}),d:function d(e){Oa(t,e);}};}function gd(e){var t;return {c:function c(){t=Pr("g");},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[3];},p:function p(e,o){8&o&&(t.innerHTML=e[3]);},d:function d(e){e&&Mr(t);}};}function fd(e){var t;return {c:function c(){t=Rr("span"),Dr(t,"class",e[11]);},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[0];},p:function p(e,o){1&o&&(t.innerHTML=e[0]),2048&o&&Dr(t,"class",e[11]);},d:function d(e){e&&Mr(t);}};}function yd(e){var t,o,_i41,n,r;var a=e[27].default,s=lr(a,e,e[29],null),l=s||function(e){var t,o,_i40,n=e[3]&&$d(e),r=e[0]&&fd(e);return {c:function c(){t=Rr("span"),n&&n.c(),o=Ir(),r&&r.c(),Dr(t,"class",e[13]);},m:function m(e,a){Tr(e,t,a),n&&n.m(t,null),Sr(t,o),r&&r.m(t,null),_i40=!0;},p:function p(e,a){e[3]?n?(n.p(e,a),8&a&&ka(n,1)):(n=$d(e),n.c(),ka(n,1),n.m(t,o)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[0]?r?r.p(e,a):(r=fd(e),r.c(),r.m(t,null)):r&&(r.d(1),r=null),(!_i40||8192&a)&&Dr(t,"class",e[13]);},i:function i(e){_i40||(ka(n),_i40=!0);},o:function o(e){Ca(n),_i40=!1;},d:function d(e){e&&Mr(t),n&&n.d(),r&&r.d();}};}(e);return {c:function c(){t=Rr("button"),l&&l.c(),Dr(t,"type",e[6]),Dr(t,"style",e[4]),t.disabled=e[5],Dr(t,"class",e[12]),Dr(t,"title",o=md(e[0],e[1],e[2]));},m:function m(o,a){Tr(o,t,a),l&&l.m(t,null),e[28](t),_i41=!0,n||(r=[Lr(t,"keydown",function(){ir(e[8])&&e[8].apply(this,arguments);}),Lr(t,"click",function(){ir(e[7])&&e[7].apply(this,arguments);}),Lr(t,"pointerdown",function(){ir(e[14])&&e[14].apply(this,arguments);}),gr(e[9].call(null,t))],n=!0);},p:function p(n,_ref171){var _ref172=_slicedToArray(_ref171,1),r=_ref172[0];e=n,s?s.p&&(!_i41||536870912&r)&&ur(s,a,e,e[29],_i41?dr(a,e[29],r,null):hr(e[29]),null):l&&l.p&&(!_i41||10249&r)&&l.p(e,_i41?r:-1),(!_i41||64&r)&&Dr(t,"type",e[6]),(!_i41||16&r)&&Dr(t,"style",e[4]),(!_i41||32&r)&&(t.disabled=e[5]),(!_i41||4096&r)&&Dr(t,"class",e[12]),(!_i41||7&r&&o!==(o=md(e[0],e[1],e[2])))&&Dr(t,"title",o);},i:function i(e){_i41||(ka(l,e),_i41=!0);},o:function o(e){Ca(l,e),_i41=!1;},d:function d(o){o&&Mr(t),l&&l.d(o),e[28](null),n=!1,or(r);}};}function bd(e,t,o){var i,r,a,s,l,c,_t$$$slots4=t.$$slots,d=_t$$$slots4===void 0?{}:_t$$$slots4,u=t.$$scope,h=t.class,p=t.label,m=t.title,$=t.shortcut,g=t.labelClass,f=t.innerClass,_t$hideLabel=t.hideLabel,y=_t$hideLabel===void 0?!1:_t$hideLabel,b=t.icon,x=t.style,v=t.disabled,_t$type=t.type,w=_t$type===void 0?"button":_t$type,S=t.onclick,k=t.onkeydown,C=t.onhold,_t$action=t.action,T=_t$action===void 0?function(){}:_t$action,_t$holdThreshold=t.holdThreshold,M=_t$holdThreshold===void 0?500:_t$holdThreshold,_t$holdSpeedUpFactor=t.holdSpeedUpFactor,R=_t$holdSpeedUpFactor===void 0?.5:_t$holdSpeedUpFactor,_t$holdSpeedMin=t.holdSpeedMin,P=_t$holdSpeedMin===void 0?20:_t$holdSpeedMin;var E=function E(e){o(25,c=setTimeout(function(){C(),E(Math.max(e*R,P));},e));};var I;return e.$$set=function(e){"class"in e&&o(15,h=e.class),"label"in e&&o(0,p=e.label),"title"in e&&o(1,m=e.title),"shortcut"in e&&o(2,$=e.shortcut),"labelClass"in e&&o(16,g=e.labelClass),"innerClass"in e&&o(17,f=e.innerClass),"hideLabel"in e&&o(18,y=e.hideLabel),"icon"in e&&o(3,b=e.icon),"style"in e&&o(4,x=e.style),"disabled"in e&&o(5,v=e.disabled),"type"in e&&o(6,w=e.type),"onclick"in e&&o(7,S=e.onclick),"onkeydown"in e&&o(8,k=e.onkeydown),"onhold"in e&&o(19,C=e.onhold),"action"in e&&o(9,T=e.action),"holdThreshold"in e&&o(20,M=e.holdThreshold),"holdSpeedUpFactor"in e&&o(21,R=e.holdSpeedUpFactor),"holdSpeedMin"in e&&o(22,P=e.holdSpeedMin),"$$scope"in e&&o(29,u=e.$$scope);},e.$$.update=function(){101187584&e.$$.dirty&&o(26,r=C?function(){c&&(clearTimeout(c),o(25,c=void 0),document.documentElement.removeEventListener("pointerup",r));}:n),68681728&e.$$.dirty&&o(14,i=C?function(){document.documentElement.addEventListener("pointerup",r),E(M);}:n),131072&e.$$.dirty&&o(13,a=Bc(["PinturaButtonInner",f])),294912&e.$$.dirty&&o(12,s=Bc(["PinturaButton",y&&"PinturaButtonIconOnly",h])),327680&e.$$.dirty&&o(11,l=Bc([y?"implicit":"PinturaButtonLabel",g]));},[p,m,$,b,x,v,w,S,k,T,I,l,s,a,i,h,g,f,y,C,M,R,P,function(e){return pd(e,I);},function(){return I;},c,r,d,function(e){ra[e?"unshift":"push"](function(){I=e,o(10,I);});},u];}var xd=/*#__PURE__*/function(_Wa6){function xd(e){var _this9;_classCallCheck(this,xd);_this9=_callSuper(this,xd),Ba(_assertThisInitialized(_this9),e,bd,yd,nr,{class:15,label:0,title:1,shortcut:2,labelClass:16,innerClass:17,hideLabel:18,icon:3,style:4,disabled:5,type:6,onclick:7,onkeydown:8,onhold:19,action:9,holdThreshold:20,holdSpeedUpFactor:21,holdSpeedMin:22,isEventTarget:23,getElement:24});return _this9;}_inherits(xd,_Wa6);return _createClass(xd,[{key:"isEventTarget",get:function get(){return this.$$.ctx[23];}},{key:"getElement",get:function get(){return this.$$.ctx[24];}}]);}(Wa);var vd=function vd(e,t){var o=e.findIndex(t);if(o>=0)return e.splice(o,1);};var wd=80;var Sd=function Sd(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _t$inertia=t.inertia,o=_t$inertia===void 0?!1:_t$inertia,_t$inertiaDurationMul=t.inertiaDurationMultiplier,i=_t$inertiaDurationMul===void 0?wd:_t$inertiaDurationMul,_t$shouldStartInterac=t.shouldStartInteraction,n=_t$shouldStartInterac===void 0?function(){return !0;}:_t$shouldStartInterac,_t$pinch=t.pinch,r=_t$pinch===void 0?!1:_t$pinch,a=t.multiTouch,_t$getEventPosition=t.getEventPosition,s=_t$getEventPosition===void 0?function(e){return he(e.clientX,e.clientY);}:_t$getEventPosition,_t$observeKeys=t.observeKeys,l=_t$observeKeys===void 0?!1:_t$observeKeys;function c(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}));}function d(){w&&w(),w=void 0;}var u=[],h=function h(e){return 0===e.timeStamp?Date.now():e.timeStamp;},p=function p(){var e=me(u[0].position);if(u[1]){var _t59=.5*(u[1].position.x-e.x),_o59=.5*(u[1].position.y-e.y);e.x+=_t59,e.y+=_o59;}return e;},m=function m(e){e.origin.x=e.position.x,e.origin.y=e.position.y,e.translation.x=0,e.translation.y=0;},$=function $(e){var t=function(e){return u.findIndex(function(t){return t.event.pointerId===e.pointerId;});}(e);if(!(t<0))return u[t];},g=function g(){return 1===u.length;},f=function f(){return 2===u.length;},y=function y(e){var t=Ie(e.map(function(e){return e.position;}));return {center:t,distance:function(e,t){return e.reduce(function(e,o){return e+Pe(t,o.position);},0)/e.length;}(e,t),velocity:Ie(e.map(function(e){return e.velocity;})),translation:Ie(e.map(function(e){return e.translation;}))};};var b,x,v,w,S,k,C,T,M=0,R=void 0;e.addEventListener("pointerdown",L);var P=["Meta","Control","Alt","Shift"];function E(e){if(!P.includes(e.key))return;var t=e.metaKey,o=e.ctrlKey,i=e.altKey,n=e.shiftKey;A({metaKey:t,ctrlKey:o,altKey:i,shiftKey:n});}var I=Date.now();var A=function A(e){var t=me(u[0].translation);var o=C;if(r&&f()){o*=Pe(u[0].position,u[1].position)/S,we(t,u[1].translation);}we(t,k);var i=Date.now();i-I<16||(I=i,c("interactionupdate",_objectSpread2({position:p(),translation:t,scalar:r?o:void 0,isMultiTouching:f()},e)));};function L(t){if(!f()&&!function(e){return Lo(e.button)&&0!==e.button;}(t)&&n(t,e))if(d(),function(e){var t=h(e),o={timeStamp:t,timeStampInitial:t,position:s(e),origin:s(e),velocity:ue(),velocityHistory:[],velocityAverage:ue(),translation:ue(),interactionState:void 0,event:e};u.push(o),o.interactionState=y(u);}(t),l&&(window.addEventListener("keydown",E),window.addEventListener("keyup",E)),g())document.documentElement.addEventListener("pointermove",z),document.documentElement.addEventListener("pointerup",F),document.documentElement.addEventListener("pointercancel",F),document.addEventListener("visibilitychange",O),T=!1,C=1,k=ue(),S=void 0,c("interactionstart",{origin:me($(t).origin)});else if(r)T=!0,S=Pe(u[0].position,u[1].position),k.x+=u[0].translation.x,k.y+=u[0].translation.y,m(u[0]);else if(!1===a)return u.length=0,W(),c("interactioncancel");}function z(e){e.preventDefault(),function(e){var t=$(e);if(!t)return;var o=h(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(function(e,t,o,i){return e.x+=t.x/i.length,e.y+=t.y/i.length,e;},ue()),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);var _ref173=l?e:{},_ref173$metaKey=_ref173.metaKey,t=_ref173$metaKey===void 0?!1:_ref173$metaKey,_ref173$ctrlKey=_ref173.ctrlKey,o=_ref173$ctrlKey===void 0?!1:_ref173$ctrlKey,_ref173$altKey=_ref173.altKey,i=_ref173$altKey===void 0?!1:_ref173$altKey,_ref173$shiftKey=_ref173.shiftKey,n=_ref173$shiftKey===void 0?!1:_ref173$shiftKey;A({metaKey:t,ctrlKey:o,altKey:i,shiftKey:n});}function F(e){if(!$(e))return;var t=p(),n=function(e){var t=vd(u,function(t){return t.event.pointerId===e.pointerId;});if(t)return t[0];}(e);if(r&&g()){var _e89=Pe(u[0].position,n.position);C*=_e89/S,k.x+=u[0].translation.x+n.translation.x,k.y+=u[0].translation.y+n.translation.y,m(u[0]);}var a=!1,s=!1;if(!T&&n){var _e90=performance.now(),_t60=_e90-n.timeStampInitial,_o60=Re(n.translation);a=_o60<64&&_t60<300,s=!!(R&&a&&_e90-M<700&&Re(R,n.position)<128),a&&(R=me(n.position),M=_e90);}if(u.length>0)return;W();var l=me(n.translation),d=me(n.velocityAverage);var h=!1;c("interactionrelease",{isTap:a,isDoubleTap:s,position:t,translation:l,scalar:C,preventInertia:function preventInertia(){return h=!0;}});var f=Pe(d);if(h||!o||f<.25)return B(l,{isTap:a,isDoubleTap:s});x=me(t),v=me(l),b=cc(me(l),{easing:ac,duration:f*i}),b.set({x:l.x+50*d.x,y:l.y+50*d.y}).then(function(){w&&B(ar(b),{isTap:a,isDoubleTap:s});}),w=b.subscribe(D);}function D(e){e&&c("interactionupdate",{position:he(x.x+(e.x-v.x),x.y+(e.y-v.y)),translation:e,scalar:r?C:void 0});}function O(e){if("visible"===document.visibilityState||!u.length)return;var t=y(u);d(),c("interactionend",_objectSpread2({},t)),u.length=0,W();}function B(e,t){d(),c("interactionend",_objectSpread2(_objectSpread2({},t),{},{translation:e,scalar:r?C:void 0}));}function W(){l&&window.removeEventListener("keydown",E),l&&window.removeEventListener("keyup",E),document.documentElement.removeEventListener("pointermove",z),document.documentElement.removeEventListener("pointerup",F),document.documentElement.removeEventListener("pointercancel",F),document.addEventListener("visibilitychange",O);}return {destroy:function destroy(){d(),e.removeEventListener("pointerdown",L);}};},kd=function kd(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=t.direction,_t$shiftMultiplier=t.shiftMultiplier,i=_t$shiftMultiplier===void 0?10:_t$shiftMultiplier,_t$bubbles=t.bubbles,n=_t$bubbles===void 0?!1:_t$bubbles,_t$preventDefault=t.preventDefault,r=_t$preventDefault===void 0?!1:_t$preventDefault,_t$stopKeydownPropaga=t.stopKeydownPropagation,a=_t$stopKeydownPropaga===void 0?!0:_t$stopKeydownPropaga,s="horizontal"===o,l="vertical"===o,c=function c(t){var o=t.key,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;var h=c?i:1;a&&t.stopPropagation(),r&&t.preventDefault(),e.dispatchEvent(new CustomEvent("nudge",{bubbles:n,detail:he((/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:function destroy(){e.removeEventListener("keydown",c);}};};function Cd(e,t){return t?t*Math.sign(e)*Math.log10(1+Math.abs(e)/t):e;}var Td=function Td(e,t,o){if(!t||!o)return _objectSpread2({},e);var i=e.x+Cd(t.x-e.x,o),n=e.x+e.width+Cd(t.x+t.width-(e.x+e.width),o),r=e.y+Cd(t.y-e.y,o);return {x:i,y:r,width:n-i,height:e.y+e.height+Cd(t.y+t.height-(e.y+e.height),o)-r};},Md=function Md(e,t,o){return t&&o?he(e.x+Cd(t.x-e.x,o),e.y+Cd(t.y-e.y,o)):_objectSpread2({},e);};var Rd=function Rd(e,t){if(e)return /em/.test(e)?16*parseInt(e,10):/px/.test(e)?parseInt(e,10):void 0;},Pd=function Pd(e,t){var o=e.detail||0;var i=e.deltaX,n=e.deltaY,r=e.wheelDelta,a=e.wheelDeltaX,s=e.wheelDeltaY,_ref174=t||{},_ref174$fixScrollDire=_ref174.fixScrollDirection,l=_ref174$fixScrollDire===void 0?!1:_ref174$fixScrollDire;return Lo(a)&&Math.abs(a)>Math.abs(s)?o=a/-120:Lo(i)&&Math.abs(i)>Math.abs(n)?o=i/20:(r||s)&&(o=(r||s)/-120),o||(o=n/20),(F()||Yt())&&(o*=2),l&&$o()&&(o*=-1),o;};function Ed(e){var t,o,i,n,r,a,s;var l=e[37].default,_c11=lr(l,e,e[36],null);return {c:function c(){t=Rr("div"),o=Rr("div"),_c11&&_c11.c(),Dr(o,"style",e[5]),Dr(t,"class",i=Bc(["PinturaScrollable",e[0]])),Dr(t,"style",e[4]),Dr(t,"data-direction",e[1]),Dr(t,"data-state",e[6]);},m:function m(i,l){Tr(i,t,l),Sr(t,o),_c11&&_c11.m(o,null),e[39](t),r=!0,a||(s=[Lr(o,"interactionstart",e[9]),Lr(o,"interactionupdate",e[11]),Lr(o,"interactionend",e[12]),Lr(o,"interactionrelease",e[10]),gr(Sd.call(null,o,{inertia:!0})),Lr(o,"measure",e[38]),gr(Mc.call(null,o)),Lr(t,"wheel",e[14],{passive:!1}),Lr(t,"scroll",e[16]),Lr(t,"focusin",e[15]),Lr(t,"nudge",e[17]),Lr(t,"measure",e[13]),gr(Mc.call(null,t,{observePosition:!0})),gr(n=kd.call(null,t,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1}))],a=!0);},p:function p(e,a){_c11&&_c11.p&&(!r||32&a[1])&&ur(_c11,l,e,e[36],r?dr(l,e[36],a,null):hr(e[36]),null),(!r||32&a[0])&&Dr(o,"style",e[5]),(!r||1&a[0]&&i!==(i=Bc(["PinturaScrollable",e[0]])))&&Dr(t,"class",i),(!r||16&a[0])&&Dr(t,"style",e[4]),(!r||2&a[0])&&Dr(t,"data-direction",e[1]),(!r||64&a[0])&&Dr(t,"data-state",e[6]),n&&ir(n.update)&&2&a[0]&&n.update.call(null,{direction:"x"===e[1]?"horizontal":"vertical",stopKeydownPropagation:!1});},i:function i(e){r||(ka(_c11,e),r=!0);},o:function o(e){Ca(_c11,e),r=!1;},d:function d(o){o&&Mr(t),_c11&&_c11.d(o),e[39](null),a=!1,or(s);}};}function Id(e,t,o){var i,r,a,s,l,c,d,u,h,_t$$$slots5=t.$$slots,p=_t$$$slots5===void 0?{}:_t$$$slots5,m=t.$$scope;var $=ea();var g,f,y,b,x="idle",v=uc(0);sr(e,v,function(e){return o(35,u=e);});var w=t.class,_t$scrollBlockInterac=t.scrollBlockInteractionDist,S=_t$scrollBlockInterac===void 0?5:_t$scrollBlockInterac,_t$scrollStep=t.scrollStep,k=_t$scrollStep===void 0?10:_t$scrollStep,_t$scrollFocusMargin=t.scrollFocusMargin,C=_t$scrollFocusMargin===void 0?64:_t$scrollFocusMargin,_t$scrollDirection=t.scrollDirection,T=_t$scrollDirection===void 0?"x":_t$scrollDirection,_t$scrollAutoCancel=t.scrollAutoCancel,M=_t$scrollAutoCancel===void 0?!1:_t$scrollAutoCancel,_t$elasticity=t.elasticity,R=_t$elasticity===void 0?0:_t$elasticity,_t$onscroll=t.onscroll,P=_t$onscroll===void 0?n:_t$onscroll,E=t.maskFeatherSize,I=t.maskFeatherStartOpacity,A=t.maskFeatherEndOpacity,L=t.scroll;var z=oa("fixScrollDirection");var F;sr(e,z,function(e){return o(46,h=e);});var D="",O=!0;var B=v.subscribe(function(e){var t=ue();t[T]=e,P(t);}),W=function W(e){return Math.max(Math.min(0,e),y[i]-f[i]);};var V,_,N;var H=function H(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _t$elastic=t.elastic,i=_t$elastic===void 0?!1:_t$elastic,_t$animate=t.animate,n=_t$animate===void 0?!1:_t$animate,_t$preventScrollState=t.preventScrollState,r=_t$preventScrollState===void 0?!1:_t$preventScrollState;Math.abs(e-g)>S&&"idle"===x&&!b&&!r&&o(28,x="scrolling");var a=W(e),s=i&&R&&!b?a+Cd(e-a,R):a;var l=!0;n?l=!1:O||(l=!b),O=!1,v.set(s,{hard:l}).then(function(e){b&&(O=!0);});};Qr(function(){B();});return e.$$set=function(e){"class"in e&&o(0,w=e.class),"scrollBlockInteractionDist"in e&&o(21,S=e.scrollBlockInteractionDist),"scrollStep"in e&&o(22,k=e.scrollStep),"scrollFocusMargin"in e&&o(23,C=e.scrollFocusMargin),"scrollDirection"in e&&o(1,T=e.scrollDirection),"scrollAutoCancel"in e&&o(24,M=e.scrollAutoCancel),"elasticity"in e&&o(25,R=e.elasticity),"onscroll"in e&&o(26,P=e.onscroll),"maskFeatherSize"in e&&o(20,E=e.maskFeatherSize),"maskFeatherStartOpacity"in e&&o(18,I=e.maskFeatherStartOpacity),"maskFeatherEndOpacity"in e&&o(19,A=e.maskFeatherEndOpacity),"scroll"in e&&o(27,L=e.scroll),"$$scope"in e&&o(36,m=e.$$scope);},e.$$.update=function(){if(2&e.$$.dirty[0]&&o(32,i="x"===T?"width":"height"),2&e.$$.dirty[0]&&o(30,r=T.toUpperCase()),8&e.$$.dirty[0]&&o(34,a=F&&getComputedStyle(F)),8&e.$$.dirty[0]|8&e.$$.dirty[1]&&o(33,s=a&&Rd(a.getPropertyValue("--scrollable-feather-size"))),537657348&e.$$.dirty[0]|22&e.$$.dirty[1]&&null!=u&&y&&null!=s&&f){var _e91=-1*u/s,_t61=-(y[i]-f[i]-u)/s;o(18,I=ls(1-_e91,0,1)),o(19,A=ls(1-_t61,0,1)),o(20,E=s),o(4,D="--scrollable-feather-start-opacity: ".concat(I,";--scrollable-feather-end-opacity: ").concat(A));}134217736&e.$$.dirty[0]&&F&&void 0!==L&&(Lo(L)?H(L):H(L.scrollOffset,L)),536870916&e.$$.dirty[0]|2&e.$$.dirty[1]&&o(31,l=y&&f?f[i]>y[i]:void 0),268435456&e.$$.dirty[0]|1&e.$$.dirty[1]&&o(6,c=Bc([x,l?"overflows":void 0])),1073741824&e.$$.dirty[0]|17&e.$$.dirty[1]&&o(5,d=l?"transform: translate".concat(r,"(").concat(u,"px)"):void 0);},[w,T,f,F,D,d,c,v,z,function(){l&&(_=!1,V=!0,N=he(0,0),b=!1,o(28,x="idle"),g=ar(v));},function(_ref175){var e=_ref175.detail;l&&(b=!0,o(28,x="idle"));},function(_ref176){var e=_ref176.detail;l&&(_||V&&(V=!1,Re(e.translation)<.1)||(!M||"x"!==T||function(e){var t=ve(he(e.x-N.x,e.y-N.y),Math.abs);N=me(e);var o=Re(t),i=t.x-t.y;return !(o>1&&i<-.5);}(e.translation)?H(g+e.translation[T],{elastic:!0}):_=!0));},function(_ref177){var e=_ref177.detail;if(!l)return;if(_)return;var t=g+e.translation[T],o=W(t);O=!1,v.set(o).then(function(e){b&&(O=!0);});},function(_ref178){var e=_ref178.detail;o(29,y=e),$("measure",{x:e.x,y:e.y,width:e.width,height:e.height});},function(e){if(!l)return;e.preventDefault(),e.stopPropagation();var t=e.shiftKey,o=Pd(e,{fixScrollDirection:h})*(t?-1:1),i=ar(v);H(i+o*k,{animate:!0});},function(e){if(!l)return;if(!b)return;var t=e.target;e.target.classList.contains("implicit")&&(t=t.parentNode);var o=t["x"===T?"offsetLeft":"offsetTop"],n=o+t["x"===T?"offsetWidth":"offsetHeight"],r=ar(v),a=C+E;r+o<a?H(-o+a):r+n>y[i]-a&&H(y[i]-n-a,{animate:!0});},function(){o(3,F["x"===T?"scrollLeft":"scrollTop"]=0,F);},function(_ref179){var e=_ref179.detail;if(F.querySelector("[data-focus-visible]"))return;var t=-2*e[T],o=ar(v);H(o+t*k,{animate:!0,preventScrollState:!0});},I,A,E,S,k,C,M,R,P,L,x,y,r,l,i,s,a,u,m,p,function(e){return o(2,f=e.detail);},function(e){ra[e?"unshift":"push"](function(){F=e,o(3,F);});}];}var Ad=/*#__PURE__*/function(_Wa7){function Ad(e){var _this10;_classCallCheck(this,Ad);_this10=_callSuper(this,Ad),Ba(_assertThisInitialized(_this10),e,Id,Ed,nr,{class:0,scrollBlockInteractionDist:21,scrollStep:22,scrollFocusMargin:23,scrollDirection:1,scrollAutoCancel:24,elasticity:25,onscroll:26,maskFeatherSize:20,maskFeatherStartOpacity:18,maskFeatherEndOpacity:19,scroll:27},null,[-1,-1]);return _this10;}_inherits(Ad,_Wa7);return _createClass(Ad);}(Wa);function Ld(e){var t,o,_i42,n,r;return {c:function c(){t=Rr("span"),Dr(t,"class","PinturaStatusMessage");},m:function m(o,a){Tr(o,t,a),t.innerHTML=e[0],_i42=!0,n||(r=[Lr(t,"measure",function(){ir(e[1])&&e[1].apply(this,arguments);}),gr(Mc.call(null,t))],n=!0);},p:function p(o,_ref180){var _ref181=_slicedToArray(_ref180,1),n=_ref181[0];e=o,(!_i42||1&n)&&(t.innerHTML=e[0]);},i:function i(n){_i42||(ha(function(){o||(o=Ma(t,e[4],{duration:e[2]},!0)),o.run(1);}),_i42=!0);},o:function(_o61){function o(_x107){return _o61.apply(this,arguments);}o.toString=function(){return _o61.toString();};return o;}(function(n){o||(o=Ma(t,e[4],{duration:e[2]},!1)),o.run(0),_i42=!1;}),d:function d(e){e&&Mr(t),e&&o&&o.end(),n=!1,or(r);}};}function zd(e,t,o){var i,r,a=t.text,_t$onmeasure=t.onmeasure,s=_t$onmeasure===void 0?n:_t$onmeasure;var l=oa("isAnimated");return sr(e,l,function(e){return o(5,r=e);}),e.$$set=function(e){"text"in e&&o(0,a=e.text),"onmeasure"in e&&o(1,s=e.onmeasure);},e.$$.update=function(){32&e.$$.dirty&&o(2,i=r?500:0);},[a,s,i,l,function(e,_ref182){var t=_ref182.duration;return {duration:t,tick:function tick(t){e.style.opacity=t;}};},r];}var Fd=/*#__PURE__*/function(_Wa8){function Fd(e){var _this11;_classCallCheck(this,Fd);_this11=_callSuper(this,Fd),Ba(_assertThisInitialized(_this11),e,zd,Ld,nr,{text:0,onmeasure:1});return _this11;}_inherits(Fd,_Wa8);return _createClass(Fd);}(Wa);function Dd(e){var t,o,i,n,r,a,s,l,_c12;return {c:function c(){t=Rr("span"),o=Pr("svg"),i=Pr("g"),n=Pr("circle"),r=Pr("circle"),a=Ir(),s=Rr("span"),l=Er(e[3]),Dr(n,"class","PinturaProgressIndicatorBar"),Dr(n,"r","8.5"),Dr(n,"cx","10"),Dr(n,"cy","10"),Dr(n,"stroke-linecap","round"),Dr(n,"opacity",".25"),Dr(r,"class","PinturaProgressIndicatorFill"),Dr(r,"r","8.5"),Dr(r,"stroke-dasharray",e[2]),Dr(r,"cx","10"),Dr(r,"cy","10"),Dr(r,"transform","rotate(-90) translate(-20)"),Dr(i,"fill","none"),Dr(i,"stroke","currentColor"),Dr(i,"stroke-width","2.5"),Dr(i,"stroke-linecap","round"),Dr(i,"opacity",e[1]),Dr(o,"width","20"),Dr(o,"height","20"),Dr(o,"viewBox","0 0 20 20"),Dr(o,"xmlns","http://www.w3.org/2000/svg"),Dr(o,"aria-hidden","true"),Dr(o,"focusable","false"),Dr(s,"class","implicit"),Dr(t,"class","PinturaProgressIndicator"),Dr(t,"data-status",e[0]),Dr(t,"style",_c12="opacity:"+e[4]);},m:function m(e,c){Tr(e,t,c),Sr(t,o),Sr(o,i),Sr(i,n),Sr(i,r),Sr(t,a),Sr(t,s),Sr(s,l);},p:function p(e,_ref183){var _ref184=_slicedToArray(_ref183,1),o=_ref184[0];4&o&&Dr(r,"stroke-dasharray",e[2]),2&o&&Dr(i,"opacity",e[1]),8&o&&Wr(l,e[3]),1&o&&Dr(t,"data-status",e[0]),16&o&&_c12!==(_c12="opacity:"+e[4])&&Dr(t,"style",_c12);},i:Kn,o:Kn,d:function d(e){e&&Mr(t);}};}function Od(e,t,o){var i,n,r,a,s,l,c,d;var u=ea();var h=t.progress,_t$min=t.min,p=_t$min===void 0?0:_t$min,_t$max=t.max,m=_t$max===void 0?100:_t$max,_t$labelBusy=t.labelBusy,$=_t$labelBusy===void 0?"Busy":_t$labelBusy,g=t.opacity;var f=oa("isAnimated");sr(e,f,function(e){return o(14,s=e);});var y=uc(g,{precision:.01});sr(e,y,function(e){return o(4,d=e);});var b=uc(0,{precision:.01}),x=uc(0,{precision:.01});sr(e,x,function(e){return o(15,l=e);});var v=Ha([b],function(e){return ls(e,p,m);});sr(e,v,function(e){return o(16,c=e);});var w=v.subscribe(function(e){1===h&&Math.round(e)>=100&&u("complete");});return Kr(function(){x.set(1,{hard:!s});}),Qr(function(){w();}),e.$$set=function(e){"progress"in e&&o(9,h=e.progress),"min"in e&&o(10,p=e.min),"max"in e&&o(11,m=e.max),"labelBusy"in e&&o(12,$=e.labelBusy),"opacity"in e&&o(13,g=e.opacity);},e.$$.update=function(){24576&e.$$.dirty&&Lo(g)&&y.set(g,{hard:!s}),16896&e.$$.dirty&&h&&h!==1/0&&b.set(100*h,{hard:!s}),70144&e.$$.dirty&&o(3,i=h===1/0?$:Math.round(c)+"%"),66048&e.$$.dirty&&o(2,n=h===1/0?"26.5 53":c/100*53+" 53"),32768&e.$$.dirty&&o(1,r=l),512&e.$$.dirty&&o(0,a=h===1/0?"busy":"loading");},[a,r,n,i,d,f,y,x,v,h,p,m,$,g,s,l,c];}var Bd=/*#__PURE__*/function(_Wa9){function Bd(e){var _this12;_classCallCheck(this,Bd);_this12=_callSuper(this,Bd),Ba(_assertThisInitialized(_this12),e,Od,Dd,nr,{progress:9,min:10,max:11,labelBusy:12,opacity:13});return _this12;}_inherits(Bd,_Wa9);return _createClass(Bd);}(Wa);function Wd(e){var t,o,_i43;var n=e[5].default,r=lr(n,e,e[4],null);return {c:function c(){t=Rr("span"),r&&r.c(),Dr(t,"class",o="PinturaStatusAside "+e[0]),Dr(t,"style",e[1]);},m:function m(e,o){Tr(e,t,o),r&&r.m(t,null),_i43=!0;},p:function p(e,_ref185){var _ref186=_slicedToArray(_ref185,1),a=_ref186[0];r&&r.p&&(!_i43||16&a)&&ur(r,n,e,e[4],_i43?dr(n,e[4],a,null):hr(e[4]),null),(!_i43||1&a&&o!==(o="PinturaStatusAside "+e[0]))&&Dr(t,"class",o),(!_i43||2&a)&&Dr(t,"style",e[1]);},i:function i(e){_i43||(ka(r,e),_i43=!0);},o:function o(e){Ca(r,e),_i43=!1;},d:function d(e){e&&Mr(t),r&&r.d(e);}};}function Vd(e,t,o){var i,_t$$$slots6=t.$$slots,n=_t$$$slots6===void 0?{}:_t$$$slots6,r=t.$$scope,_t$offset=t.offset,a=_t$offset===void 0?0:_t$offset,_t$opacity=t.opacity,s=_t$opacity===void 0?0:_t$opacity,l=t.class;return e.$$set=function(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=function(){12&e.$$.dirty&&o(1,i="transform:translateX(".concat(a,"px);opacity:").concat(s));},[l,i,a,s,r,n];}var _d=/*#__PURE__*/function(_Wa10){function _d(e){var _this13;_classCallCheck(this,_d);_this13=_callSuper(this,_d),Ba(_assertThisInitialized(_this13),e,Vd,Wd,nr,{offset:2,opacity:3,class:0});return _this13;}_inherits(_d,_Wa10);return _createClass(_d);}(Wa);var Nd=Ra.document;function Hd(e){var t,o,i,n;return {c:function c(){t=Ir(),o=Rr("button"),Dr(o,"class","PinturaImageButton"),Dr(o,"type","button"),Dr(o,"title",e[1]),o.disabled=e[2];},m:function m(r,a){Tr(r,t,a),Tr(r,o,a),o.innerHTML=e[0],e[11](o),i||(n=[Lr(Nd.body,"load",e[5],!0),Lr(Nd.body,"error",e[6],!0),Lr(o,"pointerdown",e[4])],i=!0);},p:function p(e,_ref36){var _ref99=_slicedToArray(_ref36,1),t=_ref99[0];1&t&&(o.innerHTML=e[0]),2&t&&Dr(o,"title",e[1]),4&t&&(o.disabled=e[2]);},i:Kn,o:Kn,d:function d(r){r&&Mr(t),r&&Mr(o),e[11](null),i=!1,or(n);}};}function jd(e,t,o){var i,r=t.html,a=t.title,s=t.onclick,_t$disabled2=t.disabled,l=_t$disabled2===void 0?!1:_t$disabled2,_t$ongrab=t.ongrab,c=_t$ongrab===void 0?n:_t$ongrab,_t$ondrag=t.ondrag,d=_t$ondrag===void 0?n:_t$ondrag,_t$ondrop=t.ondrop,u=_t$ondrop===void 0?n:_t$ondrop;var h=function h(e){return Re(p,he(e.pageX,e.pageY))<256;};var p;var m=function m(e){document.documentElement.removeEventListener("pointermove",$),document.documentElement.removeEventListener("pointerup",m);var t=he(e.pageX,e.pageY);if(Re(p,t)<32)return s(e);h(e)||u(e);},$=function $(e){h(e)||d(e);},g=function g(e){return i&&i.contains(e)&&"IMG"===e.nodeName;};return e.$$set=function(e){"html"in e&&o(0,r=e.html),"title"in e&&o(1,a=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=function(){8&e.$$.dirty&&i&&i.querySelector("img")&&o(3,i.dataset.loader=!0,i);},[r,a,l,i,function(e){p=he(e.pageX,e.pageY),c(e),document.documentElement.addEventListener("pointermove",$),document.documentElement.addEventListener("pointerup",m);},function(_ref100){var e=_ref100.target;g(e)&&o(3,i.dataset.load=!0,i);},function(_ref102){var e=_ref102.target;g(e)&&o(3,i.dataset.error=!0,i);},s,c,d,u,function(e){ra[e?"unshift":"push"](function(){i=e,o(3,i);});}];}var Ud=/*#__PURE__*/function(_Wa11){function Ud(e){var _this14;_classCallCheck(this,Ud);_this14=_callSuper(this,Ud),Ba(_assertThisInitialized(_this14),e,jd,Hd,nr,{html:0,title:1,onclick:7,disabled:2,ongrab:8,ondrag:9,ondrop:10});return _this14;}_inherits(Ud,_Wa11);return _createClass(Ud);}(Wa);function Gd(e,t,o){var i=e.slice();return i[14]=t[o],i;}function Zd(e,t){var o,_i4,n,r,a,s,l;function c(){return t[10](t[14]);}function d(){var _t9;for(var _len5=arguments.length,e=new Array(_len5),_key5=0;_key5<_len5;_key5++){e[_key5]=arguments[_key5];}return (_t9=t)[11].apply(_t9,[t[14]].concat(e));}function u(){var _t18;for(var _len6=arguments.length,e=new Array(_len6),_key6=0;_key6<_len6;_key6++){e[_key6]=arguments[_key6];}return (_t18=t)[12].apply(_t18,[t[14]].concat(e));}function h(){var _t53;for(var _len7=arguments.length,e=new Array(_len7),_key7=0;_key7<_len7;_key7++){e[_key7]=arguments[_key7];}return (_t53=t)[13].apply(_t53,[t[14]].concat(e));}return _i4=new Ud({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:function c(){o=Rr("li"),Fa(_i4.$$.fragment),n=Ir(),Dr(o,"style",t[6]),this.first=o;},m:function m(e,c){Tr(e,o,c),Da(_i4,o,null),Sr(o,n),a=!0,s||(l=gr(r=t[8].call(null,o,t[14])),s=!0);},p:function p(e,n){t=e;var 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),_i4.$set(s),(!a||64&n)&&Dr(o,"style",t[6]),r&&ir(r.update)&&1&n&&r.update.call(null,t[14]);},i:function i(e){a||(ka(_i4.$$.fragment,e),a=!0);},o:function o(e){Ca(_i4.$$.fragment,e),a=!1;},d:function d(e){e&&Mr(o),Oa(_i4),s=!1,l();}};}function Xd(e){var t,_o10,_i16=[],n=new Map(),r=e[0];var a=function a(e){return e[14].id;};for(var _t62=0;_t62<r.length;_t62+=1){var _o7=Gd(e,r,_t62),_s15=a(_o7);n.set(_s15,_i16[_t62]=Zd(_s15,_o7));}return {c:function c(){t=Rr("ul");for(var _e11=0;_e11<_i16.length;_e11+=1)_i16[_e11].c();Dr(t,"class","PinturaImageButtonList");},m:function m(e,n){Tr(e,t,n);for(var _e25=0;_e25<_i16.length;_e25+=1)_i16[_e25].m(t,null);_o10=!0;},p:function p(e,_ref103){var _ref187=_slicedToArray(_ref103,1),o=_ref187[0];127&o&&(r=e[0],wa(),_i16=Ia(_i16,o,a,1,e,r,n,t,Ea,Zd,null,Gd),Sa());},i:function i(e){if(!_o10){for(var _e32=0;_e32<r.length;_e32+=1)ka(_i16[_e32]);_o10=!0;}},o:function o(e){for(var _e36=0;_e36<_i16.length;_e36+=1)Ca(_i16[_e36]);_o10=!1;},d:function d(e){e&&Mr(t);for(var _e41=0;_e41<_i16.length;_e41+=1)_i16[_e41].d();}};}function Yd(e,t,o){var i,n,r=t.items,a=t.disabled,s=t.onclickitem,l=t.ongrabitem,c=t.ondragitem,d=t.ondropitem;var u=uc(0,{stiffness:.25,damping:.9});sr(e,u,function(e){return o(9,n=e);});Kr(function(){return u.set(1);});return e.$$set=function(e){"items"in e&&o(0,r=e.items),"disabled"in e&&o(1,a=e.disabled),"onclickitem"in e&&o(2,s=e.onclickitem),"ongrabitem"in e&&o(3,l=e.ongrabitem),"ondragitem"in e&&o(4,c=e.ondragitem),"ondropitem"in e&&o(5,d=e.ondropitem);},e.$$.update=function(){512&e.$$.dirty&&o(6,i="opacity:"+n);},[r,a,s,l,c,d,i,u,function(e,t){return t.mount&&t.mount(e.firstChild,t);},n,function(e){return s(e.id);},function(e,t){return l&&l(e.id,t);},function(e,t){return c&&c(e.id,t);},function(e,t){return d&&d(e.id,t);}];}var qd=/*#__PURE__*/function(_Wa12){function qd(e){var _this15;_classCallCheck(this,qd);_this15=_callSuper(this,qd),Ba(_assertThisInitialized(_this15),e,Yd,Xd,nr,{items:0,disabled:1,onclickitem:2,ongrabitem:3,ondragitem:4,ondropitem:5});return _this15;}_inherits(qd,_Wa12);return _createClass(qd);}(Wa);var Kd=function Kd(){return c()&&window.devicePixelRatio||1;};var Jd=null;var Qd=function Qd(e){return null===Jd&&(Jd=1===Kd()?Math.round:function(e){return e;}),Jd(e);},eu=function eu(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(e){if(t.preventScroll&&Yt()){var _t63=document.body.scrollTop;return e.focus(),void(document.body.scrollTop=_t63);}e.focus(t);}},tu=function tu(e){return /date|email|number|search|text|url/.test(e.type);},ou=function ou(e){return function(e){return /textarea/i.test(e.nodeName);}(e)||tu(e)||e.isContentEditable;};var iu=function iu(e){return {};},nu=function nu(e){return {};},ru=function ru(e){return {};},au=function au(e){return {};};function su(e){var t,_o34;var i=[e[7]];var n={$$slots:{default:[cu]},$$scope:{ctx:e}};for(var _e68=0;_e68<i.length;_e68+=1)n=Qn(n,i[_e68]);return t=new xd({props:n}),e[46](t),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o34=!0;},p:function p(e,o){var n=128&o[0]?Aa(i,[La(e[7])]):{};524288&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);},i:function i(e){_o34||(ka(t.$$.fragment,e),_o34=!0);},o:function o(e){Ca(t.$$.fragment,e),_o34=!1;},d:function d(o){e[46](null),Oa(t,o);}};}function lu(e){var t,_o62;var i=[e[7]];var n={};for(var _e72=0;_e72<i.length;_e72+=1)n=Qn(n,i[_e72]);return t=new xd({props:n}),e[45](t),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o62=!0;},p:function p(e,o){var n=128&o[0]?Aa(i,[La(e[7])]):{};t.$set(n);},i:function i(e){_o62||(ka(t.$$.fragment,e),_o62=!0);},o:function o(e){Ca(t.$$.fragment,e),_o62=!1;},d:function d(o){e[45](null),Oa(t,o);}};}function cu(e){var t;var o=e[44].label,_i44=lr(o,e,e[50],au);return {c:function c(){_i44&&_i44.c();},m:function m(e,o){_i44&&_i44.m(e,o),t=!0;},p:function p(e,n){_i44&&_i44.p&&(!t||524288&n[1])&&ur(_i44,o,e,e[50],t?dr(o,e[50],n,ru):hr(e[50]),au);},i:function i(e){t||(ka(_i44,e),t=!0);},o:function o(e){Ca(_i44,e),t=!1;},d:function d(e){_i44&&_i44.d(e);}};}function du(e){var t,o,i,n,r,a,s;var l=e[44].details,_c13=lr(l,e,e[50],nu);return {c:function c(){t=Rr("div"),_c13&&_c13.c(),o=Ir(),i=Rr("span"),Dr(i,"class","PinturaPanelTip"),Dr(i,"style",e[10]),Dr(t,"class",n=Bc(["PinturaPanel","pintura-editor-panel",e[2]])),Dr(t,"tabindex","-1"),Dr(t,"style",e[11]);},m:function m(n,l){Tr(n,t,l),_c13&&_c13.m(t,null),Sr(t,o),Sr(t,i),e[47](t),r=!0,a||(s=[Lr(t,"close",e[48]),Lr(t,"keydown",e[18]),Lr(t,"measure",e[49]),gr(Mc.call(null,t))],a=!0);},p:function p(e,o){_c13&&_c13.p&&(!r||524288&o[1])&&ur(_c13,l,e,e[50],r?dr(l,e[50],o,iu):hr(e[50]),nu),(!r||1024&o[0])&&Dr(i,"style",e[10]),(!r||4&o[0]&&n!==(n=Bc(["PinturaPanel","pintura-editor-panel",e[2]])))&&Dr(t,"class",n),(!r||2048&o[0])&&Dr(t,"style",e[11]);},i:function i(e){r||(ka(_c13,e),r=!0);},o:function o(e){Ca(_c13,e),r=!1;},d:function d(o){o&&Mr(t),_c13&&_c13.d(o),e[47](null),a=!1,or(s);}};}function uu(e){var t,o,_i45,n,r,a,s,l,c;var d=[lu,su],u=[];function h(e,t){return e[1]?0:1;}o=h(e),_i45=u[o]=d[o](e);var _p13=e[6]&&du(e);return {c:function c(){t=Ir(),_i45.c(),n=Ir(),_p13&&_p13.c(),r=Ir(),a=Ar();},m:function m(i,d){Tr(i,t,d),u[o].m(i,d),Tr(i,n,d),_p13&&_p13.m(i,d),Tr(i,r,d),Tr(i,a,d),s=!0,l||(c=[Lr(document.body,"pointerdown",function(){ir(e[9])&&e[9].apply(this,arguments);}),Lr(document.body,"pointerup",function(){ir(e[8])&&e[8].apply(this,arguments);})],l=!0);},p:function p(t,a){var s=o;o=h(e=t),o===s?u[o].p(e,a):(wa(),Ca(u[s],1,1,function(){u[s]=null;}),Sa(),_i45=u[o],_i45?_i45.p(e,a):(_i45=u[o]=d[o](e),_i45.c()),ka(_i45,1),_i45.m(n.parentNode,n)),e[6]?_p13?(_p13.p(e,a),64&a[0]&&ka(_p13,1)):(_p13=du(e),_p13.c(),ka(_p13,1),_p13.m(r.parentNode,r)):_p13&&(wa(),Ca(_p13,1,1,function(){_p13=null;}),Sa());},i:function i(e){s||(ka(_i45),ka(_p13),ka(false),s=!0);},o:function o(e){Ca(_i45),Ca(_p13),Ca(false),s=!1;},d:function d(e){e&&Mr(t),u[o].d(e),e&&Mr(n),_p13&&_p13.d(e),e&&Mr(r),e&&Mr(a),l=!1,or(c);}};}function hu(e,t,o){var i,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,_t$$$slots7=t.$$slots,S=_t$$$slots7===void 0?{}:_t$$$slots7,k=t.$$scope,C=t.buttonClass,T=t.buttonLabel,M=t.buttonLabelClass,R=t.buttonHideLabel,P=t.buttonIcon,E=t.buttonTitle,I=t.panelClass,_t$isActive2=t.isActive,A=_t$isActive2===void 0?!1:_t$isActive2,_t$onshow=t.onshow,L=_t$onshow===void 0?function(_ref188){var e=_ref188.panel;return eu(e,{preventScroll:!0});}:_t$onshow,_t$onhide=t.onhide,z=_t$onhide===void 0?n:_t$onhide;var F=oa("isAnimated");sr(e,F,function(e){return o(43,w=e);});var D=oa("rootPortal");sr(e,D,function(e){return o(38,f=e);});var O=oa("rootRect");var B,W,V;sr(e,O,function(e){return o(41,x=e);});var _=function _(){return o(26,V=i&&i.getBoundingClientRect());};var N=ue(),H=uc(0);sr(e,H,function(e){return o(40,b=e);});var j=ue();var U=Na({x:0,y:0});sr(e,U,function(e){return o(39,y=e);});var G=uc(-5,{stiffness:.1,damping:.35,precision:.001});sr(e,G,function(e){return o(42,v=e);});var Z=!0;var X=function X(e){return pd(e,f)||W.isEventTarget(e);};var Y,q,K=!1;var J=function J(e){ou(e.target)||(A||_(),o(31,q=e),o(0,A=!A));},Q=function Q(e){/down/i.test(e.key)&&(o(0,A=!0),o(31,q=e));};Qr(function(){if(!f)return;if(!Y)return;var e=Y;ua().then(function(){e.parentNode&&e.remove();});});return e.$$set=function(e){"buttonClass"in e&&o(19,C=e.buttonClass),"buttonLabel"in e&&o(1,T=e.buttonLabel),"buttonLabelClass"in e&&o(20,M=e.buttonLabelClass),"buttonHideLabel"in e&&o(21,R=e.buttonHideLabel),"buttonIcon"in e&&o(22,P=e.buttonIcon),"buttonTitle"in e&&o(23,E=e.buttonTitle),"panelClass"in e&&o(2,I=e.panelClass),"isActive"in e&&o(0,A=e.isActive),"onshow"in e&&o(24,L=e.onshow),"onhide"in e&&o(25,z=e.onhide),"$$scope"in e&&o(50,k=e.$$scope);},e.$$.update=function(){if(16&e.$$.dirty[0]&&(i=W&&W.getElement()),1073741825&e.$$.dirty[0]&&o(8,$=A?function(e){K&&(o(30,K=!1),X(e)||o(0,A=!1));}:void 0),1&e.$$.dirty[0]|4096&e.$$.dirty[1]&&H.set(A?1:0,{hard:!1===w}),1&e.$$.dirty[0]|4096&e.$$.dirty[1]&&G.set(A?0:-5,{hard:!1===w}),2048&e.$$.dirty[1]&&o(34,r=1-v/-5),1&e.$$.dirty[0]|1024&e.$$.dirty[1]&&x&&A&&_(),67108873&e.$$.dirty[0]|1024&e.$$.dirty[1]&&x&&B&&V&&A){o(29,Z=!0);var _e74=V.x-x.x+.5*V.width-.5*B.width,_t64=V.y-x.y+V.height;var _i46=12,_n4=12,_r2=x.width-12,_a2=x.height-12,_s16=_e74,_l9=_t64,_c14=_s16+B.width,_d10=_l9+B.height;if(_s16<_i46&&(o(28,j.x=_s16-_i46,j),_e74=_i46),_c14>_r2&&(o(28,j.x=_c14-_r2,j),_e74=_r2-B.width),_d10>_a2){o(27,N.y=-1,N);_n4<_t64-B.height-V.height?(o(28,j.y=0,j),_t64-=B.height+V.height):(o(28,j.y=_t64-(_d10-_a2),j),_t64-=_d10-_a2-12,o(29,Z=!1));}else o(27,N.y=1,N);$r(U,y=ve(he(_e74,_t64),Qd),y);}512&e.$$.dirty[1]&&o(6,a=b>0),512&e.$$.dirty[1]&&o(37,s=b<1),134217728&e.$$.dirty[0]|2304&e.$$.dirty[1]&&o(36,l="translateX(".concat(Math.round(y.x)+12*N.x,"px) translateY(").concat(Math.round(y.y)+12*N.y+N.y*v,"px)")),1024&e.$$.dirty[1]&&o(35,c="--panel-max-height:".concat(x.height-24,"px")),624&e.$$.dirty[1]&&o(11,d=s?"opacity: ".concat(b,"; pointer-events: ").concat(b<1?"none":"all","; transform: ").concat(l,";").concat(c):"transform: ".concat(l,";").concat(c)),8&e.$$.dirty[1]&&o(32,u=.5+.5*r),8&e.$$.dirty[1]&&o(33,h=r),939524104&e.$$.dirty[0]|262&e.$$.dirty[1]&&o(10,p=y&&B&&"opacity:".concat(Z?h:0,";transform:scaleX(").concat(u,")rotate(45deg);top:").concat(N.y<0?j.y+B.height:0,"px;left:").concat(j.x+.5*B.width,"px")),1&e.$$.dirty[0]&&o(9,m=A?function(e){X(e)||o(30,K=!0);}:void 0),96&e.$$.dirty[0]|128&e.$$.dirty[1]&&a&&f&&Y&&Y.parentNode!==f&&f.append(Y),1&e.$$.dirty[0]&&(A||o(31,q=void 0)),16777313&e.$$.dirty[0]|1&e.$$.dirty[1]&&A&&a&&Y&&L({e:q,panel:Y}),33554497&e.$$.dirty[0]&&a&&!A&&z(),16252930&e.$$.dirty[0]&&o(7,g={label:T,icon:P,class:Bc(["PinturaPanelButton",C]),onkeydown:Q,onclick:J,hideLabel:R,labelClass:M,title:E});},[A,T,I,B,W,Y,a,g,$,m,p,d,F,D,O,H,U,G,function(e){/esc/i.test(e.key)&&(o(0,A=!1),i.focus());},C,M,R,P,E,L,z,V,N,j,Z,K,q,u,h,r,c,l,s,f,y,b,x,v,w,S,function(e){ra[e?"unshift":"push"](function(){W=e,o(4,W);});},function(e){ra[e?"unshift":"push"](function(){W=e,o(4,W);});},function(e){ra[e?"unshift":"push"](function(){Y=e,o(5,Y);});},function(e){e.stopPropagation(),o(0,A=!1);},function(e){return o(3,B=De(e.detail));},k];}var pu=/*#__PURE__*/function(_Wa13){function pu(e){var _this16;_classCallCheck(this,pu);_this16=_callSuper(this,pu),Ba(_assertThisInitialized(_this16),e,hu,uu,nr,{buttonClass:19,buttonLabel:1,buttonLabelClass:20,buttonHideLabel:21,buttonIcon:22,buttonTitle:23,panelClass:2,isActive:0,onshow:24,onhide:25},null,[-1,-1]);return _this16;}_inherits(pu,_Wa13);return _createClass(pu);}(Wa);var mu={Up:38,Down:40,Left:37,Right:39};function $u(e){var t,o,i,n,r,a,s,l;var c=e[15].default,_d11=lr(c,e,e[14],null);return {c:function c(){t=Rr("li"),o=Rr("input"),i=Ir(),n=Rr("label"),_d11&&_d11.c(),Dr(o,"type","radio"),Dr(o,"class","implicit"),Dr(o,"id",e[7]),Dr(o,"name",e[0]),o.value=e[3],o.disabled=e[6],o.hidden=e[5],o.checked=e[4],Dr(n,"for",e[7]),Dr(n,"title",e[2]),Dr(t,"class",r=Bc(["PinturaRadioGroupOption",e[1]])),Dr(t,"data-hidden",e[5]),Dr(t,"data-disabled",e[6]),Dr(t,"data-selected",e[4]);},m:function m(r,c){Tr(r,t,c),Sr(t,o),Sr(t,i),Sr(t,n),_d11&&_d11.m(n,null),a=!0,s||(l=[Lr(o,"change",Fr(e[16])),Lr(o,"keydown",e[9]),Lr(o,"click",e[10])],s=!0);},p:function p(e,_ref189){var _ref190=_slicedToArray(_ref189,1),i=_ref190[0];(!a||128&i)&&Dr(o,"id",e[7]),(!a||1&i)&&Dr(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]),_d11&&_d11.p&&(!a||16384&i)&&ur(_d11,c,e,e[14],a?dr(c,e[14],i,null):hr(e[14]),null),(!a||128&i)&&Dr(n,"for",e[7]),(!a||4&i)&&Dr(n,"title",e[2]),(!a||2&i&&r!==(r=Bc(["PinturaRadioGroupOption",e[1]])))&&Dr(t,"class",r),(!a||32&i)&&Dr(t,"data-hidden",e[5]),(!a||64&i)&&Dr(t,"data-disabled",e[6]),(!a||16&i)&&Dr(t,"data-selected",e[4]);},i:function i(e){a||(ka(_d11,e),a=!0);},o:function o(e){Ca(_d11,e),a=!1;},d:function d(e){e&&Mr(t),_d11&&_d11.d(e),s=!1,or(l);}};}function gu(e,t,o){var i,n,_t$$$slots8=t.$$slots,r=_t$$$slots8===void 0?{}:_t$$$slots8,a=t.$$scope,s=t.name,l=t.class,c=t.label,d=t.id,u=t.value,h=t.checked,p=t.onkeydown,m=t.onclick,_t$hidden=t.hidden,$=_t$hidden===void 0?!1:_t$hidden,_t$disabled3=t.disabled,g=_t$disabled3===void 0?!1:_t$disabled3;var f=Object.values(mu),y=oa("keysPressed");sr(e,y,function(e){return o(17,n=e);});return e.$$set=function(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,$=e.hidden),"disabled"in e&&o(6,g=e.disabled),"$$scope"in e&&o(14,a=e.$$scope);},e.$$.update=function(){2049&e.$$.dirty&&o(7,i="".concat(s,"-").concat(d));},[s,l,c,u,h,$,g,i,y,function(e){p(e);},function(e){n.some(function(e){return f.includes(e);})||m(e);},d,p,m,a,r,function(t){ia.call(this,e,t);}];}var fu=/*#__PURE__*/function(_Wa14){function fu(e){var _this17;_classCallCheck(this,fu);_this17=_callSuper(this,fu),Ba(_assertThisInitialized(_this17),e,gu,$u,nr,{name:0,class:1,label:2,id:11,value:3,checked:4,onkeydown:12,onclick:13,hidden:5,disabled:6});return _this17;}_inherits(fu,_Wa14);return _createClass(fu);}(Wa);var yu=function yu(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return e.reduce(function(e,t){return (Do(t)?Do(t[1]):!!t.options)?e.concat(Do(t)?t[1]:t.options):(e.push(t),e);},[]);};var bu=function bu(e,t,o){var i;return Do(e)?i=_objectSpread2({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 xu=function xu(e,t,o){return M(e)?e(t,o):e;};var vu=function vu(e,t){return e.map(function(_ref191){var _ref192=_slicedToArray(_ref191,3),e=_ref192[0],o=_ref192[1],i=_ref192[2];if(Do(o))return [xu(e,t),vu(o,t)];{var _n7=[e,xu(o,t)];if(i){var _e76=_objectSpread2({},i);i.icon&&(_e76.icon=xu(i.icon,t)),_n7.push(_e76);}return _n7;}});};var wu=function wu(e,t){return vu(e,t);},Su=function Su(e,t){return Array.isArray(e)&&Array.isArray(t)?ps(e,t):e===t;};function ku(e,t,o){var i=e.slice();return i[27]=t[o],i;}var Cu=function Cu(e){return {option:1024&e[0]};},Tu=function Tu(e){return {option:e[27]};};function Mu(e,t,o){var i=e.slice();return i[27]=t[o],i;}var Ru=function Ru(e){return {option:1024&e[0]};},Pu=function Pu(e){return {option:e[27]};},Eu=function Eu(e){return {option:1024&e[0]};},Iu=function Iu(e){return {option:e[27]};};function Au(e){var t,o,i,n,r,a=[],s=new Map(),l=e[1]&&Lu(e),c=e[10];var d=function d(e){return e[27].id;};for(var _t66=0;_t66<c.length;_t66+=1){var _o63=ku(e,c,_t66),_i47=d(_o63);s.set(_i47,a[_t66]=Uu(_i47,_o63));}return {c:function c(){t=Rr("fieldset"),l&&l.c(),o=Ir(),i=Rr("ul");for(var _e80=0;_e80<a.length;_e80+=1)a[_e80].c();Dr(i,"class","PinturaRadioGroupOptions"),Dr(t,"class",n=Bc(["PinturaRadioGroup",e[3]])),Dr(t,"data-layout",e[5]),Dr(t,"title",e[7]);},m:function m(e,n){Tr(e,t,n),l&&l.m(t,null),Sr(t,o),Sr(t,i);for(var _e84=0;_e84<a.length;_e84+=1)a[_e84].m(i,null);r=!0;},p:function p(e,u){e[1]?l?l.p(e,u):(l=Lu(e),l.c(),l.m(t,o)):l&&(l.d(1),l=null),8419153&u[0]&&(c=e[10],wa(),a=Ia(a,u,d,1,e,c,s,i,Ea,Uu,null,ku),Sa()),(!r||8&u[0]&&n!==(n=Bc(["PinturaRadioGroup",e[3]])))&&Dr(t,"class",n),(!r||32&u[0])&&Dr(t,"data-layout",e[5]),(!r||128&u[0])&&Dr(t,"title",e[7]);},i:function i(e){if(!r){for(var _e92=0;_e92<c.length;_e92+=1)ka(a[_e92]);r=!0;}},o:function o(e){for(var _e94=0;_e94<a.length;_e94+=1)Ca(a[_e94]);r=!1;},d:function d(e){e&&Mr(t),l&&l.d();for(var _e96=0;_e96<a.length;_e96+=1)a[_e96].d();}};}function Lu(e){var t,o,i;return {c:function c(){t=Rr("legend"),o=Er(e[1]),Dr(t,"class",i=e[2]&&"implicit");},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,n){2&n[0]&&Wr(o,e[1]),4&n[0]&&i!==(i=e[2]&&"implicit")&&Dr(t,"class",i);},d:function d(e){e&&Mr(t);}};}function zu(e){var t,_o64;return t=new fu({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:[Wu]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o64=!0;},p:function p(e,o){var 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:function i(e){_o64||(ka(t.$$.fragment,e),_o64=!0);},o:function o(e){Ca(t.$$.fragment,e),_o64=!1;},d:function d(e){Oa(t,e);}};}function Fu(e){var t,o,i,n,r,a,s=[],l=new Map();var c=e[22].group,d=lr(c,e,e[23],Iu),u=d||function(e){var t,o,i=e[27].label+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"class","PinturaRadioGroupOptionGroupLabel");},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){1024&t[0]&&i!==(i=e[27].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}(e);var h=e[27].options;var _p14=function p(e){return e[27].id;};for(var _t68=0;_t68<h.length;_t68+=1){var _o65=Mu(e,h,_t68),_i48=_p14(_o65);l.set(_i48,s[_t68]=ju(_i48,_o65));}return {c:function c(){t=Rr("li"),u&&u.c(),o=Ir(),i=Rr("ul");for(var _e98=0;_e98<s.length;_e98+=1)s[_e98].c();n=Ir(),Dr(i,"class","PinturaRadioGroupOptions"),Dr(t,"class",r=Bc(["PinturaRadioGroupOptionGroup",e[9]]));},m:function m(e,r){Tr(e,t,r),u&&u.m(t,null),Sr(t,o),Sr(t,i);for(var _e100=0;_e100<s.length;_e100+=1)s[_e100].m(i,null);Sr(t,n),a=!0;},p:function p(e,o){d?d.p&&(!a||8389632&o[0])&&ur(d,c,e,e[23],a?dr(c,e[23],o,Eu):hr(e[23]),Iu):u&&u.p&&(!a||1024&o[0])&&u.p(e,a?o:[-1,-1]),8418641&o[0]&&(h=e[27].options,wa(),s=Ia(s,o,_p14,1,e,h,l,i,Ea,ju,null,Mu),Sa()),(!a||512&o[0]&&r!==(r=Bc(["PinturaRadioGroupOptionGroup",e[9]])))&&Dr(t,"class",r);},i:function i(e){if(!a){ka(u,e);for(var _e102=0;_e102<h.length;_e102+=1)ka(s[_e102]);a=!0;}},o:function o(e){Ca(u,e);for(var _e104=0;_e104<s.length;_e104+=1)Ca(s[_e104]);a=!1;},d:function d(e){e&&Mr(t),u&&u.d(e);for(var _e106=0;_e106<s.length;_e106+=1)s[_e106].d();}};}function Du(e){var t,_o66;return t=new hd({props:{$$slots:{default:[Ou]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o66=!0;},p:function p(e,o){var i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o66||(ka(t.$$.fragment,e),_o66=!0);},o:function o(e){Ca(t.$$.fragment,e),_o66=!1;},d:function d(e){Oa(t,e);}};}function Ou(e){var t,o=e[27].icon+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function Bu(e){var t,o,i=e[27].label+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"class",e[6]);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,n){1024&n[0]&&i!==(i=e[27].label+"")&&Wr(o,i),64&n[0]&&Dr(t,"class",e[6]);},d:function d(e){e&&Mr(t);}};}function Wu(e){var t;var o=e[22].option,i=lr(o,e,e[23],Tu),n=i||function(e){var t,o,_i49,n=e[27].icon&&Du(e),r=!e[27].hideLabel&&Bu(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ir();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i49=!0;},p:function p(e,i){e[27].icon?n?(n.p(e,i),1024&i[0]&&ka(n,1)):(n=Du(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[27].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=Bu(e),r.c(),r.m(o.parentNode,o));},i:function i(e){_i49||(ka(n),_i49=!0);},o:function o(e){Ca(n),_i49=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}(e);return {c:function c(){n&&n.c();},m:function m(e,o){n&&n.m(e,o),t=!0;},p:function p(e,r){i?i.p&&(!t||8389632&r[0])&&ur(i,o,e,e[23],t?dr(o,e[23],r,Cu):hr(e[23]),Tu):n&&n.p&&(!t||1088&r[0])&&n.p(e,t?r:[-1,-1]);},i:function i(e){t||(ka(n,e),t=!0);},o:function o(e){Ca(n,e),t=!1;},d:function d(e){n&&n.d(e);}};}function Vu(e){var t,_o67;return t=new hd({props:{$$slots:{default:[_u]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o67=!0;},p:function p(e,o){var i={};8389632&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o67||(ka(t.$$.fragment,e),_o67=!0);},o:function o(e){Ca(t.$$.fragment,e),_o67=!1;},d:function d(e){Oa(t,e);}};}function _u(e){var t,o=e[27].icon+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){1024&i[0]&&o!==(o=e[27].icon+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function Nu(e){var t,o,i=e[27].label+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"class",e[6]);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,n){1024&n[0]&&i!==(i=e[27].label+"")&&Wr(o,i),64&n[0]&&Dr(t,"class",e[6]);},d:function d(e){e&&Mr(t);}};}function Hu(e){var t;var o=e[22].option,i=lr(o,e,e[23],Pu),n=i||function(e){var t,o,_i50,n=e[27].icon&&Vu(e),r=!e[27].hideLabel&&Nu(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ir();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i50=!0;},p:function p(e,i){e[27].icon?n?(n.p(e,i),1024&i[0]&&ka(n,1)):(n=Vu(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[27].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=Nu(e),r.c(),r.m(o.parentNode,o));},i:function i(e){_i50||(ka(n),_i50=!0);},o:function o(e){Ca(n),_i50=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}(e);return {c:function c(){n&&n.c();},m:function m(e,o){n&&n.m(e,o),t=!0;},p:function p(e,r){i?i.p&&(!t||8389632&r[0])&&ur(i,o,e,e[23],t?dr(o,e[23],r,Ru):hr(e[23]),Pu):n&&n.p&&(!t||1088&r[0])&&n.p(e,t?r:[-1,-1]);},i:function i(e){t||(ka(n,e),t=!0);},o:function o(e){Ca(n,e),t=!1;},d:function d(e){n&&n.d(e);}};}function ju(e,t){var o,_i51,n;return _i51=new fu({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:[Hu]},$$scope:{ctx:t}}}),{key:e,first:null,c:function c(){o=Ar(),Fa(_i51.$$.fragment),this.first=o;},m:function m(e,t){Tr(e,o,t),Da(_i51,e,t),n=!0;},p:function p(e,o){t=e;var 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}),_i51.$set(n);},i:function i(e){n||(ka(_i51.$$.fragment,e),n=!0);},o:function o(e){Ca(_i51.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(o),Oa(_i51,e);}};}function Uu(e,t){var o,i,n,r,a;var s=[Fu,zu],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:function c(){o=Ar(),n.c(),r=Ar(),this.first=o;},m:function m(e,t){Tr(e,o,t),l[i].m(e,t),Tr(e,r,t),a=!0;},p:function p(e,o){var a=i;i=c(t=e),i===a?l[i].p(t,o):(wa(),Ca(l[a],1,1,function(){l[a]=null;}),Sa(),n=l[i],n?n.p(t,o):(n=l[i]=s[i](t),n.c()),ka(n,1),n.m(r.parentNode,r));},i:function i(e){a||(ka(n),a=!0);},o:function o(e){Ca(n),a=!1;},d:function d(e){e&&Mr(o),l[i].d(e),e&&Mr(r);}};}function Gu(e){var t,o,_i52,n=e[11].length&&Au(e);return {c:function c(){n&&n.c(),t=Ir(),o=Ar();},m:function m(e,r){n&&n.m(e,r),Tr(e,t,r),Tr(e,o,r),_i52=!0;},p:function p(e,o){e[11].length?n?(n.p(e,o),2048&o[0]&&ka(n,1)):(n=Au(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa());},i:function i(e){_i52||(ka(n),ka(false),_i52=!0);},o:function o(e){Ca(n),Ca(false),_i52=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),e&&Mr(o);}};}function Zu(e,t,o){var i,n,r,_t$$$slots9=t.$$slots,a=_t$$$slots9===void 0?{}:_t$$$slots9,s=t.$$scope;var l=ea();var c=t.label,_t$hideLabel2=t.hideLabel,d=_t$hideLabel2===void 0?!0:_t$hideLabel2,u=t.class,_t$name=t.name,h=_t$name===void 0?"radio-group-"+I():_t$name,_t$selectedIndex=t.selectedIndex,p=_t$selectedIndex===void 0?-1:_t$selectedIndex,_t$options=t.options,m=_t$options===void 0?[]:_t$options,$=t.onchange,g=t.layout,f=t.optionMapper,y=t.optionFilter,b=t.value,x=t.optionLabelClass,v=t.title,w=t.locale,S=t.optionClass,k=t.optionGroupClass;var C=function C(e){return r.findIndex(function(t){return t.id===e.id;});},T=function T(e,t){o(0,p=C(e));var i=_objectSpread2({index:p},e);(function(e){for(var _len8=arguments.length,t=new Array(_len8>1?_len8-1:0),_key8=1;_key8<_len8;_key8++){t[_key8-1]=arguments[_key8];}e&&e.apply(void 0,t);})($,i,t),l("change",i);};return e.$$set=function(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,$=e.onchange),"layout"in e&&o(5,g=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=function(){1343488&e.$$.dirty[0]&&o(11,i=wu(y?m.filter(y):m,w)),133120&e.$$.dirty[0]&&o(10,n=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];var t=arguments.length>1?arguments[1]:undefined;var o=0;return e.map(function(e){return o++,Do(e)?Do(e[1])?{id:o,label:e[0],options:e[1].map(function(e){return bu(e,++o,t);})}:bu(e,o,t):e.options?{id:e.id||o,label:e.label,options:e.options.map(function(e){return bu(e,++o,t);})}:bu(e,o,t);});}(i,f)),1024&e.$$.dirty[0]&&o(21,r=yu(n)),2654209&e.$$.dirty[0]&&p<0&&(o(0,p=r.findIndex(function(e){return Su(e.value,b);})),p<0&&o(0,p=function(e){return e.findIndex(function(e){return void 0===e[0];});}(m)));},[p,c,d,u,h,g,x,v,S,k,n,i,C,function(e){return function(t){var o;(o=t.key,/enter| /i.test(o))&&T(e,t);};},function(e){return function(t){T(e,t);};},m,$,f,y,b,w,r,a,s];}var Xu=/*#__PURE__*/function(_Wa15){function Xu(e){var _this18;_classCallCheck(this,Xu);_this18=_callSuper(this,Xu),Ba(_assertThisInitialized(_this18),e,Zu,Gu,nr,{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]);return _this18;}_inherits(Xu,_Wa15);return _createClass(Xu);}(Wa);function Yu(e){var t,o,i,n,r,a,s,l,c,_d12;return {c:function c(){t=Rr("div"),o=Rr("button"),i=Er("▲"),r=Ir(),a=Rr("button"),s=Er("▼"),Dr(o,"type","button"),Dr(o,"tabindex","-1"),Dr(o,"aria-label",n="increase "+e[7]),Dr(a,"type","button"),Dr(a,"tabindex","-1"),Dr(a,"aria-label",l="decrease "+e[7]),Dr(t,"class","PinturaInputSpinners");},m:function m(n,l){Tr(n,t,l),Sr(t,o),Sr(o,i),Sr(t,r),Sr(t,a),Sr(a,s),c||(_d12=[Lr(o,"click",e[17]),Lr(a,"click",e[18])],c=!0);},p:function p(e,t){128&t&&n!==(n="increase "+e[7])&&Dr(o,"aria-label",n),128&t&&l!==(l="decrease "+e[7])&&Dr(a,"aria-label",l);},d:function d(e){e&&Mr(t),c=!1,or(_d12);}};}function qu(e){var t,o,i,n,r,a,s="number"===e[1]&&e[9]&&Yu(e);return {c:function c(){t=Rr("div"),o=Rr("input"),n=Ir(),s&&s.c(),Dr(o,"class","PinturaInputField"),Dr(o,"title",e[7]),Dr(o,"type",e[1]),Dr(o,"min",e[4]),Dr(o,"max",e[5]),Dr(o,"step",e[6]),Dr(o,"inputmode",e[3]),o.value=i=e[14]?e[13]:e[0],Dr(o,"style",e[11]),Dr(o,"placeholder",e[8]),Dr(o,"maxlength",e[12]),o.disabled=e[2],Dr(o,"spellcheck","false"),Dr(o,"autocorrect","off"),Dr(o,"autocapitalize","off"),Dr(t,"class","PinturaInput");},m:function m(i,l){Tr(i,t,l),Sr(t,o),e[27](o),Sr(t,n),s&&s.m(t,null),r||(a=[Lr(o,"input",e[16]),Lr(o,"blur",function(){ir(e[14]&&e[15])&&(e[14]&&e[15]).apply(this,arguments);}),Lr(o,"keydown",e[19]),Lr(o,"keyup",e[20])],r=!0);},p:function p(n,_ref193){var _ref194=_slicedToArray(_ref193,1),r=_ref194[0];e=n,128&r&&Dr(o,"title",e[7]),2&r&&Dr(o,"type",e[1]),16&r&&Dr(o,"min",e[4]),32&r&&Dr(o,"max",e[5]),64&r&&Dr(o,"step",e[6]),8&r&&Dr(o,"inputmode",e[3]),24577&r&&i!==(i=e[14]?e[13]:e[0])&&o.value!==i&&(o.value=i),2048&r&&Dr(o,"style",e[11]),256&r&&Dr(o,"placeholder",e[8]),4096&r&&Dr(o,"maxlength",e[12]),4&r&&(o.disabled=e[2]),"number"===e[1]&&e[9]?s?s.p(e,r):(s=Yu(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null);},i:Kn,o:Kn,d:function d(o){o&&Mr(t),e[27](null),s&&s.d(),r=!1,or(a);}};}function Ku(e,t,o){var i,r,a,s,l,c,d,u=t.value,_t$type2=t.type,h=_t$type2===void 0?"text":_t$type2,_t$disabled4=t.disabled,p=_t$disabled4===void 0?!1:_t$disabled4,m=t.inputmode,$=t.min,g=t.max,f=t.step,_t$onchange=t.onchange,y=_t$onchange===void 0?n:_t$onchange,_t$onkeydown=t.onkeydown,b=_t$onkeydown===void 0?n:_t$onkeydown,x=t.title,_t$stepMultiplier=t.stepMultiplier,v=_t$stepMultiplier===void 0?10:_t$stepMultiplier,w=t.placeholder,_t$enableSpinButtons=t.enableSpinButtons,S=_t$enableSpinButtons===void 0?!0:_t$enableSpinButtons,_t$enableStopPropagat=t.enableStopPropagation,k=_t$enableStopPropagat===void 0?!1:_t$enableStopPropagat;var C=function C(){var e=c.value;return "number"===h&&(e="numeric"===m?parseInt(e,10):parseFloat(e),!Lo(e)||Number.isNaN(e)?e=$||0:i&&(e=ls(e,$,g))),e;};var T=u;var M=function M(){var e=ls(C()+(d?f*v:f),$,g);e!==u&&(o(25,T=e),o(0,u=e),y(u));},R=function R(){var e=ls(C()-(d?f*v:f),$,g);e!==u&&(o(25,T=e),o(0,u=e),y(u));};return e.$$set=function(e){"value"in e&&o(0,u=e.value),"type"in e&&o(1,h=e.type),"disabled"in e&&o(2,p=e.disabled),"inputmode"in e&&o(3,m=e.inputmode),"min"in e&&o(4,$=e.min),"max"in e&&o(5,g=e.max),"step"in e&&o(6,f=e.step),"onchange"in e&&o(21,y=e.onchange),"onkeydown"in e&&o(22,b=e.onkeydown),"title"in e&&o(7,x=e.title),"stepMultiplier"in e&&o(23,v=e.stepMultiplier),"placeholder"in e&&o(8,w=e.placeholder),"enableSpinButtons"in e&&o(9,S=e.enableSpinButtons),"enableStopPropagation"in e&&o(24,k=e.enableStopPropagation);},e.$$.update=function(){48&e.$$.dirty&&o(14,i=Lo($)&&Lo(g)),33555457&e.$$.dirty&&o(13,r=c===document.activeElement?T:u),32&e.$$.dirty&&o(26,a=g?(g+"").length:void 0),67108872&e.$$.dirty&&o(12,s="numeric"===m&&a?a:void 0),67108864&e.$$.dirty&&o(11,l=a?"min-width:".concat(a,"em"):void 0);},[u,h,p,m,$,g,f,x,w,S,c,l,s,r,i,function(){o(25,T=C()),y(u);},function(){o(25,T=c.value),y(C());},M,R,function(e){d=e.shiftKey,b(e);var t=e.key;k&&e.stopPropagation(),/up|down/i.test(t)&&(/up/i.test(t)&&M(),/down/i.test(t)&&R(),e.preventDefault(),e.stopPropagation());},function(e){var t=e.key;/up|down/i.test(t)&&(e.preventDefault(),e.stopPropagation());},y,b,v,k,T,a,function(e){ra[e?"unshift":"push"](function(){c=e,o(10,c);});}];}var Ju=/*#__PURE__*/function(_Wa16){function Ju(e){var _this19;_classCallCheck(this,Ju);_this19=_callSuper(this,Ju),Ba(_assertThisInitialized(_this19),e,Ku,qu,nr,{value:0,type:1,disabled:2,inputmode:3,min:4,max:5,step:6,onchange:21,onkeydown:22,title:7,stepMultiplier:23,placeholder:8,enableSpinButtons:9,enableStopPropagation:24});return _this19;}_inherits(Ju,_Wa16);return _createClass(Ju);}(Wa);var Qu=function Qu(e){return {};},eh=function eh(e){return {};};function th(e){var t,o,i,n,r=(e[2]||e[21])+"",a=e[6]&&ih(e);return {c:function c(){a&&a.c(),t=Ir(),o=Rr("span"),Dr(o,"class",i=Bc(["PinturaButtonLabel",e[3],e[5]&&"implicit"]));},m:function m(e,i){a&&a.m(e,i),Tr(e,t,i),Tr(e,o,i),o.innerHTML=r,n=!0;},p:function p(e,s){e[6]?a?(a.p(e,s),64&s[0]&&ka(a,1)):(a=ih(e),a.c(),ka(a,1),a.m(t.parentNode,t)):a&&(wa(),Ca(a,1,1,function(){a=null;}),Sa()),(!n||2097156&s[0])&&r!==(r=(e[2]||e[21])+"")&&(o.innerHTML=r),(!n||40&s[0]&&i!==(i=Bc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&Dr(o,"class",i);},i:function i(e){n||(ka(a),n=!0);},o:function o(e){Ca(a),n=!1;},d:function d(e){a&&a.d(e),e&&Mr(t),e&&Mr(o);}};}function oh(e){var t,_o68;return t=new Ju({props:{value:e[10],onchange:e[17],enableStopPropagation:!0,type:"number",inputmode:"numeric",min:e[8].reduce(mh,1/0),max:e[8].reduce($h,-1/0),enableSpinButtons:!1}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o68=!0;},p:function p(e,o){var i={};1024&o[0]&&(i.value=e[10]),131072&o[0]&&(i.onchange=e[17]),256&o[0]&&(i.min=e[8].reduce(mh,1/0)),256&o[0]&&(i.max=e[8].reduce($h,-1/0)),t.$set(i);},i:function i(e){_o68||(ka(t.$$.fragment,e),_o68=!0);},o:function o(e){Ca(t.$$.fragment,e),_o68=!1;},d:function d(e){Oa(t,e);}};}function ih(e){var t,_o69;return t=new hd({props:{class:"PinturaButtonIcon",$$slots:{default:[nh]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o69=!0;},p:function p(e,o){var i={};536870976&o[0]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o69||(ka(t.$$.fragment,e),_o69=!0);},o:function o(e){Ca(t.$$.fragment,e),_o69=!1;},d:function d(e){Oa(t,e);}};}function nh(e){var t;return {c:function c(){t=Pr("g");},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[6];},p:function p(e,o){64&o[0]&&(t.innerHTML=e[6]);},d:function d(e){e&&Mr(t);}};}function rh(e){var t,o,_i53,n,r,a;var s=[oh,th],l=[];function c(e,t){return e[18]?0:1;}return o=c(e),_i53=l[o]=s[o](e),{c:function c(){t=Rr("span"),_i53.c(),Dr(t,"slot","label"),Dr(t,"title",n=xu(e[1],e[16])),Dr(t,"class",r=Bc(["PinturaButtonInner",e[18]&&"PinturaComboBox",e[4]]));},m:function m(e,i){Tr(e,t,i),l[o].m(t,null),a=!0;},p:function p(e,d){var u=o;o=c(e),o===u?l[o].p(e,d):(wa(),Ca(l[u],1,1,function(){l[u]=null;}),Sa(),_i53=l[o],_i53?_i53.p(e,d):(_i53=l[o]=s[o](e),_i53.c()),ka(_i53,1),_i53.m(t,null)),(!a||65538&d[0]&&n!==(n=xu(e[1],e[16])))&&Dr(t,"title",n),(!a||262160&d[0]&&r!==(r=Bc(["PinturaButtonInner",e[18]&&"PinturaComboBox",e[4]])))&&Dr(t,"class",r);},i:function i(e){a||(ka(_i53),a=!0);},o:function o(e){Ca(_i53),a=!1;},d:function d(e){e&&Mr(t),l[o].d();}};}function ah(e){var t,o,i=e[31].label+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"slot","group");},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){1&t[1]&&i!==(i=e[31].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function sh(e){var t,_o70;return t=new hd({props:{style:M(e[14])?e[14](e[31].value):e[14],$$slots:{default:[lh]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o70=!0;},p:function p(e,o){var i={};16384&o[0]|1&o[1]&&(i.style=M(e[14])?e[14](e[31].value):e[14]),536870912&o[0]|1&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o70||(ka(t.$$.fragment,e),_o70=!0);},o:function o(e){Ca(t.$$.fragment,e),_o70=!1;},d:function d(e){Oa(t,e);}};}function lh(e){var t,o=e[31].icon+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){1&i[1]&&o!==(o=e[31].icon+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function ch(e){var t,o,i,n,r,a=e[31].label+"",s=e[31].sublabel&&dh(e);return {c:function c(){t=Rr("span"),o=new Nr(!1),i=Ir(),s&&s.c(),o.a=i,Dr(t,"style",n=M(e[15])?e[15](e[31].value):e[15]),Dr(t,"class",r=Bc(["PinturaDropdownOptionLabel",e[11]]));},m:function m(e,n){Tr(e,t,n),o.m(a,t),Sr(t,i),s&&s.m(t,null);},p:function p(e,i){1&i[1]&&a!==(a=e[31].label+"")&&o.p(a),e[31].sublabel?s?s.p(e,i):(s=dh(e),s.c(),s.m(t,null)):s&&(s.d(1),s=null),32768&i[0]|1&i[1]&&n!==(n=M(e[15])?e[15](e[31].value):e[15])&&Dr(t,"style",n),2048&i[0]&&r!==(r=Bc(["PinturaDropdownOptionLabel",e[11]]))&&Dr(t,"class",r);},d:function d(e){e&&Mr(t),s&&s.d();}};}function dh(e){var t,o=e[31].sublabel+"";return {c:function c(){t=Rr("span"),Dr(t,"class","PinturaDropdownOptionSublabel");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){1&i[1]&&o!==(o=e[31].sublabel+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function uh(e){var t,o,_i54,n=e[31].icon&&sh(e),r=!e[31].hideLabel&&ch(e);return {c:function c(){t=Rr("span"),n&&n.c(),o=Ir(),r&&r.c(),Dr(t,"slot","option");},m:function m(e,a){Tr(e,t,a),n&&n.m(t,null),Sr(t,o),r&&r.m(t,null),_i54=!0;},p:function p(e,i){e[31].icon?n?(n.p(e,i),1&i[1]&&ka(n,1)):(n=sh(e),n.c(),ka(n,1),n.m(t,o)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[31].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=ch(e),r.c(),r.m(t,null));},i:function i(e){_i54||(ka(n),_i54=!0);},o:function o(e){Ca(n),_i54=!1;},d:function d(e){e&&Mr(t),n&&n.d(),r&&r.d();}};}function hh(e){var t,o,_i55,n,r,a;var s=e[27].controls,l=lr(s,e,e[29],eh);return _i55=new Xu({props:{class:"PinturaOptionsList PinturaScrollableContent",name:e[7],value:e[10],selectedIndex:e[9],optionFilter:e[12],optionMapper:e[13],optionLabelClass:Bc(["PinturaDropdownOptionLabel",e[11]]),optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[19],onchange:e[22],$$slots:{option:[uh,function(_ref195){var e=_ref195.option;return {31:e};},function(_ref196){var e=_ref196.option;return [0,e?1:0];}],group:[ah,function(_ref197){var e=_ref197.option;return {31:e};},function(_ref198){var e=_ref198.option;return [0,e?1:0];}]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),l&&l.c(),o=Ir(),Fa(_i55.$$.fragment),Dr(t,"slot","details"),Dr(t,"class","PinturaOptionsListWrapper");},m:function m(s,c){Tr(s,t,c),l&&l.m(t,null),Sr(t,o),Da(_i55,t,null),n=!0,r||(a=Lr(t,"keydown",e[24]),r=!0);},p:function p(e,t){l&&l.p&&(!n||536870912&t[0])&&ur(l,s,e,e[29],n?dr(s,e[29],t,Qu):hr(e[29]),eh);var o={};128&t[0]&&(o.name=e[7]),1024&t[0]&&(o.value=e[10]),512&t[0]&&(o.selectedIndex=e[9]),4096&t[0]&&(o.optionFilter=e[12]),8192&t[0]&&(o.optionMapper=e[13]),2048&t[0]&&(o.optionLabelClass=Bc(["PinturaDropdownOptionLabel",e[11]])),524288&t[0]&&(o.options=e[19]),536922112&t[0]|1&t[1]&&(o.$$scope={dirty:t,ctx:e}),_i55.$set(o);},i:function i(e){n||(ka(l,e),ka(_i55.$$.fragment,e),n=!0);},o:function o(e){Ca(l,e),Ca(_i55.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(t),l&&l.d(e),Oa(_i55),r=!1,a();}};}function ph(e){var t,o,_i56;function n(t){e[28](t);}var r={onshow:e[23],buttonClass:Bc(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"]),$$slots:{details:[hh],label:[rh]},$$scope:{ctx:e}};return void 0!==e[20]&&(r.isActive=e[20]),t=new pu({props:r}),ra.push(function(){return za(t,"isActive",n);}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i56=!0;},p:function p(e,i){var n={};33&i[0]&&(n.buttonClass=Bc(["PinturaDropdownButton",e[0],e[5]&&"PinturaDropdownIconOnly"])),540016638&i[0]&&(n.$$scope={dirty:i,ctx:e}),!o&&1048576&i[0]&&(o=!0,n.isActive=e[20],pa(function(){return o=!1;})),t.$set(n);},i:function i(e){_i56||(ka(t.$$.fragment,e),_i56=!0);},o:function o(e){Ca(t.$$.fragment,e),_i56=!1;},d:function d(e){Oa(t,e);}};}var mh=function mh(e,_ref199){var _ref200=_slicedToArray(_ref199,1),t=_ref200[0];return t<e?t:e;},$h=function $h(e,_ref201){var _ref202=_slicedToArray(_ref201,1),t=_ref202[0];return t>e?t:e;};function gh(e,t,o){var i,r,_t$$$slots10=t.$$slots,a=_t$$$slots10===void 0?{}:_t$$$slots10,s=t.$$scope,l=t.class,c=t.title,d=t.label,u=t.labelClass,h=t.innerClass,_t$hideLabel3=t.hideLabel,p=_t$hideLabel3===void 0?!1:_t$hideLabel3,m=t.icon,$=t.name,_t$options2=t.options,g=_t$options2===void 0?[]:_t$options2,_t$selectedIndex2=t.selectedIndex,f=_t$selectedIndex2===void 0?-1:_t$selectedIndex2,y=t.value,b=t.optionLabelClass,x=t.optionFilter,v=t.optionMapper,w=t.optionIconStyle,S=t.optionLabelStyle,k=t.locale,_t$onchange2=t.onchange,C=_t$onchange2===void 0?n:_t$onchange2,_t$onload=t.onload,T=_t$onload===void 0?n:_t$onload,_t$ondestroy=t.ondestroy,M=_t$ondestroy===void 0?n:_t$ondestroy,_t$enableInput=t.enableInput,R=_t$enableInput===void 0?!1:_t$enableInput;var P;return Kr(function(){return T({options:g});}),Qr(function(){return M({options:g});}),e.$$set=function(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,$=e.name),"options"in e&&o(8,g=e.options),"selectedIndex"in e&&o(9,f=e.selectedIndex),"value"in e&&o(10,y=e.value),"optionLabelClass"in e&&o(11,b=e.optionLabelClass),"optionFilter"in e&&o(12,x=e.optionFilter),"optionMapper"in e&&o(13,v=e.optionMapper),"optionIconStyle"in e&&o(14,w=e.optionIconStyle),"optionLabelStyle"in e&&o(15,S=e.optionLabelStyle),"locale"in e&&o(16,k=e.locale),"onchange"in e&&o(17,C=e.onchange),"onload"in e&&o(25,T=e.onload),"ondestroy"in e&&o(26,M=e.ondestroy),"enableInput"in e&&o(18,R=e.enableInput),"$$scope"in e&&o(29,s=e.$$scope);},e.$$.update=function(){65792&e.$$.dirty[0]&&o(19,i=k?wu(g,k):g),525312&e.$$.dirty[0]&&o(21,r=i.reduce(function(e,t){if(e)return e;var o=Array.isArray(t)?t:[t,t],_o71=_slicedToArray(o,2),i=_o71[0],n=_o71[1];return Su(i,y)?n:void 0;},void 0)||function(e){var t=e.find(function(e){return 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,C,R,i,P,r,function(e){o(21,r=e.value),C(e),o(20,P=!1);},function(_ref203){var e=_ref203.e,t=_ref203.panel;if(e&&e.key&&/up|down/i.test(e.key))return eu(t.querySelector("input:not([disabled])"));eu(t.querySelector("fieldset"));},function(e){/tab/i.test(e.key)&&e.preventDefault();},T,M,a,function(e){P=e,o(20,P);},s];}var fh=/*#__PURE__*/function(_Wa17){function fh(e){var _this20;_classCallCheck(this,fh);_this20=_callSuper(this,fh),Ba(_assertThisInitialized(_this20),e,gh,ph,nr,{class:0,title:1,label:2,labelClass:3,innerClass:4,hideLabel:5,icon:6,name:7,options:8,selectedIndex:9,value:10,optionLabelClass:11,optionFilter:12,optionMapper:13,optionIconStyle:14,optionLabelStyle:15,locale:16,onchange:17,onload:25,ondestroy:26,enableInput:18},null,[-1,-1]);return _this20;}_inherits(fh,_Wa17);return _createClass(fh);}(Wa);function yh(e){var t;return {c:function c(){t=Rr("div"),Dr(t,"slot","details");},m:function m(o,i){Tr(o,t,i),e[14](t);},p:Kn,d:function d(o){o&&Mr(t),e[14](null);}};}function bh(e){var t,o,_i57;function n(t){e[15](t);}var r={buttonLabel:e[0],buttonClass:e[1],buttonIcon:e[2],buttonHideLabel:e[3],buttonTitle:e[4],buttonLabelClass:e[5],onshow:e[6],onhide:e[7],$$slots:{details:[yh]},$$scope:{ctx:e}};return void 0!==e[9]&&(r.isActive=e[9]),t=new pu({props:r}),ra.push(function(){return za(t,"isActive",n);}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i57=!0;},p:function p(e,_ref204){var _ref205=_slicedToArray(_ref204,1),i=_ref205[0];var n={};1&i&&(n.buttonLabel=e[0]),2&i&&(n.buttonClass=e[1]),4&i&&(n.buttonIcon=e[2]),8&i&&(n.buttonHideLabel=e[3]),16&i&&(n.buttonTitle=e[4]),32&i&&(n.buttonLabelClass=e[5]),64&i&&(n.onshow=e[6]),128&i&&(n.onhide=e[7]),65792&i&&(n.$$scope={dirty:i,ctx:e}),!o&&512&i&&(o=!0,n.isActive=e[9],pa(function(){return o=!1;})),t.$set(n);},i:function i(e){_i57||(ka(t.$$.fragment,e),_i57=!0);},o:function o(e){Ca(t.$$.fragment,e),_i57=!1;},d:function d(e){Oa(t,e);}};}function xh(e,t,o){var i=t.buttonLabel,r=t.buttonClass,a=t.buttonIcon,s=t.buttonHideLabel,l=t.buttonTitle,c=t.buttonLabelClass,d=t.root,_t$ondestroy2=t.ondestroy,u=_t$ondestroy2===void 0?n:_t$ondestroy2,_t$onshow2=t.onshow,h=_t$onshow2===void 0?n:_t$onshow2,_t$onhide2=t.onhide,p=_t$onhide2===void 0?n:_t$onhide2;var m,$=!1;return Qr(u),e.$$set=function(e){"buttonLabel"in e&&o(0,i=e.buttonLabel),"buttonClass"in e&&o(1,r=e.buttonClass),"buttonIcon"in e&&o(2,a=e.buttonIcon),"buttonHideLabel"in e&&o(3,s=e.buttonHideLabel),"buttonTitle"in e&&o(4,l=e.buttonTitle),"buttonLabelClass"in e&&o(5,c=e.buttonLabelClass),"root"in e&&o(10,d=e.root),"ondestroy"in e&&o(11,u=e.ondestroy),"onshow"in e&&o(6,h=e.onshow),"onhide"in e&&o(7,p=e.onhide);},e.$$.update=function(){1280&e.$$.dirty&&m&&d&&m.firstChild!==d&&(m.hasChildNodes()?m.replaceChild(d,m.firstChild):m.append(d));},[i,r,a,s,l,c,h,p,m,$,d,u,function(){return o(9,$=!1);},function(){return o(9,$=!0);},function(e){ra[e?"unshift":"push"](function(){m=e,o(8,m);});},function(e){$=e,o(9,$);}];}var vh=/*#__PURE__*/function(_Wa18){function vh(e){var _this21;_classCallCheck(this,vh);_this21=_callSuper(this,vh),Ba(_assertThisInitialized(_this21),e,xh,bh,nr,{buttonLabel:0,buttonClass:1,buttonIcon:2,buttonHideLabel:3,buttonTitle:4,buttonLabelClass:5,root:10,ondestroy:11,onshow:6,onhide:7,hide:12,show:13});return _this21;}_inherits(vh,_Wa18);return _createClass(vh,[{key:"hide",get:function get(){return this.$$.ctx[12];}},{key:"show",get:function get(){return this.$$.ctx[13];}}]);}(Wa);var wh=function wh(e,t,o){return (e-t)/(o-t);};var Sh=function Sh(e){return {};},kh=function kh(e){return {};};function Ch(e){var t,_o72,i,n,r,a,s,l;return _o72=new hd({props:{$$slots:{default:[Th]},$$scope:{ctx:e}}}),r=new hd({props:{$$slots:{default:[Mh]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("button"),Fa(_o72.$$.fragment),i=Ir(),n=Rr("button"),Fa(r.$$.fragment),Dr(t,"type","button"),Dr(t,"aria-label","Increase"),Dr(n,"type","button"),Dr(n,"aria-label","Decrease");},m:function m(c,d){Tr(c,t,d),Da(_o72,t,null),Tr(c,i,d),Tr(c,n,d),Da(r,n,null),a=!0,s||(l=[Lr(t,"pointerdown",e[20](1)),Lr(n,"pointerdown",e[20](-1))],s=!0);},p:function p(e,t){var i={};128&t[1]&&(i.$$scope={dirty:t,ctx:e}),_o72.$set(i);var n={};128&t[1]&&(n.$$scope={dirty:t,ctx:e}),r.$set(n);},i:function i(e){a||(ka(_o72.$$.fragment,e),ka(r.$$.fragment,e),a=!0);},o:function o(e){Ca(_o72.$$.fragment,e),Ca(r.$$.fragment,e),a=!1;},d:function d(e){e&&Mr(t),Oa(_o72),e&&Mr(i),e&&Mr(n),Oa(r),s=!1,or(l);}};}function Th(e){var t;return {c:function c(){t=Pr("path"),Dr(t,"d","M8 12 h8 M12 8 v8");},m:function m(e,o){Tr(e,t,o);},p:Kn,d:function d(e){e&&Mr(t);}};}function Mh(e){var t;return {c:function c(){t=Pr("path"),Dr(t,"d","M9 12 h6");},m:function m(e,o){Tr(e,t,o);},p:Kn,d:function d(e){e&&Mr(t);}};}function Rh(e){var t,o,i,n,r,a,s,l,_c15,d,u,h,p,m,$,g,f;var y=e[36].default,b=lr(y,e,e[38],null),x=e[36].knob,v=lr(x,e,e[38],kh);var w=e[9]&&Ch(e);return {c:function c(){t=Rr("div"),o=Rr("div"),i=Rr("input"),r=Ir(),a=Rr("div"),b&&b.c(),l=Ir(),_c15=Rr("div"),d=Rr("div"),v&&v.c(),p=Ir(),w&&w.c(),Dr(i,"type","range"),Dr(i,"id",e[3]),Dr(i,"min",e[0]),Dr(i,"max",e[1]),Dr(i,"step",e[2]),i.value=e[14],Dr(i,"style",n=e[10]?"pointer-events:none":""),Dr(a,"class",s=Bc(["PinturaSliderTrack",e[5]])),Dr(a,"style",e[4]),Dr(d,"class",u=Bc(["PinturaSliderKnob",e[7]])),Dr(d,"style",e[6]),Dr(_c15,"class","PinturaSliderKnobController"),Dr(_c15,"style",e[17]),Dr(o,"class","PinturaSliderControl"),Dr(o,"style",h="--slider-position:"+Math.round(e[15])),Dr(t,"class",m=Bc(["PinturaSlider",e[12]])),Dr(t,"data-direction",e[8]);},m:function m(n,s){Tr(n,t,s),Sr(t,o),Sr(o,i),e[37](i),Sr(o,r),Sr(o,a),b&&b.m(a,null),Sr(o,l),Sr(o,_c15),Sr(_c15,d),v&&v.m(d,null),Sr(t,p),w&&w.m(t,null),$=!0,g||(f=[Lr(i,"input",e[18]),Lr(i,"nudge",e[19]),gr(kd.call(null,i)),Lr(o,"pointerdown",function(){ir(e[11]&&e[13])&&(e[11]&&e[13]).apply(this,arguments);})],g=!0);},p:function p(r,l){e=r,(!$||8&l[0])&&Dr(i,"id",e[3]),(!$||1&l[0])&&Dr(i,"min",e[0]),(!$||2&l[0])&&Dr(i,"max",e[1]),(!$||4&l[0])&&Dr(i,"step",e[2]),(!$||16384&l[0])&&(i.value=e[14]),(!$||1024&l[0]&&n!==(n=e[10]?"pointer-events:none":""))&&Dr(i,"style",n),b&&b.p&&(!$||128&l[1])&&ur(b,y,e,e[38],$?dr(y,e[38],l,null):hr(e[38]),null),(!$||32&l[0]&&s!==(s=Bc(["PinturaSliderTrack",e[5]])))&&Dr(a,"class",s),(!$||16&l[0])&&Dr(a,"style",e[4]),v&&v.p&&(!$||128&l[1])&&ur(v,x,e,e[38],$?dr(x,e[38],l,Sh):hr(e[38]),kh),(!$||128&l[0]&&u!==(u=Bc(["PinturaSliderKnob",e[7]])))&&Dr(d,"class",u),(!$||64&l[0])&&Dr(d,"style",e[6]),(!$||131072&l[0])&&Dr(_c15,"style",e[17]),(!$||32768&l[0]&&h!==(h="--slider-position:"+Math.round(e[15])))&&Dr(o,"style",h),e[9]?w?(w.p(e,l),512&l[0]&&ka(w,1)):(w=Ch(e),w.c(),ka(w,1),w.m(t,null)):w&&(wa(),Ca(w,1,1,function(){w=null;}),Sa()),(!$||4096&l[0]&&m!==(m=Bc(["PinturaSlider",e[12]])))&&Dr(t,"class",m),(!$||256&l[0])&&Dr(t,"data-direction",e[8]);},i:function i(e){$||(ka(b,e),ka(v,e),ka(w),$=!0);},o:function o(e){Ca(b,e),Ca(v,e),Ca(w),$=!1;},d:function d(o){o&&Mr(t),e[37](null),b&&b.d(o),v&&v.d(o),w&&w.d(),g=!1,or(f);}};}function Ph(e,t,o){var i,r,a,s,l,c,d,u,h,p,m,$,g,f,y,_t$$$slots11=t.$$slots,b=_t$$$slots11===void 0?{}:_t$$$slots11,x=t.$$scope,_t$min2=t.min,v=_t$min2===void 0?0:_t$min2,_t$max2=t.max,w=_t$max2===void 0?100:_t$max2,_t$step=t.step,S=_t$step===void 0?1:_t$step,k=t.id,_t$value=t.value,C=_t$value===void 0?0:_t$value,M=t.valueMin,R=t.valueMax,P=t.trackStyle,E=t.trackClass,I=t.knobStyle,A=t.knobClass,_t$ongrab2=t.ongrab,L=_t$ongrab2===void 0?n:_t$ongrab2,_t$onchange3=t.onchange,z=_t$onchange3===void 0?n:_t$onchange3,_t$onrelease=t.onrelease,F=_t$onrelease===void 0?n:_t$onrelease,_t$onexceed=t.onexceed,D=_t$onexceed===void 0?n:_t$onexceed,_t$direction=t.direction,O=_t$direction===void 0?"x":_t$direction,_t$getValue=t.getValue,B=_t$getValue===void 0?Z:_t$getValue,_t$setValue=t.setValue,W=_t$setValue===void 0?Z:_t$setValue,_t$enableSpinButtons2=t.enableSpinButtons,V=_t$enableSpinButtons2===void 0?!0:_t$enableSpinButtons2,_t$enableForceUseKnob=t.enableForceUseKnob,_=_t$enableForceUseKnob===void 0?!1:_t$enableForceUseKnob,_t$enableStopPropagat2=t.enableStopPropagation,N=_t$enableStopPropagat2===void 0?!0:_t$enableStopPropagat2,_t$enablePointerdownL=t.enablePointerdownListener,H=_t$enablePointerdownL===void 0?!0:_t$enablePointerdownL,_t$maxInteractionDist=t.maxInteractionDistance,j=_t$maxInteractionDist===void 0?6:_t$maxInteractionDist,U=t.class;var G=function G(e){return W(function(e,t){return t=1/t,Math.round(e*t)/t;}(ls(e,v,w),S),C);},X=function X(e,t){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _i$grabbed=i.grabbed,n=_i$grabbed===void 0?!1:_i$grabbed,_i$released=i.released,a=_i$released===void 0?!1:_i$released,s=G(v+e/t*r),l=M||v,c=R||w;o(21,C=T(s)?s:ls(s,l,c)),y!==s&&(y=s,!T(s)&&(s<l||s>c)&&D(C,s),C!==f&&(f=C,n&&L(C),z(C),a&&F(C)));};var Y;var q=function q(e){var t=e[u]-g;X($+t,m);},K=function K(e){m=void 0,document.documentElement.removeEventListener("pointermove",q),document.documentElement.removeEventListener("pointerup",K),z(C),F(C);},J=function J(){o(21,C=G(i+ee*S)),z(C);};var Q,ee=1,te=!1;var oe=function oe(e){clearTimeout(Q),te||J(),F(C),document.removeEventListener("pointerup",oe);};return e.$$set=function(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,C=e.value),"valueMin"in e&&o(22,M=e.valueMin),"valueMax"in e&&o(23,R=e.valueMax),"trackStyle"in e&&o(4,P=e.trackStyle),"trackClass"in e&&o(5,E=e.trackClass),"knobStyle"in e&&o(6,I=e.knobStyle),"knobClass"in e&&o(7,A=e.knobClass),"ongrab"in e&&o(24,L=e.ongrab),"onchange"in e&&o(25,z=e.onchange),"onrelease"in e&&o(26,F=e.onrelease),"onexceed"in e&&o(27,D=e.onexceed),"direction"in e&&o(8,O=e.direction),"getValue"in e&&o(28,B=e.getValue),"setValue"in e&&o(29,W=e.setValue),"enableSpinButtons"in e&&o(9,V=e.enableSpinButtons),"enableForceUseKnob"in e&&o(10,_=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=function(){270532608&e.$$.dirty[0]&&o(14,i=void 0!==C?B(C):0),3&e.$$.dirty[0]&&(r=w-v),16387&e.$$.dirty[0]&&o(33,a=wh(i,v,w)),4&e.$$.dirty[1]&&o(15,s=100*a),256&e.$$.dirty[0]&&o(34,l=O.toUpperCase()),256&e.$$.dirty[0]&&o(35,c="x"===O?"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".concat(l,"(").concat(s,"%)"));},[v,w,S,k,P,E,I,A,O,V,_,H,U,function(e){var t=!1;N&&e.stopPropagation(),clearTimeout(Y);var o=p.getBoundingClientRect();if(m=p[d],g=e[u],$=g-o[O],_){if(Math.abs($-a*m)>j)return;t=!0,e.stopPropagation();}return document.activeElement!==p&&p.focus(),X($,m,{grabbed:!0}),document.documentElement.addEventListener("pointermove",q),document.documentElement.addEventListener("pointerup",K),t;},i,s,p,h,function(e){m||(o(21,C=W(parseFloat(e.target.value))),C!==f&&(f=C,z(C)));},function(e){var t=p[d];X(i/r*t+e.detail[O],t),clearTimeout(Y),Y=setTimeout(function(){F(C);},250);},function(e){return function(t){clearTimeout(Y),ee=e,te=!1,Q=setInterval(function(){te=!0,J();},100),document.addEventListener("pointercancel",oe),document.addEventListener("pointerup",oe);};},C,M,R,L,z,F,D,B,W,N,j,function(e){var t=p.getBoundingClientRect(),o=e[u]-t[O],i=p[d];return Math.abs(o-a*i);},a,l,c,b,function(e){ra[e?"unshift":"push"](function(){p=e,o(16,p);});},x];}var Eh=/*#__PURE__*/function(_Wa19){function Eh(e){var _this22;_classCallCheck(this,Eh);_this22=_callSuper(this,Eh),Ba(_assertThisInitialized(_this22),e,Ph,Rh,nr,{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]);return _this22;}_inherits(Eh,_Wa19);return _createClass(Eh,[{key:"eventDistanceToKnob",get:function get(){return this.$$.ctx[32];}},{key:"handlePointerDown",get:function get(){return this.$$.ctx[13];}}]);}(Wa);function Ih(e){var t,_o73;return t=new hd({props:{class:"PinturaButtonIcon",$$slots:{default:[Ah]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o73=!0;},p:function p(e,o){var i={};1048580&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o73||(ka(t.$$.fragment,e),_o73=!0);},o:function o(e){Ca(t.$$.fragment,e),_o73=!1;},d:function d(e){Oa(t,e);}};}function Ah(e){var t;return {c:function c(){t=Pr("g");},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[2];},p:function p(e,o){4&o&&(t.innerHTML=e[2]);},d:function d(e){e&&Mr(t);}};}function Lh(e){var t,o,i=xu(e[8],e[6])+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"class","PinturaButtonLabelPrefix");},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){320&t&&i!==(i=xu(e[8],e[6])+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function zh(e){var t,o,i,n,r,a,s,l,c,_d13=e[2]&&Ih(e),u=e[8]&&Lh(e);return {c:function c(){t=Rr("span"),_d13&&_d13.c(),o=Ir(),u&&u.c(),i=Ir(),n=Rr("span"),r=Er(e[9]),Dr(n,"class",a=Bc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])),Dr(t,"slot","label"),Dr(t,"title",s=xu(e[1],e[6])),Dr(t,"class",l=Bc(["PinturaButtonInner",e[4]]));},m:function m(e,a){Tr(e,t,a),_d13&&_d13.m(t,null),Sr(t,o),u&&u.m(t,null),Sr(t,i),Sr(t,n),Sr(n,r),c=!0;},p:function p(e,h){e[2]?_d13?(_d13.p(e,h),4&h&&ka(_d13,1)):(_d13=Ih(e),_d13.c(),ka(_d13,1),_d13.m(t,o)):_d13&&(wa(),Ca(_d13,1,1,function(){_d13=null;}),Sa()),e[8]?u?u.p(e,h):(u=Lh(e),u.c(),u.m(t,i)):u&&(u.d(1),u=null),(!c||512&h)&&Wr(r,e[9]),(!c||40&h&&a!==(a=Bc(["PinturaButtonLabel",e[3],e[5]&&"implicit"])))&&Dr(n,"class",a),(!c||66&h&&s!==(s=xu(e[1],e[6])))&&Dr(t,"title",s),(!c||16&h&&l!==(l=Bc(["PinturaButtonInner",e[4]])))&&Dr(t,"class",l);},i:function i(e){c||(ka(_d13),c=!0);},o:function o(e){Ca(_d13),c=!1;},d:function d(e){e&&Mr(t),_d13&&_d13.d(),u&&u.d();}};}function Fh(e){var t,_o74,_i58,n,r;var a=[e[12],{value:e[7]},{onchange:e[11]}];var s={};for(var _e108=0;_e108<a.length;_e108+=1)s=Qn(s,a[_e108]);return _o74=new Eh({props:s}),{c:function c(){t=Rr("div"),Fa(_o74.$$.fragment),Dr(t,"slot","details");},m:function m(a,s){Tr(a,t,s),Da(_o74,t,null),_i58=!0,n||(r=Lr(t,"keydown",e[10]),n=!0);},p:function p(e,t){var i=6272&t?Aa(a,[4096&t&&La(e[12]),128&t&&{value:e[7]},2048&t&&{onchange:e[11]}]):{};_o74.$set(i);},i:function i(e){_i58||(ka(_o74.$$.fragment,e),_i58=!0);},o:function o(e){Ca(_o74.$$.fragment,e),_i58=!1;},d:function d(e){e&&Mr(t),Oa(_o74),n=!1,r();}};}function Dh(e){var t,_o75;return t=new pu({props:{panelClass:"PinturaSliderPanel",buttonClass:Bc(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"]),$$slots:{details:[Fh],label:[zh]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o75=!0;},p:function p(e,_ref206){var _ref207=_slicedToArray(_ref206,1),o=_ref207[0];var i={};33&o&&(i.buttonClass=Bc(["PinturaSliderButton",e[0],e[5]&&"PinturaSliderIconOnly"])),1053694&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o75||(ka(t.$$.fragment,e),_o75=!0);},o:function o(e){Ca(t.$$.fragment,e),_o75=!1;},d:function d(e){Oa(t,e);}};}function Oh(e,t,o){var i=["class","title","label","icon","labelClass","innerClass","hideLabel","locale","value","onchange","labelPrefix"];var r=mr(t,i),_t69=t,a=_t69.class,_t70=t,s=_t70.title,_t71=t,_t71$label=_t71.label,l=_t71$label===void 0?Math.round:_t71$label,_t72=t,c=_t72.icon,_t73=t,d=_t73.labelClass,_t74=t,u=_t74.innerClass,_t75=t,_t75$hideLabel=_t75.hideLabel,h=_t75$hideLabel===void 0?!1:_t75$hideLabel,_t76=t,p=_t76.locale,_t77=t,m=_t77.value,_t78=t,_t78$onchange=_t78.onchange,$=_t78$onchange===void 0?n:_t78$onchange,_t79=t,g=_t79.labelPrefix;var _r18=r,f=_r18.min,y=_r18.max,_r18$getValue=_r18.getValue,b=_r18$getValue===void 0?Z:_r18$getValue;var x;var v=function v(e){return o(9,x=function(e){return M(l)?l(b(e),f,y,e):l;}(e));};return e.$$set=function(e){t=Qn(Qn({},t),pr(e)),o(12,r=mr(t,i)),"class"in e&&o(0,a=e.class),"title"in e&&o(1,s=e.title),"label"in e&&o(13,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(14,$=e.onchange),"labelPrefix"in e&&o(8,g=e.labelPrefix);},e.$$.update=function(){8320&e.$$.dirty&&v(m);},[a,s,c,d,u,h,p,m,g,x,function(e){/tab/i.test(e.key)&&e.preventDefault();},function(e){v(e),$(e);},r,l,$];}var Bh=/*#__PURE__*/function(_Wa20){function Bh(e){var _this23;_classCallCheck(this,Bh);_this23=_callSuper(this,Bh),Ba(_assertThisInitialized(_this23),e,Oh,Dh,nr,{class:0,title:1,label:13,icon:2,labelClass:3,innerClass:4,hideLabel:5,locale:6,value:7,onchange:14,labelPrefix:8});return _this23;}_inherits(Bh,_Wa20);return _createClass(Bh);}(Wa);function Wh(e){var t,o,i=xu(e[0],e[1])+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"class",e[3]);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,n){3&n&&i!==(i=xu(e[0],e[1])+"")&&Wr(o,i),8&n&&Dr(t,"class",e[3]);},d:function d(e){e&&Mr(t);}};}function Vh(e){var t,o,_i59,n,r=e[0]&&Wh(e);return _i59=new Cp({props:{items:e[2]}}),{c:function c(){t=Rr("li"),r&&r.c(),o=Ir(),Fa(_i59.$$.fragment),Dr(t,"class","PinturaShapeStyle");},m:function m(e,a){Tr(e,t,a),r&&r.m(t,null),Sr(t,o),Da(_i59,t,null),n=!0;},p:function p(e,_ref208){var _ref209=_slicedToArray(_ref208,1),n=_ref209[0];e[0]?r?r.p(e,n):(r=Wh(e),r.c(),r.m(t,o)):r&&(r.d(1),r=null);var a={};4&n&&(a.items=e[2]),_i59.$set(a);},i:function i(e){n||(ka(_i59.$$.fragment,e),n=!0);},o:function o(e){Ca(_i59.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(t),r&&r.d(),Oa(_i59);}};}function _h(e,t,o){var i,n=t.title,r=t.locale,a=t.items,_t$hideTitle=t.hideTitle,s=_t$hideTitle===void 0?!1:_t$hideTitle;return e.$$set=function(e){"title"in e&&o(0,n=e.title),"locale"in e&&o(1,r=e.locale),"items"in e&&o(2,a=e.items),"hideTitle"in e&&o(4,s=e.hideTitle);},e.$$.update=function(){16&e.$$.dirty&&o(3,i="PinturaShapeStyleLabel"+(s?" implicit":""));},[n,r,a,i,s];}var Nh=/*#__PURE__*/function(_Wa21){function Nh(e){var _this24;_classCallCheck(this,Nh);_this24=_callSuper(this,Nh),Ba(_assertThisInitialized(_this24),e,_h,Vh,nr,{title:0,locale:1,items:2,hideTitle:4});return _this24;}_inherits(Nh,_Wa21);return _createClass(Nh);}(Wa);var Hh=function Hh(e,t,o){var i,n,r;var 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 jh(e){var t,o,i;return {c:function c(){t=Rr("div"),o=Rr("span"),Dr(t,"class","PinturaColorPreview"),Dr(t,"title",e[0]),Dr(t,"style",i="--color:"+e[1]);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,_ref210){var _ref211=_slicedToArray(_ref210,1),o=_ref211[0];1&o&&Dr(t,"title",e[0]),2&o&&i!==(i="--color:"+e[1])&&Dr(t,"style",i);},i:Kn,o:Kn,d:function d(e){e&&Mr(t);}};}function Uh(e,t,o){var i,n=t.color,r=t.title;return e.$$set=function(e){"color"in e&&o(2,n=e.color),"title"in e&&o(0,r=e.title);},e.$$.update=function(){4&e.$$.dirty&&o(1,i=n?jo(n):"transparent");},[r,i,n];}var Gh=/*#__PURE__*/function(_Wa22){function Gh(e){var _this25;_classCallCheck(this,Gh);_this25=_callSuper(this,Gh),Ba(_assertThisInitialized(_this25),e,Uh,jh,nr,{color:2,title:0});return _this25;}_inherits(Gh,_Wa22);return _createClass(Gh);}(Wa);var Zh=function Zh(e){return e=e.trim(),/^rgba/.test(e)?e.substr(5).split(",").map(parseFloat).map(function(e,t){return e/(3===t?1:255);}):/^rgb/.test(e)?e.substr(4).split(",").map(parseFloat).map(function(e){return e/255;}):/^#/.test(e)?function(e){var _e$split=e.split(""),_e$split2=_slicedToArray(_e$split,5),t=_e$split2[1],o=_e$split2[2],i=_e$split2[3],n=_e$split2[4];e=e.length>=4&&e.length<=5?"#".concat(t).concat(t).concat(o).concat(o).concat(i).concat(i).concat(n?"".concat(n).concat(n):""):e;var _ref212=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e)||[],_ref213=_slicedToArray(_ref212,5),r=_ref213[0],a=_ref213[1],s=_ref213[2],l=_ref213[3],c=_ref213[4];if(r)return [a,s,l,c].filter(function(e){return void 0!==e;}).map(function(e){return 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(function(e){return parseInt(e,10);}).map(function(e){return e/255;}):void 0;};var Xh=null;function Yh(e){var t,o;return {c:function c(){t=Rr("span"),o=Er(e[0]);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){1&t[0]&&Wr(o,e[0]);},d:function d(e){e&&Mr(t);}};}function qh(e){var t,_o76,i,n;_o76=new Gh({props:{color:e[4],title:xu(e[8],e[10])}});var r=!e[9]&&Yh(e);return {c:function c(){t=Rr("span"),Fa(_o76.$$.fragment),i=Ir(),r&&r.c(),Dr(t,"slot","label"),Dr(t,"class","PinturaButtonLabel");},m:function m(e,a){Tr(e,t,a),Da(_o76,t,null),Sr(t,i),r&&r.m(t,null),n=!0;},p:function p(e,i){var n={};16&i[0]&&(n.color=e[4]),1280&i[0]&&(n.title=xu(e[8],e[10])),_o76.$set(n),e[9]?r&&(r.d(1),r=null):r?r.p(e,i):(r=Yh(e),r.c(),r.m(t,null));},i:function i(e){n||(ka(_o76.$$.fragment,e),n=!0);},o:function o(e){Ca(_o76.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(t),Oa(_o76),r&&r.d();}};}function Kh(e){var t,o,i,n,r,a,s,l,_c16,d,u,h,p,_m8;_c16=new Eh({props:{class:"PinturaHuePicker",knobStyle:"background-color:"+e[21],onchange:e[27],value:e[16],min:0,max:1,step:.01}});var $=e[11]&&Jh(e),g=(e[14]||e[15])&&Qh(e);return {c:function c(){t=Rr("div"),o=Rr("div"),i=Rr("div"),n=Rr("div"),l=Ir(),Fa(_c16.$$.fragment),d=Ir(),$&&$.c(),u=Ir(),g&&g.c(),Dr(n,"role","button"),Dr(n,"aria-label","Saturation slider"),Dr(n,"class","PinturaPickerKnob"),Dr(n,"tabindex","0"),Dr(n,"style",r="background-color:".concat(e[20],";")),Dr(i,"class","PinturaPickerKnobController"),Dr(i,"style",a="transform:translate(".concat(e[25],"%,").concat(e[24],"%)")),Dr(o,"class","PinturaSaturationPicker"),Dr(o,"style",s="background-color: "+e[21]),Dr(t,"class","PinturaPicker");},m:function m(r,a){Tr(r,t,a),Sr(t,o),Sr(o,i),Sr(i,n),e[41](o),Sr(t,l),Da(_c16,t,null),Sr(t,d),$&&$.m(t,null),Sr(t,u),g&&g.m(t,null),h=!0,p||(_m8=[Lr(n,"nudge",e[30]),gr(kd.call(null,n,{preventDefault:!0})),Lr(o,"pointerdown",e[29])],p=!0);},p:function p(e,l){(!h||1048576&l[0]&&r!==(r="background-color:".concat(e[20],";")))&&Dr(n,"style",r),(!h||50331648&l[0]&&a!==(a="transform:translate(".concat(e[25],"%,").concat(e[24],"%)")))&&Dr(i,"style",a),(!h||2097152&l[0]&&s!==(s="background-color: "+e[21]))&&Dr(o,"style",s);var d={};2097152&l[0]&&(d.knobStyle="background-color:"+e[21]),65536&l[0]&&(d.value=e[16]),_c16.$set(d),e[11]?$?($.p(e,l),2048&l[0]&&ka($,1)):($=Jh(e),$.c(),ka($,1),$.m(t,u)):$&&(wa(),Ca($,1,1,function(){$=null;}),Sa()),e[14]||e[15]?g?(g.p(e,l),49152&l[0]&&ka(g,1)):(g=Qh(e),g.c(),ka(g,1),g.m(t,null)):g&&(wa(),Ca(g,1,1,function(){g=null;}),Sa());},i:function i(e){h||(ka(_c16.$$.fragment,e),ka($),ka(g),h=!0);},o:function o(e){Ca(_c16.$$.fragment,e),Ca($),Ca(g),h=!1;},d:function d(o){o&&Mr(t),e[41](null),Oa(_c16),$&&$.d(),g&&g.d(),p=!1,or(_m8);}};}function Jh(e){var t,_o77;return t=new Eh({props:{class:"PinturaOpacityPicker",knobStyle:"background-color:"+e[18],trackStyle:"background-image:linear-gradient(to right,".concat(e[19],",").concat(e[20],")"),onchange:e[28],value:e[17],min:0,max:1,step:.01}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o77=!0;},p:function p(e,o){var i={};262144&o[0]&&(i.knobStyle="background-color:"+e[18]),1572864&o[0]&&(i.trackStyle="background-image:linear-gradient(to right,".concat(e[19],",").concat(e[20],")")),131072&o[0]&&(i.value=e[17]),t.$set(i);},i:function i(e){_o77||(ka(t.$$.fragment,e),_o77=!0);},o:function o(e){Ca(t.$$.fragment,e),_o77=!1;},d:function d(e){Oa(t,e);}};}function Qh(e){var t,o,i,n,r,a,s,l=e[15]&&ep(e);return {c:function c(){t=Rr("div"),o=Rr("input"),n=Ir(),l&&l.c(),Dr(o,"class","PinturaColorPickerInput"),Dr(o,"type","text"),o.disabled=i=!e[14],o.value=e[23],Dr(t,"class","PinturColorPickerInputGroup");},m:function m(i,c){Tr(i,t,c),Sr(t,o),Sr(t,n),l&&l.m(t,null),r=!0,a||(s=[Lr(o,"keydown",e[32]),Lr(o,"input",e[31])],a=!0);},p:function p(e,n){(!r||16384&n[0]&&i!==(i=!e[14]))&&(o.disabled=i),(!r||8388608&n[0]&&o.value!==e[23])&&(o.value=e[23]),e[15]?l?(l.p(e,n),32768&n[0]&&ka(l,1)):(l=ep(e),l.c(),ka(l,1),l.m(t,null)):l&&(wa(),Ca(l,1,1,function(){l=null;}),Sa());},i:function i(e){r||(ka(l),r=!0);},o:function o(e){Ca(l),r=!1;},d:function d(e){e&&Mr(t),l&&l.d(),a=!1,or(s);}};}function ep(e){var t,_o78;return t=new xd({props:{icon:'<path stroke="currentColor" stroke-linecap="square" d="m13 14-7 7a2.704 2.704 0 0 1-3 0 2.704 2.704 0 0 1 0-3l7-7"/><path fill="currentColor" d="M9.475 9.475 14.5 14.5c.263.263.69.265.955.005l.783-.767a4.209 4.209 0 0 0 1.262-3.006V10l4-4c.5-.5.375-2.125-.5-3s-2.5-1-3-.5l-4 4h-.732a4.329 4.329 0 0 0-3.03 1.238l-.758.742a.7.7 0 0 0-.005.995Z"/>',hideLabel:!0,label:"Pick a color",class:"PinturaEyeDropper",onclick:e[33]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o78=!0;},p:Kn,i:function i(e){_o78||(ka(t.$$.fragment,e),_o78=!0);},o:function o(e){Ca(t.$$.fragment,e),_o78=!1;},d:function d(e){Oa(t,e);}};}function tp(e){var t,_o79;return t=new Xu({props:{label:xu(e[10].labelColorPalette,e[10]),class:Bc(["PinturaColorPresets",e[9]?"PinturaColorPresetsGrid":"PinturaColorPresetsList"]),hideLabel:!1,name:e[1],value:e[4],optionGroupClass:"PinturaListOptionGroup",optionClass:"PinturaListOption",options:e[2].map(e[42]),selectedIndex:e[3],optionMapper:e[7],optionLabelClass:e[6],onchange:e[43],$$slots:{option:[np,function(_ref214){var e=_ref214.option;return {55:e};},function(_ref215){var e=_ref215.option;return [0,e?16777216:0];}],group:[op,function(_ref216){var e=_ref216.option;return {55:e};},function(_ref217){var e=_ref217.option;return [0,e?16777216:0];}]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o79=!0;},p:function p(e,o){var i={};1024&o[0]&&(i.label=xu(e[10].labelColorPalette,e[10])),512&o[0]&&(i.class=Bc(["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[42])),8&o[0]&&(i.selectedIndex=e[3]),128&o[0]&&(i.optionMapper=e[7]),64&o[0]&&(i.optionLabelClass=e[6]),512&o[0]|50331648&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o79||(ka(t.$$.fragment,e),_o79=!0);},o:function o(e){Ca(t.$$.fragment,e),_o79=!1;},d:function d(e){Oa(t,e);}};}function op(e){var t,o,i=e[55].label+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"slot","group");},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){16777216&t[1]&&i!==(i=e[55].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function ip(e){var t,o,i=e[55].label+"";return {c:function c(){t=Rr("span"),o=Er(i),Dr(t,"class","PinturaButtonLabel");},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){16777216&t[1]&&i!==(i=e[55].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function np(e){var t,_o80,i,n;_o80=new Gh({props:{title:e[55].label,color:e[55].value}});var r=!e[9]&&ip(e);return {c:function c(){t=Rr("span"),Fa(_o80.$$.fragment),i=Ir(),r&&r.c(),Dr(t,"slot","option");},m:function m(e,a){Tr(e,t,a),Da(_o80,t,null),Sr(t,i),r&&r.m(t,null),n=!0;},p:function p(e,i){var n={};16777216&i[1]&&(n.title=e[55].label),16777216&i[1]&&(n.color=e[55].value),_o80.$set(n),e[9]?r&&(r.d(1),r=null):r?r.p(e,i):(r=ip(e),r.c(),r.m(t,null));},i:function i(e){n||(ka(_o80.$$.fragment,e),n=!0);},o:function o(e){Ca(_o80.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(t),Oa(_o80),r&&r.d();}};}function rp(e){var t,o,_i60,n=e[13]&&Kh(e),r=e[12]&&tp(e);return {c:function c(){t=Rr("div"),n&&n.c(),o=Ir(),r&&r.c(),Dr(t,"slot","details"),Dr(t,"class","PinturaColorPickerPanel");},m:function m(e,a){Tr(e,t,a),n&&n.m(t,null),Sr(t,o),r&&r.m(t,null),_i60=!0;},p:function p(e,i){e[13]?n?(n.p(e,i),8192&i[0]&&ka(n,1)):(n=Kh(e),n.c(),ka(n,1),n.m(t,o)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[12]?r?(r.p(e,i),4096&i[0]&&ka(r,1)):(r=tp(e),r.c(),ka(r,1),r.m(t,null)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());},i:function i(e){_i60||(ka(n),ka(r),_i60=!0);},o:function o(e){Ca(n),Ca(r),_i60=!1;},d:function d(e){e&&Mr(t),n&&n.d(),r&&r.d();}};}function ap(e){var t,_o81;return t=new pu({props:{buttonClass:Bc(["PinturaColorPickerButton",e[5]]),$$slots:{details:[rp],label:[qh]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o81=!0;},p:function p(e,o){var i={};32&o[0]&&(i.buttonClass=Bc(["PinturaColorPickerButton",e[5]])),67108831&o[0]|33554432&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o81||(ka(t.$$.fragment,e),_o81=!0);},o:function o(e){Ca(t.$$.fragment,e),_o81=!1;},d:function d(e){Oa(t,e);}};}function sp(e,t,o){var i,n,r,a,s,l,d,u,h,p,m,$,g,f,y,b=t.label,x=t.name,_t$options3=t.options,v=_t$options3===void 0?[]:_t$options3,_t$selectedIndex3=t.selectedIndex,w=_t$selectedIndex3===void 0?-1:_t$selectedIndex3,S=t.value,k=t.buttonClass,C=t.optionLabelClass,T=t.optionMapper,R=t.onchange,P=t.title,_t$hidePresetLabel=t.hidePresetLabel,E=_t$hidePresetLabel===void 0?!0:_t$hidePresetLabel,I=t.locale,_t$enableOpacity=t.enableOpacity,A=_t$enableOpacity===void 0?!0:_t$enableOpacity,_t$enablePresets=t.enablePresets,L=_t$enablePresets===void 0?!0:_t$enablePresets,_t$enablePicker=t.enablePicker,z=_t$enablePicker===void 0?!0:_t$enablePicker,_t$enableInput2=t.enableInput,F=_t$enableInput2===void 0?!1:_t$enableInput2,_t$enableEyeDropper=t.enableEyeDropper,D=_t$enableEyeDropper===void 0?!1:_t$enableEyeDropper;var O=function O(e,t){if(p=[e[0],e[1],e[2]],t){var _t80=function(e,t,o){var 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];}.apply(void 0,_toConsumableArray(p));o(16,l=_t80[0]),o(36,d=_t80[1]),o(37,u=_t80[2]),o(17,h=Lo(e[3])?e[3]:1);}o(18,m=jo(e)),o(19,$=jo([].concat(_toConsumableArray(p),[0]))),o(20,g=jo([].concat(_toConsumableArray(p),[1]))),o(21,f=jo(Hh(l,1,1)));},B=function B(){var e=[].concat(_toConsumableArray(Hh(l,d,u)),[h]);O(e),R(e);},W=function W(e){var t=3===e.length?[].concat(_toConsumableArray(e),[1]):e;O(t,!0),R(t);},V=function V(e,t){var i=ls(e.x/t.width,0,1),n=ls(e.y/t.height,0,1);var r;r=1-n,o(36,d=i),o(37,u=r),0===h&&o(17,h=1),B();};var _,N,H,j;var U=function U(e){var t=Se(pe(e),j);V(we(me(H),t),N);},G=function G(e){N=void 0,document.documentElement.removeEventListener("pointermove",U),document.documentElement.removeEventListener("pointerup",G);};var Z;return e.$$set=function(e){"label"in e&&o(0,b=e.label),"name"in e&&o(1,x=e.name),"options"in e&&o(2,v=e.options),"selectedIndex"in e&&o(3,w=e.selectedIndex),"value"in e&&o(4,S=e.value),"buttonClass"in e&&o(5,k=e.buttonClass),"optionLabelClass"in e&&o(6,C=e.optionLabelClass),"optionMapper"in e&&o(7,T=e.optionMapper),"onchange"in e&&o(34,R=e.onchange),"title"in e&&o(8,P=e.title),"hidePresetLabel"in e&&o(9,E=e.hidePresetLabel),"locale"in e&&o(10,I=e.locale),"enableOpacity"in e&&o(11,A=e.enableOpacity),"enablePresets"in e&&o(12,L=e.enablePresets),"enablePicker"in e&&o(13,z=e.enablePicker),"enableInput"in e&&o(14,F=e.enableInput),"enableEyeDropper"in e&&o(35,D=e.enableEyeDropper);},e.$$.update=function(){16&e.$$.dirty[1]&&o(15,i=D&&(null===Xh&&(Xh=c()&&"EyeDropper"in window),Xh)),16&e.$$.dirty[0]|128&e.$$.dirty[1]&&(!S||y&&ps(S,y)||(o(38,y=_toConsumableArray(S)),O(S,!0))),32&e.$$.dirty[1]&&o(25,n=100*d),64&e.$$.dirty[1]&&o(24,r=100-100*u),256&e.$$.dirty[1]&&o(40,a=!!Z&&Z.length>=4&&Z.length<=5),51216&e.$$.dirty[0]|512&e.$$.dirty[1]&&o(23,s=(F||i)&&S?function(e,t,o){var i=e.map(function(e){return Math.round(255*e).toString(16).toLowerCase().padStart(2,"0");});return (!t&&i.length>3||"ff"===i[3])&&i.pop(),o&&(i=i.map(function(e){return e.substring(0,1);})),"#"+i.join("");}(S,A,a):void 0);},[b,x,v,w,S,k,C,T,P,E,I,A,L,z,F,i,l,h,m,$,g,f,_,s,r,n,W,function(e){o(16,l=e),0===h&&o(17,h=1),B();},function(e){o(17,h=e),B();},function(e){e.stopPropagation(),N=Ve(_.offsetWidth,_.offsetHeight),H=function(e){return he(e.offsetX,e.offsetY);}(e),j=pe(e),V(H,N),document.documentElement.addEventListener("pointermove",U),document.documentElement.addEventListener("pointerup",G);},function(e){N=Ve(_.offsetWidth,_.offsetHeight);var t=n/100*N.width,o=r/100*N.height;V({x:t+e.detail.x,y:o+e.detail.y},N);},function(e){var t=e.target.value,i=t.length;if(!t.startsWith("#")||i<4||6===i||8===i||i>9)return;if(!A&&i>7)return;var n=Zh(t);n&&(o(39,Z=t),O(n),R(n));},function(e){e.stopPropagation();},function(e){new EyeDropper().open().then(function(_ref218){var e=_ref218.sRGBHex;var t=Zh(e);t&&(o(39,Z=S),O(t),R(t));}).catch(function(e){});},R,D,d,u,y,Z,a,function(e){ra[e?"unshift":"push"](function(){_=e,o(22,_);});},function(_ref219){var _ref220=_slicedToArray(_ref219,2),e=_ref220[0],t=_ref220[1];return [e,M(t)?t(I):t];},function(e){return W(e.value);}];}var lp=/*#__PURE__*/function(_Wa23){function lp(e){var _this26;_classCallCheck(this,lp);_this26=_callSuper(this,lp),Ba(_assertThisInitialized(_this26),e,sp,ap,nr,{label:0,name:1,options:2,selectedIndex:3,value:4,buttonClass:5,optionLabelClass:6,optionMapper:7,onchange:34,title:8,hidePresetLabel:9,locale:10,enableOpacity:11,enablePresets:12,enablePicker:13,enableInput:14,enableEyeDropper:35},null,[-1,-1]);return _this26;}_inherits(lp,_Wa23);return _createClass(lp);}(Wa);function cp(e){var t,_o82,_i61;return _o82=new Cp({props:{items:e[0]}}),{c:function c(){t=Rr("div"),Fa(_o82.$$.fragment),Dr(t,"class","PinturaShorthandControl PinturaShapeStyle");},m:function m(e,n){Tr(e,t,n),Da(_o82,t,null),_i61=!0;},p:function p(e,_ref221){var _ref222=_slicedToArray(_ref221,1),t=_ref222[0];var i={};1&t&&(i.items=e[0]),_o82.$set(i);},i:function i(e){_i61||(ka(_o82.$$.fragment,e),_i61=!0);},o:function o(e){Ca(_o82.$$.fragment,e),_i61=!1;},d:function d(e){e&&Mr(t),Oa(_o82);}};}function dp(e,t,o){var i,n,_t81=t,r=_t81.value,_t82=t,a=_t82.onchange,_t83=t,_t83$controls=_t83.controls,s=_t83$controls===void 0?[]:_t83$controls;return e.$$set=function(e){o(6,t=Qn(Qn({},t),pr(e))),"value"in e&&o(1,r=e.value),"onchange"in e&&o(2,a=e.onchange),"controls"in e&&o(3,s=e.controls);},e.$$.update=function(){o(4,i=function(e){var t=e.controls,o=_objectWithoutProperties(e,_excluded2);return o;}(t)),30&e.$$.dirty&&o(0,n=s.map(function(e,t){var _e109=_slicedToArray(e,3),o=_e109[0],n=_e109[1],s=_e109[2];return [o,n,_objectSpread2(_objectSpread2(_objectSpread2({},i),s),{},{value:r[t],onchange:function onchange(e){var o=_toConsumableArray(r);o[t]=e,a(o);}})];}));},t=pr(t),[n,r,a,s,i];}var up=/*#__PURE__*/function(_Wa24){function up(e){var _this27;_classCallCheck(this,up);_this27=_callSuper(this,up),Ba(_assertThisInitialized(_this27),e,dp,cp,nr,{value:1,onchange:2,controls:3});return _this27;}_inherits(up,_Wa24);return _createClass(up);}(Wa);function hp(e){var t,_o83;return t=new fh({props:{label:e[4],options:e[1],title:e[2],selectedIndex:e[5],onchange:e[10]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o83=!0;},p:function p(e,_ref223){var _ref224=_slicedToArray(_ref223,1),o=_ref224[0];var i={};16&o&&(i.label=e[4]),2&o&&(i.options=e[1]),4&o&&(i.title=e[2]),32&o&&(i.selectedIndex=e[5]),9&o&&(i.onchange=e[10]),t.$set(i);},i:function i(e){_o83||(ka(t.$$.fragment,e),_o83=!0);},o:function o(e){Ca(t.$$.fragment,e),_o83=!1;},d:function d(e){Oa(t,e);}};}function pp(e,t,o){var i,n,r,a,s=t.options,l=t.title,c=t.onchange,_t$selectedIndex4=t.selectedIndex,d=_t$selectedIndex4===void 0?-1:_t$selectedIndex4,u=t.value,h=t.label;return e.$$set=function(e){"options"in e&&o(1,s=e.options),"title"in e&&o(2,l=e.title),"onchange"in e&&o(3,c=e.onchange),"selectedIndex"in e&&o(0,d=e.selectedIndex),"value"in e&&o(6,u=e.value),"label"in e&&o(7,h=e.label);},e.$$.update=function(){67&e.$$.dirty&&o(9,i=function(e,t,o){if(e)return t>-1?e[t]:void 0!==o?e.find(function(e){return e[0]===o;}):e[0];}(s,d,u)),514&e.$$.dirty&&o(5,n=s&&s.findIndex(function(e){return e===i;})),512&e.$$.dirty&&o(8,r=i&&i[1]),384&e.$$.dirty&&o(4,a=h||r);},[d,s,l,c,a,n,u,h,r,i,function(e){o(0,d=e.index),c&&c(e);}];}var mp=/*#__PURE__*/function(_Wa25){function mp(e){var _this28;_classCallCheck(this,mp);_this28=_callSuper(this,mp),Ba(_assertThisInitialized(_this28),e,pp,hp,nr,{options:1,title:2,onchange:3,selectedIndex:0,value:6,label:7});return _this28;}_inherits(mp,_Wa25);return _createClass(mp);}(Wa);function $p(e,t,o){var 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 gp(e){var t,o,_i62;var n=[e[10]];var r=e[3][e[9]]||e[9];function a(e){var t={};for(var _e111=0;_e111<n.length;_e111+=1)t=Qn(t,n[_e111]);return {props:t};}return r&&(t=Hr(r,a())),{c:function c(){t&&Fa(t.$$.fragment),o=Ar();},m:function m(e,n){t&&Da(t,e,n),Tr(e,o,n),_i62=!0;},p:function p(e,i){var s=4&i?Aa(n,[La(e[10])]):{};if(r!==(r=e[3][e[9]]||e[9])){if(t){wa();var _e112=t;Ca(_e112.$$.fragment,1,0,function(){Oa(_e112,1);}),Sa();}r?(t=Hr(r,a()),Fa(t.$$.fragment),ka(t.$$.fragment,1),Da(t,o.parentNode,o)):t=null;}else r&&t.$set(s);},i:function i(e){_i62||(t&&ka(t.$$.fragment,e),_i62=!0);},o:function o(e){t&&Ca(t.$$.fragment,e),_i62=!1;},d:function d(e){e&&Mr(o),t&&Oa(t,e);}};}function fp(e){var t,o=e[9],i=e[9]&&vp(e);return {c:function c(){i&&i.c(),t=Ar();},m:function m(e,o){i&&i.m(e,o),Tr(e,t,o);},p:function p(e,n){e[9]?o?nr(o,e[9])?(i.d(1),i=vp(e),i.c(),i.m(t.parentNode,t)):i.p(e,n):(i=vp(e),i.c(),i.m(t.parentNode,t)):o&&(i.d(1),i=null),o=e[9];},i:Kn,o:function o(e){Ca(i);},d:function d(e){e&&Mr(t),i&&i.d(e);}};}function yp(e){var t,o,i=e[10].innerHTML+"";return {c:function c(){t=new Nr(!1),o=Ar(),t.a=o;},m:function m(e,n){t.m(i,e,n),Tr(e,o,n);},p:function p(e,o){4&o&&i!==(i=e[10].innerHTML+"")&&t.p(i);},i:Kn,o:Kn,d:function d(e){e&&Mr(o),e&&t.d();}};}function bp(e){var t,o=e[10].textContent+"";return {c:function c(){t=Er(o);},m:function m(e,o){Tr(e,t,o);},p:function p(e,i){4&i&&o!==(o=e[10].textContent+"")&&Wr(t,o);},i:Kn,o:Kn,d:function d(e){e&&Mr(t);}};}function xp(e){var t,_o84;return t=new Cp({props:{items:e[2],discardEmptyItems:!0}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o84=!0;},p:function p(e,o){var i={};4&o&&(i.items=e[2]),t.$set(i);},i:function i(e){_o84||(ka(t.$$.fragment,e),_o84=!0);},o:function o(e){Ca(t.$$.fragment,e),_o84=!1;},d:function d(e){Oa(t,e);}};}function vp(e){var t,o,_i63,n,r;var a=[xp,bp,yp],s=[];function l(e,t){return e[2]&&e[2].length?0:e[10].textContent?1:e[10].innerHTML?2:-1;}~(o=l(e))&&(_i63=s[o]=a[o](e));var c=[e[4](e[10])],d={};for(var _e114=0;_e114<c.length;_e114+=1)d=Qn(d,c[_e114]);return {c:function c(){t=Rr(e[9]),_i63&&_i63.c(),n=Ir(),/-/.test(e[9])?Br(t,d):Or(t,d);},m:function m(e,i){Tr(e,t,i),~o&&s[o].m(t,null),Sr(t,n),r=!0;},p:function p(e,r){var u=o;o=l(e),o===u?~o&&s[o].p(e,r):(_i63&&(wa(),Ca(s[u],1,1,function(){s[u]=null;}),Sa()),~o?(_i63=s[o],_i63?_i63.p(e,r):(_i63=s[o]=a[o](e),_i63.c()),ka(_i63,1),_i63.m(t,n)):_i63=null),d=Aa(c,[4&r&&e[4](e[10])]),/-/.test(e[9])?Br(t,d):Or(t,d);},i:function i(e){r||(ka(_i63),r=!0);},o:function o(e){Ca(_i63),r=!1;},d:function d(e){e&&Mr(t),~o&&s[o].d();}};}function wp(e,t){var o,i,n,r,a,s;var l=[fp,gp],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:function c(){o=Ar(),r.c(),a=Ar(),this.first=o;},m:function m(e,t){Tr(e,o,t),c[n].m(e,t),Tr(e,a,t),s=!0;},p:function p(e,o){var i=n;n=d(t=e,o),n===i?c[n].p(t,o):(wa(),Ca(c[i],1,1,function(){c[i]=null;}),Sa(),r=c[n],r?r.p(t,o):(r=c[n]=l[n](t),r.c()),ka(r,1),r.m(a.parentNode,a));},i:function i(e){s||(ka(r),s=!0);},o:function o(e){Ca(r),s=!1;},d:function d(e){e&&Mr(o),c[n].d(e),e&&Mr(a);}};}function Sp(e){var t,_o86,_i64=[],n=new Map(),r=e[2];var a=function a(e){return e[0]+e[1];};for(var _t85=0;_t85<r.length;_t85+=1){var _o85=$p(e,r,_t85),_s17=a(_o85);n.set(_s17,_i64[_t85]=wp(_s17,_o85));}return {c:function c(){for(var _e116=0;_e116<_i64.length;_e116+=1)_i64[_e116].c();t=Ar();},m:function m(e,n){for(var _t87=0;_t87<_i64.length;_t87+=1)_i64[_t87].m(e,n);Tr(e,t,n),_o86=!0;},p:function p(e,_ref225){var _ref226=_slicedToArray(_ref225,1),o=_ref226[0];62&o&&(r=e[2],wa(),_i64=Ia(_i64,o,a,1,e,r,n,t.parentNode,Ea,wp,t,$p),Sa());},i:function i(e){if(!_o86){for(var _e118=0;_e118<r.length;_e118+=1)ka(_i64[_e118]);_o86=!0;}},o:function o(e){for(var _e120=0;_e120<_i64.length;_e120+=1)Ca(_i64[_e120]);_o86=!1;},d:function d(e){for(var _t89=0;_t89<_i64.length;_t89+=1)_i64[_t89].d(e);e&&Mr(t);}};}function kp(e,t,o){var i,n,r=t.items,_t$discardEmptyItems=t.discardEmptyItems,a=_t$discardEmptyItems===void 0?!0:_t$discardEmptyItems,_t$key=t.key,s=_t$key===void 0?"":_t$key;var l={Button:xd,ImageButton:Ud,ImageButtonList:qd,Dropdown:fh,Select:mp,RadioGroup:Xu,Input:Ju,Panel:vh,ProgressIndicator:Bd,ShapeStyle:Nh,ToggleSlider:Bh,ColorPicker:lp,ShorthandControl:up},c=function c(e){return !T(e)||!!l[e];},d=function d(e){if(!e)return !1;var _e121=_slicedToArray(e,4),t=_e121[0],o=_e121[2],_e121$=_e121[3],i=_e121$===void 0?[]:_e121$;return !!c(t)||i.some(d)||o.textContent||o.innerHTML;};return e.$$set=function(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=function(){1&e.$$.dirty&&o(1,i=s),192&e.$$.dirty&&o(2,n=(r&&a?r.filter(d):r)||[]);},[s,i,n,l,function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=e.textContent,o=e.innerHTML,i=_objectWithoutProperties(e,_excluded3);return i;},c,r,a];}var Cp=/*#__PURE__*/function(_Wa26){function Cp(e){var _this29;_classCallCheck(this,Cp);_this29=_callSuper(this,Cp),Ba(_assertThisInitialized(_this29),e,kp,Sp,nr,{items:6,discardEmptyItems:7,key:0});return _this29;}_inherits(Cp,_Wa26);return _createClass(Cp,[{key:"items",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({items:e}),fa();}},{key:"discardEmptyItems",get:function get(){return this.$$.ctx[7];},set:function set(e){this.$$set({discardEmptyItems:e}),fa();}},{key:"key",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({key:e}),fa();}}]);}(Wa);var Tp=null;var Mp=function Mp(e){if(null===Tp&&(Tp=c()&&"visualViewport"in window),!Tp)return !1;var t=visualViewport.height,o=function o(){e(visualViewport.height<t?"visible":"hidden");};return visualViewport.addEventListener("resize",o),function(){return visualViewport.removeEventListener("resize",o);};};function Rp(e){var t,_o87;var i=[{onclick:e[1]},e[3]];var n={};for(var _e123=0;_e123<i.length;_e123+=1)n=Qn(n,i[_e123]);return t=new xd({props:n}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o87=!0;},p:function p(e,o){var n=10&o[0]?Aa(i,[2&o[0]&&{onclick:e[1]},8&o[0]&&La(e[3])]):{};t.$set(n);},i:function i(e){_o87||(ka(t.$$.fragment,e),_o87=!0);},o:function o(e){Ca(t.$$.fragment,e),_o87=!1;},d:function d(e){Oa(t,e);}};}function Pp(e){var t,_o88;var i=[{onclick:e[0]},{class:"PinturaInputFormButtonConfirm"},e[2]];var n={};for(var _e125=0;_e125<i.length;_e125+=1)n=Qn(n,i[_e125]);return t=new xd({props:n}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o88=!0;},p:function p(e,o){var n=5&o[0]?Aa(i,[1&o[0]&&{onclick:e[0]},i[1],4&o[0]&&La(e[2])]):{};t.$set(n);},i:function i(e){_o88||(ka(t.$$.fragment,e),_o88=!0);},o:function o(e){Ca(t.$$.fragment,e),_o88=!1;},d:function d(e){Oa(t,e);}};}function Ep(e){var t,o,i,n,r,a,s,l,_c17=e[3]&&Rp(e);var d=e[24].default,u=lr(d,e,e[23],null);var h=e[2]&&Pp(e);return {c:function c(){t=Rr("div"),o=Rr("div"),_c17&&_c17.c(),i=Ir(),n=Rr("div"),u&&u.c(),r=Ir(),h&&h.c(),Dr(n,"class","PinturaInputFormFields"),Dr(o,"class","PinturaInputFormInner"),Dr(t,"class","PinturaInputForm"),Dr(t,"data-layout",e[4]),Dr(t,"style",e[6]);},m:function m(d,p){Tr(d,t,p),Sr(t,o),_c17&&_c17.m(o,null),Sr(o,i),Sr(o,n),u&&u.m(n,null),Sr(o,r),h&&h.m(o,null),e[25](t),a=!0,s||(l=[Lr(n,"keydown",e[10]),Lr(t,"focusin",e[7]),Lr(t,"focusout",e[8]),Lr(t,"measure",e[9]),gr(Mc.call(null,t))],s=!0);},p:function p(e,n){e[3]?_c17?(_c17.p(e,n),8&n[0]&&ka(_c17,1)):(_c17=Rp(e),_c17.c(),ka(_c17,1),_c17.m(o,i)):_c17&&(wa(),Ca(_c17,1,1,function(){_c17=null;}),Sa()),u&&u.p&&(!a||8388608&n[0])&&ur(u,d,e,e[23],a?dr(d,e[23],n,null):hr(e[23]),null),e[2]?h?(h.p(e,n),4&n[0]&&ka(h,1)):(h=Pp(e),h.c(),ka(h,1),h.m(o,null)):h&&(wa(),Ca(h,1,1,function(){h=null;}),Sa()),(!a||16&n[0])&&Dr(t,"data-layout",e[4]),(!a||64&n[0])&&Dr(t,"style",e[6]);},i:function i(e){a||(ka(_c17),ka(u,e),ka(h),a=!0);},o:function o(e){Ca(_c17),Ca(u,e),Ca(h),a=!1;},d:function d(o){o&&Mr(t),_c17&&_c17.d(),u&&u.d(o),h&&h.d(),e[25](null),s=!1,or(l);}};}function Ip(e,t,o){var i,n,r,a,s,_t$$$slots12=t.$$slots,l=_t$$$slots12===void 0?{}:_t$$$slots12,c=t.$$scope,d=t.onconfirm,u=t.oncancel,_t$autoFocus=t.autoFocus,h=_t$autoFocus===void 0?!0:_t$autoFocus,_t$autoPositionCursor=t.autoPositionCursor,p=_t$autoPositionCursor===void 0?!0:_t$autoPositionCursor,m=t.buttonConfirm,$=t.buttonCancel,_t$layout=t.layout,g=_t$layout===void 0?"stack":_t$layout,f=t.parentRect,y=t.align,x=t.justify,_t$parentMargin=t.parentMargin,v=_t$parentMargin===void 0?16:_t$parentMargin,_t$panelOffset=t.panelOffset,w=_t$panelOffset===void 0?ue():_t$panelOffset,S=!1,k=void 0,C=void 0,T="",M=0;var R=function R(){var e=s.querySelector("input, textarea");e.focus(),M>=1||e.select();},P=function P(){S=!0,I||!fo()&&!b()||o(19,T="top:1em;bottom:auto;"),fo()&&function(e){var t;var o=function o(e){return t=e.touches[0].screenY;},i=function i(e){var 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);}(s),o(20,M=1);};var E;var I=Mp(function(e){r?"hidden"!==e||S?(clearTimeout(C),C=void 0,o(19,T="top:".concat(visualViewport.height-k.height-w.y,"px")),"visible"===e?(o(5,s.dataset.stick=!0,s),R(),P()):(S=!1,o(20,M=0))):R():o(19,T="top: 4.5em; bottom: auto");});return Kr(function(){h&&R();}),Qr(function(){I&&I();}),e.$$set=function(e){"onconfirm"in e&&o(0,d=e.onconfirm),"oncancel"in e&&o(1,u=e.oncancel),"autoFocus"in e&&o(11,h=e.autoFocus),"autoPositionCursor"in e&&o(12,p=e.autoPositionCursor),"buttonConfirm"in e&&o(2,m=e.buttonConfirm),"buttonCancel"in e&&o(3,$=e.buttonCancel),"layout"in e&&o(4,g=e.layout),"parentRect"in e&&o(13,f=e.parentRect),"align"in e&&o(14,y=e.align),"justify"in e&&o(15,x=e.justify),"parentMargin"in e&&o(16,v=e.parentMargin),"panelOffset"in e&&o(17,w=e.panelOffset),"$$scope"in e&&o(23,c=e.$$scope);},e.$$.update=function(){385024&e.$$.dirty[0]&&o(21,i=f&&k?function(e,t,o,i,n){var r,a;return r="center"===i?e.x+.5*e.width-.5*t.width:"right"===i?e.x+e.width-t.width-n:e.x+n,a="center"===o?e.y+.5*e.height-.5*t.height:"bottom"===o?e.y+e.height-t.height-n:e.y+n,"left:".concat(r,"px;top:").concat(a,"px;right:auto;bottom:auto;");}(f,k,y,x,v):void 0),32&e.$$.dirty[0]&&o(22,n=s&&getComputedStyle(s)),4194304&e.$$.dirty[0]&&(r=n&&"1"===n.getPropertyValue("--editor-modal")),3670016&e.$$.dirty[0]&&o(6,a="opacity:".concat(M,";").concat(i||T));},[d,u,m,$,g,s,a,function(e){var t;((function(e){return /textarea/i.test(e);})(e.target)||tu(e.target))&&(E=Date.now(),p&&((t=e.target).selectionStart=t.selectionEnd=t.value.length),clearTimeout(C),C=setTimeout(P,200));},function(e){Date.now()-E>50||(e.stopPropagation(),R());},function(_ref227){var e=_ref227.detail;o(18,k={width:e.width,height:e.height});},function(e){return "Enter"===e.key?d():"Escape"===e.key?u():void 0;},h,p,f,y,x,v,w,k,T,M,i,n,c,l,function(e){ra[e?"unshift":"push"](function(){s=e,o(5,s);});}];}var Ap=/*#__PURE__*/function(_Wa27){function Ap(e){var _this30;_classCallCheck(this,Ap);_this30=_callSuper(this,Ap),Ba(_assertThisInitialized(_this30),e,Ip,Ep,nr,{onconfirm:0,oncancel:1,autoFocus:11,autoPositionCursor:12,buttonConfirm:2,buttonCancel:3,layout:4,parentRect:13,align:14,justify:15,parentMargin:16,panelOffset:17},null,[-1,-1]);return _this30;}_inherits(Ap,_Wa27);return _createClass(Ap);}(Wa);var Lp=function Lp(e,t){e.fastSeek&&e.fastSeek(t),e.currentTime=t;};var zp=["aspectRatio","isRotatedSideways","flip","cropSize"],Fp=ys.map(function(_ref228){var _ref229=_slicedToArray(_ref228,1),e=_ref229[0];return e;}).filter(function(e){return !zp.includes(e);});var Dp=function Dp(e,t){return new CustomEvent("ping",{detail:{type:e,data:t},cancelable:!0,bubbles:!0});},Op=function Op(e,t){return (t?xl(e,t):e).replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase();},Bp=function Bp(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Z;var _Na3=Na(void 0),o=_Na3.subscribe,i=_Na3.set;return {subscribe:o,destroy:function(e,t){var o=matchMedia(e);return o.addListener(t),t(o),{get matches(){return o.matches;},destroy:function destroy(){return o.removeListener(t);}};}(e,function(_ref230){var e=_ref230.matches;return i(t(e));}).destroy};},Wp=function Wp(e,t,o){return new Promise(function(i,n){_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee56(){var r,a,s;return _regeneratorRuntime().wrap(function _callee56$(_context57){while(1)switch(_context57.prev=_context57.next){case 0:_context57.t0=Os(e);if(!_context57.t0){_context57.next=7;break;}_context57.t1=i;_context57.next=5;return Ds(e);case 5:_context57.t2=_context57.sent;(0, _context57.t1)(_context57.t2);case 7:_context57.next=9;return t.read(e);case 9:r=_context57.sent;a=function a(e){return O(e,o).then(function(e){return t.apply(e,r);}).then(i).catch(n);};if(!(E(e)||!P()||Yt()||fo())){_context57.next=13;break;}return _context57.abrupt("return",a(e));case 13:_context57.prev=13;_context57.next=16;return L(function(e,t){return createImageBitmap(e).then(function(e){return t(null,e);}).catch(t);},[e]);case 16:s=_context57.sent;_context57.next=21;break;case 19:_context57.prev=19;_context57.t3=_context57["catch"](13);case 21:if(!(s&&s.width)){_context57.next=39;break;}_context57.next=24;return u();case 24:if(!_context57.sent){_context57.next=36;break;}if(!(Gl()&&r>1)){_context57.next=33;break;}_context57.t4=i;_context57.next=29;return function(){var _ref232=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee55(e){return _regeneratorRuntime().wrap(function _callee55$(_context56){while(1)switch(_context56.prev=_context56.next){case 0:_context56.t0=h;_context56.next=3;return v(e);case 3:_context56.t1=_context56.sent;return _context56.abrupt("return",(0, _context56.t0)(_context56.t1));case 5:case"end":return _context56.stop();}},_callee55);}));return function(_x108){return _ref232.apply(this,arguments);};}()(s);case 29:_context57.t5=_context57.sent;(0, _context57.t4)(_context57.t5);_context57.next=34;break;case 33:i(s);case 34:_context57.next=37;break;case 36:i(t.apply(s,r));case 37:_context57.next=40;break;case 39:a(e);case 40:case"end":return _context57.stop();}},_callee56,null,[[13,19]]);}))();});},Vp=function Vp(e,t){return new Promise(/*#__PURE__*/function(){var _ref233=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee57(o){var i,n,r,a,s,l;return _regeneratorRuntime().wrap(function _callee57$(_context58){while(1)switch(_context58.prev=_context58.next){case 0:if(!(e.width<t.width&&e.height<t.height)){_context58.next=2;break;}return _context58.abrupt("return",o(e));case 2:i=Math.min(t.width/e.width,t.height/e.height);n=i*e.width;r=i*e.height;a=p("canvas",{width:n,height:r});s=a.getContext("2d",{willReadFrequently:!0});if(!g(e)){_context58.next=13;break;}_context58.next=10;return v(e);case 10:_context58.t0=_context58.sent;_context58.next=14;break;case 13:_context58.t0=e;case 14:l=_context58.t0;s.drawImage(l,0,0,n,r),o(h(a));case 16:case"end":return _context58.stop();}},_callee57);}));return function(_x109){return _ref233.apply(this,arguments);};}());};var _p=null;var Np=function Np(){if(null===_p){var _e126=p("canvas");_p=!!Dl(_e126),$(_e126),_e126=void 0;}return _p;};var Hp=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],jp={precision:1e-4},Up={precision:.01*jp.precision};var Gp=function Gp(){var e=[],t=[],o=[],i=function i(){t.forEach(function(e){return e(o);});},n=function n(t){t.unsub=t.subscribe(function(n){return function(t,n){var r=e.indexOf(t);r<0||(o[r]=n,i());}(t,n);}),i();};return {get length(){return e.length;},clear:function clear(){e.forEach(function(e){return e.unsub();}),e.length=0,o.length=0;},unshift:function unshift(t){e.unshift(t),n(t);},get:function get(t){return e[t];},push:function push(t){e.push(t),n(t);},remove:function remove(t){t.unsub();var i=e.indexOf(t);e.splice(i,1),o.splice(i,1);},forEach:function forEach(t){return e.forEach(t);},filter:function filter(t){return e.filter(t);},subscribe:function subscribe(e){return t.push(e),e(o),function(){t.splice(t.indexOf(e),1);};}};},Zp=function Zp(e){return e[0]<.25&&e[1]<.25&&e[2]<.25;},Xp=function Xp(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new Promise(function(t){var _e$accept=e.accept,o=_e$accept===void 0?"image/*":_e$accept,i=p("input",{style:"position:absolute;visibility:hidden;width:0;height:0;",type:"file",accept:o}),n=function n(){var _i$files=_slicedToArray(i.files,1),e=_i$files[0];i.parentNode&&i.remove(),i.removeEventListener("change",n),t(e);};i.addEventListener("change",n),fo()&&document.body.append(i),i.click();});},Yp=function Yp(e){try{return e();}catch(e){console.error(e);}},qp=function qp(_ref234){var _ref235=_slicedToArray(_ref234,2),e=_ref235[0],t=_ref235[1];return e+.5*(t-e);},Kp=function Kp(e){return Math.round(100*e);},Jp=function Jp(e){return he(e.clientX,e.clientY);},Qp=function Qp(e,t,o){var i=Jp(e);return Se(Se(i,t),o);};function em(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S,k=t.root,C=t.locale,T=t.stores,_t$allowPan=t.allowPan,M=_t$allowPan===void 0?!0:_t$allowPan,_t$allowZoom=t.allowZoom,R=_t$allowZoom===void 0?!0:_t$allowZoom,_t$enablePan=t.enablePan,P=_t$enablePan===void 0?!0:_t$enablePan,_t$enableZoom=t.enableZoom,E=_t$enableZoom===void 0?!0:_t$enableZoom,_t$enableZoomControls=t.enableZoomControls,I=_t$enableZoomControls===void 0?E:_t$enableZoomControls,_t$enableZoomInput=t.enableZoomInput,A=_t$enableZoomInput===void 0?!0:_t$enableZoomInput,_t$enablePanInput=t.enablePanInput,L=_t$enablePanInput===void 0?!0:_t$enablePanInput,_t$enablePanLimit=t.enablePanLimit,z=_t$enablePanLimit===void 0?!0:_t$enablePanLimit,_t$panLimitGutterScal=t.panLimitGutterScalar,F=_t$panLimitGutterScal===void 0?0:_t$panLimitGutterScal,_t$zoomOptions=t.zoomOptions,D=_t$zoomOptions===void 0?[.25,.5,1,1.25,1.5,2,3,4,6,8,16]:_t$zoomOptions,_t$zoomAdjustStep=t.zoomAdjustStep,O=_t$zoomAdjustStep===void 0?.25:_t$zoomAdjustStep,_t$zoomAdjustFactor=t.zoomAdjustFactor,B=_t$zoomAdjustFactor===void 0?.1:_t$zoomAdjustFactor,_t$zoomAdjustWheelFac=t.zoomAdjustWheelFactor,W=_t$zoomAdjustWheelFac===void 0?1:_t$zoomAdjustWheelFac,_t$elasticity2=t.elasticity,V=_t$elasticity2===void 0?5:_t$elasticity2,_=t.imageSelectionRectCentered,N=t.imageSelectionRectScalar,_t$zoomLevel=t.zoomLevel,H=_t$zoomLevel===void 0?null:_t$zoomLevel,j=t.zoomControls,_t$zoomMultiTouching=t.zoomMultiTouching,U=_t$zoomMultiTouching===void 0?!1:_t$zoomMultiTouching;var _T=T,G=_T.isAnimated,Z=_T.isInteracting,X=_T.rootRect,Y=_T.stageRect,q=_T.stageScalar,K=_T.imageSelectionPan,J=_T.imageSelectionZoom,Q=_T.imageSelectionStageFitScalar,ee=_T.imageSelectionRect,te=_T.imageSelectionStoredState,oe=_T.imagePreviewUpscale;sr(e,G,function(e){return o(70,w=e);}),sr(e,Z,function(e){return o(69,x=e);}),sr(e,X,function(e){return o(66,f=e);}),sr(e,Y,function(e){return o(65,g=e);}),sr(e,q,function(e){return o(46,v=e);}),sr(e,K,function(e){return o(64,p=e);}),sr(e,J,function(e){return o(43,h=e);}),sr(e,Q,function(e){return o(44,m=e);}),sr(e,ee,function(e){return o(67,y=e);}),sr(e,te,function(e){return o(71,S=e);}),sr(e,oe,function(e){return o(45,$=e);});var ie=oa("fixScrollDirection");sr(e,ie,function(e){return o(68,b=e);});var ne=!1,re=void 0,ae=void 0,se=void 0,le=void 0;var ce=function ce(e){var t=k.querySelector(".PinturaMain > .PinturaUtilMain")||k.querySelector('div[tabindex="0"] .PinturaUtilMain');return !!t&&!!t.contains(e.target)&&!ou(e.target);},de=function de(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _e$pan=e.pan,t=_e$pan===void 0?p:_e$pan,_e$zoom=e.zoom,o=_e$zoom===void 0?h:_e$zoom;$r(te,S={translation:t,zoom:o},S);},pe=function pe(){return p&&0===p.x&&0===p.y;},$e=function $e(){$r(J,h=void 0,h),pe()||$r(K,p=ue(),p),ye.set(void 0,{hard:!0});},ge=function ge(){$e(),de();},ye=uc(void 0,{precision:.01});ye.subscribe(function(e){if(void 0===e)return $r(J,h=void 0,h),void(pe()||$r(K,p=ue(),p));var t=h;e<=1?pe()||$r(K,p=ue(),p):e<=t&&$r(K,p=Ce(p,.8),p),$r(J,h=e,h);});var be=function be(e){ye.update(function(t){var o=e(t||m);return de({zoom:o}),o;});},xe=function xe(e){e?ye.set(e,{hard:!1===w}):(e=void 0,ye.set(void 0,{hard:!0})),$r(J,h=e,h),de({zoom:e});},ve=function ve(e,t){var o=N*t,i=_objectSpread2({},_),n=1-ls(F,0,1);ct(i,o<n?o:n);var r=_objectSpread2({},_);ct(r,o),lt(r,e);var a=_objectSpread2({},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(st(a),st(i));},we=function we(_ref236){var e=_ref236.translation,_ref236$zoom=_ref236.zoom,t=_ref236$zoom===void 0?1:_ref236$zoom,_ref236$elastify=_ref236.elastify,o=_ref236$elastify===void 0?!0:_ref236$elastify;if(!re)return;var i=e;var n=he(re.x+i.x,re.y+i.y);if(!z)return n;var r=ve(n,t);return o?Md(r,n,V):r;};var Te,Me;var Re=function Re(){Me=void 0,$r(Z,x=!0,x),o(34,ne=L),Te=!1,se=!1,re=_objectSpread2({},p),ae=$?h||m:r?h||1:h||m;},Pe=function Pe(e){var _e$detail=e.detail,t=_e$detail.scalar,n=_e$detail.translation,r=_e$detail.isMultiTouching;if(!re||!r&&!L)return;r&&Ce(n,.5),(L||r)&&(Te=!0),U||o(13,U=r);var a=i?ls(ae*t,s,l):1,c=we({translation:n,zoom:a,elastify:!0}),d=fe(c);le=fe(p),se=d<le,i&&J.set(a),K.set(c),Me=U&&{translation:e.detail.translation,scalar:t};},Ee=function Ee(e){$r(Z,x=!1,x),o(34,ne=!1),o(13,U=!1),se&&le<50&&(re=void 0,ae=void 0,K.set(ue()));},Ie=function Ie(e){$r(Z,x=!1,x),o(34,ne=!1),o(13,U=!1),Promise.resolve().then(function(){if(Te&&re){var _t90=Me||e.detail,_o89=i?ls(ae*_t90.scalar,s,l):1,_n36=we({elastify:!1,translation:_t90.translation,zoom:_o89});K.set(_n36);}re=void 0,ae=void 0,L&&e.detail.isDoubleTap&&ge(),de();});};var Ae,Le=Date.now(),ze=0,Fe=!1,De=!1;var Oe=function Oe(e){if(!ce(e))return;if(e.preventDefault(),e.stopPropagation(),De)return;clearTimeout(Ae);var t=Pd(e,{fixScrollDirection:b}),o=Date.now(),i=o-Le;Le=o;var n=Math.abs(t/i)>.2;ze=n?ze+1:0;var r=1+-1*t*W/(n?50:100),a=Qp(e,f,g);Be(a,r,{isZoomingFast:n});},Be=function Be(e,t,_ref237){var o=_ref237.isZoomingFast;var i=$?h||m:r?h||1:h||m,n=i*t,a=ue(),c=p,d=$?m:r?1:m,u=Math.abs(n-d),g=n<i,f=i>d&&g||i<d&&n>i,b=ze>=5;if(o||(Fe=!1),ze>0&&!Fe&&(Fe=f),b&&Fe)return ge(),De=!0,void setTimeout(function(){De=!1;},100);if(b)return;!o&&f&&u<=.05&&(Ae=setTimeout(function(){ge();},250)),$r(J,h=ls(n,s,l),h);var x=Je(y);ct(x,i),lt(x,c);var v=st(x),w=Je(x);ct(w,h-i+1,e);var S=st(w),k=ke(Se(S,v),i);(function(e,t,o){e.x=t,e.y=o;})(a,c.x+k.x,c.y+k.y),$r(K,p=g&&o?Ce(me(p),.85):ve(a,i),p),de();},We=function We(e){return (e?"add":"remove")+"EventListener";};var Ve,_e,Ne,He;var je=function je(e){e.preventDefault(),_e=_objectSpread2({},p),He=Je(y),Ne=Qp(e,f,g),Ve=$?h||m:r?h||1:h||m;},Ue=function Ue(e){e.preventDefault(),$r(J,h=ls(e.scale*Ve,s,l),h);var t=Je(He);ct(t,Ve),lt(t,_e);var o=st(t),i=Je(t);ct(i,h-Ve+1,Ne);var n=st(i),r=ke(Se(n,o),Ve),a={x:_e.x+r.x,y:_e.y+r.y};$r(K,p=ve(a,h),p);},Ge=function Ge(e){e.preventDefault();},Ze=function Ze(e){k[We(e)]("wheel",Oe),fo()||(k[We(e)]("gesturestart",je),k[We(e)]("gesturechange",Ue),k[We(e)]("gestureend",Ge));},Xe=function Xe(e){var t=We(e);k[t]("interactionstart",Re),k[t]("interactionupdate",Pe),k[t]("interactionrelease",Ee),k[t]("interactionend",Ie);};var Ye;return Kr(function(){Ye=Sd(k,{drag:!0,pinch:!0,inertia:!0,inertiaDurationMultiplier:10,shouldStartInteraction:ce});}),Qr(function(){Ze(!1),Xe(!1),Ye.destroy(),Ye=void 0;}),e.$$set=function(e){"root"in e&&o(14,k=e.root),"locale"in e&&o(15,C=e.locale),"stores"in e&&o(16,T=e.stores),"allowPan"in e&&o(17,M=e.allowPan),"allowZoom"in e&&o(18,R=e.allowZoom),"enablePan"in e&&o(19,P=e.enablePan),"enableZoom"in e&&o(20,E=e.enableZoom),"enableZoomControls"in e&&o(21,I=e.enableZoomControls),"enableZoomInput"in e&&o(22,A=e.enableZoomInput),"enablePanInput"in e&&o(23,L=e.enablePanInput),"enablePanLimit"in e&&o(24,z=e.enablePanLimit),"panLimitGutterScalar"in e&&o(25,F=e.panLimitGutterScalar),"zoomOptions"in e&&o(26,D=e.zoomOptions),"zoomAdjustStep"in e&&o(27,O=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(28,B=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(29,W=e.zoomAdjustWheelFactor),"elasticity"in e&&o(30,V=e.elasticity),"imageSelectionRectCentered"in e&&o(31,_=e.imageSelectionRectCentered),"imageSelectionRectScalar"in e&&o(32,N=e.imageSelectionRectScalar),"zoomLevel"in e&&o(33,H=e.zoomLevel),"zoomControls"in e&&o(12,j=e.zoomControls),"zoomMultiTouching"in e&&o(13,U=e.zoomMultiTouching);},e.$$.update=function(){var t,g;5505024&e.$$.dirty[0]&&o(36,i=R&&E&&A),655360&e.$$.dirty[0]&&o(35,n=M&&P),393216&e.$$.dirty[0]&&(M||R?($r(J,h=E?S.zoom:void 0,h),$r(K,p=P?me(S.translation):pe()?p:ue(),p),ye.set(h)):$e()),32768&e.$$.dirty[1]&&(r=v>=1),67141632&e.$$.dirty[0]|57344&e.$$.dirty[1]&&o(40,a=[($||v<1)&&[m,Kp(m)+"%",{sublabel:C.labelZoomFit}]].concat(_toConsumableArray(D.map(function(e){return [e,Kp(e)+"%"];}))).filter(Boolean).map(function(e){return 1===e[0]&&(e[2]={sublabel:C.labelZoomActual}),e;}).sort(function(e,t){var o=e[0]||m,i=t[0]||m;return o<i?-1:i<o?1:0;})),8704&e.$$.dirty[1]&&o(38,s=Math.min(a.reduce(function(e,_ref238){var _ref239=_slicedToArray(_ref238,1),t=_ref239[0];return t<e?t:e;},Number.MAX_SAFE_INTEGER),m)),512&e.$$.dirty[1]&&o(37,l=a.reduce(function(e,_ref240){var _ref241=_slicedToArray(_ref240,1),t=_ref241[0];return t>e?t:e;},Number.MIN_SAFE_INTEGER)),4&e.$$.dirty[1]&&null!==H&&xe(H),61440&e.$$.dirty[1]&&o(42,d=h||($||v<1?m:1)),2560&e.$$.dirty[1]&&o(39,(t=a.map(function(_ref242){var _ref243=_slicedToArray(_ref242,1),e=_ref243[0];return e;}),g=d,c=t.findIndex(function(e){return e===g;}))),2048&e.$$.dirty[1]&&o(41,u=Kp(d)+"%"),405045248&e.$$.dirty[0]|6080&e.$$.dirty[1]&&o(12,j=(R||R)&&I?[["Button","zoom-out",{hideLabel:!0,label:C.labelZoomOut,icon:C.iconZoomOut,disabled:h===s,onclick:function onclick(){return be(function(e){return Math.max(s,e-O);});},onhold:function onhold(){return be(function(e){return Math.max(s,e*(1-B));});}}],["Dropdown","zoom-level",{label:u,labelClass:"PinturaFixedWidthCharacters",options:a,selectedIndex:c,onchange:function onchange(e){return xe(e.value);}}],["Button","zoom-in",{hideLabel:!0,label:C.labelZoomIn,icon:C.iconZoomIn,disabled:h===l,onclick:function onclick(){return be(function(e){return Math.min(l,e+O);});},onhold:function onhold(){return be(function(e){return Math.min(l,e*(1+B));});}}]]:[]),16384&e.$$.dirty[0]|32&e.$$.dirty[1]&&k&&Ze(i),16384&e.$$.dirty[0]|16&e.$$.dirty[1]&&k&&Xe(n),8404992&e.$$.dirty[0]|24&e.$$.dirty[1]&&k&&k.style.setProperty("--cursor",n&&L?ne?"grabbing":"grab":"");},[G,Z,X,Y,q,K,J,Q,ee,te,oe,ie,j,U,k,C,T,M,R,P,E,I,A,L,z,F,D,O,B,W,V,_,N,H,ne,n,i,l,s,c,a,u,d,h,m,$,v];}var tm=/*#__PURE__*/function(_Wa28){function tm(e){var _this31;_classCallCheck(this,tm);_this31=_callSuper(this,tm),Ba(_assertThisInitialized(_this31),e,em,null,nr,{root:14,locale:15,stores:16,allowPan:17,allowZoom:18,enablePan:19,enableZoom:20,enableZoomControls:21,enableZoomInput:22,enablePanInput:23,enablePanLimit:24,panLimitGutterScalar:25,zoomOptions:26,zoomAdjustStep:27,zoomAdjustFactor:28,zoomAdjustWheelFactor:29,elasticity:30,imageSelectionRectCentered:31,imageSelectionRectScalar:32,zoomLevel:33,zoomControls:12,zoomMultiTouching:13},null,[-1,-1,-1,-1]);return _this31;}_inherits(tm,_Wa28);return _createClass(tm);}(Wa);var om=Ra.window;function im(e){var t,o,_i65,n=e[41]&&nm(e),r=e[38]&&pm(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ar();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i65=!0;},p:function p(e,i){e[41]?n?(n.p(e,i),1024&i[1]&&ka(n,1)):(n=nm(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[38]?r?(r.p(e,i),128&i[1]&&ka(r,1)):(r=pm(e),r.c(),ka(r,1),r.m(o.parentNode,o)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());},i:function i(e){_i65||(ka(n),ka(r),_i65=!0);},o:function o(e){Ca(n),Ca(r),_i65=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}function nm(e){var t,o,i,n,r,a;var s=[am,rm],l=[];function c(e,t){return e[39]?0:e[35]?1:-1;}return ~(i=c(e))&&(n=l[i]=s[i](e)),{c:function c(){t=Rr("div"),o=Rr("p"),n&&n.c(),Dr(o,"style",e[72]),Dr(t,"class","PinturaStatus"),Dr(t,"style",r="opacity: "+e[54]);},m:function m(e,n){Tr(e,t,n),Sr(t,o),~i&&l[i].m(o,null),a=!0;},p:function p(e,d){var u=i;i=c(e),i===u?~i&&l[i].p(e,d):(n&&(wa(),Ca(l[u],1,1,function(){l[u]=null;}),Sa()),~i?(n=l[i],n?n.p(e,d):(n=l[i]=s[i](e),n.c()),ka(n,1),n.m(o,null)):n=null),(!a||1024&d[2])&&Dr(o,"style",e[72]),(!a||8388608&d[1]&&r!==(r="opacity: "+e[54]))&&Dr(t,"style",r);},i:function i(e){a||(ka(n),a=!0);},o:function o(e){Ca(n),a=!1;},d:function d(e){e&&Mr(t),~i&&l[i].d();}};}function rm(e){var t,o,i,n;t=new Fd({props:{text:e[35].text||"",onmeasure:e[221]}});var r=e[35].aside&&sm(e);return {c:function c(){Fa(t.$$.fragment),o=Ir(),r&&r.c(),i=Ar();},m:function m(e,a){Da(t,e,a),Tr(e,o,a),r&&r.m(e,a),Tr(e,i,a),n=!0;},p:function p(e,o){var n={};16&o[1]&&(n.text=e[35].text||""),t.$set(n),e[35].aside?r?(r.p(e,o),16&o[1]&&ka(r,1)):(r=sm(e),r.c(),ka(r,1),r.m(i.parentNode,i)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());},i:function i(e){n||(ka(t.$$.fragment,e),ka(r),n=!0);},o:function o(e){Ca(t.$$.fragment,e),Ca(r),n=!1;},d:function d(e){Oa(t,e),e&&Mr(o),r&&r.d(e),e&&Mr(i);}};}function am(e){var t,o,_i66,n;return t=new Fd({props:{text:e[39],onmeasure:e[221]}}),_i66=new _d({props:{class:"PinturaStatusIcon",offset:e[82],opacity:e[83],$$slots:{default:[hm]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment),o=Ir(),Fa(_i66.$$.fragment);},m:function m(e,r){Da(t,e,r),Tr(e,o,r),Da(_i66,e,r),n=!0;},p:function p(e,o){var n={};256&o[1]&&(n.text=e[39]),t.$set(n);var r={};1048576&o[2]&&(r.offset=e[82]),2097152&o[2]&&(r.opacity=e[83]),8&o[0]|16384&o[19]&&(r.$$scope={dirty:o,ctx:e}),_i66.$set(r);},i:function i(e){n||(ka(t.$$.fragment,e),ka(_i66.$$.fragment,e),n=!0);},o:function o(e){Ca(t.$$.fragment,e),Ca(_i66.$$.fragment,e),n=!1;},d:function d(e){Oa(t,e),e&&Mr(o),Oa(_i66,e);}};}function sm(e){var t,_o90;return t=new _d({props:{class:"PinturaStatusButton",offset:e[82],opacity:e[83],$$slots:{default:[dm]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o90=!0;},p:function p(e,o){var i={};1048576&o[2]&&(i.offset=e[82]),2097152&o[2]&&(i.opacity=e[83]),16&o[1]|16384&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o90||(ka(t.$$.fragment,e),_o90=!0);},o:function o(e){Ca(t.$$.fragment,e),_o90=!1;},d:function d(e){Oa(t,e);}};}function lm(e){var t,_o91;return t=new Bd({props:{progress:e[35].progressIndicator.progress}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o91=!0;},p:function p(e,o){var i={};16&o[1]&&(i.progress=e[35].progressIndicator.progress),t.$set(i);},i:function i(e){_o91||(ka(t.$$.fragment,e),_o91=!0);},o:function o(e){Ca(t.$$.fragment,e),_o91=!1;},d:function d(e){Oa(t,e);}};}function cm(e){var t,_o92;var i=[e[35].closeButton,{hideLabel:!0}];var n={};for(var _e23=0;_e23<i.length;_e23+=1)n=Qn(n,i[_e23]);return t=new xd({props:n}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o92=!0;},p:function p(e,o){var n=16&o[1]?Aa(i,[La(e[35].closeButton),i[1]]):{};t.$set(n);},i:function i(e){_o92||(ka(t.$$.fragment,e),_o92=!0);},o:function o(e){Ca(t.$$.fragment,e),_o92=!1;},d:function d(e){Oa(t,e);}};}function dm(e){var t,o,_i67,n=e[35].progressIndicator.visible&&lm(e),r=e[35].closeButton&&e[35].text&&cm(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ar();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i67=!0;},p:function p(e,i){e[35].progressIndicator.visible?n?(n.p(e,i),16&i[1]&&ka(n,1)):(n=lm(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[35].closeButton&&e[35].text?r?(r.p(e,i),16&i[1]&&ka(r,1)):(r=cm(e),r.c(),ka(r,1),r.m(o.parentNode,o)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());},i:function i(e){_i67||(ka(n),ka(r),_i67=!0);},o:function o(e){Ca(n),Ca(r),_i67=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}function um(e){var t,o=e[3].iconSupportError+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){8&i[0]&&o!==(o=e[3].iconSupportError+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function hm(e){var t,_o93;return t=new hd({props:{$$slots:{default:[um]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o93=!0;},p:function p(e,o){var i={};8&o[0]|16384&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o93||(ka(t.$$.fragment,e),_o93=!0);},o:function o(e){Ca(t.$$.fragment,e),_o93=!1;},d:function d(e){Oa(t,e);}};}function pm(e){var t,o,i,n,r,a,s,l,_c18,_d14,u,h,_p15,_m9,$=e[10]&&mm(e),g=e[46]&&e[45]&&$m(e);var f=[wm,vm],y=[];function b(e,t){return e[46]?0:1;}function x(t){e[438](t);}function v(t){e[439](t);}function w(t){e[440](t);}i=b(e),n=y[i]=f[i](e),a=new Oc({props:{isAnimated:e[53],isTransparent:e[20],pixelRatio:e[57],textPixelRatio:e[6],backgroundColor:e[56],maskRect:e[58],maskOpacity:e[73]?e[73].maskOpacity:1,maskMarkupOpacity:e[7],maskFrameOpacity:e[5],clipAnnotationsToImage:e[85],images:e[55],interfaceImages:e[86],loadImageData:e[28],enableGrid:e[11],gridSize:e[87],gridColors:[e[88],e[89]],gridOpacity:e[90],selectionColor:e[91],csp:e[92]||{},willRequest:e[81]||e[93],willRender:e[435],didRender:e[436]}});var S={root:e[2],locale:e[3],stores:e[202],allowPan:e[95],enablePan:e[17],enablePanLimit:e[21],panLimitGutterScalar:e[22],enablePanInput:e[96],allowZoom:e[97],enableZoom:e[18],enableZoomInput:void 0!==e[19]?e[19]:e[98],enableZoomControls:e[99],zoomOptions:e[13]||e[23],zoomAdjustStep:e[14]||e[24],zoomAdjustFactor:e[15]||e[25],zoomAdjustWheelFactor:e[16]||e[26],imageSelectionRectCentered:e[100],imageSelectionRectScalar:e[101],elasticity:Rm*e[8]};return void 0!==e[0]&&(S.zoomLevel=e[0]),void 0!==e[33]&&(S.zoomControls=e[33]),void 0!==e[34]&&(S.zoomMultiTouching=e[34]),_d14=new tm({props:S}),ra.push(function(){return za(_d14,"zoomLevel",x);}),ra.push(function(){return za(_d14,"zoomControls",v);}),ra.push(function(){return za(_d14,"zoomMultiTouching",w);}),{c:function c(){$&&$.c(),t=Ir(),g&&g.c(),o=Ir(),n.c(),r=Ir(),Fa(a.$$.fragment),s=Ir(),l=Rr("div"),_c18=Ir(),Fa(_d14.$$.fragment),Dr(l,"class","PinturaRootPortal");},m:function m(n,u){$&&$.m(n,u),Tr(n,t,u),g&&g.m(n,u),Tr(n,o,u),y[i].m(n,u),Tr(n,r,u),Da(a,n,u),Tr(n,s,u),Tr(n,l,u),e[437](l),Tr(n,_c18,u),Da(_d14,n,u),_m9=!0;},p:function p(e,s){e[10]?$?($.p(e,s),1024&s[0]&&ka($,1)):($=mm(e),$.c(),ka($,1),$.m(t.parentNode,t)):$&&(wa(),Ca($,1,1,function(){$=null;}),Sa()),e[46]&&e[45]?g?(g.p(e,s),49152&s[1]&&ka(g,1)):(g=$m(e),g.c(),ka(g,1),g.m(o.parentNode,o)):g&&(wa(),Ca(g,1,1,function(){g=null;}),Sa());var l=i;i=b(e),i===l?y[i].p(e,s):(wa(),Ca(y[l],1,1,function(){y[l]=null;}),Sa(),n=y[i],n?n.p(e,s):(n=y[i]=f[i](e),n.c()),ka(n,1),n.m(r.parentNode,r));var c={};4194304&s[1]&&(c.isAnimated=e[53]),1048576&s[0]&&(c.isTransparent=e[20]),67108864&s[1]&&(c.pixelRatio=e[57]),64&s[0]&&(c.textPixelRatio=e[6]),33554432&s[1]&&(c.backgroundColor=e[56]),134217728&s[1]&&(c.maskRect=e[58]),2048&s[2]&&(c.maskOpacity=e[73]?e[73].maskOpacity:1),128&s[0]&&(c.maskMarkupOpacity=e[7]),32&s[0]&&(c.maskFrameOpacity=e[5]),8388608&s[2]&&(c.clipAnnotationsToImage=e[85]),16777216&s[1]&&(c.images=e[55]),16777216&s[2]&&(c.interfaceImages=e[86]),268435456&s[0]&&(c.loadImageData=e[28]),2048&s[0]&&(c.enableGrid=e[11]),33554432&s[2]&&(c.gridSize=e[87]),201326592&s[2]&&(c.gridColors=[e[88],e[89]]),268435456&s[2]&&(c.gridOpacity=e[90]),536870912&s[2]&&(c.selectionColor=e[91]),1073741824&s[2]&&(c.csp=e[92]||{}),524288&s[2]|1&s[3]&&(c.willRequest=e[81]||e[93]),512&s[0]|270991424&s[1]|2&s[3]&&(c.willRender=e[435]),62&s[2]&&(c.didRender=e[436]),a.$set(c);var m={};4&s[0]&&(m.root=e[2]),8&s[0]&&(m.locale=e[3]),4&s[3]&&(m.allowPan=e[95]),131072&s[0]&&(m.enablePan=e[17]),2097152&s[0]&&(m.enablePanLimit=e[21]),4194304&s[0]&&(m.panLimitGutterScalar=e[22]),8&s[3]&&(m.enablePanInput=e[96]),16&s[3]&&(m.allowZoom=e[97]),262144&s[0]&&(m.enableZoom=e[18]),524288&s[0]|32&s[3]&&(m.enableZoomInput=void 0!==e[19]?e[19]:e[98]),64&s[3]&&(m.enableZoomControls=e[99]),8396800&s[0]&&(m.zoomOptions=e[13]||e[23]),16793600&s[0]&&(m.zoomAdjustStep=e[14]||e[24]),33587200&s[0]&&(m.zoomAdjustFactor=e[15]||e[25]),67174400&s[0]&&(m.zoomAdjustWheelFactor=e[16]||e[26]),128&s[3]&&(m.imageSelectionRectCentered=e[100]),256&s[3]&&(m.imageSelectionRectScalar=e[101]),256&s[0]&&(m.elasticity=Rm*e[8]),!u&&1&s[0]&&(u=!0,m.zoomLevel=e[0],pa(function(){return u=!1;})),!h&&4&s[1]&&(h=!0,m.zoomControls=e[33],pa(function(){return h=!1;})),!_p15&&8&s[1]&&(_p15=!0,m.zoomMultiTouching=e[34],pa(function(){return _p15=!1;})),_d14.$set(m);},i:function i(e){_m9||(ka($),ka(g),ka(n),ka(a.$$.fragment,e),ka(_d14.$$.fragment,e),_m9=!0);},o:function o(e){Ca($),Ca(g),Ca(n),Ca(a.$$.fragment,e),Ca(_d14.$$.fragment,e),_m9=!1;},d:function d(n){$&&$.d(n),n&&Mr(t),g&&g.d(n),n&&Mr(o),y[i].d(n),n&&Mr(r),Oa(a,n),n&&Mr(s),n&&Mr(l),e[437](null),n&&Mr(_c18),Oa(_d14,n);}};}function mm(e){var t,_o94,_i68,n,r;return _o94=new Cp({props:{items:e[69]}}),{c:function c(){t=Rr("div"),Fa(_o94.$$.fragment),Dr(t,"class","PinturaNav PinturaNavTools");},m:function m(a,s){Tr(a,t,s),Da(_o94,t,null),_i68=!0,n||(r=[Lr(t,"measure",e[424]),gr(Mc.call(null,t))],n=!0);},p:function p(e,t){var i={};128&t[2]&&(i.items=e[69]),_o94.$set(i);},i:function i(e){_i68||(ka(_o94.$$.fragment,e),_i68=!0);},o:function o(e){Ca(_o94.$$.fragment,e),_i68=!1;},d:function d(e){e&&Mr(t),Oa(_o94),n=!1,or(r);}};}function $m(e){var t,_o95,_i69;return _o95=new Ad({props:{elasticity:e[8]*Pm,scrollDirection:e[76]?"y":"x",$$slots:{default:[xm]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),Fa(_o95.$$.fragment),Dr(t,"class","PinturaNav PinturaNavMain");},m:function m(e,n){Tr(e,t,n),Da(_o95,t,null),_i69=!0;},p:function p(e,t){var i={};256&t[0]&&(i.elasticity=e[8]*Pm),16384&t[2]&&(i.scrollDirection=e[76]?"y":"x"),12288&t[1]|135168&t[2]|16384&t[19]&&(i.$$scope={dirty:t,ctx:e}),_o95.$set(i);},i:function i(e){_i69||(ka(_o95.$$.fragment,e),_i69=!0);},o:function o(e){Ca(_o95.$$.fragment,e),_i69=!1;},d:function d(e){e&&Mr(t),Oa(_o95);}};}function gm(e){var t,_o96;var i=[e[79],{tabs:e[44]}];var n={$$slots:{default:[bm,function(_ref231){var e=_ref231.tab;return {602:e};},function(_ref244){var e=_ref244.tab;return [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,e?8192:0];}]},$$scope:{ctx:e}};for(var _e34=0;_e34<i.length;_e34+=1)n=Qn(n,i[_e34]);return t=new Gc({props:n}),t.$on("select",e[425]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o96=!0;},p:function p(e,o){var n=8192&o[1]|131072&o[2]?Aa(i,[131072&o[2]&&La(e[79]),8192&o[1]&&{tabs:e[44]}]):{};24576&o[19]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);},i:function i(e){_o96||(ka(t.$$.fragment,e),_o96=!0);},o:function o(e){Ca(t.$$.fragment,e),_o96=!1;},d:function d(e){Oa(t,e);}};}function fm(e){var t,_o97;return t=new Cp({props:{items:e[44]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o97=!0;},p:function p(e,o){var i={};8192&o[1]&&(i.items=e[44]),t.$set(i);},i:function i(e){_o97||(ka(t.$$.fragment,e),_o97=!0);},o:function o(e){Ca(t.$$.fragment,e),_o97=!1;},d:function d(e){Oa(t,e);}};}function ym(e){var t,o=e[602].icon+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){8192&i[19]&&o!==(o=e[602].icon+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function bm(e){var t,o,i,n,r,a=e[602].label+"";return t=new hd({props:{$$slots:{default:[ym]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment),o=Ir(),i=Rr("span"),n=Er(a);},m:function m(e,a){Da(t,e,a),Tr(e,o,a),Tr(e,i,a),Sr(i,n),r=!0;},p:function p(e,o){var i={};24576&o[19]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i),(!r||8192&o[19])&&a!==(a=e[602].label+"")&&Wr(n,a);},i:function i(e){r||(ka(t.$$.fragment,e),r=!0);},o:function o(e){Ca(t.$$.fragment,e),r=!1;},d:function d(e){Oa(t,e),e&&Mr(o),e&&Mr(i);}};}function xm(e){var t,_o98,i,n;var r=[fm,gm],a=[];function s(e,t){return e[74]?0:1;}return t=s(e),_o98=a[t]=r[t](e),{c:function c(){_o98.c(),i=Ar();},m:function m(e,o){a[t].m(e,o),Tr(e,i,o),n=!0;},p:function p(e,n){var l=t;t=s(e),t===l?a[t].p(e,n):(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa(),_o98=a[t],_o98?_o98.p(e,n):(_o98=a[t]=r[t](e),_o98.c()),ka(_o98,1),_o98.m(i.parentNode,i));},i:function i(e){n||(ka(_o98),n=!0);},o:function o(e){Ca(_o98),n=!1;},d:function d(e){a[t].d(e),e&&Mr(i);}};}function vm(e){var t,o,_i70;function n(t){e[431](t);}var r={locale:e[3],class:"PinturaMain",view:e[207](e[43]),props:e[206](e[43],e[27]),stores:e[202]};return void 0!==e[1][e[43]]&&(r.component=e[1][e[43]]),t=new cd({props:r}),ra.push(function(){return za(t,"component",n);}),t.$on("measure",e[233]),t.$on("show",e[432]),t.$on("hide",e[433]),t.$on("fade",e[434]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i70=!0;},p:function p(e,i){var n={};8&i[0]&&(n.locale=e[3]),4096&i[1]&&(n.view=e[207](e[43])),134217728&i[0]|4096&i[1]&&(n.props=e[206](e[43],e[27])),!o&&2&i[0]|4096&i[1]&&(o=!0,n.component=e[1][e[43]],pa(function(){return o=!1;})),t.$set(n);},i:function i(e){_i70||(ka(t.$$.fragment,e),_i70=!0);},o:function o(e){Ca(t.$$.fragment,e),_i70=!1;},d:function d(e){Oa(t,e);}};}function wm(e){var t,_o99;var i=[{class:"PinturaMain"},{visible:e[62]},e[79],{panels:e[78]}];var n={$$slots:{default:[Sm,function(_ref245){var e=_ref245.panel,t=_ref245.panelIsActive;return {600:e,601:t};},function(_ref246){var e=_ref246.panel,t=_ref246.panelIsActive;return [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(e?2048:0)|(t?4096:0)];}]},$$scope:{ctx:e}};for(var _e66=0;_e66<i.length;_e66+=1)n=Qn(n,i[_e66]);return t=new nd({props:n}),t.$on("measure",e[430]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o99=!0;},p:function p(e,o){var n=196609&o[2]?Aa(i,[i[0],1&o[2]&&{visible:e[62]},131072&o[2]&&La(e[79]),65536&o[2]&&{panels:e[78]}]):{};134217738&o[0]|22528&o[19]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);},i:function i(e){_o99||(ka(t.$$.fragment,e),_o99=!0);},o:function o(e){Ca(t.$$.fragment,e),_o99=!1;},d:function d(e){Oa(t,e);}};}function Sm(e){var t,o,_i71;function n(t){e[426](t,e[600]);}var r={locale:e[3],view:e[207](e[600]),props:e[206](e[600],e[27]),isActive:e[601],stores:e[202]};return void 0!==e[1][e[600]]&&(r.component=e[1][e[600]]),t=new cd({props:r}),ra.push(function(){return za(t,"component",n);}),t.$on("measure",e[233]),t.$on("show",function(){return e[427](e[600]);}),t.$on("hide",function(){return e[428](e[600]);}),t.$on("fade",function(){var _e70;for(var _len9=arguments.length,t=new Array(_len9),_key9=0;_key9<_len9;_key9++){t[_key9]=arguments[_key9];}return (_e70=e)[429].apply(_e70,[e[600]].concat(t));}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i71=!0;},p:function p(i,n){e=i;var r={};8&n[0]&&(r.locale=e[3]),2048&n[19]&&(r.view=e[207](e[600])),134217728&n[0]|2048&n[19]&&(r.props=e[206](e[600],e[27])),4096&n[19]&&(r.isActive=e[601]),!o&&2&n[0]|2048&n[19]&&(o=!0,r.component=e[1][e[600]],pa(function(){return o=!1;})),t.$set(r);},i:function i(e){_i71||(ka(t.$$.fragment,e),_i71=!0);},o:function o(e){Ca(t.$$.fragment,e),_i71=!1;},d:function d(e){Oa(t,e);}};}function km(e){var t,o;return {c:function c(){t=Rr("span"),Dr(t,"class","PinturaEditorOverlay"),Dr(t,"style",o="opacity:"+e[102]);},m:function m(e,o){Tr(e,t,o);},p:function p(e,i){512&i[3]&&o!==(o="opacity:"+e[102])&&Dr(t,"style",o);},d:function d(e){e&&Mr(t);}};}function Cm(e){var t,_o100;var i=[{layout:"row"},{parentRect:e[50]},e[60]];var n={$$slots:{default:[Tm]},$$scope:{ctx:e}};for(var _e82=0;_e82<i.length;_e82+=1)n=Qn(n,i[_e82]);return t=new Ap({props:n}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o100=!0;},p:function p(e,o){var n=537395200&o[1]?Aa(i,[i[0],524288&o[1]&&{parentRect:e[50]},536870912&o[1]&&La(e[60])]):{};1610612736&o[1]|16384&o[19]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);},i:function i(e){_o100||(ka(t.$$.fragment,e),_o100=!0);},o:function o(e){Ca(t.$$.fragment,e),_o100=!1;},d:function d(e){Oa(t,e);}};}function Tm(e){var t,o,i;return {c:function c(){t=Rr("input"),t.value=o=e[60].text,Dr(t,"placeholder",i=e[60].placeholder),Dr(t,"type","text"),Dr(t,"spellcheck","false"),Dr(t,"autocorrect","off"),Dr(t,"autocapitalize","off");},m:function m(o,i){Tr(o,t,i),e[441](t);},p:function p(e,n){536870912&n[1]&&o!==(o=e[60].text)&&t.value!==o&&(t.value=o),536870912&n[1]&&i!==(i=e[60].placeholder)&&Dr(t,"placeholder",i);},d:function d(o){o&&Mr(t),e[441](null);}};}function Mm(e){var t,o,i,r,a,s;ha(e[423]);var l=e[40]&&im(e),_c19=e[102]>0&&km(e),_d15=e[60]&&Cm(e);return {c:function c(){t=Rr("div"),l&&l.c(),o=Ir(),_c19&&_c19.c(),i=Ir(),_d15&&_d15.c(),Dr(t,"id",e[4]),Dr(t,"class",e[77]),Dr(t,"data-env",e[75]),Dr(t,"dir",e[12]);},m:function m(u,h){Tr(u,t,h),l&&l.m(t,null),Sr(t,o),_c19&&_c19.m(t,null),Sr(t,i),_d15&&_d15.m(t,null),e[442](t),r=!0,a||(s=[Lr(om,"keydown",e[224]),Lr(om,"keyup",e[225]),Lr(om,"blur",e[226]),Lr(om,"paste",e[230]),Lr(om,"resize",e[423]),Lr(t,"ping",function(){ir(e[68])&&e[68].apply(this,arguments);}),Lr(t,"contextmenu",e[227]),Lr(t,"touchstart",e[222],{passive:!1}),Lr(t,"touchmove",function(){ir(e[71])&&e[71].apply(this,arguments);}),Lr(t,"pointermove",function(){ir(e[70])&&e[70].apply(this,arguments);}),Lr(t,"transitionend",e[212]),Lr(t,"dropfiles",e[228]),Lr(t,"measure",e[443]),Lr(t,"click",function(){ir(e[42]?e[229]:n)&&(e[42]?e[229]:n).apply(this,arguments);}),gr(Mc.call(null,t,{observeViewRect:!0,isMeasureRoot:!0})),gr(Rc.call(null,t)),gr(Ec.call(null,t))],a=!0);},p:function p(n,a){(e=n)[40]?l?(l.p(e,a),512&a[1]&&ka(l,1)):(l=im(e),l.c(),ka(l,1),l.m(t,o)):l&&(wa(),Ca(l,1,1,function(){l=null;}),Sa()),e[102]>0?_c19?_c19.p(e,a):(_c19=km(e),_c19.c(),_c19.m(t,i)):_c19&&(_c19.d(1),_c19=null),e[60]?_d15?(_d15.p(e,a),536870912&a[1]&&ka(_d15,1)):(_d15=Cm(e),_d15.c(),ka(_d15,1),_d15.m(t,null)):_d15&&(wa(),Ca(_d15,1,1,function(){_d15=null;}),Sa()),(!r||16&a[0])&&Dr(t,"id",e[4]),(!r||32768&a[2])&&Dr(t,"class",e[77]),(!r||8192&a[2])&&Dr(t,"data-env",e[75]),(!r||4096&a[0])&&Dr(t,"dir",e[12]);},i:function i(e){r||(ka(l),ka(_d15),r=!0);},o:function o(e){Ca(l),Ca(_d15),r=!1;},d:function d(o){o&&Mr(t),l&&l.d(),_c19&&_c19.d(),_d15&&_d15.d(),e[442](null),a=!1,or(s);}};}var Rm=1,Pm=10;function Em(e,t,o){var i,r,a,s,l,c,d,u,p,m,g,f,y,v,w,S,k,C,M,R,P,E,A,L,z,D,O,B,W,V,_,N,H,j,U,G,X,Y,q,K,J,Q,ee,te,oe,ie,ne,re,ae,se,ce,de,pe,me,$e,ge,fe,ye,be,xe,we,Se,ke,Ce,Te,Me,Re,Pe,Ee,Ie,Ae,Le,ze,Fe,De,Oe,Be,We,_e,Ne,He,je,Ue,Ge,Ze,Xe,Ye,qe,Ke,tt,ot,nt,rt,st,dt,ut,$t,gt,bt,xt,St,Ct,Mt,Rt,Pt,Et,It,At,Lt,zt,Ft,Dt,Ot,Bt,Wt,Nt,Ht,jt,Ut,Gt,Zt,Xt,qt,Kt,Jt,Qt,eo,to,oo,io,no,ro,ao,so,lo,co,ho,po,mo,$o,go,yo,bo,xo,vo,wo,So,ko,Co,To,Mo,Ro,Po,Eo,Io,Ao,zo,Fo,Do,Oo,Bo,Wo,Vo,_o,Ho,jo,Uo,Go,Zo,Xo,qo,Ko,Jo,Qo,ei,ti,oi,ii,ni,ri,ai,si,li,ci,di,ui,hi,pi,mi,$i,fi,yi,bi,xi,vi,wi,Ci,Ti,Mi,Pi,Ei,Ai,Li,Fi,Di,Oi,Bi,Wi,Vi,_i,Ni,Hi,ji,Ui,Gi=Kn,Zi=Kn;sr(e,hc,function(e){return o(411,ei=e);}),e.$$.on_destroy.push(function(){return Gi();}),e.$$.on_destroy.push(function(){return Zi();});var Xi=Yo(),Yi=ea();var qi=t.class,Ki=t.layout,Ji=t.stores,Qi=t.locale,en=t.id,tn=t.util,on=t.utils,_t$animations=t.animations,nn=_t$animations===void 0?"auto":_t$animations,_t$disabled5=t.disabled,rn=_t$disabled5===void 0?!1:_t$disabled5,an=t.status,_t$previewUpscale=t.previewUpscale,sn=_t$previewUpscale===void 0?!1:_t$previewUpscale,_t$previewPad=t.previewPad,ln=_t$previewPad===void 0?!1:_t$previewPad,_t$previewMaskOpacity=t.previewMaskOpacity,cn=_t$previewMaskOpacity===void 0?.95:_t$previewMaskOpacity,dn=t.previewImageDataMaxSize,un=t.previewImageTextPixelRatio,_t$markupMaskOpacity=t.markupMaskOpacity,hn=_t$markupMaskOpacity===void 0?1:_t$markupMaskOpacity,_t$zoomMaskOpacity=t.zoomMaskOpacity,pn=_t$zoomMaskOpacity===void 0?.85:_t$zoomMaskOpacity,_t$elasticityMultipli=t.elasticityMultiplier,mn=_t$elasticityMultipli===void 0?10:_t$elasticityMultipli,_t$willRevert=t.willRevert,$n=_t$willRevert===void 0?function(){return Promise.resolve(!0);}:_t$willRevert,_t$willProcessImage=t.willProcessImage,fn=_t$willProcessImage===void 0?function(){return Promise.resolve(!0);}:_t$willProcessImage,_t$willRenderCanvas=t.willRenderCanvas,yn=_t$willRenderCanvas===void 0?Z:_t$willRenderCanvas,_t$willRenderToolbar=t.willRenderToolbar,bn=_t$willRenderToolbar===void 0?Z:_t$willRenderToolbar,_t$willRenderUtilTabs=t.willRenderUtilTabs,xn=_t$willRenderUtilTabs===void 0?Z:_t$willRenderUtilTabs,_t$willSetHistoryInit=t.willSetHistoryInitialState,Sn=_t$willSetHistoryInit===void 0?Z:_t$willSetHistoryInit,_t$enableButtonExport=t.enableButtonExport,kn=_t$enableButtonExport===void 0?!0:_t$enableButtonExport,_t$enableButtonRevert=t.enableButtonRevert,Cn=_t$enableButtonRevert===void 0?!0:_t$enableButtonRevert,_t$enableNavigateHist=t.enableNavigateHistory,Tn=_t$enableNavigateHist===void 0?!0:_t$enableNavigateHist,_t$enableToolbar=t.enableToolbar,Mn=_t$enableToolbar===void 0?!0:_t$enableToolbar,_t$enableUtils=t.enableUtils,Pn=_t$enableUtils===void 0?!0:_t$enableUtils,_t$enableButtonClose=t.enableButtonClose,En=_t$enableButtonClose===void 0?!1:_t$enableButtonClose,_t$enableDropImage=t.enableDropImage,In=_t$enableDropImage===void 0?!1:_t$enableDropImage,_t$enablePasteImage=t.enablePasteImage,An=_t$enablePasteImage===void 0?!1:_t$enablePasteImage,_t$enableBrowseImage=t.enableBrowseImage,Ln=_t$enableBrowseImage===void 0?!1:_t$enableBrowseImage,_t$enableTransparency=t.enableTransparencyGrid,zn=_t$enableTransparency===void 0?!1:_t$enableTransparency,_t$layoutDirectionPre=t.layoutDirectionPreference,Fn=_t$layoutDirectionPre===void 0?"auto":_t$layoutDirectionPre,_t$layoutHorizontalUt=t.layoutHorizontalUtilsPreference,Dn=_t$layoutHorizontalUt===void 0?"left":_t$layoutHorizontalUt,_t$layoutVerticalUtil=t.layoutVerticalUtilsPreference,On=_t$layoutVerticalUtil===void 0?"bottom":_t$layoutVerticalUtil,_t$layoutVerticalTool=t.layoutVerticalToolbarPreference,Bn=_t$layoutVerticalTool===void 0?"top":_t$layoutVerticalTool,_t$layoutVerticalCont=t.layoutVerticalControlGroupsPreference,Wn=_t$layoutVerticalCont===void 0?"bottom":_t$layoutVerticalCont,_t$layoutVerticalCont2=t.layoutVerticalControlTabsPreference,Vn=_t$layoutVerticalCont2===void 0?"bottom":_t$layoutVerticalCont2,_n=t.textDirection,_t$markupEditorZoomLe=t.markupEditorZoomLevel,Nn=_t$markupEditorZoomLe===void 0?null:_t$markupEditorZoomLe,Hn=t.markupEditorZoomLevels,jn=t.markupEditorZoomAdjustStep,Un=t.markupEditorZoomAdjustFactor,Gn=t.markupEditorZoomAdjustWheelFactor,_t$markupEditorIntera=t.markupEditorInteractionMode,Zn=_t$markupEditorIntera===void 0?!1:_t$markupEditorIntera,_t$muteAudio=t.muteAudio,Xn=_t$muteAudio===void 0?!0:_t$muteAudio,_t$willSetMediaInitia=t.willSetMediaInitialTimeOffset,Jn=_t$willSetMediaInitia===void 0?function(e,t){return e*qp(t[0]);}:_t$willSetMediaInitia,_t$enablePan2=t.enablePan,Qn=_t$enablePan2===void 0?!0:_t$enablePan2,_t$enableZoom2=t.enableZoom,er=_t$enableZoom2===void 0?!0:_t$enableZoom2,_t$enableZoomControls2=t.enableZoomControls,tr=_t$enableZoomControls2===void 0?!0:_t$enableZoomControls2,or=t.enableZoomInput,ir=t.enablePanInput,_t$enableCanvasAlpha=t.enableCanvasAlpha,nr=_t$enableCanvasAlpha===void 0?!1:_t$enableCanvasAlpha,lr=t.enablePanLimit,cr=t.panLimitGutterScalar,_t$zoomPresetOptions=t.zoomPresetOptions,dr=_t$zoomPresetOptions===void 0?[.25,.5,1,1.25,1.5,2,3,4,6,8,16]:_t$zoomPresetOptions,_t$zoomAdjustStep2=t.zoomAdjustStep,ur=_t$zoomAdjustStep2===void 0?.25:_t$zoomAdjustStep2,_t$zoomAdjustFactor2=t.zoomAdjustFactor,hr=_t$zoomAdjustFactor2===void 0?.1:_t$zoomAdjustFactor2,_t$zoomAdjustWheelFac2=t.zoomAdjustWheelFactor,pr=_t$zoomAdjustWheelFac2===void 0?1:_t$zoomAdjustWheelFac2,_t$zoomLevel2=t.zoomLevel,mr=_t$zoomLevel2===void 0?null:_t$zoomLevel2,_t$fixScrollDirection=t.fixScrollDirection,gr=_t$fixScrollDirection===void 0?!1:_t$fixScrollDirection;var fr=Na(gr);var yr,br;ta("fixScrollDirection",fr);var xr=t.imagePreviewSrc,_t$imageOrienter=t.imageOrienter,vr=_t$imageOrienter===void 0?{read:function read(){return 1;},apply:function apply(e){return e;}}:_t$imageOrienter,wr=t.pluginComponents,_t$pluginOptions=t.pluginOptions,Sr=_t$pluginOptions===void 0?{}:_t$pluginOptions;var kr=Xi.sub,Cr={};var Tr=t.root;var Mr=function Mr(){St.setAttribute("data-redraw","true"),Yr.set({});},Rr=Na(!0);sr(e,Rr,function(e){return o(476,Zt=e);});var Pr=Na(void 0);sr(e,Pr,function(e){return o(421,yi=e);});var Er=Na(0);sr(e,Er,function(e){return o(418,mi=e);});var Ir=Na(!1),Ar=function Ar(e){Ir.set("play"===e.type),Xi.pub(e.type);};var Lr,zr;var Fr,Dr,Or=!1;var Br=function Br(){if(!a||!Vr())return;Dr=p,$r(Pr,yi=void 0,yi);var e=St;Or=!1;var t=1/24,o=Gr();(Math.abs(d*o-mi*o)<=t||o-o*mi<=t)&&$r(Er,mi=c,mi),Xr(mi*Gr()),e.play().catch(function(){});var i=Zr();var n=function n(){if(Vr())return;Fr=requestAnimationFrame(n);var e=Zr();e-i<=0&&(e=i+.01),i=e,$r(Er,mi=e/Gr(),mi),Dr>=0&&mi>=d&&($r(Er,mi=d,mi),Wr()),p>-1&&(Or=!0),Or&&-1===p&&m>0&&($r(Er,mi=l[m][0],mi),Xr(mi*Gr())),$r(ha,di=mi*Gr(),di),Mr();};n();},Wr=function Wr(){a&&!Vr()&&($r(Pr,yi=void 0,yi),Dr=void 0,St.pause(),cancelAnimationFrame(Fr),Mr());},Vr=function Vr(){return St&&St.paused;},_r=function _r(){if(a)return Vr()?Br():Wr();},Nr=function Nr(){if(!a)return;St.muted=!0;},Hr=function Hr(){if(!a)return;St.muted=!1;},jr=function jr(){a&&$r(Ur,fi=!fi,fi);},Ur=Na(Xn);sr(e,Ur,function(e){return o(420,fi=e);});var Gr=function Gr(){if(a)return St.duration;},Zr=function Zr(){if(!a)return;return St.currentTime;},Xr=function Xr(e){a&&(Lp(St,e),$r(Er,mi=e/$i,mi));},Yr=Na({});sr(e,Yr,function(e){return o(52,Kt=e);}),ta("redrawTrigger",Yr);var qr=Na(mn);sr(e,qr,function(e){return o(493,hi=e);}),ta("elasticityMultiplier",qr);var Kr=[];var Jr=uc();sr(e,Jr,function(e){return o(102,Ui=e);});var oa=Ul()||1024,ia=Ve(oa,oa),na=Rs(),aa=function aa(e){return Promise.resolve(ui&&ui(e,{resourceType:"image"})).then(function(t){if(!1===t)return;var _ref247=t||{},o=_ref247.headers,i=_ref247.credentials;return fetch(e,{headers:o,credentials:i}).then(function(e){if(200!==e.status)throw "".concat(e.status," (").concat(e.statusText,")");return e.blob();}).then(function(e){return Wp(e,vr,na);}).then(function(e){return Vp(e,y);});});};var _t$imageSourceToImage=t.imageSourceToImageData,sa=_t$imageSourceToImage===void 0?function(e){return T(e)?aa(e):Vt(e)?new Promise(function(t){return t(h(e));}):uo(e)||_t(e)?Wp(e,vr,na).then(function(e){return Vp(e,y);}):void 0;}:_t$imageSourceToImage;var la=function(){var e,t;var o=Fp.reduce(function(e,o){return e[o]=function(e,t,o){var i=[];return {set:t,update:o,publish:function publish(e){i.forEach(function(t){return t(e);});},subscribe:function subscribe(t){return i.push(t),e(t),function(){i=i.filter(function(e){return e!==t;});};}};}(function(e){if(!t)return e();t.stores[o].subscribe(e)();},function(e){t&&t.stores[o].set(e);},function(e){t&&t.stores[o].update(e);}),e;},{});return {update:function update(i){if(t=i,e&&(e.forEach(function(e){return e();}),e=void 0),!i)return o.file.publish(void 0),void o.loadState.publish(void 0);e=Fp.map(function(e){return i.stores[e].subscribe(function(t){o[e].publish(t);});});},stores:o,destroy:function destroy(){e&&e.forEach(function(e){return e();});}};}(),_la$stores=la.stores,ca=_la$stores.file,da=_la$stores.size,ua=_la$stores.duration,ha=_la$stores.currentTime,pa=_la$stores.trim,ma=_la$stores.volume,$a=_la$stores.minDuration,ga=_la$stores.maxDuration,fa=_la$stores.loadState,ya=_la$stores.processState,ba=_la$stores.cropAspectRatio,xa=_la$stores.cropLimitToImage,va=_la$stores.crop,wa=_la$stores.cropMinSize,Sa=_la$stores.cropMaxSize,ka=_la$stores.cropRange,Ca=_la$stores.cropOrigin,Ta=_la$stores.cropRectAspectRatio,Ma=_la$stores.rotation,Ra=_la$stores.rotationRange,Pa=_la$stores.targetSize,Ea=_la$stores.flipX,Ia=_la$stores.flipY,Aa=_la$stores.backgroundColor,La=_la$stores.backgroundImage,za=_la$stores.colorMatrix,Fa=_la$stores.convolutionMatrix,Da=_la$stores.gamma,Oa=_la$stores.vignette,Ba=_la$stores.noise,Wa=_la$stores.decoration,Va=_la$stores.annotation,ja=_la$stores.manipulation,Ua=_la$stores.redaction,Ga=_la$stores.frame,Za=_la$stores.selection,Xa=_la$stores.state;sr(e,ca,function(e){return o(395,xo=e);}),sr(e,da,function(e){return o(368,Rt=e);}),sr(e,ua,function(e){return o(419,$i=e);}),sr(e,ha,function(e){return o(492,di=e);}),sr(e,pa,function(e){return o(416,ci=e);}),sr(e,ma,function(e){return o(417,pi=e);}),sr(e,ga,function(e){return o(422,bi=e);}),sr(e,fa,function(e){return o(387,so=e);}),sr(e,ya,function(e){return o(386,ao=e);}),sr(e,ba,function(e){return o(489,oi=e);}),sr(e,xa,function(e){return o(85,Ci=e);}),sr(e,va,function(e){return o(406,Wo=e);}),sr(e,Ma,function(e){return o(371,It=e);}),sr(e,Ea,function(e){return o(370,Et=e);}),sr(e,Ia,function(e){return o(369,Pt=e);}),sr(e,Aa,function(e){return o(377,jt=e);}),sr(e,Wa,function(e){return o(48,Mt=e);}),sr(e,Va,function(e){return o(49,At=e);}),sr(e,ja,function(e){return o(374,Wt=e);}),sr(e,Ua,function(e){return o(375,Nt=e);}),sr(e,Ga,function(e){return o(47,Ct=e);}),sr(e,Za,function(e){return o(59,ai=e);}),sr(e,Xa,function(e){return o(478,So=e);}),ta("components",{DynamicComponentTree:Cp}),ta("previewcontrols",{play:Br,pause:Wr,togglePlayPause:_r,mute:Nr,unmute:Hr,toggleMute:jr,setCurrentTime:Xr,getCurrentTime:Zr,getDuration:Gr,frameOffset:Er,framePeekOffset:Pr,isPlaying:Ir,isMuted:Ur});var Ya=function Ya(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;return new Promise(function(i,n){if(Os(e))return void zs(e).then(function(e){var t=Lo(di)?di:Jn(e.duration,ci||[[0,1]]);Fs(e,t).then(i);});var r,a=!1;t.cancel=function(){return a=!0;};var s=Date.now();sa(e).then(function(e){var t=Date.now()-s;clearTimeout(r),r=setTimeout(function(){a||i(e);},Math.max(0,o-t));}).catch(n);});},_Ji=Ji,qa=_Ji.images,Ka=_Ji.shapePreprocessor,Ja=_Ji.imageScrambler,Qa=_Ji.imageRedactionRendering,es=_Ji.willRequest,ts=_Ji.willRequestResource,os=_Ji.csp;var is;sr(e,qa,function(e){return o(415,li=e);}),sr(e,Ka,function(e){return o(414,si=e);}),sr(e,Ja,function(e){return o(378,Ut=e);}),sr(e,Qa,function(e){return o(376,Ht=e);}),sr(e,es,function(e){return o(81,ui=e);}),sr(e,ts,function(e){return o(93,Di=e);}),sr(e,os,function(e){return o(92,Fi=e);});var ns=Ha(La,function(e,t){if(!e)return t(void 0);is&&(is.cancel(),is=void 0),is={cancel:n},Ya(e,is).then(t).catch(function(e){});}),rs=Xa.subscribe(function(e){return Xi.pub("update",e);}),as=Na();ta("ui",Na({})),ta("selection",Za);var ss=Na(!0);sr(e,ss,function(e){return o(95,Bi=e);});var cs=Na(!0);sr(e,cs,function(e){return o(97,Vi=e);});var ds=Na(!0);sr(e,ds,function(e){return o(413,ri=e);});var us=Na(!0);sr(e,us,function(e){return o(490,ii=e);});var hs=Na(!0);sr(e,hs,function(e){return o(98,_i=e);});var ms=Na();sr(e,ms,function(e){return o(99,Ni=e);});var $s=Na();sr(e,$s,function(e){return o(491,ni=e);});var gs=Ha([$s,us],function(){return void 0!==ni?ni:ii;});sr(e,gs,function(e){return o(96,Wi=e);});var fs=Na([0,0,0]);sr(e,fs,function(e){return o(56,Ro=e);});var ys=Na([1,1,1]);sr(e,ys,function(e){return o(474,Bt=e);});var bs=uc([1,1,1]);sr(e,bs,function(e){return o(473,Ot=e);});var xs=Na();sr(e,xs,function(e){return o(91,Li=e);});var vs=Na(),ws=Na();sr(e,ws,function(e){return o(51,Xt=e);});var Ss=Na();sr(e,Ss,function(e){return o(372,zt=e);});var ks=Na(Qe());sr(e,ks,function(e){return o(80,ko=e);});var Cs=Na(0);sr(e,Cs,function(e){return o(412,ti=e);});var Ts=Na(Qe());sr(e,Ts,function(e){return o(84,wi=e);});var Ms=Na();sr(e,Ms,function(e){return o(471,xt=e);});var Ps=Bp("(pointer: fine)",function(e){return e?"pointer-fine":"pointer-coarse";});sr(e,Ps,function(e){return o(393,yo=e);});var Es=Bp("(hover: hover)",function(e){return e?"pointer-hover":"pointer-no-hover";});sr(e,Es,function(e){return o(392,go=e);});var Is=Na(!1),As=Na(!1);sr(e,As,function(e){return o(373,Dt=e);});var Ls=_a(void 0,function(e){var t=uc(0),o=[As.subscribe(function(e){t.set(e?1:0,{hard:!Qt});}),t.subscribe(e)];return function(){return o.forEach(function(e){return e();});};});sr(e,Ls,function(e){return o(472,Ft=e);});var Ds=Na();sr(e,Ds,function(e){return o(477,po=e);});var Bs=Na();var Ws;sr(e,Bs,function(e){return o(53,Qt=e);}),ta("isAnimated",Bs);var Vs=Na(sn);sr(e,Vs,function(e){return o(396,vo=e);});var _s=Na(!1);sr(e,_s,function(e){return o(483,Ho=e);}),ta("imageIsStatic",_s);var Ns=Na();sr(e,Ns,function(e){return o(484,jo=e);});var Hs=Na();sr(e,Hs,function(e){return o(481,Vo=e);});var js=_a(void 0,function(e){var t=Na(void 0),o=[va.subscribe(function(){if(!Wo)return;if(Ho)return t.set(Je(Wo));var e=Td(Wo,Vo,5*mn);t.set(e);}),t.subscribe(e)];return function(){return o.forEach(function(e){return e();});};}),Us=Na();sr(e,Us,function(e){return o(480,Bo=e);});var Gs=Na();sr(e,Gs,function(e){return o(482,_o=e);});var Zs=Na(void 0);sr(e,Zs,function(e){return o(487,Ko=e);});var Xs=Na(ue());sr(e,Xs,function(e){return o(488,Jo=e);});var Ys=function Ys(e,t){if(!t||!e)return {top:0,right:0,bottom:0,left:0};var o=wn(t,e,v),i=vn(o,e);return {top:Math.abs(i.top),right:Math.abs(i.right),bottom:Math.abs(i.bottom),left:Math.abs(i.left)};},qs=Na({}),Ks=Ha([Ms,ks,Ts,qs],function(_ref248,n){var _ref249=_slicedToArray(_ref248,4),e=_ref249[0],t=_ref249[1],o=_ref249[2],i=_ref249[3];if(!e)return n(void 0);var r=0;1!==V.length||g||"bottom"===Bn||(r=o.y+o.height),n(at(e.x+t.x,e.y+t.y+r,e.width,e.height));});var Js={left:0,right:0,top:0,bottom:0};var Qs=Na(!1),el=Ha([Qs,Ga,Ks,As],function(_ref250,n){var _ref251=_slicedToArray(_ref250,4),e=_ref251[0],t=_ref251[1],o=_ref251[2],i=_ref251[3];if(!o)return n({left:0,right:0,top:0,bottom:0});if(!e)return;var r=Math.min(o.width,o.height),a=Ys({width:r,height:r},t);le(Js.top,4)===le(a.top,4)&&le(Js.bottom,4)===le(a.bottom,4)&&le(Js.right,4)===le(a.right,4)&&le(Js.left,4)===le(a.left,4)||(Js=a,n(a));});sr(e,el,function(e){return o(404,Fo=e);});var tl=Ha([Qs,el],function(_ref252,o){var _ref253=_slicedToArray(_ref252,2),e=_ref253[0],t=_ref253[1];if(!e)return o(!1);o(Object.values(t).some(function(e){return e>0;}));});sr(e,tl,function(e){return o(405,Do=e);});var ol=Ha([Qs,Ms,tl,el],function(_ref254,n){var _ref255=_slicedToArray(_ref254,4),e=_ref255[0],t=_ref255[1],o=_ref255[2],i=_ref255[3];if(t)return e&&o?void n(at(t.x+i.left,t.y+i.top,t.width-i.left-i.right,t.height-i.top-i.bottom)):n(_objectSpread2({},t));}),il=Ha([Ks,tl,el],function(_ref256,i){var _ref257=_slicedToArray(_ref256,3),e=_ref257[0],t=_ref257[1],o=_ref257[2];return e?t?void i(at(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);});sr(e,il,function(e){return o(50,Lt=e);});var nl=Ha([_s,da,Ma],function(_ref258,i){var _ref259=_slicedToArray(_ref258,3),e=_ref259[0],t=_ref259[1],o=_ref259[2];if(!e||!t)return i(void 0);var n=et(t);i(ft(n,o));}),rl=Ha([nl],function(_ref260,t){var _ref261=_slicedToArray(_ref260,1),e=_ref261[0];if(!e)return t(void 0);var o=it(e);t(Tt(o));});sr(e,rl,function(e){return o(408,Zo=e);});var al=Ha([il,va,rl,Vs],function(_ref262,n){var _ref263=_slicedToArray(_ref262,4),e=_ref263[0],t=_ref263[1],o=_ref263[2],i=_ref263[3];if(!e||!t||!(!jo&&!Vo))return;var _ref264=o||t,r=_ref264.width,a=_ref264.height,s=Math.min(e.width/r,e.height/a);n(i?s:Math.min(1,s));});sr(e,al,function(e){return o(407,Go=e);});ta("imageStaticVisualCorners",Ha([_s,da,Ma,il,Ms,al],function(_ref265,a){var _ref266=_slicedToArray(_ref265,6),e=_ref266[0],t=_ref266[1],o=_ref266[2],i=_ref266[3],n=_ref266[4],r=_ref266[5];if(!(e&&i&&n&&t))return a(void 0);var s=et(t),l=Tt(ct(s,r)),c=yt(i,l);l.x=c.x,l.y=c.y;a(ft(l,o));}));var sl=Na(void 0);sr(e,sl,function(e){return o(410,Qo=e);});var ll=Ha([va,il],function(_ref267){var _ref268=_slicedToArray(_ref267,2),e=_ref268[0],t=_ref268[1];if(t&&e)return Math.min(t.width/e.width,t.height/e.height);}),cl=Ha([va,Us],function(_ref269){var _ref270=_slicedToArray(_ref269,2),e=_ref270[0],t=_ref270[1];return e&&t?Math.min(e.width/t.width,e.height/t.height):1;});sr(e,cl,function(e){return o(101,ji=e);});var dl=Ha([sl,cl],function(_ref271){var _ref272=_slicedToArray(_ref271,2),e=_ref272[0],t=_ref272[1];return e&&t?t*e:1;});sr(e,dl,function(e){return o(486,Xo=e);});var ul=Na(ue());sr(e,ul,function(e){return o(409,qo=e);});var hl=Na({scalar:Xo,translation:qo}),pl=function pl(){hl.set({scalar:void 0,translation:ue()});},ml=_a(void 0,function(e){var t=uc(void 0,{precision:1e-4}),o=1===Kd()?function(e){return kt(e,Math.round);}:Z,i=function i(){if(!Bo)return;var e=Dt||!po;if(Ho){var _o101=Je(Bo);return lt(_o101,Jo),lt(_o101,Lt),t.set(_o101,{hard:e});}var i=Td(Bo,Ko,Rm*mn);i.width<0&&(i.width=0,i.x=Bo.x),i.height<0&&(i.height=0,i.y=Bo.y),lt(i,Lt),lt(i,qo),ct(i,Xo),!e&&o(i),t.set(i,{hard:e});},n=[il.subscribe(i),Us.subscribe(i),dl.subscribe(i),ul.subscribe(i),Ga.subscribe(i),t.subscribe(e)];return function(){return n.forEach(function(e){return e();});};});sr(e,ml,function(e){return o(58,zo=e);});var $l=Na(1);sr(e,$l,function(e){return o(479,Oo=e);});var fl=function fl(){if(!Wo||!Lt)return;var e=ht(Je(Wo),Go||1);var t=yt(Lt,ht(Je(Zo),Go));lt(e,t);var o=xt.width/e.width,i=xt.height/e.height,n=Math.min(1,o,i);$l.set(n),ct(e,n),function(e,t){var _wt=wt(e),_wt2=_slicedToArray(_wt,4),o=_wt2[0],i=_wt2[1],n=_wt2[2],r=_wt2[3];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,_objectSpread2(_objectSpread2({},xt),{},{x:0,y:0})),Us.set(e);},yl=Ha([il,al,va,da],function(_ref273,n){var _ref274=_slicedToArray(_ref273,4),e=_ref274[0],t=_ref274[1],o=_ref274[2],i=_ref274[3];e&&(o||i)&&n(bl(e,t||1,o||i));});sr(e,yl,function(e){return o(100,Hi=e);});var bl=function bl(e,t,o){return o.width<=e.width&&o.height<=e.height?yt(e,ht(Je(o),t)):vt(e,mt(o));};var vl,wl;var Sl=function Sl(e){if(g&&vl&&pt(vl,e)&&wl===Go)return;if(Ho)return fl();vl=e,wl=Go;var t=bl(e,Go,Wo||Rt);Us.set(t);};var kl=!1;var Cl=al.subscribe(function(e){!kl&&void 0!==e&&Wo&&(Sl(Lt),kl=!0);}),Tl=il.subscribe(function(e){e&&void 0!==Go&&Wo&&Sl(e);}),Ml=_s.subscribe(function(e){!e&&Lt&&Sl(Lt);});var Rl;var Pl=Gs.subscribe(function(e){if(!e)return Rl=void 0,void $r(Ns,jo=void 0,jo);Rl=Uo;var t=Je(Wo);Ns.set(t);}),El=Us.subscribe(function(e){if(!e||!_o)return;var t=(o=Je(e),i=_o,o.x-=i.x,o.y-=i.y,o.width-=i.width,o.height-=i.height,o);var o,i;(function(e,t){e.x/=t,e.y/=t,e.width/=t,e.height/=t;})(t,Rl);var n=function(e,t){return e.x+=t.x,e.y+=t.y,e.width+=t.width,e.height+=t.height,e;}(Je(jo),t);va.set(n);}),Il=va.subscribe(function(e){if(!e||!Bo)return;if(Ho)return void(_o||fl());if(Dt||_o||Vo)return;var t=mt(Bo),o=mt(e);if(le(t,6)===le(o,6))return;var _Wo=Wo,i=_Wo.width,n=_Wo.height,r=Math.min(Lt.width/i,Lt.height/n),a=Ve(e.width*r,e.height*r),s=.5*(Bo.width-a.width),l=.5*(Bo.height-a.height),c=at(Math.max(0,Math.min(Lt.width-a.width,Bo.x+s)),Math.max(0,Math.min(Lt.height-a.height,Bo.y+l)),a.width,a.height);Us.set(c);}),Al=Ha([al,va,Us,_s],function(_ref275,n){var _ref276=_slicedToArray(_ref275,4),e=_ref276[0],t=_ref276[1],o=_ref276[2],i=_ref276[3];if(!e||!t||!o)return;if(i)return n(Oo);var r=o.width/t.width,a=o.height/t.height;n(Math.max(r,a)/e);}),Ll=Ha([al,Al],function(_ref277,o){var _ref278=_slicedToArray(_ref277,2),e=_ref278[0],t=_ref278[1];if(!t)return;o(e*t);});sr(e,Ll,function(e){return o(485,Uo=e);});var zl={left:0,right:0,top:0,bottom:0};var Fl=Ha([Ga,Us],function(_ref279,o){var _ref280=_slicedToArray(_ref279,2),e=_ref280[0],t=_ref280[1];if(!t)return o(zl);var i=Ys(t,e);le(zl.top,4)===le(i.top,4)&&le(zl.bottom,4)===le(i.bottom,4)&&le(zl.right,4)===le(i.right,4)&&le(zl.left,4)===le(i.left,4)||(zl=i,o(i));}),Dl=Ha([Fl],function(_ref281,t){var _ref282=_slicedToArray(_ref281,1),e=_ref282[0];t(Object.values(e).some(function(e){return e>0;}));}),Ol=uc(.075,{stiffness:.03,damping:.4,precision:.001}),Bl=Ha([bs,fs,Ol,ml,dl,Ga,Dl,Fl,tl],function(_ref283,c){var _ref284=_slicedToArray(_ref283,9),e=_ref284[0],t=_ref284[1],o=_ref284[2],i=_ref284[3],n=_ref284[4],r=_ref284[5],a=_ref284[6],s=_ref284[7],l=_ref284[8];if(!i||g)return c([]);var d=i.x,u=i.y,h=i.width,p=i.height;d+=.5,u+=.5,h-=.5,p-=.5;var m=[];if(r){if(a){var _e86=s.left,_o102=s.right,_i72=s.top,_r21=s.bottom;_e86*=n,_o102*=n,_i72*=n,_r21*=n;var _a14=Zp(t)?[1,1,1,.125]:[0,0,0,.075];m.push({x:d-_e86-.5,y:u-_i72-.5,width:h+_e86+_o102+1,height:p+_i72+_r21+1,strokeWidth:1,strokeColor:_a14,opacity:l?1:.5});}var _i73=Zp(e);r&&r.frameColor&&Zp(r.frameColor)||_i73||(m.push({x:d-1,y:u-1,width:h+2,height:p+2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}),m.push({x:d+1,y:u+1,width:h-2,height:p-2,strokeWidth:2,strokeColor:[0,0,0,.1],opacity:o}));}c([].concat(m,[{x:d,y:u,width:h,height:p,strokeWidth:1,strokeColor:e,opacity:o}]));}),Wl=Na([]);sr(e,Wl,function(e){return o(398,Co=e);});var Vl=Ha([Bl,Wl],function(_ref285,o){var _ref286=_slicedToArray(_ref285,2),e=_ref286[0],t=_ref286[1];o([].concat(_toConsumableArray(e),_toConsumableArray(t)));});sr(e,Vl,function(e){return o(94,Oi=e);});var _l=uc(0,{precision:.001});sr(e,_l,function(e){return o(400,Mo=e);});var Nl=uc();sr(e,Nl,function(e){return o(403,Io=e);});var Hl=uc();sr(e,Hl,function(e){return o(402,Eo=e);});var jl=uc();sr(e,jl,function(e){return o(401,Po=e);});var Zl=uc();sr(e,Zl,function(e){return o(399,To=e);});var Xl=Na(!1);sr(e,Xl,function(e){return o(385,ro=e);});var Yl=Na();var ql;sr(e,Yl,function(e){return o(388,lo=e);});var Kl=Ha([Xl,Yl],function(_ref287,i){var _ref288=_slicedToArray(_ref287,2),e=_ref288[0],t=_ref288[1];if(!e||!t)return void i(void 0);if(ql&&(ql.cancel(),o(291,ql=void 0)),Rn(t))return i(x(t));var r=wc.length?0:Qt?250:0;o(291,ql={cancel:n}),Ya(t,ql,r).then(i).catch(function(e){$r(fa,so.error=e,so);}).finally(function(){o(291,ql=void 0);});});Gi(),Gi=rr(Kl,function(e){return o(367,St=e);});var Jl=t.imagePreviewCurrent;var Ql=Na({});sr(e,Ql,function(e){return o(390,mo=e);});var ec=Na([]);sr(e,ec,function(e){return o(86,Ti=e);});var tc=Ha([il,Ss,da,js,Us,Ll,Ma,Ea,Ia,dl,ul,Is],function(_ref289,h){var _ref290=_slicedToArray(_ref289,12),e=_ref290[0],t=_ref290[1],o=_ref290[2],i=_ref290[3],n=_ref290[4],r=_ref290[5],a=_ref290[6],s=_ref290[7],l=_ref290[8],c=_ref290[9],d=_ref290[10],u=_ref290[11];if(!e||!n)return;var p=gl(e,t,o,i,n,c,d,r,a,s,l);!u&&D(p),h(p);});sr(e,tc,function(e){return o(391,$o=e);});var oc=Ha([za,Fa,Da,Oa,Ba],function(_ref291,r){var _ref292=_slicedToArray(_ref291,5),e=_ref292[0],t=_ref292[1],o=_ref292[2],i=_ref292[3],n=_ref292[4];var a=e&&Object.keys(e).map(function(t){return 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&&Yn(a)});});var ic,nc;var rc=function(){if(!fo())return !1;var e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/i)||[],_e$map=e.map(function(e){return parseInt(e,10)||0;}),_e$map2=_slicedToArray(_e$map,3),t=_e$map2[1],o=_e$map2[2];return t>13||13===t&&o>=4;}(),ac=Na({});sr(e,ac,function(e){return o(379,qt=e);}),ta("env",ac);var sc=Kd(),lc=_a(sc,function(e){var t=function t(){return e(Kd());},o=matchMedia("(resolution: ".concat(sc,"dppx)"));return o.addListener(t),function(){return o.removeListener(t);};});sr(e,lc,function(e){return o(57,Ao=e);});var dc=function(e,t,o){var _Yo4=Yo(),i=_Yo4.sub,n=_Yo4.pub,_ref293=o||{},_ref293$willUndo=_ref293.willUndo,r=_ref293$willUndo===void 0?function(){return !0;}:_ref293$willUndo,a=[],s=Na(0),l=[],c=function c(){return l.forEach(function(e){return e({index:ar(s),length:a.length});});},d={get index(){return ar(s);},set index(e){e=Number.isInteger(e)?e:0,e=ls(e,0,a.length-1),s.set(e),t(a[d.index]),c();},get state(){return a[a.length-1];},length:function length(){return a.length;},undo:function undo(){if(!1===r())return;var e=d.index--;return n("undo",e),e;},redo:function redo(){var e=d.index++;return n("redo",d.index),e;},revert:function revert(){a.length=1,d.index=0,n("revert");},write:function write(o){o&&t(_objectSpread2(_objectSpread2({},e()),o));var i=e(),r=a[a.length-1];JSON.stringify(i)!==JSON.stringify(r)&&(a.length=d.index+1,a.push(i),s.set(a.length-1),c(),n("writehistory"));},set:function set(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};a.length=0,d.index=0;var t=Array.isArray(e)?e:[e];a.push.apply(a,_toConsumableArray(t)),d.index=a.length-1;},get:function get(){return [].concat(a);},subscribe:function subscribe(e){return l.push(e),e({index:d.index,length:a.length}),function(){return l.splice(l.indexOf(e),1);};},on:i};return d;}(function(){return So;},function(e){$r(Xa,So=e,So),ks.set(ko);},{willUndo:function willUndo(){return !yc()||(fc(),!1);}});Zi(),Zi=rr(dc,function(e){return o(397,wo=e);});var pc=function pc(){var e=_objectSpread2({x:0,y:0},Rt),t=kt(vt(e,So.cropAspectRatio),Math.round),o=Sn(_objectSpread2(_objectSpread2({},So),{},{rotation:0,crop:t}),So),i=[o];JSON.stringify(o)!==JSON.stringify(So)&&i.push(_objectSpread2({},So)),dc.set(i);},mc=fa.subscribe(function(e){e&&e.complete&&pc();}),$c=function $c(){return $n().then(function(e){return e&&dc.revert();});},gc=[Va,Wa,Ua,ja],fc=function fc(){gc.forEach(function(e){e.update(function(e){return e.length&&zi(e[e.length-1])?e.slice(0,-1):e;});});},yc=function yc(){return W.filter(function(e){return e.length;}).some(function(e){return zi(e[e.length-1]);});},bc=Na(!1);sr(e,bc,function(e){return o(380,Jt=e);});var xc=function xc(){$r(bc,Jt=!0,Jt),fn().then(function(e){if(!e)return void $r(bc,Jt=!1,Jt);var t;t=Jc.subscribe(function(e){1===e&&(t&&t(),Yi("processImage"));});});},vc=ya.subscribe(function(e){if(!e)return void $r(bc,Jt=!1,Jt);$r(bc,Jt=!0,Jt);var t=e.complete,o=e.abort;(t||o)&&$r(bc,Jt=!1,Jt);}),wc=Gp();sr(e,wc,function(e){return o(55,co=e);});var Sc=Ha([wc],function(_ref294,t){var _ref295=_slicedToArray(_ref294,1),e=_ref295[0];if(!e.length)return t();var _e$=e[0],o=_e$.origin,i=_e$.translation,n=_e$.rotation,r=_e$.scale;t({origin:o,translation:i,rotation:n,scale:r});}),kc=Na();sr(e,kc,function(e){return o(394,bo=e);});var Cc,Tc=[];var Mc=Na(),Rc=Na(),Pc=Ha([sl,Rc,al,ll],function(_ref296){var _ref297=_slicedToArray(_ref296,4),e=_ref297[0],t=_ref297[1],o=_ref297[2],i=_ref297[3];return e||(t||o<1?i:1);}),Ec=_objectSpread2(_objectSpread2({},Ji),{},{imageFile:ca,imageSize:da,mediaDuration:ua,mediaMinDuration:$a,mediaMaxDuration:ga,mediaTrim:pa,imageBackgroundColor:Aa,imageBackgroundImage:La,imageCropAspectRatio:ba,imageCropMinSize:wa,imageCropMaxSize:Sa,imageCropLimitToImage:xa,imageCropRect:va,imageCropRectOrigin:Ca,imageCropRectSnapshot:Ns,imageCropRectAspectRatio:Ta,imageCropRange:ka,imageRotation:Ma,imageRotationRange:Ra,imageFlipX:Ea,imageFlipY:Ia,imageOutputSize:Pa,imageColorMatrix:za,imageConvolutionMatrix:Fa,imageGamma:Da,imageVignette:Oa,imageNoise:Ba,imageManipulation:ja,imageDecoration:Wa,imageAnnotation:Va,imageRedaction:Ua,imageFrame:Ga,imagePreview:Kl,imagePreviewSource:Yl,imageTransforms:tc,imagePreviewModifiers:Ql,history:dc,animation:Ds,pixelRatio:lc,elasticityMultiplier:mn,scrollElasticity:Pm,rangeInputElasticity:5,redrawTrigger:Yr,pointerAccuracy:Ps,pointerHoverable:Es,env:ac,rootRect:Ss,stageRect:il,stageRectBase:Ks,stageRecenter:qs,stageScalar:al,stagePadding:el,stagePadded:tl,presentationScalar:Ll,imagePreviewUpscale:Rc,utilRect:Ms,utilRectPadded:ol,allowPlayPause:Rr,allowPan:ss,allowZoom:cs,allowZoomControls:ds,enableZoomInput:hs,enablePanInput:us,enablePanInputStatus:gs,imageSelectionMultiTouching:Mc,rootBackgroundColor:fs,rootForegroundColor:ys,rootLineColor:bs,rootColorSecondary:vs,imageOutlineOpacity:Ol,utilTools:kc,imageSelectionPan:ul,imageSelectionZoom:sl,imageSelectionZoomCurrent:Pc,imageSelectionStageFitScalar:ll,imageSelectionStoredState:hl,imageOverlayMarkup:Wl,interfaceImages:ec,isInteracting:As,isTransformingImage:Is,isInteractingFraction:Ls,imageCropRectIntent:Hs,imageCropRectPresentation:js,imageSelectionRect:Us,imageSelectionRectIntent:Zs,imageSelectionRectPresentation:ml,imageSelectionRectSnapshot:Gs,imageScalar:Al,imageTransformsInterpolated:Sc,imageEffects:oc});delete Ec.image;var Ic="util-"+I();var Lc=[];var zc=function zc(e){return _.find(function(_ref298){var _ref299=_slicedToArray(_ref298,1),t=_ref299[0];return e===t;});};var Fc=[];var Dc=function Dc(e){o(62,Fc=Fc.concat(e));},Oc=function Oc(e){o(62,Fc=Fc.filter(function(t){return t!==e;}));},Wc=function Wc(e,t){o(297,U[e]=t,U);};var Vc=fo();var _c=function _c(e,t,o){var i=we.getPropertyValue(e);i=o?o(i):/^[0-9]+$/.test(i)?parseFloat(i):void 0,t.set(i,{hard:!Qt});},Nc=function Nc(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var i=function(e){var t=we.getPropertyValue(e);return Zh(t);}(e);i&&0!==i[3]&&(o||(i.length=3),t.set(i,{hard:!Qt}));},Hc=Na();sr(e,Hc,function(e){return o(87,Mi=e);});var jc=Na();sr(e,jc,function(e){return o(88,Pi=e);});var Uc=Na();sr(e,Uc,function(e){return o(89,Ei=e);});var Gc=uc(0,{damping:.9});sr(e,Gc,function(e){return o(90,Ai=e);});var Zc=function Zc(){Nc("color",ys),Nc(nr?"--color-background":"background-color",fs),Nc("outline-color",bs),Nc("--color-primary",xs),Nc("--color-secondary",vs),Nc("--grid-color-even",jc,!0),Nc("--grid-color-odd",Uc,!0),_c("--grid-size",Hc),_c("--editor-inset-top",Cs,function(e){return parseInt(e,10);});},Xc=Ha([tc,oc,Aa,ns],function(_ref300){var _ref301=_slicedToArray(_ref300,4),e=_ref301[0],t=_ref301[1],o=_ref301[2],i=_ref301[3];return e&&_objectSpread2(_objectSpread2(_objectSpread2({},e),t),{},{backgroundColor:o,backgroundImage:i});});sr(e,Xc,function(e){return o(389,ho=e);});var Yc=function Yc(){var e=wc.length?void 0:{resize:1.05},t=function(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _o$resize=o.resize,i=_o$resize===void 0?1:_o$resize,_o$opacity=o.opacity,n=_o$opacity===void 0?0:_o$opacity,r={opacity:[uc(n,_objectSpread2(_objectSpread2({},jp),{},{stiffness:.1})),Z],resize:[uc(i,_objectSpread2(_objectSpread2({},jp),{},{stiffness:.1})),Z],translation:[uc(void 0,jp),Z],rotation:[uc(void 0,Up),Z],origin:[uc(void 0,jp),Z],scale:[uc(void 0,Up),Z],gamma:[uc(void 0,Up),function(e){return e||1;}],vignette:[uc(void 0,Up),function(e){return e||0;}],colorMatrix:[uc([].concat(Hp),jp),function(e){return e||[].concat(Hp);}],convolutionMatrix:[Na(void 0),function(e){return e&&e.clarity||void 0;}],backgroundColor:[uc(void 0,jp),function(e,t,o){if(Array.isArray(e)){if(Array.isArray(t)){var _i74=_toConsumableArray(e);0===t[3]?(_i74[3]=0,o(_i74)):0===_i74[3]&&((e=_toConsumableArray(t))[3]=0);}return e;}}],backgroundImage:[Na(void 0),Z]},a=Object.entries(r).map(function(_ref302){var _ref303=_slicedToArray(_ref302,2),e=_ref303[0],t=_ref303[1];return [e,t[0]];}),s=a.map(function(_ref304){var _ref305=_slicedToArray(_ref304,2),e=_ref305[1];return e;}),l=Object.entries(r).reduce(function(e,_ref306){var _ref307=_slicedToArray(_ref306,2),t=_ref307[0],o=_ref307[1];var _o103=_slicedToArray(o,2),i=_o103[0],n=_o103[1];return e[t]=function(e,o){return i.set(n(e,c[t],function(e){i.set(e,{hard:!0});}),o);},e;},{});var c;var d=Ha(s,function(o){return c=o.reduce(function(e,t,o){return e[a[o][0]]=t,e;},{}),c.data=e,c.size=t,c.scale*=o[1],c;});return d.get=function(){return c;},d.set=function(e,t){var o={hard:!t};Object.entries(e).forEach(function(_ref308){var _ref309=_slicedToArray(_ref308,2),e=_ref309[0],t=_ref309[1];l[e]&&l[e](t,o);});},d;}(St,Rt,e);wc.unshift(t),qc(ho);},qc=function qc(e){wc.forEach(function(t,o){var i=0===o?1:0;t.set(_objectSpread2(_objectSpread2({},e),{},{opacity:i,resize:1}),po);});};var Kc;var Jc=cc(void 0,{duration:500});var Qc;sr(e,Jc,function(e){return o(54,io=e);});var ed=Na(!1);var td;sr(e,ed,function(e){return o(384,no=e);});var od=uc(void 0,{stiffness:.1,damping:.7,precision:.25});sr(e,od,function(e){return o(82,xi=e);});var id=uc(0,{stiffness:.1,precision:.05});sr(e,id,function(e){return o(83,vi=e);});var nd=uc(0,{stiffness:.02,damping:.5,precision:.25});sr(e,nd,function(e){return o(382,to=e);});var rd=uc(void 0,{stiffness:.02,damping:.5,precision:.25});sr(e,rd,function(e){return o(383,oo=e);});var ad=uc(void 0,{stiffness:.02,damping:.5,precision:.25});var sd;sr(e,ad,function(e){return o(381,eo=e);});var ld=function ld(){Yi("abortLoadImage");},cd=function cd(){Yi("abortProcessImage"),$r(bc,Jt=!1,Jt);},dd=function dd(e){e.target&&"true"===e.target.dataset.touchScroll||e.preventDefault();},ud=rc?function(e){var t=e.touches?e.touches[0]:e;t.pageX>20&&t.pageX<window.innerWidth-20||dd(e);}:n,hd=Na([]);sr(e,hd,function(e){return o(475,Gt=e);}),ta("keysPressed",hd);var pd=function pd(e){!e||No(e)&&!function(e){return /^image/.test(e.type)&&!/svg/.test(e.type);}(e)||!No(e)&&!/^http/.test(e)||Yi("loadImage",e);},md=function md(e){e&&pd(e);};var $d=void 0;var gd,fd=[];var yd=Na();ta("rootPortal",yd),ta("rootRect",Ss);var bd=function bd(){return {foregroundColor:_toConsumableArray(Bt),lineColor:_toConsumableArray(Ot),utilVisibility:_objectSpread2({},U),isInteracting:Dt,isInteractingFraction:Ft,rootRect:Je(zt),stageRect:Je(Lt),manipulationShapesDirty:Od,annotationShapesDirty:Ld,decorationShapesDirty:Fd,frameShapesDirty:Dd};},xd=function xd(e,t,o){return gn(e,Ve(Math.round(t.width/o),Math.round(t.height/o)));},vd=function vd(e,t,o){var i;return e._translate=he((i=t).x,i.y),e._scale=o,e;},wd=function wd(e){var t=[];return e.forEach(function(e){return t.push(Sd(e));}),t.filter(Boolean);},Sd=function Sd(e){return Ri(e)?(e.points=[he(e.x1,e.y1),he(e.x2,e.y2)],e):(!function(e){return Si(e)&&!e.text.length;}(e)||e.backgroundColor&&0!==e.backgroundColor[3]||(ki(e)&&(e.width=5,e.height=e.lineHeight),e.strokeWidth=1,e.strokeColor=[1,1,1,.5],e.backgroundColor=[0,0,0,.1]),e);};var kd,Cd=[],Md=[],Rd=[],Pd=[],Ed=[],Id={};var Ad=function Ad(e,t,o,i,n,r,a){var s=e.manipulationShapesDirty,l=e.annotationShapesDirty,c=e.decorationShapesDirty,d=e.frameShapesDirty,u=e.selectionRect,h=e.scale,p=kd!==h,m=p||!pt(Id,u);m&&(kd=h,Id=u),s&&(Rd=t.filter(Ii).map(gi).map(function(e){return gn(e,Rt);})),(l||o!==At)&&(Cd=o.filter(Ii).map(gi).sort(function(e,t){return e.alwaysOnTop?1:t.alwaysOnTop?-1:0;}).map(function(e){return gn(e,Rt);})),(p||zd||l||o!==At)&&(Md=wd(Cd.map(function(e){return v(e,{flipX:Et,flipY:Pt,rotation:It,scale:h,context:et(Rt)});}).flat())),(c||i!==Mt||m)&&(Pd=wd(i.filter(Ii).map(gi).sort(function(e,t){return e.alwaysOnTop?1:t.alwaysOnTop?-1:0;}).map(function(e){return xd(e,u,h);}).map(function(e){return v(e,{context:u});}).flat().map(function(e){return vd(e,u,h);}))),(d||r!==Ct||m)&&(Ed=r?wd([r].map(gi).map(function(e){return xd(e,u,h);}).map(v).flat().map(function(e){return vd(e,u,h);})):[]);var $=wd(n.filter(Ii));return "undefined"!=typeof window&&function(e){if(e&&e._4pf3wm7)return;var _map3=[[85,110,108,105,99,101,110,115,101,100,32,80,105,110,116,117,114,97,32,105,110,115,116,97,110,99,101]].map(function(e){return e.map(function(e){return String.fromCharCode(e);}).join("");}),_map4=_slicedToArray(_map3,1),t=_map4[0];$=[].concat(_toConsumableArray($),[{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),{manipulationShapesDirty:s,manipulationShapes:Rd,annotationShapesDirty:l,annotationShapes:Md,decorationShapesDirty:c,decorationShapes:Pd,frameShapesDirty:d,frameShapes:Ed,interfaceShapes:$,selectionShapes:a.map(gi).map(function(e){return gn(e,Rt);})};};var Ld=!0;var zd=!0;var Fd=!0;var Dd=!0;var Od=!0;Qr(function(){Wr(),St&&T(St.src)&&/^blob:/.test(St.src)&&URL.revokeObjectURL(St.src),rs(),Tl(),Cl(),Ml(),Pl(),El(),Il(),mc(),vc(),Ps.destroy(),Es.destroy(),la.destroy(),wc.clear(),Cd.length=0,Md.length=0,Rd.length=0,Pd.length=0,Ed.length=0;try{o(235,Jl=void 0),o(292,Kc=void 0);}catch(e){}});return e.$$set=function(e){"class"in e&&o(236,qi=e.class),"layout"in e&&o(237,Ki=e.layout),"stores"in e&&o(238,Ji=e.stores),"locale"in e&&o(3,Qi=e.locale),"id"in e&&o(4,en=e.id),"util"in e&&o(239,tn=e.util),"utils"in e&&o(240,on=e.utils),"animations"in e&&o(241,nn=e.animations),"disabled"in e&&o(242,rn=e.disabled),"status"in e&&o(234,an=e.status),"previewUpscale"in e&&o(243,sn=e.previewUpscale),"previewPad"in e&&o(244,ln=e.previewPad),"previewMaskOpacity"in e&&o(5,cn=e.previewMaskOpacity),"previewImageDataMaxSize"in e&&o(245,dn=e.previewImageDataMaxSize),"previewImageTextPixelRatio"in e&&o(6,un=e.previewImageTextPixelRatio),"markupMaskOpacity"in e&&o(7,hn=e.markupMaskOpacity),"zoomMaskOpacity"in e&&o(246,pn=e.zoomMaskOpacity),"elasticityMultiplier"in e&&o(8,mn=e.elasticityMultiplier),"willRevert"in e&&o(247,$n=e.willRevert),"willProcessImage"in e&&o(248,fn=e.willProcessImage),"willRenderCanvas"in e&&o(9,yn=e.willRenderCanvas),"willRenderToolbar"in e&&o(249,bn=e.willRenderToolbar),"willRenderUtilTabs"in e&&o(250,xn=e.willRenderUtilTabs),"willSetHistoryInitialState"in e&&o(251,Sn=e.willSetHistoryInitialState),"enableButtonExport"in e&&o(252,kn=e.enableButtonExport),"enableButtonRevert"in e&&o(253,Cn=e.enableButtonRevert),"enableNavigateHistory"in e&&o(254,Tn=e.enableNavigateHistory),"enableToolbar"in e&&o(10,Mn=e.enableToolbar),"enableUtils"in e&&o(255,Pn=e.enableUtils),"enableButtonClose"in e&&o(256,En=e.enableButtonClose),"enableDropImage"in e&&o(257,In=e.enableDropImage),"enablePasteImage"in e&&o(258,An=e.enablePasteImage),"enableBrowseImage"in e&&o(259,Ln=e.enableBrowseImage),"enableTransparencyGrid"in e&&o(11,zn=e.enableTransparencyGrid),"layoutDirectionPreference"in e&&o(260,Fn=e.layoutDirectionPreference),"layoutHorizontalUtilsPreference"in e&&o(261,Dn=e.layoutHorizontalUtilsPreference),"layoutVerticalUtilsPreference"in e&&o(262,On=e.layoutVerticalUtilsPreference),"layoutVerticalToolbarPreference"in e&&o(263,Bn=e.layoutVerticalToolbarPreference),"layoutVerticalControlGroupsPreference"in e&&o(264,Wn=e.layoutVerticalControlGroupsPreference),"layoutVerticalControlTabsPreference"in e&&o(265,Vn=e.layoutVerticalControlTabsPreference),"textDirection"in e&&o(12,_n=e.textDirection),"markupEditorZoomLevel"in e&&o(266,Nn=e.markupEditorZoomLevel),"markupEditorZoomLevels"in e&&o(13,Hn=e.markupEditorZoomLevels),"markupEditorZoomAdjustStep"in e&&o(14,jn=e.markupEditorZoomAdjustStep),"markupEditorZoomAdjustFactor"in e&&o(15,Un=e.markupEditorZoomAdjustFactor),"markupEditorZoomAdjustWheelFactor"in e&&o(16,Gn=e.markupEditorZoomAdjustWheelFactor),"markupEditorInteractionMode"in e&&o(267,Zn=e.markupEditorInteractionMode),"muteAudio"in e&&o(268,Xn=e.muteAudio),"willSetMediaInitialTimeOffset"in e&&o(269,Jn=e.willSetMediaInitialTimeOffset),"enablePan"in e&&o(17,Qn=e.enablePan),"enableZoom"in e&&o(18,er=e.enableZoom),"enableZoomControls"in e&&o(270,tr=e.enableZoomControls),"enableZoomInput"in e&&o(19,or=e.enableZoomInput),"enablePanInput"in e&&o(271,ir=e.enablePanInput),"enableCanvasAlpha"in e&&o(20,nr=e.enableCanvasAlpha),"enablePanLimit"in e&&o(21,lr=e.enablePanLimit),"panLimitGutterScalar"in e&&o(22,cr=e.panLimitGutterScalar),"zoomPresetOptions"in e&&o(23,dr=e.zoomPresetOptions),"zoomAdjustStep"in e&&o(24,ur=e.zoomAdjustStep),"zoomAdjustFactor"in e&&o(25,hr=e.zoomAdjustFactor),"zoomAdjustWheelFactor"in e&&o(26,pr=e.zoomAdjustWheelFactor),"zoomLevel"in e&&o(0,mr=e.zoomLevel),"fixScrollDirection"in e&&o(272,gr=e.fixScrollDirection),"imagePreviewSrc"in e&&o(275,xr=e.imagePreviewSrc),"imageOrienter"in e&&o(276,vr=e.imageOrienter),"pluginComponents"in e&&o(277,wr=e.pluginComponents),"pluginOptions"in e&&o(27,Sr=e.pluginOptions),"root"in e&&o(2,Tr=e.root),"imageSourceToImageData"in e&&o(28,sa=e.imageSourceToImageData),"imagePreviewCurrent"in e&&o(235,Jl=e.imagePreviewCurrent);},e.$$.update=function(){if(16777216&e.$$.dirty[8]&&fr.set(gr),8&e.$$.dirty[0]&&o(349,i=!!Qi),1&e.$$.dirty[0]|262144&e.$$.dirty[8]&&o(0,mr=null===mr?Nn:mr),2&e.$$.dirty[0]|536870912&e.$$.dirty[8]){var _e93=!1;wr.forEach(function(_ref310){var _ref311=_slicedToArray(_ref310,1),t=_ref311[0];Cr[t]||(o(1,Cr[t]={},Cr),_e93=!0);}),_e93&&o(289,Kr=_toConsumableArray(wr));}var t,h,b,x;if(8388608&e.$$.dirty[7]|1024&e.$$.dirty[9]|256&e.$$.dirty[11]&&o(347,V=i&&Kr.length?on||Kr.map(function(_ref312){var _ref313=_slicedToArray(_ref312,1),e=_ref313[0];return e;}):[]),134217728&e.$$.dirty[0]|1024&e.$$.dirty[9]|64&e.$$.dirty[11]|8388608&e.$$.dirty[12]&&o(348,_=function(e,t,o,i){var n=t.filter(function(_ref314){var _ref315=_slicedToArray(_ref314,1),t=_ref315[0];return e.includes(t);}).filter(function(_ref316){var _ref317=_slicedToArray(_ref316,2),e=_ref317[0],t=_ref317[1].isSupported;return t(_objectSpread2(_objectSpread2({},i),o[e]));}).map(function(_ref318){var _ref319=_slicedToArray(_ref318,2),e=_ref319[0],t=_ref319[1];return [e,t.Component];});return ps(n,Lc,function(e,t){return e[0]===t[0]&&e[1]===t[1];})?Lc:(Lc=n,n);}(V,Kr,Sr,{src:xo})),128&e.$$.dirty[11]&&o(301,N=_.length),8&e.$$.dirty[0]|4194304&e.$$.dirty[9]|64&e.$$.dirty[11]&&o(346,H=N&&V.map(function(e){var t=zc(e);if(t)return {id:e,view:t[1],tabIcon:Qi[e+"Icon"],tabLabel:Qi[e+"Label"]};}).filter(Boolean)||[]),32&e.$$.dirty[11]&&o(366,r=!!H.find(function(e){return "trim"===e.id;})),100663296&e.$$.dirty[11]|65536&e.$$.dirty[13]&&o(300,a=!!($i&&St&&r)),4194304&e.$$.dirty[7]|4194304&e.$$.dirty[9]&&o(43,j=N&&tn&&"string"==typeof tn&&zc(tn)?tn:N>0?_[0][0]:void 0),4096&e.$$.dirty[1]|2097152&e.$$.dirty[9]&&a&&j&&Wr(),2097152&e.$$.dirty[9]|67108864&e.$$.dirty[11]&&(a?(St.addEventListener("play",Ar),St.addEventListener("pause",Ar)):St&&"video"===St.nodeName&&(St.removeEventListener("play",Ar),St.removeEventListener("pause",Ar))),2097152&e.$$.dirty[9]&&a&&Er.set(Zr()/Gr()),294912&e.$$.dirty[13]&&function(e){if(!Vr())return;var t=Date.now();if(zr&&t-zr<16)return;zr=t;var o=$i*e;if(o.toFixed(1)===Lr)return;Lr=o.toFixed(1);var i=St,n=function n(){i.removeEventListener("seeked",n),Mr();};i.addEventListener("seeked",n),Lp(i,o);}(yi||mi),32768&e.$$.dirty[13]&&o(364,s=mi&&le(mi,6)),598016&e.$$.dirty[13]&&o(362,l=ci||[[0,Math.min($i,bi)/$i]]),2097152&e.$$.dirty[11]&&(c=l[0][0]),2097152&e.$$.dirty[11]&&(d=l[l.length-1][1]),2097152&e.$$.dirty[11]&&o(365,u=l.map(function(_ref320){var _ref321=_slicedToArray(_ref320,2),e=_ref321[0],t=_ref321[1];return [le(e,6),le(t,6)];})),25165824&e.$$.dirty[11]&&o(363,p=u.findIndex(function(_ref322){var _ref323=_slicedToArray(_ref322,2),e=_ref323[0],t=_ref323[1];return s>=e&&s<=t;})),29360128&e.$$.dirty[11]&&(m=-1===p&&u.findIndex(function(e,t,o){var i=o[t-1];return i?s<=e[0]&&s>=i[1]:s<=e[0];})),1048576&e.$$.dirty[8]&&Ur.set(Xn),67108864&e.$$.dirty[11]|131072&e.$$.dirty[13]&&(St&&fi?Nr():Hr()),2097152&e.$$.dirty[9]|32768&e.$$.dirty[13]&&a&&ha.set(Gr()*mi),67108864&e.$$.dirty[11]|16384&e.$$.dirty[13]&&St&&function(e){if(!a)return;St.volume=Math.min(1,e);}(pi),256&e.$$.dirty[0]&&$r(qr,hi=mn,hi),1048576&e.$$.dirty[7]&&o(358,g="overlay"===Ki),128&e.$$.dirty[8]|131072&e.$$.dirty[11]&&o(45,f=Pn&&!g),134217730&e.$$.dirty[0]&&Sr&&Object.entries(Sr).forEach(function(_ref324){var _ref325=_slicedToArray(_ref324,2),e=_ref325[0],t=_ref325[1];Object.entries(t).forEach(function(_ref326){var _ref327=_slicedToArray(_ref326,2),t=_ref327[0],i=_ref327[1];Cr[e]&&o(1,Cr[e][t]=i,Cr);});}),256&e.$$.dirty[13]&&o(359,k=!ei),16777216&e.$$.dirty[7]|786432&e.$$.dirty[11]&&$r(Bs,Qt="always"===nn?w:"never"!==nn&&w&&k,Qt),4194304&e.$$.dirty[1]|33554432&e.$$.dirty[7]&&Jr.set(rn?1:0,{hard:!Qt}),268435456&e.$$.dirty[7]&&(y=dn?(t=dn,h=ia,Ve(Math.min(t.width,h.width),Math.min(t.height,h.height))):ia),4096&e.$$.dirty[13]&&la.update(li[0]),2048&e.$$.dirty[13]&&(v=si?function(e,t){return si(e,_objectSpread2(_objectSpread2({flipX:void 0,flipY:void 0,rotation:void 0},t),{},{isPreview:!0}));}:Z),268435456&e.$$.dirty[1]&&Array.isArray(ai)&&Yi("selectionchange",_toConsumableArray(ai)),4194304&e.$$.dirty[8]|1024&e.$$.dirty[13]&&ms.set(ri&&tr),8912896&e.$$.dirty[8]&&$s.set("pan"===Zn||ir),1048576&e.$$.dirty[1]&&Xt&&Ss.set(at(Xt.x,Xt.y,Xt.width,Xt.height)),131072&e.$$.dirty[11]|32769&e.$$.dirty[12]&&zt&&g&&so&&so.complete&&function(){var e=oi,t=mt(zt);e&&e===t||(ba.set(mt(zt)),pc());}(),64&e.$$.dirty[11]&&o(46,q=V.length>1),32768&e.$$.dirty[1]&&(q||ks.set(Qe())),1024&e.$$.dirty[0]|512&e.$$.dirty[13]&&(Mn||Ts.set(at(0,ti,0,0))),524288&e.$$.dirty[11]|2&e.$$.dirty[12]&&o(361,S=!Dt&&w),1048576&e.$$.dirty[1]&&o(302,rt=Xt&&Xt.width>0&&Xt.height>0),8&e.$$.dirty[0]|12582912&e.$$.dirty[9]&&o(40,st=rt&&Qi&&!!N),512&e.$$.dirty[1]&&setTimeout(function(){return o(290,Ws=st);},1),16777216&e.$$.dirty[7]|2048&e.$$.dirty[9]|1310720&e.$$.dirty[11]&&$r(Ds,po="always"===nn?S:"never"!==nn&&S&&Ws&&k,po),67108864&e.$$.dirty[7]|131072&e.$$.dirty[11]&&Vs.set(sn||g),134217728&e.$$.dirty[7]&&Qs.set(ln),4&e.$$.dirty[0]|144&e.$$.dirty[13]&&Tr&&(Tr.dispatchEvent(Dp("markupzoom",Qo)),Tr.dispatchEvent(Dp("zoom",Lo(Qo)?Qo:Go))),4&e.$$.dirty[0]|64&e.$$.dirty[13]&&Tr&&(Tr.dispatchEvent(Dp("markuppan",qo)),Tr.dispatchEvent(Dp("pan",qo))),8&e.$$.dirty[13]&&Wo&&pl(),32&e.$$.dirty[13]&&Zo&&fl(),4198400&e.$$.dirty[1]&&j&&Ol.set(.075,{hard:!Qt}),536870912&e.$$.dirty[7]&&o(356,C=pn),6&e.$$.dirty[13]&&o(357,M=Do?-Math.max.apply(Math,_toConsumableArray(Object.values(Fo))):0),138936320&e.$$.dirty[1]|98304&e.$$.dirty[11]&&zo){var _e95=zo.x-Lt.x,_t57=Lt.x+Lt.width-(zo.x+zo.width),_o104=zo.y-Lt.y,_i75=Lt.y+Lt.height-(zo.y+zo.height),_n37=Math.min(_e95,_o104,_t57,_i75);_l.set(_n37>M?0:Math.min(C,Math.abs(_n37/64)),{hard:!Qt});}if(67108864&e.$$.dirty[1]&&o(355,R=.55/Ao),4718592&e.$$.dirty[1]|16384&e.$$.dirty[11]&&Lt&&Nl.set({x:0,y:Lt.y,width:Lt.x<64?0:Lt.x,height:Lt.height+R},{hard:!Qt}),4718592&e.$$.dirty[1]|16384&e.$$.dirty[11]|1&e.$$.dirty[12]&&Lt&&Hl.set({x:0,y:0,width:zt.width,height:Lt.y+R},{hard:!Qt}),4718592&e.$$.dirty[1]|16384&e.$$.dirty[11]|1&e.$$.dirty[12]&&Lt){var _e97=Lt.x+Lt.width,_t65=zt.width-(Lt.x+Lt.width);_t65<64&&(_e97+=_t65,_t65=0),jl.set({x:_e97,y:Lt.y,width:_t65,height:Lt.height+R},{hard:!Qt});}if(4718592&e.$$.dirty[1]|1&e.$$.dirty[12]&&Lt&&Zl.set({x:0,y:Lt.y+Lt.height,width:zt.width,height:zt.height-(Lt.y+Lt.height)},{hard:!Qt}),33554432&e.$$.dirty[1]|268435456&e.$$.dirty[12]|1&e.$$.dirty[13]&&o(351,P=Io&&_objectSpread2({id:"stage-overlay",backgroundColor:Ro,opacity:Mo},Io)),33554432&e.$$.dirty[1]|1342177280&e.$$.dirty[12]&&o(354,E=Eo&&_objectSpread2({id:"stage-overlay",backgroundColor:Ro,opacity:Mo},Eo)),33554432&e.$$.dirty[1]|805306368&e.$$.dirty[12]&&o(353,A=Po&&_objectSpread2({id:"stage-overlay",backgroundColor:Ro,opacity:Mo},Po)),33554432&e.$$.dirty[1]|402653184&e.$$.dirty[12]&&o(352,L=To&&_objectSpread2({id:"stage-overlay",backgroundColor:Ro,opacity:Mo},To)),15360&e.$$.dirty[11]&&o(350,z=[E,A,L,P].filter(Boolean)),512&e.$$.dirty[11]|67108864&e.$$.dirty[12]&&z&&Co&&Wl.update(function(e){return [].concat(_toConsumableArray(e.filter(function(e){return "stage-overlay"!==e.id;})),_toConsumableArray(z));}),134217728&e.$$.dirty[8]|8388608&e.$$.dirty[12]&&Yl.set(xr||xo||void 0),4&e.$$.dirty[0]|262144&e.$$.dirty[7]|67108864&e.$$.dirty[11]&&(o(235,Jl=St),St&&Tr.dispatchEvent(Dp("loadpreview",Jl))),65536&e.$$.dirty[12]&&lo&&(ul.set(ue()),sl.set(void 0),pl(),ec.set([])),33554432&e.$$.dirty[12]&&o(306,O=wo.index>0),33554432&e.$$.dirty[12]&&o(305,B=wo.index<wo.length-1),393216&e.$$.dirty[1]|12&e.$$.dirty[12]&&(W=[At,Mt,Nt,Wt]),8&e.$$.dirty[1]&&Mc.set(Cc),16777216&e.$$.dirty[12]&&Rc.set(vo),4096&e.$$.dirty[1]&&as.set(j),262144&e.$$.dirty[9]|32&e.$$.dirty[11]&&o(297,U=H.reduce(function(e,t){return e[t.id]=U&&U[t.id]||0,e;},{})),4096&e.$$.dirty[1]&&o(79,G={name:Ic,selected:j}),32&e.$$.dirty[11]&&o(328,X=H.map(function(e){return {id:e.id,icon:e.tabIcon,label:e.tabLabel};})),32&e.$$.dirty[11]&&o(78,Y=H.map(function(e){return e.id;})),524288&e.$$.dirty[7]&&o(77,K=Bc(["PinturaRoot","PinturaRootComponent",qi])),1&e.$$.dirty[12]&&o(342,J=zt&&(zt.width>1e3?"wide":zt.width<600?"narrow":void 0)),1&e.$$.dirty[12]&&o(329,Q=zt&&(zt.width<=320||zt.height<=460)),1&e.$$.dirty[12]&&o(341,ee=zt&&(zt.height>1e3?"tall":zt.height<600?"short":void 0)),4&e.$$.dirty[0]&&o(308,te=Tr&&Tr.parentNode&&Tr.parentNode.classList.contains("PinturaModal")),1&e.$$.dirty[1]|536870912&e.$$.dirty[9]|1&e.$$.dirty[12]&&o(334,oe=te&&zt&&ic>zt.width),2&e.$$.dirty[1]|536870912&e.$$.dirty[9]|1&e.$$.dirty[12]&&o(333,ie=te&&zt&&nc>zt.height),25165824&e.$$.dirty[10]&&o(335,ne=oe&&ie),1048576&e.$$.dirty[0]&&o(332,re=nr),2&e.$$.dirty[11]&&o(303,ae="narrow"===J),4096&e.$$.dirty[8]|1&e.$$.dirty[12]&&o(343,(b=zt,x=Fn,se=zt?"auto"===x?b.width>b.height?"landscape":"portrait":"horizontal"===x?b.width<500?"portrait":"landscape":"vertical"===x?b.height<400?"landscape":"portrait":void 0:"landscape")),4&e.$$.dirty[11]&&o(76,ce="landscape"===se),16777216&e.$$.dirty[9]|1&e.$$.dirty[11]&&o(331,de=ae||"short"===ee),1&e.$$.dirty[1]|1&e.$$.dirty[12]&&o(330,pe=Vc&&zt&&ic===zt.width&&!rc),4&e.$$.dirty[1]|4194304&e.$$.dirty[12]&&o(304,me=[].concat(_toConsumableArray(bo||[]),_toConsumableArray(Tc)).filter(Boolean)),8192&e.$$.dirty[8]&&o(340,$e="has-navigation-preference-"+Dn),16384&e.$$.dirty[8]&&o(339,ge="has-navigation-preference-"+On),32768&e.$$.dirty[8]&&o(336,fe="has-toolbar-preference-"+Bn),65536&e.$$.dirty[8]&&o(338,ye="has-controlgroups-preference-"+Wn),131072&e.$$.dirty[8]&&o(337,be="has-controltabs-preference-"+Vn),1&e.$$.dirty[12]&&o(345,xe=void 0!==zt&&zt.width>0&&zt.height>0),4&e.$$.dirty[0]|16&e.$$.dirty[11]&&o(344,we=xe&&Tr&&getComputedStyle(Tr)),8&e.$$.dirty[11]&&we&&Zc(),1024&e.$$.dirty[0]|4243456&e.$$.dirty[1]|34603008&e.$$.dirty[7]|536870912&e.$$.dirty[9]|2146959360&e.$$.dirty[10]|7&e.$$.dirty[11]|3145856&e.$$.dirty[12]&&ac.set(_objectSpread2(_objectSpread2({},qt),{},{layoutMode:Ki,orientation:se,horizontalSpace:J,verticalSpace:ee,navigationHorizontalPreference:$e,navigationVerticalPreference:ge,controlGroupsVerticalPreference:ye,controlTabsVerticalpreference:be,toolbarVerticalPreference:fe,isModal:te,isDisabled:rn,isCentered:ne,isCenteredHorizontally:oe,isCenteredVertically:ie,isAnimated:Qt,isTransparent:re,pointerAccuracy:yo,pointerHoverable:go,isCompact:de,hasSwipeNavigation:pe,hasLimitedSpace:Q,hasToolbar:Mn,hasNavigation:q&&f,isIOS:Vc,browserVersion:Gl()?"chrome-"+(navigator.userAgent.match(/Chrome\/([0-9]+)/)||[])[1]:void 0})),128&e.$$.dirty[12]&&o(75,Se=Object.entries(qt).map(function(_ref328){var _ref329=_slicedToArray(_ref328,2),e=_ref329[0],t=_ref329[1];return /^is|has/.test(e)?t?Op(e):void 0:t;}).filter(Boolean).join(" ")),4096&e.$$.dirty[1]&&j&&kc.set([]),4096&e.$$.dirty[1]|4&e.$$.dirty[8]|262144&e.$$.dirty[10]|128&e.$$.dirty[12]&&o(44,ke=xn(X.map(function(e){return _objectSpread2(_objectSpread2({},e),{},{selected:j===e.id});}),_objectSpread2({},qt),function(){return Yr.set({});})),8192&e.$$.dirty[1]&&o(74,Ce=!!ke.find(function(e){return Array.isArray(e);})),786432&e.$$.dirty[12]&&o(73,Te=$o&&Object.entries(mo).filter(function(_ref330){var _ref331=_slicedToArray(_ref330,2),e=_ref331[1];return null!=e;}).reduce(function(e,_ref332){var _ref333=_slicedToArray(_ref332,2),t=_ref333[1];return e=_objectSpread2(_objectSpread2({},e),t);},{})),32768&e.$$.dirty[12]&&o(325,Ee=so&&"any-to-file"===so.task),32768&e.$$.dirty[10]&&Ee&&wc&&wc.clear(),131072&e.$$.dirty[12]&&o(327,Me=!!ho&&!!ho.translation),8192&e.$$.dirty[9]|131072&e.$$.dirty[10]|67108864&e.$$.dirty[11]&&Me&&St&&St!==Kc&&(o(292,Kc=St),Yc()),131072&e.$$.dirty[10]|131072&e.$$.dirty[12]&&Me&&qc(ho),16777216&e.$$.dirty[1]&&co&&co.length>1){var _e99=[];wc.forEach(function(t,o){0!==o&&t.get().opacity<=0&&_e99.push(t);}),_e99.forEach(function(e){return wc.remove(e);});}if(8&e.$$.dirty[0]|65536&e.$$.dirty[10]&&o(39,Pe=Qi&&Re.length&&Qi.labelSupportError(Re)),32768&e.$$.dirty[12]&&o(317,Ie=so&&!!so.error),32768&e.$$.dirty[12]&&o(42,Ae=!so||!so.complete&&void 0===so.task),32768&e.$$.dirty[12]&&o(318,Le=so&&(so.taskLengthComputable?so.taskProgress:1/0)),32768&e.$$.dirty[10]&&Ee&&$r(Xl,ro=!1,ro),4194304&e.$$.dirty[1]|16384&e.$$.dirty[9]|32768&e.$$.dirty[12]&&so&&so.complete){var _e101=Qt?250:0;clearTimeout(Qc),o(293,Qc=setTimeout(function(){$r(Xl,ro=!0,ro);},_e101));}if(2048&e.$$.dirty[1]|128&e.$$.dirty[10]|40960&e.$$.dirty[12]&&o(322,ze=so&&!Ie&&!Ae&&!ro),4096&e.$$.dirty[9]|67108864&e.$$.dirty[11]|65536&e.$$.dirty[12]&&o(321,Fe=!(!lo||St&&!ql)),4194304&e.$$.dirty[1]|8192&e.$$.dirty[12])if(ro){setTimeout(function(){return Gc.set(1,{hard:!Qt});},Qt?500:0);}else Gc.set(0,{hard:!Qt});if(16640&e.$$.dirty[12]&&o(316,De=!!(Jt||ao&&void 0!==ao.progress&&!ao.complete)),64&e.$$.dirty[10]&&De&&Wr(),2048&e.$$.dirty[1]|32768&e.$$.dirty[12]&&o(319,Oe=so&&!(so.error||Ae)),8&e.$$.dirty[0]|32768&e.$$.dirty[12]&&o(320,Be=Qi&&(so?!so.complete||so.error?xl(Qi.statusLabelLoadImage(so),so.error&&so.error.metadata,"{","}"):Qi.statusLabelLoadImage({progress:1/0,task:"blob-to-bitmap"}):Qi.statusLabelLoadImage(so))),8&e.$$.dirty[0]|16384&e.$$.dirty[12]&&o(315,We=ao&&Qi&&Qi.statusLabelProcessImage(ao)),16384&e.$$.dirty[12]&&o(313,_e=ao&&(ao.taskLengthComputable?ao.taskProgress:1/0)),16384&e.$$.dirty[12]&&o(314,Ne=ao&&!ao.error),16384&e.$$.dirty[12]&&o(312,He=!(!ao||!ao.error)),8&e.$$.dirty[0]|2048&e.$$.dirty[1]|131072&e.$$.dirty[7]|8188&e.$$.dirty[10])if(an){var _an,_an2;var _e103,_t67,_i76,_n38,_r24;T(an)&&(_e103=an),Lo(an)?_t67=an:Array.isArray(an)&&((_an=an,_an2=_slicedToArray(_an,3),_e103=_an2[0],_t67=_an2[1],_r24=_an2[2]),!1===_t67&&(_n38=!0),Lo(_t67)&&(_i76=!0)),o(35,td=(_e103||_t67)&&{text:_e103,aside:_n38||_i76,progressIndicator:{visible:_i76,progress:_t67},closeButton:_n38&&{label:Qi.statusLabelButtonClose,icon:Qi.statusIconButtonClose,onclick:_r24||function(){return o(234,an=void 0);}}});}else o(35,td=Qi&&Ae||Ie||ze||Fe?{text:Be,aside:Ie||Oe,progressIndicator:{visible:Oe,progress:Le},closeButton:Ie&&{label:Qi.statusLabelButtonClose,icon:Qi.statusIconButtonClose,onclick:ld}}:Qi&&De&&We?{text:We,aside:He||Ne,progressIndicator:{visible:Ne,progress:_e},closeButton:He&&{label:Qi.statusLabelButtonClose,icon:Qi.statusIconButtonClose,onclick:cd}}:void 0);if(131072&e.$$.dirty[7]&&o(324,je=void 0!==an),4194304&e.$$.dirty[1]|536870912&e.$$.dirty[9]|16384&e.$$.dirty[12]&&te&&ao&&ao.complete&&(ed.set(!0),setTimeout(function(){return ed.set(!1);},Qt?100:0)),4&e.$$.dirty[0]|4096&e.$$.dirty[1]|8192&e.$$.dirty[12]&&ro&&Tr&&Tr.dispatchEvent(Dp("selectutil",j)),2304&e.$$.dirty[1]|22720&e.$$.dirty[10]|4096&e.$$.dirty[12]&&o(323,Ue=no||Pe||Ae||Ie||ze||Fe||De||je),8192&e.$$.dirty[10]&&$r(Jc,io=Ue?1:0,io),4194304&e.$$.dirty[1]|8192&e.$$.dirty[10]&&Jc.set(Ue?1:0,{duration:Qt?500:1}),8388608&e.$$.dirty[1]&&o(41,Ge=io>0),16&e.$$.dirty[1]&&o(311,Ze=!(!td||!td.aside)),4195344&e.$$.dirty[1]|32768&e.$$.dirty[9]|2&e.$$.dirty[10]|2048&e.$$.dirty[12]&&Ge&&td){clearTimeout(sd);var _e105={hard:!1===Qt};if(Ze){var _t84=!!td.error||!Qt;id.set(1,_e105),od.set(oo,{hard:_t84}),o(294,sd=setTimeout(function(){nd.set(16,_e105);},1));}else id.set(0,_e105),o(294,sd=setTimeout(function(){nd.set(0,_e105);},1));}if(1024&e.$$.dirty[1]&&(Ge||(ad.set(void 0,{hard:!0}),od.set(void 0,{hard:!0}),nd.set(0,{hard:!0}))),1024&e.$$.dirty[12]&&o(310,Xe=.5*to),1&e.$$.dirty[10]|512&e.$$.dirty[12]&&o(72,Ye="transform: translateX(".concat(eo-Xe,"px)")),256&e.$$.dirty[1]|201326592&e.$$.dirty[11]&&o(38,bt=St&&Rt&&!Pe),128&e.$$.dirty[1]|1610612736&e.$$.dirty[9]&&o(307,Ke=qe&&(bt||te)?dd:n),268435456&e.$$.dirty[9]&&o(71,tt=Ke),268435456&e.$$.dirty[9]&&o(70,ot=Ke),8&e.$$.dirty[0]|2097152&e.$$.dirty[1]|370&e.$$.dirty[8]|251658240&e.$$.dirty[9]|128&e.$$.dirty[12]&&o(69,nt=Qi&&Kt&&Yp(function(){return bn([["div","alpha",{class:"PinturaNavGroup"},[["div","alpha-set",{class:"PinturaNavSet"},[En&&["Button","close",{label:Qi.labelClose,icon:Qi.iconButtonClose,onclick:function onclick(){return Yi("close");},hideLabel:!0}],Cn&&["Button","revert",{label:Qi.labelButtonRevert,icon:Qi.iconButtonRevert,disabled:!O,onclick:$c,hideLabel:!0}]]]]],["div","beta",{class:"PinturaNavGroup PinturaNavGroupFloat"},[Tn&&["div","history",{class:"PinturaNavSet"},[["Button","undo",{label:Qi.labelButtonUndo,icon:Qi.iconButtonUndo,disabled:!O,onclick:dc.undo,hideLabel:!0}],["Button","redo",{label:Qi.labelButtonRedo,icon:Qi.iconButtonRedo,disabled:!B,onclick:dc.redo,hideLabel:!0}]]],me.length&&["div","plugin-tools",{class:"PinturaNavSet"},me.filter(Boolean).map(function(_ref334){var _ref335=_slicedToArray(_ref334,3),e=_ref335[0],t=_ref335[1],o=_ref335[2];return [e,t,_objectSpread2({},o)];})]]],["div","gamma",{class:"PinturaNavGroup"},[kn&&["Button","export",{label:Qi.labelButtonExport,icon:ae&&Qi.iconButtonExport,class:"PinturaButtonExport",onclick:xc,hideLabel:ae}]]]],_objectSpread2({},qt),function(){return Yr.set({});});})),8&e.$$.dirty[12]&&o(299,dt=Nt&&!!Nt.length),1048576&e.$$.dirty[9]|134217728&e.$$.dirty[11]|8&e.$$.dirty[12]&&o(298,ut=dt&&qn(Rt,Nt)),1572864&e.$$.dirty[9]|67108864&e.$$.dirty[11]|96&e.$$.dirty[12]&&dt&&function(e,t,i,n){if(!t)return;var r={dataSizeScalar:i};n&&n[3]>0&&(r.backgroundColor=_toConsumableArray(n)),t(e,r).then(function(e){$d&&$($d),o(295,$d=e);});}(St,Ut,ut,jt),65536&e.$$.dirty[9]|134217728&e.$$.dirty[11]|24&e.$$.dirty[12]&&Nt&&$d&&Rt){var _Rt2=Rt,_e107=_Rt2.width,_t86=_Rt2.height,_i77=Yt()?"pixelated":"auto"===Ht?"auto":"pixelated";o(296,fd=Nt.map(function(o){var n=at(o.x,o.y,o.width,o.height),r=ft(Je(n),o.rotation).map(function(o){return he(o.x/_e107,o.y/_t86);});return _objectSpread2(_objectSpread2({},o),{},{id:"redaction",flipX:!1,flipY:!1,cornerRadius:0,strokeWidth:0,strokeColor:void 0,backgroundColor:[0,0,0,0],backgroundImage:$d,backgroundImageRendering:_i77,backgroundCorners:r});}));}131072&e.$$.dirty[9]|4&e.$$.dirty[12]&&o(37,$t=[].concat(_toConsumableArray(fd),_toConsumableArray(Wt||[]))),32&e.$$.dirty[1]&&gd&&yd.set(gd),4&e.$$.dirty[0]|128&e.$$.dirty[1]&&bt&&Tr&&Tr.dispatchEvent(Dp("ready")),262144&e.$$.dirty[1]&&o(63,Ld=!0),2013265920&e.$$.dirty[11]&&o(64,zd=!0),131072&e.$$.dirty[1]&&o(65,Fd=!0),65536&e.$$.dirty[1]&&o(66,Dd=!0),64&e.$$.dirty[1]&&o(67,Od=!0);},o(360,w=!Ac()),D=1===Kd()?function(e){e&&(ve(e.origin,Math.round),ve(e.translation,Math.round));}:Z,o(326,Re=[!Np()&&"WebGL"].filter(Boolean)),o(309,qe=fo()||b()&&F()),o(68,gt=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return function(o){"ping"===o.type&&(t&&o.stopPropagation(),e(o.detail.type,o.detail.data));};}(Xi.pub)),[mr,Cr,Tr,Qi,en,cn,un,hn,mn,yn,Mn,zn,_n,Hn,jn,Un,Gn,Qn,er,or,nr,lr,cr,dr,ur,hr,pr,Sr,sa,Kl,dc,ic,nc,Tc,Cc,td,gd,$t,bt,Pe,st,Ge,Ae,j,ke,f,q,Ct,Mt,At,Lt,Xt,Kt,Qt,io,co,Ro,Ao,zo,ai,yr,br,Fc,Ld,zd,Fd,Dd,Od,gt,nt,ot,tt,Ye,Te,Ce,Se,ce,K,Y,G,ko,ui,xi,vi,wi,Ci,Ti,Mi,Pi,Ei,Ai,Li,Fi,Di,Oi,Bi,Wi,Vi,_i,Ni,Hi,ji,Ui,Rr,Pr,Er,Ur,Yr,qr,Jr,ca,da,ua,ha,pa,ma,ga,fa,ya,ba,xa,va,Ma,Ea,Ia,Aa,Wa,Va,ja,Ua,Ga,Za,Xa,qa,Ka,Ja,Qa,es,ts,os,ss,cs,ds,us,hs,ms,$s,gs,fs,ys,bs,xs,ws,Ss,ks,Cs,Ts,Ms,Ps,Es,As,Ls,Ds,Bs,Vs,_s,Ns,Hs,Us,Gs,Zs,Xs,el,tl,il,rl,al,sl,cl,dl,ul,ml,$l,yl,Ll,Wl,Vl,_l,Nl,Hl,jl,Zl,Xl,Yl,Ql,ec,tc,ac,lc,bc,wc,kc,Ec,Dc,Oc,Wc,function(e,t){return t[e];},function(e){return H.find(function(t){return t.id===e;}).view;},Hc,jc,Uc,Gc,function(_ref336){var e=_ref336.target,t=_ref336.propertyName;e===Tr&&/background|outline/.test(t)&&we&&Zc();},Xc,Jc,ed,od,id,nd,rd,ad,function(e){var t=!(!td||!td.closeButton)||!Qt;rd.set(e.detail.width,{hard:t}),ad.set(Math.round(.5*-e.detail.width),{hard:t});},ud,hd,function(e){var t=e.keyCode,o=e.metaKey,i=e.ctrlKey,n=e.shiftKey;if(9===t&&rn)return void e.preventDefault();if(e.target&&32===t&&Tr.contains(e.target)&&!ou(e.target)&&(Zt&&a&&_r(),e.preventDefault()),90===t&&(o||i))return void(n&&o?dc.redo():dc.undo());if(89===t&&i)return void dc.redo();if(229===t)return;var r=new Set([].concat(_toConsumableArray(Gt),[t]));hd.set(Array.from(r));},function(_ref337){var e=_ref337.key,t=_ref337.keyCode;if("Meta"===e)return hd.set([]);hd.set(Gt.filter(function(e){return e!==t;}));},function(){hd.set([]);},function(e){ou(e.target)||e.preventDefault();},function(e){In&&pd(e.detail.resources[0]);},function(){Ln&&Xp().then(md);},function(e){if(!An)return;var t=ls((window.innerWidth-Math.abs(zt.x))/zt.width,0,1),o=ls((window.innerHeight-Math.abs(zt.y))/zt.height,0,1);t<.75&&o<.75||pd((e.clipboardData||window.clipboardData).files[0]);},bd,Ad,function(e){xt&&pt(e.detail,xt)||$r(Ms,xt=e.detail,xt);},an,Jl,qi,Ki,Ji,tn,on,nn,rn,sn,ln,dn,pn,$n,fn,bn,xn,Sn,kn,Cn,Tn,Pn,En,In,An,Ln,Fn,Dn,On,Bn,Wn,Vn,Nn,Zn,Xn,Jn,tr,ir,gr,function(){return o(60,yr=void 0);},function(e,t,i){var _i$text=i.text,n=_i$text===void 0?"":_i$text,_i$placeholder=i.placeholder,r=_i$placeholder===void 0?"":_i$placeholder,_i$autoClose=i.autoClose,a=_i$autoClose===void 0?!0:_i$autoClose,_i$align=i.align,s=_i$align===void 0?"top":_i$align,_i$justify=i.justify,l=_i$justify===void 0?"center":_i$justify,c=i.buttonConfirm,d=i.buttonCancel;o(60,yr={align:s,justify:l,text:n,placeholder:r,buttonConfirm:c,buttonCancel:d,onconfirm:function onconfirm(){e(br.value),a&&o(60,yr=void 0);},oncancel:function oncancel(){t(void 0),o(60,yr=void 0);}});},xr,vr,wr,kr,Br,Wr,Vr,_r,Nr,Hr,jr,Gr,Zr,Xr,Kr,Ws,ql,Kc,Qc,sd,$d,fd,U,ut,dt,a,N,rt,ae,me,B,O,Ke,te,qe,Xe,Ze,He,_e,Ne,We,De,Ie,Le,Oe,Be,Fe,ze,Ue,je,Ee,Re,Me,X,Q,pe,de,re,ie,oe,ne,fe,be,ye,ge,$e,ee,J,se,we,xe,H,V,_,i,z,P,L,A,E,R,C,M,g,k,w,S,l,p,s,u,r,St,Rt,Pt,Et,It,zt,Dt,Wt,Nt,Ht,jt,Ut,qt,Jt,eo,to,oo,no,ro,ao,so,lo,ho,mo,$o,go,yo,bo,xo,vo,wo,Co,To,Mo,Po,Eo,Io,Fo,Do,Wo,Go,Zo,qo,Qo,ei,ti,ri,si,li,ci,pi,mi,$i,fi,yi,bi,function(){o(31,ic=om.innerWidth),o(32,nc=om.innerHeight);},function(e){return $r(Ts,wi=e.detail,wi);},function(_ref338){var e=_ref338.detail;return o(43,j=e);},function(t,i){e.$$.not_equal(Cr[i],t)&&(Cr[i]=t,o(1,Cr),o(277,wr),o(27,Sr));},function(e){return Dc(e);},function(e){return Oc(e);},function(e,_ref339){var t=_ref339.detail;return Wc(e,t);},function(e){return $r(ks,ko=e.detail,ko);},function(t){e.$$.not_equal(Cr[j],t)&&(Cr[j]=t,o(1,Cr),o(277,wr),o(27,Sr));},function(){return Dc(j);},function(){return Oc(j);},function(_ref340){var e=_ref340.detail;return Wc(j,e);},function(e){var t=_objectSpread2(_objectSpread2({},e),bd()),_yn=yn({annotationShapes:At,decorationShapes:Mt,interfaceShapes:Oi,frameShapes:Ct,selectionShapes:ai},t),o=_yn.annotationShapes,i=_yn.decorationShapes,n=_yn.interfaceShapes,r=_yn.frameShapes,a=_yn.selectionShapes;return Ad(t,$t,o,i,n,r,a);},function(){o(63,Ld=!1),o(64,zd=!1),o(65,Fd=!1),o(66,Dd=!1),o(67,Od=!1);},function(e){ra[e?"unshift":"push"](function(){gd=e,o(36,gd);});},function(e){mr=e,o(0,mr),o(266,Nn);},function(e){Tc=e,o(33,Tc);},function(e){Cc=e,o(34,Cc);},function(e){ra[e?"unshift":"push"](function(){br=e,o(61,br);});},function(e){ra[e?"unshift":"push"](function(){Tr=e,o(2,Tr);});},function(e){return $r(ws,Xt=e.detail,Xt);}];}var Im=/*#__PURE__*/function(_Wa29){function Im(e){var _this32;_classCallCheck(this,Im);_this32=_callSuper(this,Im),Ba(_assertThisInitialized(_this32),e,Em,Mm,nr,{class:236,layout:237,stores:238,locale:3,id:4,util:239,utils:240,animations:241,disabled:242,status:234,previewUpscale:243,previewPad:244,previewMaskOpacity:5,previewImageDataMaxSize:245,previewImageTextPixelRatio:6,markupMaskOpacity:7,zoomMaskOpacity:246,elasticityMultiplier:8,willRevert:247,willProcessImage:248,willRenderCanvas:9,willRenderToolbar:249,willRenderUtilTabs:250,willSetHistoryInitialState:251,enableButtonExport:252,enableButtonRevert:253,enableNavigateHistory:254,enableToolbar:10,enableUtils:255,enableButtonClose:256,enableDropImage:257,enablePasteImage:258,enableBrowseImage:259,enableTransparencyGrid:11,layoutDirectionPreference:260,layoutHorizontalUtilsPreference:261,layoutVerticalUtilsPreference:262,layoutVerticalToolbarPreference:263,layoutVerticalControlGroupsPreference:264,layoutVerticalControlTabsPreference:265,textDirection:12,markupEditorZoomLevel:266,markupEditorZoomLevels:13,markupEditorZoomAdjustStep:14,markupEditorZoomAdjustFactor:15,markupEditorZoomAdjustWheelFactor:16,markupEditorInteractionMode:267,muteAudio:268,willSetMediaInitialTimeOffset:269,enablePan:17,enableZoom:18,enableZoomControls:270,enableZoomInput:19,enablePanInput:271,enableCanvasAlpha:20,enablePanLimit:21,panLimitGutterScalar:22,zoomPresetOptions:23,zoomAdjustStep:24,zoomAdjustFactor:25,zoomAdjustWheelFactor:26,zoomLevel:0,fixScrollDirection:272,hideTextInput:273,showTextInput:274,imagePreviewSrc:275,imageOrienter:276,pluginComponents:277,pluginOptions:27,sub:278,pluginInterface:1,root:2,play:279,pause:280,isPaused:281,togglePlayPause:282,mute:283,unmute:284,toggleMute:285,getDuration:286,getCurrentTime:287,setCurrentTime:288,imageSourceToImageData:28,imagePreview:29,imagePreviewCurrent:235,history:30},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);return _this32;}_inherits(Im,_Wa29);return _createClass(Im,[{key:"class",get:function get(){return this.$$.ctx[236];},set:function set(e){this.$$set({class:e}),fa();}},{key:"layout",get:function get(){return this.$$.ctx[237];},set:function set(e){this.$$set({layout:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[238];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"id",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({id:e}),fa();}},{key:"util",get:function get(){return this.$$.ctx[239];},set:function set(e){this.$$set({util:e}),fa();}},{key:"utils",get:function get(){return this.$$.ctx[240];},set:function set(e){this.$$set({utils:e}),fa();}},{key:"animations",get:function get(){return this.$$.ctx[241];},set:function set(e){this.$$set({animations:e}),fa();}},{key:"disabled",get:function get(){return this.$$.ctx[242];},set:function set(e){this.$$set({disabled:e}),fa();}},{key:"status",get:function get(){return this.$$.ctx[234];},set:function set(e){this.$$set({status:e}),fa();}},{key:"previewUpscale",get:function get(){return this.$$.ctx[243];},set:function set(e){this.$$set({previewUpscale:e}),fa();}},{key:"previewPad",get:function get(){return this.$$.ctx[244];},set:function set(e){this.$$set({previewPad:e}),fa();}},{key:"previewMaskOpacity",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({previewMaskOpacity:e}),fa();}},{key:"previewImageDataMaxSize",get:function get(){return this.$$.ctx[245];},set:function set(e){this.$$set({previewImageDataMaxSize:e}),fa();}},{key:"previewImageTextPixelRatio",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({previewImageTextPixelRatio:e}),fa();}},{key:"markupMaskOpacity",get:function get(){return this.$$.ctx[7];},set:function set(e){this.$$set({markupMaskOpacity:e}),fa();}},{key:"zoomMaskOpacity",get:function get(){return this.$$.ctx[246];},set:function set(e){this.$$set({zoomMaskOpacity:e}),fa();}},{key:"elasticityMultiplier",get:function get(){return this.$$.ctx[8];},set:function set(e){this.$$set({elasticityMultiplier:e}),fa();}},{key:"willRevert",get:function get(){return this.$$.ctx[247];},set:function set(e){this.$$set({willRevert:e}),fa();}},{key:"willProcessImage",get:function get(){return this.$$.ctx[248];},set:function set(e){this.$$set({willProcessImage:e}),fa();}},{key:"willRenderCanvas",get:function get(){return this.$$.ctx[9];},set:function set(e){this.$$set({willRenderCanvas:e}),fa();}},{key:"willRenderToolbar",get:function get(){return this.$$.ctx[249];},set:function set(e){this.$$set({willRenderToolbar:e}),fa();}},{key:"willRenderUtilTabs",get:function get(){return this.$$.ctx[250];},set:function set(e){this.$$set({willRenderUtilTabs:e}),fa();}},{key:"willSetHistoryInitialState",get:function get(){return this.$$.ctx[251];},set:function set(e){this.$$set({willSetHistoryInitialState:e}),fa();}},{key:"enableButtonExport",get:function get(){return this.$$.ctx[252];},set:function set(e){this.$$set({enableButtonExport:e}),fa();}},{key:"enableButtonRevert",get:function get(){return this.$$.ctx[253];},set:function set(e){this.$$set({enableButtonRevert:e}),fa();}},{key:"enableNavigateHistory",get:function get(){return this.$$.ctx[254];},set:function set(e){this.$$set({enableNavigateHistory:e}),fa();}},{key:"enableToolbar",get:function get(){return this.$$.ctx[10];},set:function set(e){this.$$set({enableToolbar:e}),fa();}},{key:"enableUtils",get:function get(){return this.$$.ctx[255];},set:function set(e){this.$$set({enableUtils:e}),fa();}},{key:"enableButtonClose",get:function get(){return this.$$.ctx[256];},set:function set(e){this.$$set({enableButtonClose:e}),fa();}},{key:"enableDropImage",get:function get(){return this.$$.ctx[257];},set:function set(e){this.$$set({enableDropImage:e}),fa();}},{key:"enablePasteImage",get:function get(){return this.$$.ctx[258];},set:function set(e){this.$$set({enablePasteImage:e}),fa();}},{key:"enableBrowseImage",get:function get(){return this.$$.ctx[259];},set:function set(e){this.$$set({enableBrowseImage:e}),fa();}},{key:"enableTransparencyGrid",get:function get(){return this.$$.ctx[11];},set:function set(e){this.$$set({enableTransparencyGrid:e}),fa();}},{key:"layoutDirectionPreference",get:function get(){return this.$$.ctx[260];},set:function set(e){this.$$set({layoutDirectionPreference:e}),fa();}},{key:"layoutHorizontalUtilsPreference",get:function get(){return this.$$.ctx[261];},set:function set(e){this.$$set({layoutHorizontalUtilsPreference:e}),fa();}},{key:"layoutVerticalUtilsPreference",get:function get(){return this.$$.ctx[262];},set:function set(e){this.$$set({layoutVerticalUtilsPreference:e}),fa();}},{key:"layoutVerticalToolbarPreference",get:function get(){return this.$$.ctx[263];},set:function set(e){this.$$set({layoutVerticalToolbarPreference:e}),fa();}},{key:"layoutVerticalControlGroupsPreference",get:function get(){return this.$$.ctx[264];},set:function set(e){this.$$set({layoutVerticalControlGroupsPreference:e}),fa();}},{key:"layoutVerticalControlTabsPreference",get:function get(){return this.$$.ctx[265];},set:function set(e){this.$$set({layoutVerticalControlTabsPreference:e}),fa();}},{key:"textDirection",get:function get(){return this.$$.ctx[12];},set:function set(e){this.$$set({textDirection:e}),fa();}},{key:"markupEditorZoomLevel",get:function get(){return this.$$.ctx[266];},set:function set(e){this.$$set({markupEditorZoomLevel:e}),fa();}},{key:"markupEditorZoomLevels",get:function get(){return this.$$.ctx[13];},set:function set(e){this.$$set({markupEditorZoomLevels:e}),fa();}},{key:"markupEditorZoomAdjustStep",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({markupEditorZoomAdjustStep:e}),fa();}},{key:"markupEditorZoomAdjustFactor",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({markupEditorZoomAdjustFactor:e}),fa();}},{key:"markupEditorZoomAdjustWheelFactor",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({markupEditorZoomAdjustWheelFactor:e}),fa();}},{key:"markupEditorInteractionMode",get:function get(){return this.$$.ctx[267];},set:function set(e){this.$$set({markupEditorInteractionMode:e}),fa();}},{key:"muteAudio",get:function get(){return this.$$.ctx[268];},set:function set(e){this.$$set({muteAudio:e}),fa();}},{key:"willSetMediaInitialTimeOffset",get:function get(){return this.$$.ctx[269];},set:function set(e){this.$$set({willSetMediaInitialTimeOffset:e}),fa();}},{key:"enablePan",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({enablePan:e}),fa();}},{key:"enableZoom",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({enableZoom:e}),fa();}},{key:"enableZoomControls",get:function get(){return this.$$.ctx[270];},set:function set(e){this.$$set({enableZoomControls:e}),fa();}},{key:"enableZoomInput",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({enableZoomInput:e}),fa();}},{key:"enablePanInput",get:function get(){return this.$$.ctx[271];},set:function set(e){this.$$set({enablePanInput:e}),fa();}},{key:"enableCanvasAlpha",get:function get(){return this.$$.ctx[20];},set:function set(e){this.$$set({enableCanvasAlpha:e}),fa();}},{key:"enablePanLimit",get:function get(){return this.$$.ctx[21];},set:function set(e){this.$$set({enablePanLimit:e}),fa();}},{key:"panLimitGutterScalar",get:function get(){return this.$$.ctx[22];},set:function set(e){this.$$set({panLimitGutterScalar:e}),fa();}},{key:"zoomPresetOptions",get:function get(){return this.$$.ctx[23];},set:function set(e){this.$$set({zoomPresetOptions:e}),fa();}},{key:"zoomAdjustStep",get:function get(){return this.$$.ctx[24];},set:function set(e){this.$$set({zoomAdjustStep:e}),fa();}},{key:"zoomAdjustFactor",get:function get(){return this.$$.ctx[25];},set:function set(e){this.$$set({zoomAdjustFactor:e}),fa();}},{key:"zoomAdjustWheelFactor",get:function get(){return this.$$.ctx[26];},set:function set(e){this.$$set({zoomAdjustWheelFactor:e}),fa();}},{key:"zoomLevel",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({zoomLevel:e}),fa();}},{key:"fixScrollDirection",get:function get(){return this.$$.ctx[272];},set:function set(e){this.$$set({fixScrollDirection:e}),fa();}},{key:"hideTextInput",get:function get(){return this.$$.ctx[273];}},{key:"showTextInput",get:function get(){return this.$$.ctx[274];}},{key:"imagePreviewSrc",get:function get(){return this.$$.ctx[275];},set:function set(e){this.$$set({imagePreviewSrc:e}),fa();}},{key:"imageOrienter",get:function get(){return this.$$.ctx[276];},set:function set(e){this.$$set({imageOrienter:e}),fa();}},{key:"pluginComponents",get:function get(){return this.$$.ctx[277];},set:function set(e){this.$$set({pluginComponents:e}),fa();}},{key:"pluginOptions",get:function get(){return this.$$.ctx[27];},set:function set(e){this.$$set({pluginOptions:e}),fa();}},{key:"sub",get:function get(){return this.$$.ctx[278];}},{key:"pluginInterface",get:function get(){return this.$$.ctx[1];}},{key:"root",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({root:e}),fa();}},{key:"play",get:function get(){return this.$$.ctx[279];}},{key:"pause",get:function get(){return this.$$.ctx[280];}},{key:"isPaused",get:function get(){return this.$$.ctx[281];}},{key:"togglePlayPause",get:function get(){return this.$$.ctx[282];}},{key:"mute",get:function get(){return this.$$.ctx[283];}},{key:"unmute",get:function get(){return this.$$.ctx[284];}},{key:"toggleMute",get:function get(){return this.$$.ctx[285];}},{key:"getDuration",get:function get(){return this.$$.ctx[286];}},{key:"getCurrentTime",get:function get(){return this.$$.ctx[287];}},{key:"setCurrentTime",get:function get(){return this.$$.ctx[288];}},{key:"imageSourceToImageData",get:function get(){return this.$$.ctx[28];},set:function set(e){this.$$set({imageSourceToImageData:e}),fa();}},{key:"imagePreview",get:function get(){return this.$$.ctx[29];}},{key:"imagePreviewCurrent",get:function get(){return this.$$.ctx[235];},set:function set(e){this.$$set({imagePreviewCurrent:e}),fa();}},{key:"history",get:function get(){return this.$$.ctx[30];}}]);}(Wa);"undefined"!=typeof window&&function(e){if(e&&e._4pf3wm7)return;var _map5=[[99,111,110,115,111,108,101],[108,111,103],[84,104,105,115,32,118,101,114,115,105,111,110,32,111,102,32,80,105,110,116,117,114,97,32,105,115,32,102,111,114,32,116,101,115,116,105,110,103,32,112,117,114,112,111,115,101,115,32,111,110,108,121,46,32,86,105,115,105,116,32,104,116,116,112,115,58,47,47,112,113,105,110,97,46,110,108,47,112,105,110,116,117,114,97,32,116,111,32,112,117,114,99,104,97,115,101,32,97,32,108,105,99,101,110,115,101,46,32,86,105,115,105,116,32,104,116,116,112,115,58,47,47,112,113,105,110,97,46,110,108,47,112,105,110,116,117,114,97,47,99,104,97,116,32,105,102,32,121,111,117,32,104,97,118,101,32,97,110,121,32,113,117,101,115,116,105,111,110,115,46]].map(function(e){return e.map(function(e){return String.fromCharCode(e);}).join("");}),_map6=_slicedToArray(_map5,3),t=_map6[0],o=_map6[1],i=_map6[2];e&&e[t]&&e[t][o](i);}(window);var Am=["klass","stores","isVisible","isActive","isActiveFraction","locale"],Lm=["history","klass","stores","navButtons","pluginComponents","pluginInterface","pluginOptions","sub","imagePreviewSrc","imagePreview","imagePreviewCurrent"],zm=["locale"];var Fm;var Dm=new Set([]),Om={},Bm=new Map(),Wm=function Wm(){for(var _len10=arguments.length,e=new Array(_len10),_key10=0;_key10<_len10;_key10++){e[_key10]=arguments[_key10];}e.filter(function(e){return !!e.util;}).forEach(function(e){var _e$util=_slicedToArray(e.util,3),t=_e$util[0],o=_e$util[1],_e$util$=_e$util[2],i=_e$util$===void 0?function(){return !0;}:_e$util$;Bm.has(t)||(Bm.set(t,{Component:o,isSupported:i}),rd(o).filter(function(e){return !Am.includes(e);}).forEach(function(e){Dm.add(e),Om[e]?Om[e].push(t):Om[e]=[t];}));});};var Vm=[].concat(xs,["init","update","undo","redo","revert","writehistory","destroy","show","hide","close","ready","zoom","pan","loadpreview","selectshape","blurshape","updateshape","addshape","removeshape","selectstyle","markuptap","markupzoom","markuppan","selectutil","selectcontrol","selectiondown","selectionup","selectionchange"]);var _m=function _m(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var _o$prefix=o.prefix,i=_o$prefix===void 0?"pintura:":_o$prefix;return Vm.map(function(o){return e.on(o,function(e){return Vt(t)?function(e,t,o){return e.dispatchEvent(new CustomEvent(t,{detail:o,bubbles:!0,cancelable:!0}));}(t,"".concat(i).concat(o),e):t(o,e);});});};var Hm=function Hm(e){return T(e[0]);},jm=function jm(e){return !Hm(e);},Um=function Um(e){return e[1];},Gm=function Gm(e){return e[3]||[];};var Jm=function Jm(e,t){var o=e$(e,t);return vd(o,function(t){return Um(t)===e;}),o;},e$=function e$(e,t){if(jm(t)){if(t.find(function(t){return Um(t)===e;}))return t;var _o107=t.find(function(t){return e$(e,Gm(t));});return _o107&&_o107[3];}return e$(e,Gm(t));},o$=function o$(){return [.75,.25,.25,0,0,.25,.75,.25,0,0,.25,.25,.75,0,0,0,0,0,1,0];},i$=function i$(){return [1.398,-.316,.065,-.273,.201,-.051,1.278,-.08,-.273,.201,-.051,.119,1.151,-.29,.215,0,0,0,1,0];},n$=function n$(){return [1.073,-.015,.092,-.115,-.017,.107,.859,.184,-.115,-.017,.015,.077,1.104,-.115,-.017,0,0,0,1,0];},r$=function r$(){return [1.06,0,0,0,0,0,1.01,0,0,0,0,0,.93,0,0,0,0,0,1,0];},a$=function a$(){return [1.1,0,0,0,-.1,0,1.1,0,0,-.1,0,0,1.2,0,-.1,0,0,0,1,0];},l$=function l$(){return [.212,.715,.114,0,0,.212,.715,.114,0,0,.212,.715,.114,0,0,0,0,0,1,0];},c$=function c$(){return [.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,.15,1.3,-.25,.1,-.2,0,0,0,1,0];},d$=function d$(){return [.163,.518,.084,-.01,.208,.163,.529,.082,-.02,.21,.171,.529,.084,0,.214,0,0,0,1,0];},u$=function u$(){return [.338,.991,.117,.093,-.196,.302,1.049,.096,.078,-.196,.286,1.016,.146,.101,-.196,0,0,0,1,0];},h$=function h$(){return [.393,.768,.188,0,0,.349,.685,.167,0,0,.272,.533,.13,0,0,0,0,0,1,0];},p$=function p$(){return [.289,.62,.185,0,.077,.257,.566,.163,0,.115,.2,.43,.128,0,.188,0,0,0,1,0];},m$=function m$(){return [.269,.764,.172,.05,.1,.239,.527,.152,0,.176,.186,.4,.119,0,.159,0,0,0,1,0];},$$=function $$(){return [.547,.764,.134,0,-.147,.281,.925,.12,0,-.135,.225,.558,.33,0,-.113,0,0,0,1,0];},g$={chrome:i$,fade:n$,pastel:o$,cold:a$,warm:r$,monoDefault:l$,monoWash:d$,monoNoir:c$,monoStark:u$,sepiaDefault:h$,sepiaRust:m$,sepiaBlues:p$,sepiaColor:$$};var f$={filterFunctions:g$,filterOptions:[["Default",[[void 0,function(e){return e.labelDefault;}]]],["Classic",[["chrome",function(e){return e.filterLabelChrome;}],["fade",function(e){return e.filterLabelFade;}],["cold",function(e){return e.filterLabelCold;}],["warm",function(e){return e.filterLabelWarm;}],["pastel",function(e){return e.filterLabelPastel;}]]],["Monochrome",[["monoDefault",function(e){return e.filterLabelMonoDefault;}],["monoNoir",function(e){return e.filterLabelMonoNoir;}],["monoStark",function(e){return e.filterLabelMonoStark;}],["monoWash",function(e){return e.filterLabelMonoWash;}]]],["Sepia",[["sepiaDefault",function(e){return e.filterLabelSepiaDefault;}],["sepiaRust",function(e){return e.filterLabelSepiaRust;}],["sepiaBlues",function(e){return e.filterLabelSepiaBlues;}],["sepiaColor",function(e){return e.filterLabelSepiaColor;}]]]]};var T$={base:0,min:-.25,max:.25,getLabel:function getLabel(e){return Kp(e/.25);},getStore:function getStore(_ref344){var e=_ref344.imageColorMatrix;return e;},getValue:function getValue(e){if(e.brightness)return e.brightness[4];},setValue:function setValue(e,t){return e.update(function(e){return _objectSpread2(_objectSpread2({},e),{},{brightness:[1,0,0,0,t,0,1,0,0,t,0,0,1,0,t,0,0,0,1,0]});});}},M$={base:1,min:.5,max:1.5,getLabel:function getLabel(e){return Kp(2*(e-.5)-1);},getStore:function getStore(_ref345){var e=_ref345.imageColorMatrix;return e;},getValue:function getValue(e){if(e.contrast)return e.contrast[0];},setValue:function setValue(e,t){return e.update(function(e){return _objectSpread2(_objectSpread2({},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]});});}},R$={base:1,min:0,max:2,getLabel:function getLabel(e){return Kp(e-1);},getStore:function getStore(_ref346){var e=_ref346.imageColorMatrix;return e;},getValue:function getValue(e){if(e.saturation)return (e.saturation[0]-.213)/.787;},setValue:function setValue(e,t){return e.update(function(e){return _objectSpread2(_objectSpread2({},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]});});}},P$={base:1,min:.5,max:1.5,getLabel:function getLabel(e){return Kp(2*(e-.5)-1);},getStore:function getStore(_ref347){var e=_ref347.imageColorMatrix;return e;},getValue:function getValue(e){if(e.exposure)return e.exposure[0];},setValue:function setValue(e,t){return e.update(function(e){return _objectSpread2(_objectSpread2({},e),{},{exposure:[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0]});});}},E$={base:1,min:.15,max:4,getLabel:function getLabel(e){return Kp(e<1?(e-.15)/.85-1:(e-1)/3);},getStore:function getStore(_ref348){var e=_ref348.imageGamma;return e;}},I$={base:0,min:-1,max:1,getStore:function getStore(_ref349){var e=_ref349.imageVignette;return e;}},A$={base:0,min:-1,max:1,getStore:function getStore(_ref350){var e=_ref350.imageConvolutionMatrix;return e;},getValue:function getValue(e){if(e.clarity)return 0===e.clarity[0]?e.clarity[1]/-1:e.clarity[1]/-2;},setValue:function setValue(e,t){e.update(function(e){return _objectSpread2(_objectSpread2({},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]});});}},L$={base:0,min:-1,max:1,getStore:function getStore(_ref351){var e=_ref351.imageColorMatrix;return e;},getValue:function getValue(e){if(!e.temperature)return;var t=e.temperature[0];return t>=1?(t-1)/.1:(1-t)/-.15;},setValue:function setValue(e,t){return e.update(function(e){return _objectSpread2(_objectSpread2({},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 z$={finetuneControlConfiguration:{gamma:E$,brightness:T$,contrast:M$,saturation:R$,exposure:P$,temperature:L$,clarity:A$,vignette:I$},finetuneOptions:[["brightness",function(e){return e.finetuneLabelBrightness;}],["contrast",function(e){return e.finetuneLabelContrast;}],["saturation",function(e){return e.finetuneLabelSaturation;}],["exposure",function(e){return e.finetuneLabelExposure;}],["temperature",function(e){return e.finetuneLabelTemperature;}],["gamma",function(e){return e.finetuneLabelGamma;}],!Ac()&&["clarity",function(e){return e.finetuneLabelClarity;}],["vignette",function(e){return e.finetuneLabelVignette;}]].filter(Boolean)};var F$={shape:{frameColor:[1,1,1],frameStyle:"solid",frameSize:"2.5%"},thumb:'<rect stroke-width="5" x="0" y="0" width="100%" height="100%"/>'},D$={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%"/>'},O$={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>'},B$={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>'},W$={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>'},V$={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>'},_$={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>'},N$={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>'},H$={shape:{frameColor:[1,1,1],frameStyle:"polaroid"},thumb:'<rect stroke-width="20%" x="-5%" y="-5%" width="110%" height="96%"/>'};var j$={frameStyles:{solidSharp:F$,solidRound:D$,lineSingle:O$,lineMultiple:B$,edgeSeparate:W$,edgeCross:V$,edgeOverlap:_$,hook:N$,polaroid:H$},frameOptions:[[void 0,function(e){return e.labelNone;}],["solidSharp",function(e){return e.frameLabelMatSharp;}],["solidRound",function(e){return e.frameLabelMatRound;}],["lineSingle",function(e){return e.frameLabelLineSingle;}],["lineMultiple",function(e){return e.frameLabelLineMultiple;}],["edgeCross",function(e){return e.frameLabelEdgeCross;}],["edgeSeparate",function(e){return e.frameLabelEdgeSeparate;}],["edgeOverlap",function(e){return e.frameLabelEdgeOverlap;}],["hook",function(e){return e.frameLabelCornerHooks;}],["polaroid",function(e){return e.frameLabelPolaroid;}]]},U$=function U$(e){return e.charAt(0).toUpperCase()+e.slice(1);};var G$=null;var Z$=function Z$(){if(null===G$)if(c())try{G$=!1===document.fonts.check("16px TestNonExistingFont");}catch(e){G$=!1;}else G$=!1;return G$;};var X$=function X$(e,t){return function(o){return o[t?"".concat(t).concat(U$(e)):e];};},Y$=function Y$(e){return [e,""+e];},q$=function q$(e,t){return function(o){return [e[o],X$(o,t)];};},K$=function K$(e){return Array.isArray(e)&&e.every(Lo)?e.map(Y$):e;},J$=[1,.2549,.2118],Q$=[1,1,1,0],ng=function ng(e){var _ref354=e||{},_ref354$hideLabel=_ref354.hideLabel,t=_ref354$hideLabel===void 0?!0:_ref354$hideLabel;return jg(["new","add","subtract"].map(function(e){return [e,X$(e,"shapeLabelSelectionMode"),{icon:X$(e,"shapeIconSelectionMode"),hideLabel:t}];}),{title:function title(e){return e.shapeTitleSelectionMode;},layout:"radio"});},rg=function rg(e){return Hg(e,{title:function title(e){return e.shapeTitleBrushSize;},layout:"radio",optionHideLabel:!0,optionIcon:function optionIcon(e,t){return "<circle fill=\"currentColor\" stroke-width=\".05em\" stroke=\"currentColor\" fill-opacity=\".25\" cx=\"12\" cy=\"12\" r=\"".concat(2+8*t,"\"/>");}});},ag={eraser:function eraser(){return {eraseRadius:8,cursorStyle:"ellipse",cursorSize:"eraseRadius"};},path:function path(){return {points:[],disableAddPoints:!1};},line:function line(){return {x1:0,y1:0,x2:0,y2:0,disableErase:!1};},rectangle:function rectangle(){return {x:0,y:0,width:0,height:0};},ellipse:function ellipse(){return {x:0,y:0,rx:0,ry:0};},text:function text(){return {x:0,y:0,text:"Text"};}},sg=function sg(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=arguments.length>2?arguments[2]:undefined;if(!ag[e])return;var _ref355=o||{},_ref355$position=_ref355.position,i=_ref355$position===void 0?"relative":_ref355$position,_ref355$inputMode=_ref355.inputMode,n=_ref355$inputMode===void 0?"drag":_ref355$inputMode,_ref355$isSelection=_ref355.isSelection,r=_ref355$isSelection===void 0?!1:_ref355$isSelection;return [_objectSpread2(_objectSpread2({},ag[e]()),t),{position:i,inputMode:n,isSelection:r}];},lg=function lg(e){return _objectSpread2({sharpie:sg("path",{bitmap:!0,strokeJoin:"round",strokeCap:"round",strokeWidth:"0.5%",strokeColor:[].concat(J$),cursorStyle:"ellipse",cursorSize:"strokeWidth",disableErase:!1,disableResize:!0,disableMove:!0}),eraser:sg("eraser"),path:sg("path",{pathClose:void 0,strokeWidth:"0.5%",strokeColor:[].concat(J$),backgroundColor:[0,0,0,0]},{inputMode:"step"}),line:sg("line",{strokeColor:[].concat(J$),strokeWidth:"0.5%"}),arrow:sg("line",{lineStart:"none",lineEnd:"arrow-solid",strokeColor:[].concat(J$),strokeWidth:"0.5%"}),rectangle:sg("rectangle",{strokeColor:[].concat(Q$),backgroundColor:[].concat(J$)}),ellipse:sg("ellipse",{strokeColor:[].concat(Q$),backgroundColor:[].concat(J$)}),text:sg("text",{color:[].concat(J$),fontSize:"2%"})},e);},cg=function cg(e,t,o){return [e,t||X$(e,"shapeLabelTool"),_objectSpread2({icon:X$(e,"shapeIconTool")},o)];},dg=function dg(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:["move","view","sharpie","eraser","path","line","arrow","rectangle","ellipse","text","preset"];return e.map(function(e){return T(e)?cg(e):Array.isArray(e)?S(e[1])?cg(e[0],void 0,e[1]):cg(e[0],e[1],e[2]):void 0;}).filter(Boolean);},wg=function wg(e){return Object.keys(e).map(q$(e,"shapeTitleColor"));},kg=function kg(e){return Object.keys(e).map(q$(e,"labelSize"));},Tg=function Tg(e){return Object.keys(e).map(q$(e,"labelSize"));},Rg=function Rg(e){return Object.keys(e).map(q$(e,"labelSize"));},Pg=function Pg(e){return _toConsumableArray(e);},Eg=function Eg(e){return e.map(function(e){return [e,function(t){return t["shapeLabelFontStyle"+e.filter(function(e){return "normal"!==e;}).map(U$).join("")];}];});},Ig=function Ig(e){return e.map(function(e){return [Op(e),function(t){return t["shapeTitleLineDecoration"+U$(e)];},{icon:function icon(t){return t["shapeIconLineDecoration"+U$(e)];}}];});},Ag=function Ag(e,t){var _ref356=t||{},o=_ref356.defaultKey,i=_ref356.defaultValue,n=_ref356.defaultOptions,r=[];return o&&(r[0]=[i,function(e){return e[o];},_objectSpread2({},n)]),[].concat(r,_toConsumableArray(e));},Lg=function Lg(e){return e.split(",").map(function(e){return e.trim();}).some(function(e){return document.fonts.check("16px "+e);});},zg=function zg(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return ["ToggleSlider",_objectSpread2({},e)];},Dg=function Dg(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{defaultKey:"labelDefault"};return ["Dropdown",{title:function title(e){return e.shapeTitleFontFamily;},onload:function onload(_ref357){var _ref357$options=_ref357.options,e=_ref357$options===void 0?[]:_ref357$options;Z$()&&e.map(function(_ref358){var _ref359=_slicedToArray(_ref358,1),e=_ref359[0];return e;}).filter(Boolean).filter(function(e){return !Lg(e);}).forEach(function(e){var t="PinturaFontTest-"+e.replace(/[^a-zA-Z0-9]+/g,"").toLowerCase();document.getElementById(t)||document.body.append(p("span",{textContent:" ",id:t,class:"PinturaFontTest",style:"font-family:".concat(e,";font-size:0;color:transparent;")}));});},ondestroy:function ondestroy(){if(!Z$())return;document.querySelectorAll(".PinturaFontTest").forEach(function(e){return e.remove();});},optionLabelStyle:function optionLabelStyle(e){return "font-family: "+e;},options:Ag(e,t),optionFilter:function optionFilter(e){if(!Z$())return !0;var _e119=_slicedToArray(e,1),t=_e119[0];if(!t)return !0;return Lg(t);}}];},Og=function Og(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return ["ColorPicker",_objectSpread2({options:Ag(e)},t)];},Bg=function Bg(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Og(e,_objectSpread2({title:function title(e){return e.labelColor;}},t));},Wg=function Wg(e){return function(t){var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Og(t,_objectSpread2({title:function title(t){return t[e];}},o));};},Vg=Wg("shapeTitleBackgroundColor"),_g=Wg("shapeTitleTextColor"),Ng=function Ng(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return Og(e,_objectSpread2({title:function title(e){return e.shapeTitleStrokeColor;},options:Ag(e),buttonClass:"PinturaColorPickerButtonStroke",onchange:function onchange(e,o){var i=o.strokeWidth;(Lo(i)||T(i)?parseFloat(i):0)>0||(o.strokeWidth=t&&t.defaultStrokeWidth||"0.5%");}},t));},Hg=function Hg(e,t){var _ref360=t||{},o=_ref360.title,_ref360$optionHideLab=_ref360.optionHideLabel,i=_ref360$optionHideLab===void 0?!1:_ref360$optionHideLab,n=_ref360.layout,_ref360$optionIcon=_ref360.optionIcon,r=_ref360$optionIcon===void 0?!1:_ref360$optionIcon,a=K$(e),s=e.map(function(_ref361){var _ref362=_slicedToArray(_ref361,1),e=_ref362[0];return T(e)?parseFloat(e):e;}),l=Math.max.apply(Math,_toConsumableArray(s)),c=Math.min.apply(Math,_toConsumableArray(s)),d=l-c;return ["radio"===n?"RadioGroup":"Dropdown",{title:!1===o?void 0:o||function(e){return e.shapeTitleStrokeWidth;},options:function options(e){var o=t?a.map(function(e){var _e122=_slicedToArray(e,3),t=_e122[0],o=_e122[1],_e122$=_e122[2],n=_e122$===void 0?{}:_e122$,a=T(t)?parseFloat(t):t,s=(a-c)/d;var l=void 0;return "line"===r?l="<path stroke=\"currentColor\" stroke-linecap=\"square\" stroke-width=\"".concat(.1+.875*s,"em\" d=\"M3,12 H20\"/>"):"dot"===r?l="<circle fill=\"currentColor\" cx=\"12\" cy=\"12\" r=\"".concat(2+8*s,"\"/>"):T(r)?l=r:M(r)&&(l=r(a,s)),[t,o,_objectSpread2({icon:l,hideLabel:i},n)];}):a;return Fo(e,"backgroundColor")?Ag(o,{defaultKey:"shapeLabelStrokeNone"}):Ag(o);},onchange:function onchange(e,t){if(!e)return;var o=t.strokeColor||[];if(o[3])return;var i=_toConsumableArray(o);i[3]=1,t.strokeColor=i;}}];},jg=function jg(e,t){var _ref363=t||{},o=_ref363.title,i=_ref363.layout;return ["radio"===i?"RadioGroup":"Dropdown",{title:o,options:Ag(e)}];},Ug=function Ug(e,t,o){return ["Dropdown",{title:function title(e){return e[t];},options:Ag(e,{defaultKey:"labelNone",defaultOptions:{icon:'<g stroke="currentColor" stroke-linecap="round" stroke-width=".125em"><path d="M5,12 H14"/></g>'}}),optionIconStyle:o}];},Gg=function Gg(e){return Ug(e,"shapeTitleLineStart","transform: scaleX(-1)");},Zg=function Zg(e){return Ug(e,"shapeTitleLineEnd");},Xg=function Xg(e){return ["Dropdown",{title:function title(e){return e.shapeTitleFontStyle;},optionLabelStyle:function optionLabelStyle(e){return e&&"font-style:".concat(e[0],";font-weight:").concat(e[1]);},options:Ag(e,{defaultKey:"shapeLabelFontStyleNormal"})}];},Yg=function Yg(e){return ["ShorthandControl",e];},qg=function qg(e,t,o,i){i||e.find(function(_ref364){var _ref365=_slicedToArray(_ref364,1),e=_ref365[0];return e===o;})||(i={defaultKey:"labelAuto",defaultValue:o});var n=K$(e);return ["Dropdown",_objectSpread2({title:t,options:Ag(n,i)},i)];},Kg=function Kg(e,t){return qg(e,function(e){return e.shapeTitleFontSize;},"4%",t);},Jg=function Jg(e,t){return qg(e,function(e){return e.shapeTitleLineHeight;},"120%",t);},Qg=function Qg(e){return ["RadioGroup",{title:function title(e){return e.shapeTitleTextAlign;},options:Ag(e)}];},ef={colorOptions:function colorOptions(){return wg({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]});},lineEndStyleOptions:function lineEndStyleOptions(){return Ig(["bar","arrow","arrowSolid","circle","circleSolid","square","squareSolid"]);},fontFamilyOptions:function fontFamilyOptions(){return Pg([["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"]]);},fontStyleOptions:function fontStyleOptions(){return Eg([["normal","bold"],["italic","normal"],["italic","bold"]]);},textAlignOptions:function textAlignOptions(){return ["left","center","right"].map(function(e){return [e,function(t){return t["shapeTitleTextAlign"+U$(e)];},{hideLabel:!0,icon:function icon(t){return t["shapeIconTextAlign"+U$(e)];}}];});},strokeWidthOptions:function strokeWidthOptions(){return Rg({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"});},brushSizeOptions:function brushSizeOptions(){return Rg(Object.entries({extraSmall:"0.25%",small:"0.5%",mediumSmall:"1%",medium:"1.75%",mediumLarge:"2.5%",large:"3.5%",extraLarge:"5%"}).reduce(function(e,_ref366){var _ref367=_slicedToArray(_ref366,2),t=_ref367[0],o=_ref367[1];return e[t]=2*parseFloat(o)+"%",e;},{}));},fontSizeOptions:function fontSizeOptions(){return kg({extraSmall:"2%",small:"4%",mediumSmall:"8%",medium:"10%",mediumLarge:"15%",large:"20%",extraLarge:"25%"});},lineHeightOptions:function lineHeightOptions(){return Tg({extraSmall:"40%",small:"60%",mediumSmall:"100%",medium:"120%",mediumLarge:"140%",large:"180%",extraLarge:"220%"});}},tf=new Intl.NumberFormat("default",{minimumFractionDigits:1,maximumFractionDigits:1}),of=function of(e,t){return T(t)?e+"%":e;},nf=function nf(e,t,o,i){return T(i)?Math.round(e/o*100)+"%":""+tf.format(e);},rf={getValue:function getValue(e){return parseFloat(e);},setValue:of,label:nf,step:.05,labelClass:"PinturaPercentageLabel"},af={factory:Yg,options:{title:"Text shadow",controls:[["ToggleSlider","x",_objectSpread2(_objectSpread2({},rf),{},{min:-100,max:100,labelPrefix:"X"})],["ToggleSlider","y",_objectSpread2(_objectSpread2({},rf),{},{min:-100,max:100,labelPrefix:"Y"})],["ToggleSlider","blur",_objectSpread2(_objectSpread2({},rf),{},{min:0,max:25,labelPrefix:function labelPrefix(e){return e.shapeTitleTextShadowBlur;}})],["ColorPicker","color",{enablePresets:!1}]]}},sf={defaultColor:{factory:Bg,items:"colorOptions"},defaultNumber:{factory:zg},defaultPercentage:{factory:zg,options:{getValue:function getValue(e){return parseFloat(e);},setValue:function setValue(e){return e+"%";},step:.05,label:function label(e,t,o){return Math.round(e/o*100)+"%";},labelClass:"PinturaPercentageLabel"}},backgroundColor:{items:"colorOptions",factory:Vg},strokeColor:{items:"colorOptions",factory:Ng},strokeWidth:{items:"strokeWidthOptions",factory:Hg},brushSize:{items:"brushSizeOptions",factory:rg},drawMode:{factory:ng},lineStart:{items:"lineEndStyleOptions",factory:Gg},lineEnd:{items:"lineEndStyleOptions",factory:Zg},color:{items:"colorOptions",factory:_g},fontFamily:{items:"fontFamilyOptions",factory:Dg},fontStyle_fontWeight:{items:"fontStyleOptions",factory:Xg},fontSize:{items:"fontSizeOptions",factory:Kg},lineHeight:{items:"lineHeightOptions",factory:Jg},textAlign:{items:"textAlignOptions",factory:Qg},textShadowX_textShadowY_textShadowBlur_textShadowColor:af,textOutlineWidth_textOutlineColor:{factory:Yg,options:{title:"Text outline",controls:[["ToggleSlider","width",{getValue:function getValue(e){return parseFloat(e);},setValue:of,label:nf,min:0,max:15,step:.05,labelClass:"PinturaPercentageLabel",labelPrefix:function labelPrefix(e){return e.shapeTitleTextOutlineWidth;}}],["ColorPicker","color",{enablePresets:!1}]]}},cornerRadius:{factory:"defaultPercentage",options:{min:0,max:50,title:function title(e){return e.shapeTitleCornerRadius;}}},frameColor:{factory:"defaultColor"},frameSize:{factory:"defaultPercentage",options:{min:.2,max:10,title:function title(e){return e.labelSize;}}},frameInset:{factory:"defaultPercentage",options:{min:.5,max:10,title:function title(e){return e.labelOffset;}}},frameOffset:{factory:"defaultPercentage",options:{min:.5,max:10,title:function title(e){return e.labelOffset;}}},frameRadius:{factory:"defaultPercentage",options:{min:.5,max:10,title:function title(e){return e.labelRadius;}}},frameAmount:{factory:"defaultNumber",options:{min:1,max:5,step:1,title:function title(e){return e.labelAmount;}}}},lf=function lf(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=_objectSpread2(_objectSpread2({},sf),e),o={};return Object.entries(t).forEach(function(_ref368){var _ref369=_slicedToArray(_ref368,2),e=_ref369[0],i=_ref369[1];if(!/Options$/.test(e))if(sf[e]&&S(i)&&!Do(i)){var _t$e2=t[e],_i78=_t$e2.component,_n41=_t$e2.factory,_r30=_t$e2.items,_t$e$options2=_t$e2.options,_a16=_t$e$options2===void 0?{}:_t$e$options2;if(T(_n41))o[e]=[_n41,_a16];else {var _s18=sf[e].items;var _l18=T(_s18)?t[_s18]||ef[_s18]():void 0;T(_r30)&&ef[_r30]?_l18=t[_r30]?t[_r30].every(function(e){return !Array.isArray(e);})?t[_r30].map(function(e){return [e,e];}):t[_r30]:ef[_r30]():(_r30||_a16.items)&&(_l18=_r30||_a16.items);var _c21=_n41||sf[e].factory;M(_c21)?o[e]=_l18?_c21(_l18,_a16):_c21(_a16):_i78&&(o[e]=[_i78,_objectSpread2(_objectSpread2({},_a16),{},{items:_r30})]);}}else o[e]=i;}),o;};function cf(e){var t,o,_i79,n,r;var a=e[7].default,s=lr(a,e,e[6],null);return {c:function c(){t=Rr("div"),o=Rr("div"),s&&s.c(),Dr(o,"class","PinturaToolbarInner"),Dr(t,"class","PinturaToolbar"),Dr(t,"data-layout",e[1]),Dr(t,"data-overflow",e[0]);},m:function m(a,l){Tr(a,t,l),Sr(t,o),s&&s.m(o,null),_i79=!0,n||(r=[Lr(o,"measure",e[3]),gr(Mc.call(null,o)),Lr(t,"measure",e[2]),gr(Mc.call(null,t))],n=!0);},p:function p(e,_ref370){var _ref371=_slicedToArray(_ref370,1),o=_ref371[0];s&&s.p&&(!_i79||64&o)&&ur(s,a,e,e[6],_i79?dr(a,e[6],o,null):hr(e[6]),null),(!_i79||2&o)&&Dr(t,"data-layout",e[1]),(!_i79||1&o)&&Dr(t,"data-overflow",e[0]);},i:function i(e){_i79||(ka(s,e),_i79=!0);},o:function o(e){Ca(s,e),_i79=!1;},d:function d(e){e&&Mr(t),s&&s.d(e),n=!1,or(r);}};}function df(e,t,o){var i,n,_t$$$slots13=t.$$slots,r=_t$$$slots13===void 0?{}:_t$$$slots13,a=t.$$scope,s=0,l=0,c=0;var d=function d(){o(0,n="compact"===i&&s>c?"overflow":void 0);};return e.$$set=function(e){"$$scope"in e&&o(6,a=e.$$scope);},e.$$.update=function(){48&e.$$.dirty&&o(1,i=l>c?"compact":"default");},[n,i,function(_ref372){var e=_ref372.detail;var t=e.width;o(5,c=t),d();},function(_ref373){var e=_ref373.detail;var t=e.width;t>l&&o(4,l=t),s=t,n||d();},l,c,a,r];}var uf=/*#__PURE__*/function(_Wa30){function uf(e){var _this33;_classCallCheck(this,uf);_this33=_callSuper(this,uf),Ba(_assertThisInitialized(_this33),e,df,cf,nr,{});return _this33;}_inherits(uf,_Wa30);return _createClass(uf);}(Wa);function hf(e){var t,_o111,i,n;var r=e[5].default,a=lr(r,e,e[4],null);return {c:function c(){t=Rr("div"),a&&a.c(),Dr(t,"class",e[0]);},m:function m(r,s){Tr(r,t,s),a&&a.m(t,null),_o111=!0,i||(n=[Lr(t,"measure",function(){ir(e[1]&&e[3])&&(e[1]&&e[3]).apply(this,arguments);}),gr(e[2].call(null,t))],i=!0);},p:function p(i,_ref374){var _ref375=_slicedToArray(_ref374,1),n=_ref375[0];e=i,a&&a.p&&(!_o111||16&n)&&ur(a,r,e,e[4],_o111?dr(r,e[4],n,null):hr(e[4]),null),(!_o111||1&n)&&Dr(t,"class",e[0]);},i:function i(e){_o111||(ka(a,e),_o111=!0);},o:function o(e){Ca(a,e),_o111=!1;},d:function d(e){e&&Mr(t),a&&a.d(e),i=!1,or(n);}};}function pf(e,t,o){var _t$$$slots14=t.$$slots,i=_t$$$slots14===void 0?{}:_t$$$slots14,n=t.$$scope;var r=ea();var _t$class=t.class,a=_t$class===void 0?null:_t$class;var s=oa("measurable");var l=!1;return Kr(function(){return o(1,l=!0);}),e.$$set=function(e){"class"in e&&o(0,a=e.class),"$$scope"in e&&o(4,n=e.$$scope);},[a,l,s,function(_ref376){var e=_ref376.detail;return r("measure",e);},n,i];}var mf=/*#__PURE__*/function(_Wa31){function mf(e){var _this34;_classCallCheck(this,mf);_this34=_callSuper(this,mf),Ba(_assertThisInitialized(_this34),e,pf,hf,nr,{class:0});return _this34;}_inherits(mf,_Wa31);return _createClass(mf);}(Wa);var $f=function $f(e){return {};},gf=function gf(e){return {};},ff=function ff(e){return {};},yf=function yf(e){return {};},bf=function bf(e){return {};},xf=function xf(e){return {};};function vf(e){var t,_o112;var i=e[4].header,n=lr(i,e,e[3],xf);return {c:function c(){t=Rr("div"),n&&n.c(),Dr(t,"class","PinturaUtilHeader");},m:function m(e,i){Tr(e,t,i),n&&n.m(t,null),_o112=!0;},p:function p(e,t){n&&n.p&&(!_o112||8&t)&&ur(n,i,e,e[3],_o112?dr(i,e[3],t,bf):hr(e[3]),xf);},i:function i(e){_o112||(ka(n,e),_o112=!0);},o:function o(e){Ca(n,e),_o112=!1;},d:function d(e){e&&Mr(t),n&&n.d(e);}};}function wf(e){var t,_o113;var i=e[4].footer,n=lr(i,e,e[3],gf);return {c:function c(){t=Rr("div"),n&&n.c(),Dr(t,"class","PinturaUtilFooter");},m:function m(e,i){Tr(e,t,i),n&&n.m(t,null),_o113=!0;},p:function p(e,t){n&&n.p&&(!_o113||8&t)&&ur(n,i,e,e[3],_o113?dr(i,e[3],t,$f):hr(e[3]),gf);},i:function i(e){_o113||(ka(n,e),_o113=!0);},o:function o(e){Ca(n,e),_o113=!1;},d:function d(e){e&&Mr(t),n&&n.d(e);}};}function Sf(e){var t,o,i,n,r,a,s=e[1]&&vf(e);var l=e[4].main,c=lr(l,e,e[3],yf),_d17=c||function(e){var t,_o114;return t=new mf({props:{class:"PinturaStage"}}),t.$on("measure",e[5]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o114=!0;},p:Kn,i:function i(e){_o114||(ka(t.$$.fragment,e),_o114=!0);},o:function o(e){Ca(t.$$.fragment,e),_o114=!1;},d:function d(e){Oa(t,e);}};}(e);var u=e[2]&&wf(e);return {c:function c(){s&&s.c(),t=Ir(),o=Rr("div"),_d17&&_d17.c(),i=Ir(),u&&u.c(),n=Ir(),r=Ar(),Dr(o,"class","PinturaUtilMain");},m:function m(l,c){s&&s.m(l,c),Tr(l,t,c),Tr(l,o,c),_d17&&_d17.m(o,null),e[6](o),Tr(l,i,c),u&&u.m(l,c),Tr(l,n,c),Tr(l,r,c),a=!0;},p:function p(e,_ref377){var _ref378=_slicedToArray(_ref377,1),o=_ref378[0];e[1]?s?(s.p(e,o),2&o&&ka(s,1)):(s=vf(e),s.c(),ka(s,1),s.m(t.parentNode,t)):s&&(wa(),Ca(s,1,1,function(){s=null;}),Sa()),c&&c.p&&(!a||8&o)&&ur(c,l,e,e[3],a?dr(l,e[3],o,ff):hr(e[3]),yf),e[2]?u?(u.p(e,o),4&o&&ka(u,1)):(u=wf(e),u.c(),ka(u,1),u.m(n.parentNode,n)):u&&(wa(),Ca(u,1,1,function(){u=null;}),Sa());},i:function i(e){a||(ka(s),ka(_d17,e),ka(u),ka(false),a=!0);},o:function o(e){Ca(s),Ca(_d17,e),Ca(u),Ca(false),a=!1;},d:function d(a){s&&s.d(a),a&&Mr(t),a&&Mr(o),_d17&&_d17.d(a),e[6](null),a&&Mr(i),u&&u.d(a),a&&Mr(n),a&&Mr(r);}};}function kf(e,t,o){var _t96=t,_t96$$$slots=_t96.$$slots,i=_t96$$$slots===void 0?{}:_t96$$$slots,n=_t96.$$scope,_t97=t,_t97$hasHeader=_t97.hasHeader,r=_t97$hasHeader===void 0?!!t.$$slots.header:_t97$hasHeader,_t98=t,_t98$hasFooter=_t98.hasFooter,a=_t98$hasFooter===void 0?!!t.$$slots.footer:_t98$hasFooter,_t99=t,s=_t99.root;return e.$$set=function(e){o(7,t=Qn(Qn({},t),pr(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=pr(t),[s,r,a,n,i,function(t){ia.call(this,e,t);},function(e){ra[e?"unshift":"push"](function(){s=e,o(0,s);});}];}var Cf=/*#__PURE__*/function(_Wa32){function Cf(e){var _this35;_classCallCheck(this,Cf);_this35=_callSuper(this,Cf),Ba(_assertThisInitialized(_this35),e,kf,Sf,nr,{hasHeader:1,hasFooter:2,root:0});return _this35;}_inherits(Cf,_Wa32);return _createClass(Cf);}(Wa);function Tf(e){var t,o;return {c:function c(){t=Rr("div"),Dr(t,"class","PinturaRangeInputMeter"),Dr(t,"style",o="transform: translateX(".concat(e[9].x-e[12].x,"px) translateY(").concat(e[9].y-e[12].y,"px)"));},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[7];},p:function p(e,i){128&i[0]&&(t.innerHTML=e[7]),512&i[0]&&o!==(o="transform: translateX(".concat(e[9].x-e[12].x,"px) translateY(").concat(e[9].y-e[12].y,"px)"))&&Dr(t,"style",o);},d:function d(e){e&&Mr(t);}};}function Mf(e){var t,o,i,n,r,a,s,l,c,_d18,u,h=e[9]&&Tf(e);return {c:function c(){t=Rr("div"),o=Rr("span"),i=Ir(),n=Rr("button"),r=Er(e[1]),s=Ir(),l=Rr("div"),h&&h.c(),Dr(o,"class","PinturaRangeInputValue"),Dr(n,"class","PinturaRangeInputReset"),Dr(n,"type","button"),n.disabled=a=e[0]===e[2],Dr(l,"class","PinturaRangeInputInner"),Dr(l,"style",e[8]),Dr(l,"data-value-limited",e[5]),Dr(t,"class","PinturaRangeInput"),Dr(t,"tabindex","0");},m:function m(a,p){Tr(a,t,p),Sr(t,o),o.innerHTML=e[3],Sr(t,i),Sr(t,n),Sr(n,r),Sr(t,s),Sr(t,l),h&&h.m(l,null),_d18||(u=[Lr(n,"click",e[17]),Lr(l,"interactionstart",e[13]),Lr(l,"interactionupdate",e[15]),Lr(l,"interactionend",e[16]),Lr(l,"interactionrelease",e[14]),gr(c=Sd.call(null,l,{inertia:e[6]})),Lr(l,"measure",e[37]),gr(Mc.call(null,l)),Lr(t,"wheel",e[19],{passive:!1}),Lr(t,"nudge",e[20]),gr(kd.call(null,t,{direction:"horizontal",preventDefault:!0}))],_d18=!0);},p:function p(e,t){8&t[0]&&(o.innerHTML=e[3]),2&t[0]&&Wr(r,e[1]),5&t[0]&&a!==(a=e[0]===e[2])&&(n.disabled=a),e[9]?h?h.p(e,t):(h=Tf(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null),256&t[0]&&Dr(l,"style",e[8]),32&t[0]&&Dr(l,"data-value-limited",e[5]),c&&ir(c.update)&&64&t[0]&&c.update.call(null,{inertia:e[6]});},i:Kn,o:Kn,d:function d(e){e&&Mr(t),h&&h.d(),_d18=!1,or(u);}};}function Rf(e,t,o){var i,r,a,s,l,c,d,u,h,p,_t$labelReset=t.labelReset,m=_t$labelReset===void 0?"Reset":_t$labelReset,_t$direction2=t.direction,$=_t$direction2===void 0?"x":_t$direction2,_t$min3=t.min,g=_t$min3===void 0?0:_t$min3,_t$max3=t.max,f=_t$max3===void 0?1:_t$max3,_t$base=t.base,y=_t$base===void 0?g:_t$base,_t$value2=t.value,b=_t$value2===void 0?0:_t$value2,_t$valueLabel=t.valueLabel,x=_t$valueLabel===void 0?0:_t$valueLabel,v=t.valueMin,w=t.valueMax,_t$oninputstart=t.oninputstart,S=_t$oninputstart===void 0?n:_t$oninputstart,_t$oninputmove=t.oninputmove,k=_t$oninputmove===void 0?n:_t$oninputmove,_t$oninputend=t.oninputend,C=_t$oninputend===void 0?n:_t$oninputend,_t$elasticity3=t.elasticity,T=_t$elasticity3===void 0?0:_t$elasticity3,M=t.nudgeMultiplier,_t$step2=t.step,R=_t$step2===void 0?8:_t$step2;var P=oa("isAnimated");sr(e,P,function(e){return o(6,u=e);});var E=oa("fixScrollDirection");sr(e,E,function(e){return o(43,h=e);});var I=function I(e,t,o){return Math.ceil((e-o)/t)*t+o;};var A,L,z;var F={x:2,y:0},D=function D(e,t,o){return "M ".concat(e-o," ").concat(t," a ").concat(o," ").concat(o," 0 1 0 0 -1");};var O,B=void 0,W=!1,V={snap:!1,elastic:!1};var _=function _(e,t,o){var i=e[$]+t[$],n=ls(i,O[1][$],O[0][$]),r=T?n+Cd(i-n,T):n,a=o.elastic?r:n,s=he(0,0);return s[$]=a,N.set(s,{hard:o.snap}),ls(j(s,$),g,f);},N=uc();sr(e,N,function(e){return o(9,p=e);});var H=function H(e,t){var o=.5*(A[t]-s[t])-(wh(e,g,f)*s[t]-.5*s[t]);return {x:"x"===t?o:0,y:"y"===t?o:0};},j=function j(e,t){var o=-(e[t]-.5*A[t])/s[t];return g+o*i;},U=N.subscribe(function(e){e&&B&&k(ls(j(e,$),g,f));}),G=function G(e){var t=[H(null!=v?v:g,$),H(null!=w?w:f,$)],o={x:"x"===$?p.x+e:0,y:"y"===$?p.y+e:0},i=ls(o[$],t[1][$],t[0][$]),n=_objectSpread2(_objectSpread2({},p),{},_defineProperty({},$,i));$r(N,p=n,p);var r=ls(j(n,$),g,f);S(),k(r),C(r);};Qr(function(){U();});return e.$$set=function(e){"labelReset"in e&&o(1,m=e.labelReset),"direction"in e&&o(21,$=e.direction),"min"in e&&o(22,g=e.min),"max"in e&&o(23,f=e.max),"base"in e&&o(2,y=e.base),"value"in e&&o(0,b=e.value),"valueLabel"in e&&o(3,x=e.valueLabel),"valueMin"in e&&o(24,v=e.valueMin),"valueMax"in e&&o(25,w=e.valueMax),"oninputstart"in e&&o(26,S=e.oninputstart),"oninputmove"in e&&o(27,k=e.oninputmove),"oninputend"in e&&o(28,C=e.oninputend),"elasticity"in e&&o(29,T=e.elasticity),"nudgeMultiplier"in e&&o(30,M=e.nudgeMultiplier),"step"in e&&o(31,R=e.step);},e.$$.update=function(){if(12582912&e.$$.dirty[0]&&o(33,i=f-g),20971520&e.$$.dirty[0]&&o(35,r=null!=v?Math.max(v,g):g),41943040&e.$$.dirty[0]&&o(34,a=null!=w?Math.min(w,f):f),12582916&e.$$.dirty[0]&&o(36,l=wh(y,g,f)),16&e.$$.dirty[0]|32&e.$$.dirty[1]&&A){var _e124=.5*A.y;var _t100,_i80=40*l,_n42="",_r31=A.y,_a17="";for(var _o116=0;_o116<=40;_o116++){var _r32=F.x+10*_o116,_s19=_e124;_n42+=D(_r32,_s19,_o116%5==0?2:.75)+" ",_t100=_r32+F.x,_o116===_i80&&(_a17="<path d=\"M".concat(_r32," ").concat(_s19-4," l2 3 l-2 -1 l-2 1 z\"/>"));}o(7,L="<svg width=\"".concat(_t100,"\" height=\"").concat(_r31,"\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 ").concat(_t100," ").concat(_r31,"\" aria-hidden=\"true\" focusable=\"false\">\n ").concat(_a17,"\n <rect rx=\"4\" ry=\"4\" y=\"").concat(_e124-4,"\"\" height=\"8\"/>\n <path fill-rule=\"evenodd\" d=\"").concat(_n42.trim(),"\"/></svg>")),o(32,z={x:_t100-2*F.x,y:_r31});}16&e.$$.dirty[0]|2&e.$$.dirty[1]&&(s=A&&z),12582912&e.$$.dirty[0]|24&e.$$.dirty[1]&&o(5,c=r!==g||a!==f),32&e.$$.dirty[0]|24&e.$$.dirty[1]&&o(8,d=c?function(e,t){var o=1/40,i=wh(e,g,f),n=wh(t,g,f);return "--range-mask-from:".concat(100*le(I(i,o,0)-.0125),"%;--range-mask-to:").concat(100*le(I(n,o,0)-.0125),"%");}(r,a):""),2097233&e.$$.dirty[0]|4&e.$$.dirty[1]&&i&&A&&A.x&&A.y&&N.set(H(b,$),{hard:!1===u});},[b,m,y,x,A,c,u,L,d,p,P,E,F,function(){W=!1,B=ar(N),O=[H(null!=v?v:g,$),H(null!=w?w:f,$)],S();},function(){W=!0;},function(_ref379){var e=_ref379.detail;V.snap=!W,V.elastic=!W,_(B,e.translation,V);},function(_ref380){var e=_ref380.detail;V.snap=!1,V.elastic=!1;var t=_(B,e.translation,V);if(B=void 0,O=void 0,Math.abs(t-y)<.01)return C(y);C(t);},function(){o(0,b=ls(y,r,a)),S(),C(b);},N,function(e){e.preventDefault(),e.stopPropagation();var t=Pd(e,{fixScrollDirection:h})*R;G(t);},function(_ref381){var e=_ref381.detail;G(e[$]*Math.abs(M||8));},$,g,f,v,w,S,k,C,T,M,R,z,i,a,r,l,function(e){return o(4,A=function(e){return he(e.width,e.height);}(e.detail));}];}var Pf=/*#__PURE__*/function(_Wa33){function Pf(e){var _this36;_classCallCheck(this,Pf);_this36=_callSuper(this,Pf),Ba(_assertThisInitialized(_this36),e,Rf,Mf,nr,{labelReset:1,direction:21,min:22,max:23,base:2,value:0,valueLabel:3,valueMin:24,valueMax:25,oninputstart:26,oninputmove:27,oninputend:28,elasticity:29,nudgeMultiplier:30,step:31},null,[-1,-1]);return _this36;}_inherits(Pf,_Wa33);return _createClass(Pf);}(Wa);var Ef=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Q,function(e){return {x:e.x,y:e.y};}),ne,function(e){return {x:e.x+e.width,y:e.y};}),ee,function(e){return {x:e.x+e.width,y:e.y};}),re,function(e){return {x:e.x+e.width,y:e.y+e.height};}),te,function(e){return {x:e.x,y:e.y+e.height};}),ae,function(e){return {x:e.x,y:e.y+e.height};}),oe,function(e){return {x:e.x,y:e.y};}),ie,function(e){return {x:e.x,y:e.y};});function If(e,t,o){var 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 Af(e,t){var o,i,n,r,a,s,l,c;return {key:e,first:null,c:function c(){o=Rr("div"),Dr(o,"role","button"),Dr(o,"aria-label",i="Drag ".concat(t[17]," ").concat(t[14])),Dr(o,"tabindex",n="edge"===t[17]?-1:0),Dr(o,"class","PinturaRectManipulator"),Dr(o,"data-direction",r=t[14]),Dr(o,"data-shape",a=""+("edge"===t[17]?"edge":""+t[0])),Dr(o,"style",s="--tx:".concat(t[15].x,";--ty:").concat(t[15].y,";--sx:").concat(t[16].x,";--sy:").concat(t[16].y,";opacity:").concat(t[18])),this.first=o;},m:function m(e,i){Tr(e,o,i),l||(c=[Lr(o,"nudge",function(){ir(t[6](t[14]))&&t[6](t[14]).apply(this,arguments);}),gr(kd.call(null,o,{preventDefault:!0})),Lr(o,"interactionstart",function(){ir(t[5]("resizestart",t[14]))&&t[5]("resizestart",t[14]).apply(this,arguments);}),Lr(o,"interactionupdate",function(){ir(t[5]("resizemove",t[14]))&&t[5]("resizemove",t[14]).apply(this,arguments);}),Lr(o,"interactionend",function(){ir(t[5]("resizeend",t[14]))&&t[5]("resizeend",t[14]).apply(this,arguments);}),gr(Sd.call(null,o))],l=!0);},p:function p(e,l){t=e,2&l&&i!==(i="Drag ".concat(t[17]," ").concat(t[14]))&&Dr(o,"aria-label",i),2&l&&n!==(n="edge"===t[17]?-1:0)&&Dr(o,"tabindex",n),2&l&&r!==(r=t[14])&&Dr(o,"data-direction",r),3&l&&a!==(a=""+("edge"===t[17]?"edge":""+t[0]))&&Dr(o,"data-shape",a),2&l&&s!==(s="--tx:".concat(t[15].x,";--ty:").concat(t[15].y,";--sx:").concat(t[16].x,";--sy:").concat(t[16].y,";opacity:").concat(t[18]))&&Dr(o,"style",s);},d:function d(e){e&&Mr(o),l=!1,or(c);}};}function Lf(e){var t,o=[],i=new Map(),n=e[1];var r=function r(e){return e[14];};for(var _t102=0;_t102<n.length;_t102+=1){var _a18=If(e,n,_t102),_s20=r(_a18);i.set(_s20,o[_t102]=Af(_s20,_a18));}return {c:function c(){for(var _e128=0;_e128<o.length;_e128+=1)o[_e128].c();t=Ar();},m:function m(e,i){for(var _t104=0;_t104<o.length;_t104+=1)o[_t104].m(e,i);Tr(e,t,i);},p:function p(e,_ref382){var _ref383=_slicedToArray(_ref382,1),a=_ref383[0];99&a&&(n=e[1],o=Ia(o,a,r,1,e,n,i,t.parentNode,Pa,Af,t,If));},i:Kn,o:Kn,d:function d(e){for(var _t106=0;_t106<o.length;_t106+=1)o[_t106].d(e);e&&Mr(t);}};}function zf(e,t,o){var i,n,r,a,_t$rect=t.rect,s=_t$rect===void 0?null:_t$rect,_t$visible=t.visible,l=_t$visible===void 0?!1:_t$visible,c=t.style;var d=oa("isAnimated");sr(e,d,function(e){return o(11,a=e);});var u=uc(void 0,{precision:1e-4,stiffness:.2,damping:.4});sr(e,u,function(e){return o(10,r=e);});var h=uc(0,{precision:.001});var p;sr(e,h,function(e){return o(9,n=e);});var m=ea();return e.$$set=function(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=function(){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(J).map(function(e,t){var o=J[e],i=Ef[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?ls(r,.5,1.25):1,y:/^(r|l)$/.test(o)?s.height:l?ls(r,.5,1.25):1},translate:{x:i.x,y:i.y},opacity:n};}));},[c,i,d,u,h,function(e,t){return function(_ref384){var o=_ref384.detail;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}));};},function(e){return function(_ref385){var t=_ref385.detail;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];}var Ff=/*#__PURE__*/function(_Wa34){function Ff(e){var _this37;_classCallCheck(this,Ff);_this37=_callSuper(this,Ff),Ba(_assertThisInitialized(_this37),e,zf,Lf,nr,{rect:7,visible:8,style:0});return _this37;}_inherits(Ff,_Wa34);return _createClass(Ff);}(Wa);var Df=function Df(e){function t(t,o){e.dispatchEvent(new CustomEvent(t,{detail:o}));}var o=function o(_o117){_o117.preventDefault(),e.addEventListener("gesturechange",i),e.addEventListener("gestureend",n),t("gesturedown");},i=function i(e){e.preventDefault(),t("gestureupdate",e.scale);},n=function n(e){t("gestureup",e.scale),e.preventDefault(),r();},r=function r(){e.removeEventListener("gesturechange",i),e.removeEventListener("gestureend",n);};return e.addEventListener("gesturestart",o),{destroy:function destroy(){r(),e.removeEventListener("gesturestart",o);}};},Of=_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({},Q,te),ee,oe),te,Q),oe,ee),ie,re),ne,ae),re,ie),ae,ne),Bf=function Bf(e){var t=e===oe||e===ee,o=e===Q||e===te;return [e===ee||e===ne||e===re,e===oe||e===ae||e===ie,e===Q||e===ne||e===ie,e===te||e===re||e===ae,t,o,t||o];},Wf=function Wf(e,t,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var n=t.target,r=t.translate,a=i.aspectRatio,s=i.minSize,l=i.maxSize,c=se[Of[n]],d=we(he(e.x,e.y),he(c[0]*e.width,c[1]*e.height)),u=se[n],h=we(Je(e),he(u[0]*e.width,u[1]*e.height)),_Bf=Bf(n),_Bf2=_slicedToArray(_Bf,7),p=_Bf2[0],m=_Bf2[1],$=_Bf2[2],g=_Bf2[3],f=_Bf2[4],y=_Bf2[5],b=_Bf2[6];var x=r.x,v=r.y;f?v=0:y&&(x=0);var _Vf=Vf(d,n,o,{aspectRatio:a,minSize:s,maxSize:l}),w=_Vf.inner,S=_Vf.outer;var _wt3=wt(e),_wt4=_slicedToArray(_wt3,4),k=_wt4[0],C=_wt4[1],T=_wt4[2],M=_wt4[3];if(p?M=d.x:m&&(C=d.x),g?k=d.y:$&&(T=d.y),p){var _e129=w.x+w.width,_t107=S.x+S.width;C=ls(h.x+x,_e129,_t107);}else if(m){var _e130=S.x,_t108=w.x;M=ls(h.x+x,_e130,_t108);}if(g){var _e131=w.y+w.height,_t109=S.y+S.height;T=ls(h.y+v,_e131,_t109);}else if($){var _e132=S.y,_t110=w.y;k=ls(h.y+v,_e132,_t110);}if(M>w.x&&(M=w.x),C<w.x+w.width&&(C=w.x+w.width),k>w.y&&(k=w.y),T<w.y+w.height&&(T=w.y+w.height),M<S.x){var _e133=S.x-M;M=S.x,C+=_e133;}if(C>S.x+S.width){var _e134=C-(S.x+S.width);C=S.x+S.width,M-=_e134;}if(k<S.y){var _e135=S.y-k;k=S.y,T+=_e135;}if(T>S.y+S.height){var _e136=T-(S.y+S.height);T=S.y+S.height,k-=_e136;}if(a)if(b){var _e137=C-M,_t111=T-k;f?(_t111=_e137/a,k=d.y-.5*_t111,T=d.y+.5*_t111):y&&(_e137=_t111*a,M=d.x-.5*_e137,C=d.x+.5*_e137);}else {var _e138=he(h.x+x-d.x,h.y+v-d.y);n===ne?(_e138.x=Math.max(0,_e138.x),_e138.y=Math.min(0,_e138.y)):n===re?(_e138.x=Math.max(0,_e138.x),_e138.y=Math.max(0,_e138.y)):n===ae?(_e138.x=Math.min(0,_e138.x),_e138.y=Math.max(0,_e138.y)):n===ie&&(_e138.x=Math.min(0,_e138.x),_e138.y=Math.min(0,_e138.y));var _t112=fe(_e138),_o118=fe(he(w.width,w.height)),_i81=fe(he(S.width,S.height)),_r33=ls(_t112,_o118,_i81),_s21=he(a,1),_l19=Ce(ye(_s21),_r33);n===ne?(C=d.x+_l19.x,k=d.y-_l19.y):n===re?(C=d.x+_l19.x,T=d.y+_l19.y):n===ae?(M=d.x-_l19.x,T=d.y+_l19.y):n===ie&&(M=d.x-_l19.x,k=d.y-_l19.y);}return at(M,k,C-M,T-k);};var Vf=function Vf(e,t,o,i){var n=i.aspectRatio,r=i.minSize,a=i.maxSize,s=t===ee||t===ne||t===re,l=t===oe||t===ae||t===ie,c=t===Q||t===ne||t===ie,d=t===te||t===re||t===ae,u=t===oe||t===ee,h=t===Q||t===te,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);var m=function(e,t){return Ke(0,0,e,t);}(Math.min(p.width,a.width),Math.min(p.height,a.height));if(n)if(u){var _t113=Math.min(e.y,o.height-e.y);m.height=Math.min(2*_t113,m.height);}else if(h){var _t114=Math.min(e.x,o.width-e.x);m.width=Math.min(2*_t114,m.width);}var $=n?Oe(xt(et(r),n)):r,g=n?Oe(vt(m,n)):m;var f,y,b,x;s?f=e.x:l&&(y=e.x),d?b=e.y:c&&(x=e.y),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);var v=it([he(f,b),he(y,x)]);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),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:it([he(f,b),he(y,x)])};};var _f=function _f(e){return 180*e/Math.PI;};function Nf(e){var t,_o119,_i82;return _o119=new Pf({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(_f(e[11]))+"&deg;",oninputstart:e[2],oninputmove:e[17],oninputend:e[18]}}),{c:function c(){t=Rr("div"),Fa(_o119.$$.fragment),Dr(t,"class","PinturaImageRotator");},m:function m(e,n){Tr(e,t,n),Da(_o119,t,null),_i82=!0;},p:function p(e,_ref386){var _ref387=_slicedToArray(_ref386,1),t=_ref387[0];var 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(_f(e[11]))+"&deg;"),4&t&&(i.oninputstart=e[2]),392&t&&(i.oninputmove=e[17]),400&t&&(i.oninputend=e[18]),_o119.$set(i);},i:function i(e){_i82||(ka(_o119.$$.fragment,e),_i82=!0);},o:function o(e){Ca(_o119.$$.fragment,e),_i82=!1;},d:function d(e){e&&Mr(t),Oa(_o119);}};}function Hf(e,t,o){var i,r,a,s,l,c,d,u=t.rotation,h=t.valueMin,p=t.valueMax,_t$oninputstart2=t.oninputstart,m=_t$oninputstart2===void 0?n:_t$oninputstart2,_t$oninputmove2=t.oninputmove,$=_t$oninputmove2===void 0?n:_t$oninputmove2,_t$oninputend2=t.oninputend,g=_t$oninputend2===void 0?n:_t$oninputend2,_t$elasticity4=t.elasticity,f=_t$elasticity4===void 0?0:_t$elasticity4,y=t.labelReset,b=t.rotationMin,x=t.rotationMax;return e.$$set=function(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,$=e.oninputmove),"oninputend"in e&&o(4,g=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=function(){16384&e.$$.dirty&&o(9,i=b+1e-9),32768&e.$$.dirty&&o(10,r=x-1e-9),1536&e.$$.dirty&&o(12,a=i+.5*(r-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,r,d,a,u,b,x,s,function(e){return $(l*c+e);},function(e){return g(l*c+e);}];}var jf=/*#__PURE__*/function(_Wa35){function jf(e){var _this38;_classCallCheck(this,jf);_this38=_callSuper(this,jf),Ba(_assertThisInitialized(_this38),e,Hf,Nf,nr,{rotation:13,valueMin:0,valueMax:1,oninputstart:2,oninputmove:3,oninputend:4,elasticity:5,labelReset:6,rotationMin:14,rotationMax:15});return _this38;}_inherits(jf,_Wa35);return _createClass(jf);}(Wa);function Uf(e){var t,o,i,n,r;return {c:function c(){t=Rr("div"),o=Rr("p"),i=Er(e[0]),n=Er(" × "),r=Er(e[1]),Dr(t,"class","PinturaImageInfo");},m:function m(e,a){Tr(e,t,a),Sr(t,o),Sr(o,i),Sr(o,n),Sr(o,r);},p:function p(e,_ref388){var _ref389=_slicedToArray(_ref388,1),t=_ref389[0];1&t&&Wr(i,e[0]),2&t&&Wr(r,e[1]);},i:Kn,o:Kn,d:function d(e){e&&Mr(t);}};}function Gf(e,t,o){var i=t.width,n=t.height;return e.$$set=function(e){"width"in e&&o(0,i=e.width),"height"in e&&o(1,n=e.height);},[i,n];}var Zf=/*#__PURE__*/function(_Wa36){function Zf(e){var _this39;_classCallCheck(this,Zf);_this39=_callSuper(this,Zf),Ba(_assertThisInitialized(_this39),e,Gf,Uf,nr,{width:0,height:1});return _this39;}_inherits(Zf,_Wa36);return _createClass(Zf);}(Wa);function Xf(e){var t,_o120;return t=new Xu({props:{class:"PinturaPresetListFilter",layout:"row",options:e[8],selectedIndex:e[7],onchange:e[10]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o120=!0;},p:function p(e,o){var i={};256&o&&(i.options=e[8]),128&o&&(i.selectedIndex=e[7]),t.$set(i);},i:function i(e){_o120||(ka(t.$$.fragment,e),_o120=!0);},o:function o(e){Ca(t.$$.fragment,e),_o120=!1;},d:function d(e){Oa(t,e);}};}function Yf(e){var t,_o121;return t=new fh({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:[Xf]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o121=!0;},p:function p(e,_ref390){var _ref391=_slicedToArray(_ref390,1),o=_ref391[0];var 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:function i(e){_o121||(ka(t.$$.fragment,e),_o121=!0);},o:function o(e){Ca(t.$$.fragment,e),_o121=!1;},d:function d(e){Oa(t,e);}};}var qf='fill="none" stroke="currentColor"';function Kf(e,t,o){var i,r,a,s=t.icon,l=t.label,c=t.labelClass,d=t.hideLabel,u=t.options,h=t.selectedIndex,p=t.onchange,m=t.optionMapper,_t$filter=t.filter,$=_t$filter===void 0?"landscape":_t$filter,_t$onfilterchange=t.onfilterchange,g=_t$onfilterchange===void 0?n:_t$onfilterchange;var f=function f(e,t,o,i,n){return "\n <rect ".concat(qf," x=\"").concat(e,"\" y=\"").concat(t,"\" width=\"").concat(o,"\" height=\"").concat(i,"\" rx=\"").concat(n,"\"/>");},y=function y(e,t){return "<path ".concat(qf," d=\"M").concat(e," ").concat(t," l2 2 l3 -4\"/>");};return e.$$set=function(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,$=e.filter),"onfilterchange"in e&&o(13,g=e.onfilterchange);},e.$$.update=function(){6144&e.$$.dirty&&o(9,i=function(e,t){return (e||[]).map(function(e){return T(e[0])?(e[1]=e[1].map(t),e):t(e);});}(u,function(e){return function(t){var _t115=_slicedToArray(t,3),o=_t115[0],i=_t115[1],_t115$=_t115[2],n=_t115$===void 0?{}:_t115$;return Lo(o)&&(n.hidden="landscape"===e?o<1:o>1),[o,i,n];};}($))),2048&e.$$.dirty&&o(7,r="landscape"===$?0:1),128&e.$$.dirty&&o(8,a=[["landscape","Landscape",{hideLabel:!0,icon:f(2,6,19,12,2)+(0===r?y(9,12):"")}],["portrait","Portrait",{hideLabel:!0,icon:f(5,3,13,18,2)+(1===r?y(9,12):"")}]]);},[s,l,c,d,h,p,m,r,a,i,function(e){o(11,$=e.value),g(e.value);},$,u,g];}var Jf=/*#__PURE__*/function(_Wa37){function Jf(e){var _this40;_classCallCheck(this,Jf);_this40=_callSuper(this,Jf),Ba(_assertThisInitialized(_this40),e,Kf,Yf,nr,{icon:0,label:1,labelClass:2,hideLabel:3,options:12,selectedIndex:4,onchange:5,optionMapper:6,filter:11,onfilterchange:13});return _this40;}_inherits(Jf,_Wa37);return _createClass(Jf);}(Wa);var Qf=function Qf(e){return ve(e,function(e){return le(e,6);});},ey=function ey(e){return kt(e,function(e){return le(e,6);});},ty=function ty(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1e-4;return Math.abs(e-t)<o;};var oy=function oy(e,t,o,i){var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};var r=n.aspectRatio;e=ey(e),i=i.map(Qf);var a=ut(e,Of[o.target]),s=ve(a,function(e){return le(e,6);}),l=r?xt(n.minSize,r):n.minSize,c=r?vt(n.maxSize,r):n.maxSize,d=ut(t,o.target);if(Pe(d,a)<1){t=Je(e);var _o122=Math.min(l.width/e.width,l.height/e.height);ct(t,_o122,a);}t=dt(Je(t),l,c,a);var u=Je(t);t=ey(t);var h=Lt(i,1),p=St(e),m=St(t),$=p.findIndex(function(e){return xe(ve(e,function(e){return le(e,6);}),s);}),g=function g(e){return h.map(function(t){return Rt(t,e);}).filter(Boolean).pop();};if(r){var _t116=m.map(function(e,t){if(t===$)return;var o=he(a.x-e.x,a.y-e.y);ye(o),Ce(o,.5);var i=he(a.x-o.x,a.y-o.y),n=Ze(i,Qf(e)),r=g(n);if(!r)return;var s=p[t];return {intersection:r,cornerDist:Pe(a,s),intersectionDist:Pe(a,r)};}).filter(Boolean);if(_t116.length){var _o123=_t116.reduce(function(e,t){var o=t.intersectionDist/t.cornerDist;return o<e?o:e;},Number.MAX_SAFE_INTEGER);u=Je(e),ct(u,_o123,a);}}else {var _e139=1===o.target.length,_n43=!(i[0].y===i[1].y||i[0].x===i[1].x),_r34=p.map(function(t,o){if(o===$)return;var i=m[o],r=!ty(i.x,s.x)&&!ty(i.y,s.y);if(!_e139&&!_n43&&r)return;if(_e139&&(ty(i.x,s.x)||ty(i.y,s.y)))return;var l=me(_e139?t:a),c=Se(me(l),i);ye(c),Ce(c,.5),_e139?we(l,c):Se(l,c);var d=Ze(l,i),u=g(d);return u||void 0;}).filter(Boolean);if(_r34.length){var _Bf5=Bf(o.target),_Bf6=_slicedToArray(_Bf5,4),_e140=_Bf6[0],_i83=_Bf6[1],_n44=_Bf6[2],_l20=_Bf6[3];var _wt7=wt(t),_wt8=_slicedToArray(_wt7,4),_c22=_wt8[0],_d19=_wt8[1],_h7=_wt8[2],_p16=_wt8[3];_r34.forEach(function(_ref392){var t=_ref392.x,o=_ref392.y;var r=le(t,6),a=le(o,6);_n44&&!ty(a,s.y)&&(_c22=Math.max(_c22,o)),_e140&&!ty(r,s.x)&&(_d19=Math.min(_d19,t)),_l20&&!ty(a,s.y)&&(_h7=Math.min(_h7,o)),_i83&&!ty(r,s.x)&&(_p16=Math.max(_p16,t));}),u=tt([_c22,_d19,_h7,_p16]),ct(u,.9999,a);}}return dt(u,l,c,a),u;};function iy(e){var t,_o124;return t=new Cp({props:{items:e[11]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o124=!0;},p:function p(e,o){var i={};2048&o[0]&&(i.items=e[11]),t.$set(i);},i:function i(e){_o124||(ka(t.$$.fragment,e),_o124=!0);},o:function o(e){Ca(t.$$.fragment,e),_o124=!1;},d:function d(e){Oa(t,e);}};}function ny(e){var t,_o125,_i84;return _o125=new uf({props:{$$slots:{default:[iy]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),Fa(_o125.$$.fragment),Dr(t,"slot","header");},m:function m(e,n){Tr(e,t,n),Da(_o125,t,null),_i84=!0;},p:function p(e,t){var i={};2048&t[0]|4&t[7]&&(i.$$scope={dirty:t,ctx:e}),_o125.$set(i);},i:function i(e){_i84||(ka(_o125.$$.fragment,e),_i84=!0);},o:function o(e){Ca(_o125.$$.fragment,e),_i84=!1;},d:function d(e){e&&Mr(t),Oa(_o125);}};}function ry(e){var t,_o126;return t=new xd({props:{onclick:e[88],label:e[4].cropLabelButtonRecenter,icon:e[4].cropIconButtonRecenter,class:"PinturaButtonCenter",disabled:!e[9],hideLabel:!0,style:"opacity: ".concat(e[29],"; transform: translate3d(").concat(e[30].x,"px, ").concat(e[30].y,"px, 0)")}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o126=!0;},p:function p(e,o){var 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: ".concat(e[29],"; transform: translate3d(").concat(e[30].x,"px, ").concat(e[30].y,"px, 0)")),t.$set(i);},i:function i(e){_o126||(ka(t.$$.fragment,e),_o126=!0);},o:function o(e){Ca(t.$$.fragment,e),_o126=!1;},d:function d(e){Oa(t,e);}};}function ay(e){var t,_o127;return t=new Ff({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:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o127=!0;},p:function p(e,o){var 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:function i(e){_o127||(ka(t.$$.fragment,e),_o127=!0);},o:function o(e){Ca(t.$$.fragment,e),_o127=!1;},d:function d(e){Oa(t,e);}};}function sy(e){var t,_o128;return t=new Zf({props:{width:Math.round(e[13].width),height:Math.round(e[13].height)}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o128=!0;},p:function p(e,o){var 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:function i(e){_o128||(ka(t.$$.fragment,e),_o128=!0);},o:function o(e){Ca(t.$$.fragment,e),_o128=!1;},d:function d(e){Oa(t,e);}};}function ly(e){var t,o,i,n,r,a,s,l,_c23=e[21]&&e[10]&&ry(e),_d20=e[21]&&ay(e),u=e[22]&&sy(e);return {c:function c(){t=Rr("div"),o=Rr("div"),_c23&&_c23.c(),i=Ir(),_d20&&_d20.c(),r=Ir(),u&&u.c(),Dr(o,"class","PinturaStage"),Dr(t,"slot","main");},m:function m(h,p){Tr(h,t,p),Sr(t,o),_c23&&_c23.m(o,null),Sr(o,i),_d20&&_d20.m(o,null),e[162](o),Sr(t,r),u&&u.m(t,null),a=!0,s||(l=[gr(Mc.call(null,o)),Lr(o,"measure",e[160]),Lr(o,"wheel",function(){ir(e[2]&&e[87])&&(e[2]&&e[87]).apply(this,arguments);},{passive:!1}),Lr(o,"interactionstart",e[74]),Lr(o,"interactionupdate",e[75]),Lr(o,"interactionrelease",e[77]),Lr(o,"interactionend",e[76]),gr(n=Sd.call(null,o,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:yy,getEventPosition:e[163]})),Lr(o,"gesturedown",e[84]),Lr(o,"gestureupdate",e[85]),Lr(o,"gestureup",e[86]),gr(Df.call(null,o))],s=!0);},p:function p(r,a){(e=r)[21]&&e[10]?_c23?(_c23.p(e,a),2098176&a[0]&&ka(_c23,1)):(_c23=ry(e),_c23.c(),ka(_c23,1),_c23.m(o,i)):_c23&&(wa(),Ca(_c23,1,1,function(){_c23=null;}),Sa()),e[21]?_d20?(_d20.p(e,a),2097152&a[0]&&ka(_d20,1)):(_d20=ay(e),_d20.c(),ka(_d20,1),_d20.m(o,null)):_d20&&(wa(),Ca(_d20,1,1,function(){_d20=null;}),Sa()),n&&ir(n.update)&&16777220&a[0]&&n.update.call(null,{drag:!0,inertia:!0,pinch:e[2],shouldStartInteraction:yy,getEventPosition:e[163]}),e[22]?u?(u.p(e,a),4194304&a[0]&&ka(u,1)):(u=sy(e),u.c(),ka(u,1),u.m(t,null)):u&&(wa(),Ca(u,1,1,function(){u=null;}),Sa());},i:function i(e){a||(ka(_c23),ka(_d20),ka(u),a=!0);},o:function o(e){Ca(_c23),Ca(_d20),Ca(u),a=!1;},d:function d(o){o&&Mr(t),_c23&&_c23.d(),_d20&&_d20.d(),e[162](null),u&&u.d(),s=!1,or(l);}};}function cy(e){var t,o,_i85,n;var r=[{class:"PinturaControlList"},{tabs:e[7]},e[18]];var a={$$slots:{default:[dy,function(_ref393){var e=_ref393.tab;return {218:e};},function(_ref394){var e=_ref394.tab;return [0,0,0,0,0,0,0,e?2:0];}]},$$scope:{ctx:e}};for(var _e142=0;_e142<r.length;_e142+=1)a=Qn(a,r[_e142]);t=new Gc({props:a}),t.$on("select",e[161]);var s=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[17]},e[18]];var l={$$slots:{default:[py,function(_ref395){var e=_ref395.panel;return {217:e};},function(_ref396){var e=_ref396.panel;return [0,0,0,0,0,0,0,e?1:0];}]},$$scope:{ctx:e}};for(var _e144=0;_e144<s.length;_e144+=1)l=Qn(l,s[_e144]);return _i85=new nd({props:l}),{c:function c(){Fa(t.$$.fragment),o=Ir(),Fa(_i85.$$.fragment);},m:function m(e,r){Da(t,e,r),Tr(e,o,r),Da(_i85,e,r),n=!0;},p:function p(e,o){var n=262272&o[0]?Aa(r,[r[0],128&o[0]&&{tabs:e[7]},262144&o[0]&&La(e[18])]):{};6&o[7]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);var a=393216&o[0]?Aa(s,[s[0],s[1],131072&o[0]&&{panels:e[17]},262144&o[0]&&La(e[18])]):{};511721496&o[0]|5&o[7]&&(a.$$scope={dirty:o,ctx:e}),_i85.$set(a);},i:function i(e){n||(ka(t.$$.fragment,e),ka(_i85.$$.fragment,e),n=!0);},o:function o(e){Ca(t.$$.fragment,e),Ca(_i85.$$.fragment,e),n=!1;},d:function d(e){Oa(t,e),e&&Mr(o),Oa(_i85,e);}};}function dy(e){var t,o,i=e[218].label+"";return {c:function c(){t=Rr("span"),o=Er(i);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){2&t[7]&&i!==(i=e[218].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function uy(e){var t,_o129;return t=new Pf({props:{elasticity:e[25]*e[44],base:fy,min:e[23],max:gy,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:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o129=!0;},p:function p(e,o){var i={};33554432&o[0]&&(i.elasticity=e[25]*e[44]),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:function i(e){_o129||(ka(t.$$.fragment,e),_o129=!0);},o:function o(e){Ca(t.$$.fragment,e),_o129=!1;},d:function d(e){Oa(t,e);}};}function hy(e){var t,_o130;return t=new jf({props:{elasticity:e[25]*e[44],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:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o130=!0;},p:function p(e,o){var i={};33554432&o[0]&&(i.elasticity=e[25]*e[44]),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:function i(e){_o130||(ka(t.$$.fragment,e),_o130=!0);},o:function o(e){Ca(t.$$.fragment,e),_o130=!1;},d:function d(e){Oa(t,e);}};}function py(e){var t,_o131,i,n;var r=[hy,uy],a=[];function s(e,t){return e[217]===e[93]+"-rotation"?0:e[217]===e[93]+"-zoom"?1:-1;}return ~(t=s(e))&&(_o131=a[t]=r[t](e)),{c:function c(){_o131&&_o131.c(),i=Ar();},m:function m(e,o){~t&&a[t].m(e,o),Tr(e,i,o),n=!0;},p:function p(e,n){var l=t;t=s(e),t===l?~t&&a[t].p(e,n):(_o131&&(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa()),~t?(_o131=a[t],_o131?_o131.p(e,n):(_o131=a[t]=r[t](e),_o131.c()),ka(_o131,1),_o131.m(i.parentNode,i)):_o131=null);},i:function i(e){n||(ka(_o131),n=!0);},o:function o(e){Ca(_o131),n=!1;},d:function d(e){~t&&a[t].d(e),e&&Mr(i);}};}function my(e){var t,_o132,_i86=e[19]&&cy(e);return {c:function c(){t=Rr("div"),_i86&&_i86.c(),Dr(t,"slot","footer"),Dr(t,"style",e[16]);},m:function m(e,n){Tr(e,t,n),_i86&&_i86.m(t,null),_o132=!0;},p:function p(e,n){e[19]?_i86?(_i86.p(e,n),524288&n[0]&&ka(_i86,1)):(_i86=cy(e),_i86.c(),ka(_i86,1),_i86.m(t,null)):_i86&&(wa(),Ca(_i86,1,1,function(){_i86=null;}),Sa()),(!_o132||65536&n[0])&&Dr(t,"style",e[16]);},i:function i(e){_o132||(ka(_i86),_o132=!0);},o:function o(e){Ca(_i86),_o132=!1;},d:function d(e){e&&Mr(t),_i86&&_i86.d();}};}function $y(e){var t,o,_i87;function n(t){e[164](t);}var r={hasHeader:e[20],$$slots:{footer:[my],main:[ly],header:[ny]},$$scope:{ctx:e}};return void 0!==e[15]&&(r.root=e[15]),t=new Cf({props:r}),ra.push(function(){return za(t,"root",n);}),t.$on("measure",e[165]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i87=!0;},p:function p(e,i){var n={};1048576&i[0]&&(n.hasHeader=e[20]),2146402302&i[0]|4&i[7]&&(n.$$scope={dirty:i,ctx:e}),!o&&32768&i[0]&&(o=!0,n.root=e[15],pa(function(){return o=!1;})),t.$set(n);},i:function i(e){_i87||(ka(t.$$.fragment,e),_i87=!0);},o:function o(e){Ca(t.$$.fragment,e),_i87=!1;},d:function d(e){Oa(t,e);}};}var gy=1,fy=0,yy=function yy(e,t){return e.target===t;};function by(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S,k,C,T,M,R,P,E,A,L,z,F,D,O,B,W,V,_,N,H,j,U,X,Y,J,Q,ee,te,oe,ce,de,ue,pe,ge,be,ve,ke,Te,Me,Re,Pe,Ee,Ie,Ae,Le,ze,De,We,_e,Ze,Xe,Ye,qe=Kn,Ke=function Ke(){return qe(),qe=rr(Qe,function(e){return o(12,A=e);}),Qe;};e.$$.on_destroy.push(function(){return qe();});var Qe=t.isActive;Ke();var tt=t.stores,_t$cropImageSelection=t.cropImageSelectionCornerStyle,ot=_t$cropImageSelection===void 0?"circle":_t$cropImageSelection,_t$cropWillRenderImag=t.cropWillRenderImageSelectionGuides,it=_t$cropWillRenderImag===void 0?function(e,t){var o="rotate"==e;return {rows:o?5:3,cols:o?5:3,opacity:.25*t};}:_t$cropWillRenderImag,nt=t.cropAutoCenterImageSelectionTimeout,_t$cropEnableZoomMatc=t.cropEnableZoomMatchImageAspectRatio,dt=_t$cropEnableZoomMatc===void 0?!0:_t$cropEnableZoomMatc,_t$cropEnableRotateMa=t.cropEnableRotateMatchImageAspectRatio,ut=_t$cropEnableRotateMa===void 0?"never":_t$cropEnableRotateMa,_t$cropEnableRotation=t.cropEnableRotationInput,$t=_t$cropEnableRotation===void 0?!0:_t$cropEnableRotation,_t$cropEnableZoom=t.cropEnableZoom,gt=_t$cropEnableZoom===void 0?!0:_t$cropEnableZoom,_t$cropEnableZoomInpu=t.cropEnableZoomInput,ft=_t$cropEnableZoomInpu===void 0?!0:_t$cropEnableZoomInpu,_t$cropEnableZoomAuto=t.cropEnableZoomAutoHide,St=_t$cropEnableZoomAuto===void 0?!0:_t$cropEnableZoomAuto,_t$cropEnableImageSel=t.cropEnableImageSelection,Ct=_t$cropEnableImageSel===void 0?!0:_t$cropEnableImageSel,_t$cropEnableInfoIndi=t.cropEnableInfoIndicator,Tt=_t$cropEnableInfoIndi===void 0?!1:_t$cropEnableInfoIndi,_t$cropEnableZoomTowa=t.cropEnableZoomTowardsWheelPosition,Mt=_t$cropEnableZoomTowa===void 0?!0:_t$cropEnableZoomTowa,_t$cropEnableLimitWhe=t.cropEnableLimitWheelInputToCropSelection,Rt=_t$cropEnableLimitWhe===void 0?!0:_t$cropEnableLimitWhe,_t$cropEnableCenterIm=t.cropEnableCenterImageSelection,Pt=_t$cropEnableCenterIm===void 0?!0:_t$cropEnableCenterIm,_t$cropEnableButtonRo=t.cropEnableButtonRotateLeft,Et=_t$cropEnableButtonRo===void 0?!0:_t$cropEnableButtonRo,_t$cropEnableButtonRo2=t.cropEnableButtonRotateRight,It=_t$cropEnableButtonRo2===void 0?!1:_t$cropEnableButtonRo2,_t$cropEnableButtonFl=t.cropEnableButtonFlipHorizontal,At=_t$cropEnableButtonFl===void 0?!0:_t$cropEnableButtonFl,_t$cropEnableButtonFl2=t.cropEnableButtonFlipVertical,Lt=_t$cropEnableButtonFl2===void 0?!1:_t$cropEnableButtonFl2,zt=t.cropSelectPresetOptions,_t$cropEnableSelectPr=t.cropEnableSelectPreset,Ft=_t$cropEnableSelectPr===void 0?!0:_t$cropEnableSelectPr,_t$cropEnableFilterMa=t.cropEnableFilterMatchAspectRatio,Dt=_t$cropEnableFilterMa===void 0?!0:_t$cropEnableFilterMa,_t$cropSelectPresetFi=t.cropSelectPresetFilter,Ot=_t$cropSelectPresetFi===void 0?!1:_t$cropSelectPresetFi,_t$cropEnableButtonTo=t.cropEnableButtonToggleCropLimit,Bt=_t$cropEnableButtonTo===void 0?!1:_t$cropEnableButtonTo,_t$cropWillRenderTool=t.cropWillRenderTools,Wt=_t$cropWillRenderTool===void 0?Z:_t$cropWillRenderTool,_t$cropActiveTransfor=t.cropActiveTransformTool,Vt=_t$cropActiveTransfor===void 0?"rotation":_t$cropActiveTransfor,_t$cropMinimizeToolba=t.cropMinimizeToolbar,_t=_t$cropMinimizeToolba===void 0?"auto":_t$cropMinimizeToolba,_t$cropInteractionFoc=t.cropInteractionFocus,Nt=_t$cropInteractionFoc===void 0?"image":_t$cropInteractionFoc,_t$cropRotationRange=t.cropRotationRange,Ht=_t$cropRotationRange===void 0?q:_t$cropRotationRange,_t$cropMaskOpacity=t.cropMaskOpacity,jt=_t$cropMaskOpacity===void 0?.85:_t$cropMaskOpacity,_t$locale=t.locale,Ut=_t$locale===void 0?{}:_t$locale;var Gt=oa("isAnimated");sr(e,Gt,function(e){return o(139,L=e);});var Zt=oa("elasticityMultiplier");sr(e,Zt,function(e){return o(25,De=e);});var Xt=oa("redrawTrigger");sr(e,Xt,function(e){return o(159,ze=e);});var Yt=oa("imageIsStatic");sr(e,Yt,function(e){return o(145,V=e);});var qt=oa("imageStaticVisualCorners");sr(e,qt,function(e){return o(181,Te=e);});var Kt=oa("fixScrollDirection");sr(e,Kt,function(e){return o(175,de=e);});var Jt="idle";var Qt=Na();sr(e,Qt,function(e){return o(156,Ie=e);});var eo=function eo(){return void 0===ve;},to=function to(e){return 1/e;},oo=function oo(e){Dt&&Ot!==e&&(o(95,Ot=e),ve&&1!==ve&&io()&&$r(No,ve=to(ve),ve));},io=function io(){if(1===ve||!i)return !1;var e=to(ve);return !!yu(Ie).find(function(_ref397){var _ref398=_slicedToArray(_ref397,1),t=_ref398[0];return t===e;});},no=function no(e,t,o){return K(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);},ro=function ro(){return (eo()||"always"===ut&&io())&&function(e,t,o){var i=Ge(je(Fe(t),o),function(e){return Math.abs(Math.round(e));}),n=He(i),r=st(e);return xe(n,r);}(_,ee,te)&&no(_,ee,te);},ao=function ao(e){if("never"!==ut&&ro()){$r(Ro,te+=e,te);var _t117=K(te),_o133=_t117?ee.height:ee.width,_i88=_t117?ee.width:ee.height;$r(Bo,_=at(0,0,_o133,_i88),_),eo()||$r(No,ve=G(_o133,_i88),ve);}else $r(Ro,te+=e,te);},_tt=tt,so=_tt.history,lo=_tt.env,co=_tt.isInteracting,uo=_tt.isInteractingFraction,ho=_tt.isTransformingImage,po=_tt.rootRect,mo=_tt.stageRect,$o=_tt.utilRect,go=_tt.utilRectPadded,fo=_tt.rootLineColor,yo=_tt.allowPan,bo=_tt.allowZoom,xo=_tt.allowPlayPause,vo=_tt.rangeInputElasticity,wo=_tt.presentationScalar,So=_tt.utilTools,ko=_tt.imagePreviewModifiers,Co=_tt.imageOutlineOpacity,To=_tt.imageFlipX,Mo=_tt.imageFlipY,Ro=_tt.imageRotation,Po=_tt.imageRotationRange,Eo=_tt.imageOutputSize,Io=_tt.imageSelectionRect,Ao=_tt.imageSelectionRectSnapshot,Lo=_tt.imageSelectionRectIntent,zo=_tt.imageSelectionRectPresentation,Fo=_tt.imageCropRectIntent,Oo=_tt.imageCropRectOrigin,Bo=_tt.imageCropRect,Wo=_tt.imageCropMinSize,Vo=_tt.imageCropMaxSize,_o=_tt.imageCropRange,No=_tt.imageCropAspectRatio,Ho=_tt.imageCropLimitToImage,jo=_tt.imageSize,Uo=_tt.imageScalar,Go=_tt.imageOverlayMarkup,Zo=_tt.stagePadded,Xo=_tt.stageRecenter;var Yo;sr(e,lo,function(e){return o(140,z=e);}),sr(e,co,function(e){return o(144,W=e);}),sr(e,ho,function(e){return o(173,J=e);}),sr(e,po,function(e){return o(24,ue=e);}),sr(e,mo,function(e){return o(151,Y=e);}),sr(e,go,function(e){return o(148,j=e);}),sr(e,wo,function(e){return o(147,H=e);}),sr(e,So,function(e){return o(183,Re=e);}),sr(e,ko,function(e){return o(172,O=e);}),sr(e,To,function(e){return o(158,Le=e);}),sr(e,Mo,function(e){return o(157,Ae=e);}),sr(e,Ro,function(e){return o(14,te=e);}),sr(e,Po,function(e){return o(26,We=e);}),sr(e,Eo,function(e){return o(184,Pe=e);}),sr(e,Io,function(e){return o(150,X=e);}),sr(e,Ao,function(e){return o(149,U=e);}),sr(e,Lo,function(e){return o(182,Me=e);}),sr(e,zo,function(e){return o(143,B=e);}),sr(e,Fo,function(e){return o(176,pe=e);}),sr(e,Oo,function(e){return o(178,be=e);}),sr(e,Bo,function(e){return o(13,_=e);}),sr(e,Wo,function(e){return o(154,ce=e);}),sr(e,Vo,function(e){return o(180,ke=e);}),sr(e,_o,function(e){return o(177,ge=e);}),sr(e,No,function(e){return o(179,ve=e);}),sr(e,Ho,function(e){return o(153,oe=e);}),sr(e,jo,function(e){return o(152,ee=e);}),sr(e,Uo,function(e){return o(146,N=e);}),sr(e,Zo,function(e){return o(142,D=e);});var qo=function qo(e,t){var o={target:e,translate:t},i=Ne(Fe(ce),H),n=Ne(Fe(ke),H);var r=Wf(U,o,_objectSpread2(_objectSpread2({},j),{},{x:0,y:0}),{aspectRatio:ve,minSize:i,maxSize:n});if(r=function(e,t,o){var _wt9=wt(e),_wt10=_slicedToArray(_wt9,4),i=_wt10[0],n=_wt10[1],r=_wt10[2],a=_wt10[3],s=_objectSpread2({},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){var _t118=Math.min(1,s.width/e.width,s.height/e.height);return ht(s,_t118);}return e;}(r,_objectSpread2(_objectSpread2({},j),{},{x:0,y:0}),ve),!oe)return {boundsLimited:r,boundsIntent:r};var a=oy(U,r,o,Te,{aspectRatio:ve,minSize:i,maxSize:n});return {boundsLimited:a,boundsIntent:a};},Ko=function Ko(e,t){var o={target:e,translate:t},i=Ne(Fe(ce),H),n=Ne(Fe(ke),H),r=function(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=t.target,n=t.translate,r=o.aspectRatio,a=o.minSize,s=se[Of[i]],l=we(Je(e),he(s[0]*e.width,s[1]*e.height)),c=se[i],d=we(Je(e),he(c[0]*e.width,c[1]*e.height)),_Bf7=Bf(i),_Bf8=_slicedToArray(_Bf7,7),u=_Bf8[0],h=_Bf8[1],p=_Bf8[2],m=_Bf8[3],$=_Bf8[4],g=_Bf8[5],f=_Bf8[6];var y=n.x,b=n.y;$?b=0:g&&(y=0);var _wt11=wt(e),_wt12=_slicedToArray(_wt11,4),x=_wt12[0],v=_wt12[1],w=_wt12[2],S=_wt12[3];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&&$&&w-x<a.height){var _e145=a.height-(w-x);x-=.5*_e145,w+=.5*_e145;}if(a&&g&&v-S<a.width){var _e146=a.width-(v-S);S-=.5*_e146,v+=.5*_e146;}if(r)if(f){var _e147=v-S,_t119=w-x;$?(_t119=_e147/r,x=l.y-.5*_t119,w=l.y+.5*_t119):g&&(_e147=_t119*r,S=l.x-.5*_e147,v=l.x+.5*_e147);}else {var _e148=he(d.x+y-l.x,d.y+b-l.y);i===ne?(_e148.x=Math.max(0,_e148.x),_e148.y=Math.min(0,_e148.y)):i===re?(_e148.x=Math.max(0,_e148.x),_e148.y=Math.max(0,_e148.y)):i===ae?(_e148.x=Math.min(0,_e148.x),_e148.y=Math.max(0,_e148.y)):i===ie&&(_e148.x=Math.min(0,_e148.x),_e148.y=Math.min(0,_e148.y));var _t120=fe(_e148),_o134=he(r,1),_n45=Ce(ye(_o134),_t120);i===ne?(v=l.x+_n45.x,x=l.y-_n45.y):i===re?(v=l.x+_n45.x,w=l.y+_n45.y):i===ae?(S=l.x-_n45.x,w=l.y+_n45.y):i===ie&&(S=l.x-_n45.x,x=l.y-_n45.y);}return at(S,x,v-S,w-x);}(U,o,{aspectRatio:ve,minSize:i});return {boundsLimited:Wf(U,o,_objectSpread2(_objectSpread2({},j),{},{x:0,y:0}),{aspectRatio:ve,minSize:i,maxSize:n}),boundsIntent:r};};var Jo=void 0,Qo=void 0;var ei=function ei(_ref399){var e=_ref399.translation,t=_ref399.scalar;V&&(t=1,e=$e(me(e)));var o=Math.min(X.width/_.width,X.height/_.height),i=Ce(me(e),1/o);var n;if(Qo){var _t121=Se(me(Qo),e);Qo=e,n=lt(Je(_),_t121);}else n=lt(Je(Jo),$e(me(i))),void 0!==t&&ct(n,1/t);$r(Fo,pe=n,pe),$r(Bo,_=n,_);},ti=Ha([_o,Bo],function(_ref400,o){var _ref401=_slicedToArray(_ref400,2),e=_ref401[0],t=_ref401[1];if(!t)return;var _e149=_slicedToArray(e,2),i=_e149[0],n=_e149[1],r=mt(t);o([Oe(kt(xt(i,r),le)),Oe(kt(vt(n,r),le))]);});sr(e,ti,function(e){return o(174,Q=e);});var oi=Ha([jo,Ho,Wo,Vo,_o,Ro],function(_ref402,a){var _ref403=_slicedToArray(_ref402,6),e=_ref403[0],t=_ref403[1],o=_ref403[2],i=_ref403[3],n=_ref403[4],r=_ref403[5];if(!e)return;var s=n[0],l=n[1];var c,d;t?(c=function(e,t,o){return K(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(function(e){return le(e);}));});sr(e,oi,function(e){return o(27,_e=e);});var ii=Ha([jo,Bo,_o,Ro],function(_ref404,n){var _ref405=_slicedToArray(_ref404,4),e=_ref405[0],t=_ref405[1],o=_ref405[2],i=_ref405[3];if(!e||!t)return n(0);var r;var a=o[0],s=o[1],l=t.width,c=t.height,d=mt(t),u=K(i)?Ve(e.height,e.width):e,h=vt(u,d);if(l<=h.width||c<=h.height){var _e150=h.width-a.width,_t122=h.height-a.height;r=0===_e150||0===_t122?1:1-Math.min((l-a.width)/_e150,(c-a.height)/_t122);}else {var _e151=s.width-h.width,_t123=s.height-h.height,_o135=vt({width:_e151,height:_t123},d);r=-Math.min((l-h.width)/_o135.width,(c-h.height)/_o135.height);}n(r);});sr(e,ii,function(e){return o(28,Ze=e);});var ni=function ni(e){var t=mt(Jo);var o,i,n;var r=K(te)?Ve(ee.height,ee.width):ee,a=vt(r,t);if(e>=0){var _r35=a.width-ge[0].width,_s22=a.height-ge[0].height;o=a.width-_r35*e,i=a.height-_s22*e,n=xt({width:o,height:i},t);}else {var _r36=ge[1].width-a.width,_s23=ge[1].height-a.height;o=a.width+_r36*-e,i=a.height+_s23*-e,n=vt({width:o,height:i},t);}o=n.width,i=n.height;var s=Jo.x+.5*Jo.width-.5*o,l=Jo.y+.5*Jo.height-.5*i;$r(Bo,_={x:s,y:l,width:o,height:i},_);};var ri;var ai=function ai(e){var t=ct(Je(ri),1/e);$r(Fo,pe=t,pe),$r(Bo,_=t,_);};var si;var li=function li(){Xo.set({});};var ci;var di=uc(0,{precision:1e-4});sr(e,di,function(e){return o(29,Xe=e);});var ui=uc();sr(e,ui,function(e){return o(30,Ye=e);});var hi=Ha([No,Eo,Qt],function(_ref406,n){var _ref407=_slicedToArray(_ref406,3),e=_ref407[0],t=_ref407[1],o=_ref407[2];if(!i)return;var r=yu(o),a=_toConsumableArray(r).map(function(e){return e[0];}).sort(function(e,t){return Do(e[0])&&!Do(t[0])?1:-1;}).find(function(o){if(Do(o)&&t){var _o137=_slicedToArray(o,2),_i89=_o137[0],_n46=_o137[1],_r37=t.width===_i89&&t.height===_n46,_a19=e===G(_i89,_n46);return _r37&&_a19;}return o===e;});if(!a)return n(void 0);n(r.map(function(e){return e[0];}).findIndex(function(e){return Do(e)?ps(e,a):e===a;}));});sr(e,hi,function(e){return o(155,Ee=e);});var pi=function pi(e,t){if(!i||-1===e||void 0===e)return;var o=yu(t)[e][0];return o?Do(o)?G(o[0],o[1]):o:void 0;},mi=Ha([fo,zo,uo],function(_ref408,i){var _ref409=_slicedToArray(_ref408,3),e=_ref409[0],t=_ref409[1],o=_ref409[2];var _it=it(Jt,o),n=_it.rows,r=_it.cols,a=_it.opacity;if(!t||a<=0)return i([]);var s=t.x,l=t.y,c=t.width,d=t.height,u=c/r,h=d/n,p=[];for(var _t125=1;_t125<=n-1;_t125++){var _o138=l+h*_t125;p.push({id:"image-selection-guide-row-"+_t125,points:[he(s,_o138),he(s+c,_o138)],opacity:a,strokeWidth:1,strokeColor:e});}for(var _t127=1;_t127<=r-1;_t127++){var _o139=s+u*_t127;p.push({id:"image-selection-guide-col-"+_t127,points:[he(_o139,l),he(_o139,l+d)],opacity:a,strokeWidth:1,strokeColor:e});}i(p);});sr(e,mi,function(e){return o(141,F=e);});var $i="crop-"+I();var gi,fi=$i+"-"+($t?Vt:"zoom"),yi=fi,bi=void 0;var xi=uc(L?20:0);sr(e,xi,function(e){return o(138,E=e);});return e.$$set=function(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,nt=e.cropAutoCenterImageSelectionTimeout),"cropEnableZoomMatchImageAspectRatio"in e&&o(100,dt=e.cropEnableZoomMatchImageAspectRatio),"cropEnableRotateMatchImageAspectRatio"in e&&o(101,ut=e.cropEnableRotateMatchImageAspectRatio),"cropEnableRotationInput"in e&&o(102,$t=e.cropEnableRotationInput),"cropEnableZoom"in e&&o(2,gt=e.cropEnableZoom),"cropEnableZoomInput"in e&&o(103,ft=e.cropEnableZoomInput),"cropEnableZoomAutoHide"in e&&o(104,St=e.cropEnableZoomAutoHide),"cropEnableImageSelection"in e&&o(105,Ct=e.cropEnableImageSelection),"cropEnableInfoIndicator"in e&&o(106,Tt=e.cropEnableInfoIndicator),"cropEnableZoomTowardsWheelPosition"in e&&o(107,Mt=e.cropEnableZoomTowardsWheelPosition),"cropEnableLimitWheelInputToCropSelection"in e&&o(108,Rt=e.cropEnableLimitWheelInputToCropSelection),"cropEnableCenterImageSelection"in e&&o(109,Pt=e.cropEnableCenterImageSelection),"cropEnableButtonRotateLeft"in e&&o(110,Et=e.cropEnableButtonRotateLeft),"cropEnableButtonRotateRight"in e&&o(111,It=e.cropEnableButtonRotateRight),"cropEnableButtonFlipHorizontal"in e&&o(112,At=e.cropEnableButtonFlipHorizontal),"cropEnableButtonFlipVertical"in e&&o(113,Lt=e.cropEnableButtonFlipVertical),"cropSelectPresetOptions"in e&&o(114,zt=e.cropSelectPresetOptions),"cropEnableSelectPreset"in e&&o(115,Ft=e.cropEnableSelectPreset),"cropEnableFilterMatchAspectRatio"in e&&o(116,Dt=e.cropEnableFilterMatchAspectRatio),"cropSelectPresetFilter"in e&&o(95,Ot=e.cropSelectPresetFilter),"cropEnableButtonToggleCropLimit"in e&&o(117,Bt=e.cropEnableButtonToggleCropLimit),"cropWillRenderTools"in e&&o(118,Wt=e.cropWillRenderTools),"cropActiveTransformTool"in e&&o(119,Vt=e.cropActiveTransformTool),"cropMinimizeToolbar"in e&&o(120,_t=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=function(){4096&e.$$.dirty[0]|268435456&e.$$.dirty[3]&&Yt.set("selection"===Nt&&A),2097152&e.$$.dirty[3]&&o(129,i=zt&&Array.isArray(zt)&&zt.length),2097152&e.$$.dirty[3]|32&e.$$.dirty[4]&&Qt.set(i?zt:[]),4096&e.$$.dirty[0]|32768&e.$$.dirty[4]&&A&&Co.set(1,{hard:!L}),4096&e.$$.dirty[0]&&yo.set(!A),4096&e.$$.dirty[0]&&bo.set(!A),4096&e.$$.dirty[0]&&A&&xo.set(!0),65536&e.$$.dirty[4]&&o(124,p="overlay"===z.layoutMode),4194304&e.$$.dirty[3]|1&e.$$.dirty[4]&&o(128,v=Ft&&!p),83886080&e.$$.dirty[4]&&o(137,l=j&&X&&yt(j,X)),67117056&e.$$.dirty[4]&&o(135,c=!(!X||!l)),67119104&e.$$.dirty[4]&&o(133,d=c&&pt(X,l,function(e){return le(e,5);})),16400&e.$$.dirty[0]|52297732&e.$$.dirty[3]|1879114288&e.$$.dirty[4]|31&e.$$.dirty[5]&&o(11,n=ze&&Wt([Et&&["Button","rotate-left",{label:Ut.cropLabelButtonRotateLeft,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonRotateLeft,onclick:function onclick(){ao(-Math.PI/2),so.write();}}],It&&["Button","rotate-right",{label:Ut.cropLabelButtonRotateRight,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonRotateRight,onclick:function onclick(){ao(Math.PI/2),so.write();}}],At&&["Button","flip-horizontal",{label:Ut.cropLabelButtonFlipHorizontal,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonFlipHorizontal,onclick:function onclick(){K(te)?$r(Mo,Ae=!Ae,Ae):$r(To,Le=!Le,Le),so.write();}}],Lt&&["Button","flip-vertical",{label:Ut.cropLabelButtonFlipVertical,labelClass:"PinturaToolbarContentWide",icon:Ut.cropIconButtonFlipVertical,onclick:function onclick(){K(te)?$r(To,Le=!Le,Le):$r(Mo,Ae=!Ae,Ae),so.write();}}],v&&i&&[!1===Ot?"Dropdown":Jf,"select-preset",{icon:xu(Ut.cropIconSelectPreset,Ut,pi(Ee,Ie)),label:xu(Ut.cropLabelSelectPreset,Ut,pi(Ee,Ie)),labelClass:"PinturaToolbarContentWide",options:Ie,filter:Ot,onfilterchange:oo,selectedIndex:Ee,onchange:function onchange(_ref410){var e=_ref410.value;Do(e)?($r(No,ve=G(e[0],e[1]),ve),$r(Eo,Pe=Be(e),Pe)):$r(No,ve=e,ve),d&&li(),so.write();},optionMapper:function optionMapper(e){var t=!1;var o=Do(e.value)?e.value[0]/e.value[1]:e.value;if(o){var _e152=rs(ee,te,o);t=_e152.width<ce.width||_e152.height<ce.height;}return e.icon=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _t$width4=t.width,o=_t$width4===void 0?24:_t$width4,_t$height4=t.height,i=_t$height4===void 0?24:_t$height4,_t$bounds=t.bounds,n=_t$bounds===void 0?16:_t$bounds,_t$radius=t.radius,r=_t$radius===void 0?3:_t$radius;var a,s,l,c,d=Do(e)?G(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=\"".concat(u?"currentColor":"none","\" stroke=\"").concat(u?"none":"currentColor","\" stroke-width=\"").concat(o/16,"\" stroke-dasharray=\"").concat([o/12,o/6].join(" "),"\" x=\"").concat(a,"\" y=\"").concat(s,"\" width=\"").concat(l,"\" height=\"").concat(c,"\" rx=\"").concat(r,"\"/>");}(e.value,{bounds:14}),_objectSpread2(_objectSpread2({},e),{},{disabled:t});}}],Bt&&["Dropdown","select-crop-limit",{icon:xu(Ut.cropIconCropBoundary,Ut,oe),label:Ut.cropLabelCropBoundary,labelClass:"PinturaToolbarContentWide",onchange:function onchange(_ref411){var e=_ref411.value;$r(Ho,oe=e,oe),so.write();},options:[[!0,Ut.cropLabelCropBoundaryEdge,{icon:xu(Ut.cropIconCropBoundary,Ut,!0)}],[!1,Ut.cropLabelCropBoundaryNone,{icon:xu(Ut.cropIconCropBoundary,Ut,!1)}]]}]].filter(Boolean),z,function(){return Xt.set({});}).filter(Boolean)),6144&e.$$.dirty[0]|134217728&e.$$.dirty[3]|65537&e.$$.dirty[4]&&$r(So,Re=A&&"never"!==_t&&("always"===_t||"short"===z.verticalSpace||p)?n.map(function(_ref412){var _ref413=_slicedToArray(_ref412,3),e=_ref413[0],t=_ref413[1],o=_ref413[2];return Array.isArray(o)?[e,t,o]:[e,t,_objectSpread2(_objectSpread2({},o),{},{hideLabel:!0})];}):[],Re),536870912&e.$$.dirty[4]&&o(23,r=oe?0:-1),150994944&e.$$.dirty[4]&&o(130,a=j&&he(-(Y.x-j.x),-(Y.y-j.y))),524352&e.$$.dirty[4]&&o(131,s=B&&a&&he(Qd(B.x+.5*B.width+a.x),Qd(B.y+.5*B.height+a.y))),33554432&e.$$.dirty[4]&&o(134,u=null!=U),16785408&e.$$.dirty[4]&&o(136,h=j&&l&&(l.height===j.height||l.width===j.width)),12587008&e.$$.dirty[4]&&o(132,m=!h&&H<1&&N<1),3840&e.$$.dirty[4]&&o(9,$=c&&!u&&(!d||m)),8192&e.$$.dirty[0]|8192&e.$$.dirty[3]|1&e.$$.dirty[4]&&o(22,g=Tt&&!!_&&!p),524352&e.$$.dirty[4]&&o(8,b=B&&a&&{x:B.x+a.x,y:B.y+a.y,width:B.width,height:B.height}),256&e.$$.dirty[0]|4096&e.$$.dirty[3]|1&e.$$.dirty[4]&&o(21,f=Ct&&!!b&&!p),65600&e.$$.dirty[3]|2097280&e.$$.dirty[4]&&o(10,y=Pt&&!!s&&!nt&&!V),512&e.$$.dirty[0]|1073741888&e.$$.dirty[3]|1048576&e.$$.dirty[4]&&$&&nt&&!W&&(clearTimeout(ci),o(123,ci=setTimeout(li,nt))),1073741824&e.$$.dirty[3]|1048576&e.$$.dirty[4]&&W&&clearTimeout(ci),1536&e.$$.dirty[0]|32768&e.$$.dirty[4]&&di.set(y&&$?1:0,{hard:!1===L}),32896&e.$$.dirty[4]&&ui.set(s,{hard:!1===L}),4096&e.$$.dirty[0]|262144&e.$$.dirty[4]&&(A&&!D?($r(ko,O.crop={maskOpacity:jt,maskMarkupOpacity:jt},O),ko.set(O)):(delete O.crop,ko.set(O))),131072&e.$$.dirty[4]&&F&&Go.update(function(e){var t=e.filter(function(e){return !/^image\-selection\-guide/.test(e.id);});return A?[].concat(_toConsumableArray(t),_toConsumableArray(F)):t;}),65536&e.$$.dirty[4]&&o(127,x="short"!==z.verticalSpace),134217728&e.$$.dirty[3]|9&e.$$.dirty[4]&&o(20,w="never"===_t&&!p||x&&"always"!==_t),4&e.$$.dirty[0]|1024&e.$$.dirty[3]&&o(126,S=gt&&ft),2048&e.$$.dirty[3]|12&e.$$.dirty[4]&&o(125,k=St?x&&S:S),512&e.$$.dirty[3]|2&e.$$.dirty[4]&&o(19,C=$t||k),2&e.$$.dirty[4]&&(k||o(5,yi=fi)),32&e.$$.dirty[0]&&o(18,T={name:$i,selected:yi}),16&e.$$.dirty[0]|512&e.$$.dirty[3]|2&e.$$.dirty[4]&&o(7,M=[$t&&{id:$i+"-rotation",label:Ut.cropLabelTabRotation},k&&{id:$i+"-zoom",label:Ut.cropLabelTabZoom}].filter(Boolean)),128&e.$$.dirty[0]&&o(17,R=M.map(function(e){return e.id;})),64&e.$$.dirty[0]|1&e.$$.dirty[4]&&gi&&!gi.children.length&&p&&gi.dispatchEvent(new CustomEvent("measure",{detail:gi.rect})),4096&e.$$.dirty[0]|32768&e.$$.dirty[4]&&L&&xi.set(A?0:20),16384&e.$$.dirty[4]&&o(16,P=E?"transform: translateY(".concat(E,"px)"):void 0);},[Qe,ot,gt,Ht,Ut,yi,gi,M,b,$,y,n,A,_,te,bi,P,R,T,C,w,f,g,r,ue,De,We,_e,Ze,Xe,Ye,Gt,Zt,Xt,Yt,qt,Kt,Qt,lo,co,ho,po,mo,go,vo,wo,So,ko,To,Mo,Ro,Po,Eo,Io,Ao,Lo,zo,Fo,Oo,Bo,Wo,Vo,_o,No,Ho,jo,Uo,Zo,function(){Jt="select",$r(co,W=!0,W),$r(Ao,U=Je(X),U),Yo=V?qo:Ko;},function(_ref414){var e=_ref414.detail;var _Yo5=Yo(e.direction,e.translation),t=_Yo5.boundsLimited,o=_Yo5.boundsIntent;$r(ho,J=!0,J),$r(Lo,Me=o,Me),$r(Io,X=t,X);},function(_ref415){var e=_ref415.detail;var _Yo6=Yo(e.direction,e.translation),t=_Yo6.boundsLimited;$r(ho,J=!1,J),$r(co,W=!1,W),$r(Lo,Me=void 0,Me),fe(e.translation)&&($r(Io,X=t,X),so.write()),$r(Ao,U=void 0,U),Jt=void 0;},function(){Jt="rotate",$r(co,W=!0,W),$r(Oo,be=Je(_),be);},function(e){$r(ho,J=!0,J),$r(Ro,te=e,te);},function(e){$r(ho,J=!1,J),$r(co,W=!1,W),$r(Ro,te=e,te),so.write(),$r(Oo,be=void 0,be);},function(){Jt="pan",Qo=void 0,$r(co,W=!0,W),Jo=Je(_);},function(_ref416){var e=_ref416.detail;$r(ho,J=!0,J),ei(e);},function(_ref417){var e=_ref417.detail;$r(ho,J=!1,J),$r(co,W=!1,W),(fe(e.translation)>0||0!==e.scalar)&&(ei(e),so.write()),$r(Fo,pe=void 0,pe),Jo=void 0;},function(_ref418){var e=_ref418.detail.translation;V&&(e=$e(me(e))),Qo=e,$r(co,W=!1,W);},ti,oi,ii,function(){Jt="zoom",$r(co,W=!0,W),Jo=Je(_);},function(e){$r(ho,J=!1,J),ni(e);},function(e){ni(e),so.write(),$r(ho,J=!1,J),$r(co,W=!1,W),Jo=void 0;},function(){Jt="zoom",Jo||(ri=Je(_),$r(co,W=!0,W));},function(_ref419){var e=_ref419.detail;ri&&($r(ho,J=!0,J),ai(e));},function(_ref420){var e=_ref420.detail;ri&&($r(ho,J=!1,J),$r(co,W=!1,W),ai(e),$r(Fo,pe=void 0,pe),ri=void 0,so.write());},function(e){var t=Qp(e,ue,Y);if(Rt&&!bt(X,t))return;Jt="zoom",$r(co,W=!0,W),$r(ho,J=!0,J),e.preventDefault(),e.stopPropagation();var o=Pd(e,{fixScrollDirection:de}),i=1+o/100,n=Je(_),r=1===Math.min(_.width/ce.width,_.height/ce.height);if(dt&&oe){var _e153=no(_,ee,te);if(eo()&&_e153&&o>0&&d){$r(co,W=!1,W),$r(ho,J=!1,J);var _e154=K(te)?et({height:ee.width,width:ee.height}):et(ee);if(pt(n,_e154))return;if(clearTimeout(si),pt(so.state.crop,_e154))return;return $r(Bo,_=_e154,_),void so.write();}}var a=st(_);if(Mt&&"selection"!==Nt&&o<0&&!r){var _e155=Se(me(t),X),_o140=Math.min(X.width/_.width,X.height/_.height),_i90=ct(Je(X),1.1);a=bt(_i90,t)?we(Je(_),Ce(_e155,1/_o140)):a;}var s=ct(Je(_),i,a);if(Ue(Q[1],s)||(s=rt(st(s),Q[1])),Ue(s,Q[0])||(s=rt(st(s),Q[0])),pt(n,s,le))return $r(co,W=!1,W),void $r(ho,J=!1,J);$r(Bo,_=kt(s,function(e){return le(e,5);}),_),$r(co,W=!1,W),$r(ho,J=!1,J),clearTimeout(si),si=setTimeout(function(){so.write();},500);},li,di,ui,hi,mi,$i,xi,Ot,"crop",tt,it,nt,dt,ut,$t,ft,St,Ct,Tt,Mt,Rt,Pt,Et,It,At,Lt,zt,Ft,Dt,Bt,Wt,Vt,_t,Nt,jt,ci,p,k,S,x,v,i,a,s,m,d,u,c,h,l,E,L,z,F,D,B,W,V,N,H,j,U,X,Y,ee,oe,ce,Ee,Ie,Ae,Le,ze,function(t){ia.call(this,e,t);},function(_ref421){var e=_ref421.detail;return o(5,yi=e);},function(e){ra[e?"unshift":"push"](function(){gi=e,o(6,gi);});},function(e){return Jp(e);},function(e){bi=e,o(15,bi);},function(t){ia.call(this,e,t);}];}var xy={util:["crop",/*#__PURE__*/function(_Wa38){function _class(e){var _this41;_classCallCheck(this,_class);_this41=_callSuper(this,_class),Ba(_assertThisInitialized(_this41),e,by,$y,nr,{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]);return _this41;}_inherits(_class,_Wa38);return _createClass(_class,[{key:"name",get:function get(){return this.$$.ctx[96];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[97];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"cropImageSelectionCornerStyle",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({cropImageSelectionCornerStyle:e}),fa();}},{key:"cropWillRenderImageSelectionGuides",get:function get(){return this.$$.ctx[98];},set:function set(e){this.$$set({cropWillRenderImageSelectionGuides:e}),fa();}},{key:"cropAutoCenterImageSelectionTimeout",get:function get(){return this.$$.ctx[99];},set:function set(e){this.$$set({cropAutoCenterImageSelectionTimeout:e}),fa();}},{key:"cropEnableZoomMatchImageAspectRatio",get:function get(){return this.$$.ctx[100];},set:function set(e){this.$$set({cropEnableZoomMatchImageAspectRatio:e}),fa();}},{key:"cropEnableRotateMatchImageAspectRatio",get:function get(){return this.$$.ctx[101];},set:function set(e){this.$$set({cropEnableRotateMatchImageAspectRatio:e}),fa();}},{key:"cropEnableRotationInput",get:function get(){return this.$$.ctx[102];},set:function set(e){this.$$set({cropEnableRotationInput:e}),fa();}},{key:"cropEnableZoom",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({cropEnableZoom:e}),fa();}},{key:"cropEnableZoomInput",get:function get(){return this.$$.ctx[103];},set:function set(e){this.$$set({cropEnableZoomInput:e}),fa();}},{key:"cropEnableZoomAutoHide",get:function get(){return this.$$.ctx[104];},set:function set(e){this.$$set({cropEnableZoomAutoHide:e}),fa();}},{key:"cropEnableImageSelection",get:function get(){return this.$$.ctx[105];},set:function set(e){this.$$set({cropEnableImageSelection:e}),fa();}},{key:"cropEnableInfoIndicator",get:function get(){return this.$$.ctx[106];},set:function set(e){this.$$set({cropEnableInfoIndicator:e}),fa();}},{key:"cropEnableZoomTowardsWheelPosition",get:function get(){return this.$$.ctx[107];},set:function set(e){this.$$set({cropEnableZoomTowardsWheelPosition:e}),fa();}},{key:"cropEnableLimitWheelInputToCropSelection",get:function get(){return this.$$.ctx[108];},set:function set(e){this.$$set({cropEnableLimitWheelInputToCropSelection:e}),fa();}},{key:"cropEnableCenterImageSelection",get:function get(){return this.$$.ctx[109];},set:function set(e){this.$$set({cropEnableCenterImageSelection:e}),fa();}},{key:"cropEnableButtonRotateLeft",get:function get(){return this.$$.ctx[110];},set:function set(e){this.$$set({cropEnableButtonRotateLeft:e}),fa();}},{key:"cropEnableButtonRotateRight",get:function get(){return this.$$.ctx[111];},set:function set(e){this.$$set({cropEnableButtonRotateRight:e}),fa();}},{key:"cropEnableButtonFlipHorizontal",get:function get(){return this.$$.ctx[112];},set:function set(e){this.$$set({cropEnableButtonFlipHorizontal:e}),fa();}},{key:"cropEnableButtonFlipVertical",get:function get(){return this.$$.ctx[113];},set:function set(e){this.$$set({cropEnableButtonFlipVertical:e}),fa();}},{key:"cropSelectPresetOptions",get:function get(){return this.$$.ctx[114];},set:function set(e){this.$$set({cropSelectPresetOptions:e}),fa();}},{key:"cropEnableSelectPreset",get:function get(){return this.$$.ctx[115];},set:function set(e){this.$$set({cropEnableSelectPreset:e}),fa();}},{key:"cropEnableFilterMatchAspectRatio",get:function get(){return this.$$.ctx[116];},set:function set(e){this.$$set({cropEnableFilterMatchAspectRatio:e}),fa();}},{key:"cropSelectPresetFilter",get:function get(){return this.$$.ctx[95];},set:function set(e){this.$$set({cropSelectPresetFilter:e}),fa();}},{key:"cropEnableButtonToggleCropLimit",get:function get(){return this.$$.ctx[117];},set:function set(e){this.$$set({cropEnableButtonToggleCropLimit:e}),fa();}},{key:"cropWillRenderTools",get:function get(){return this.$$.ctx[118];},set:function set(e){this.$$set({cropWillRenderTools:e}),fa();}},{key:"cropActiveTransformTool",get:function get(){return this.$$.ctx[119];},set:function set(e){this.$$set({cropActiveTransformTool:e}),fa();}},{key:"cropMinimizeToolbar",get:function get(){return this.$$.ctx[120];},set:function set(e){this.$$set({cropMinimizeToolbar:e}),fa();}},{key:"cropInteractionFocus",get:function get(){return this.$$.ctx[121];},set:function set(e){this.$$set({cropInteractionFocus:e}),fa();}},{key:"cropRotationRange",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({cropRotationRange:e}),fa();}},{key:"cropMaskOpacity",get:function get(){return this.$$.ctx[122];},set:function set(e){this.$$set({cropMaskOpacity:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({locale:e}),fa();}}]);}(Wa)]};function vy(e){var t,o,i,n,r,a,s,l=e[77],_c24=(M(e[77].label)?e[77].label(e[2]):e[77].label)+"";function d(){var _e156;for(var _len11=arguments.length,t=new Array(_len11),_key11=0;_key11<_len11;_key11++){t[_key11]=arguments[_key11];}return (_e156=e)[51].apply(_e156,[e[77]].concat(t));}var u=function u(){return e[52](o,l);},h=function h(){return e[52](null,l);};return {c:function c(){t=Rr("div"),o=Rr("div"),i=Ir(),n=Rr("span"),r=Er(_c24),Dr(o,"class",Cy),Dr(t,"slot","option"),Dr(t,"class","PinturaFilterOption");},m:function m(e,l){Tr(e,t,l),Sr(t,o),u(),Sr(t,i),Sr(t,n),Sr(n,r),a||(s=[Lr(o,"measure",d),gr(Mc.call(null,o))],a=!0);},p:function p(t,o){l!==(e=t)[77]&&(h(),l=e[77],u()),4&o[0]|32768&o[2]&&_c24!==(_c24=(M(e[77].label)?e[77].label(e[2]):e[77].label)+"")&&Wr(r,_c24);},d:function d(e){e&&Mr(t),h(),a=!1,or(s);}};}function wy(e){var t,_o141;return t=new Xu({props:{locale:e[2],layout:"row",options:e[3],selectedIndex:e[12],onchange:e[32],$$slots:{option:[vy,function(_ref422){var e=_ref422.option;return {77:e};},function(_ref423){var e=_ref423.option;return [0,0,e?32768:0];}]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o141=!0;},p:function p(e,o){var 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]|98304&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o141||(ka(t.$$.fragment,e),_o141=!0);},o:function o(e){Ca(t.$$.fragment,e),_o141=!1;},d:function d(e){Oa(t,e);}};}function Sy(e){var t,_o142,i,n,r,a,s,l;function c(t){e[54](t);}function d(t){e[55](t);}function u(t){e[56](t);}var h={elasticity:e[13]*e[19],onscroll:e[53],$$slots:{default:[wy]},$$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]),_o142=new Ad({props:h}),ra.push(function(){return za(_o142,"maskFeatherStartOpacity",c);}),ra.push(function(){return za(_o142,"maskFeatherEndOpacity",d);}),ra.push(function(){return za(_o142,"maskFeatherSize",u);}),_o142.$on("measure",e[57]),{c:function c(){t=Rr("div"),Fa(_o142.$$.fragment),Dr(t,"slot","footer"),Dr(t,"style",e[11]);},m:function m(i,n){Tr(i,t,n),Da(_o142,t,null),a=!0,s||(l=[Lr(t,"transitionend",e[30]),Lr(t,"measure",e[58]),gr(Mc.call(null,t,{observePosition:!0}))],s=!0);},p:function p(e,s){var l={};8192&s[0]&&(l.elasticity=e[13]*e[19]),128&s[0]&&(l.onscroll=e[53]),5132&s[0]|65536&s[2]&&(l.$$scope={dirty:s,ctx:e}),!i&&16&s[0]&&(i=!0,l.maskFeatherStartOpacity=e[4],pa(function(){return i=!1;})),!n&&32&s[0]&&(n=!0,l.maskFeatherEndOpacity=e[5],pa(function(){return n=!1;})),!r&&64&s[0]&&(r=!0,l.maskFeatherSize=e[6],pa(function(){return r=!1;})),_o142.$set(l),(!a||2048&s[0])&&Dr(t,"style",e[11]);},i:function i(e){a||(ka(_o142.$$.fragment,e),a=!0);},o:function o(e){Ca(_o142.$$.fragment,e),a=!1;},d:function d(e){e&&Mr(t),Oa(_o142),s=!1,or(l);}};}function ky(e){var t,_o143;return t=new Cf({props:{$$slots:{footer:[Sy]},$$scope:{ctx:e}}}),t.$on("measure",e[59]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o143=!0;},p:function p(e,o){var i={};16380&o[0]|65536&o[2]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o143||(ka(t.$$.fragment,e),_o143=!0);},o:function o(e){Ca(t.$$.fragment,e),_o143=!1;},d:function d(e){Oa(t,e);}};}var Cy="PinturaFilterPreview";function Ty(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S=Kn,k=function k(){return S(),S=rr(P,function(e){return o(43,d=e);}),P;},C=Kn,T=function T(){return C(),C=rr(R,function(e){return o(49,b=e);}),R;};e.$$.on_destroy.push(function(){return S();}),e.$$.on_destroy.push(function(){return C();});var R=t.isActive;T();var P=t.isActiveFraction;k();var E=t.stores,I=t.locale,A=t.filterFunctions,L=t.filterOptions;var z=oa("elasticityMultiplier");sr(e,z,function(e){return o(13,w=e);});var _E=E,F=_E.history,D=_E.interfaceImages,O=_E.stageRectBase,B=_E.utilRect,W=_E.animation,V=_E.scrollElasticity,_=_E.imageSize,N=_E.imagePreview,H=_E.imageCropRect,j=_E.imageRotation,U=_E.imageFlipX,G=_E.imageFlipY,Z=_E.imageBackgroundColor,X=_E.imageGamma,Y=_E.imageColorMatrix,q=_E.allowPan,K=_E.allowZoom,J=_E.allowZoomControls,Q=_E.allowPlayPause;sr(e,D,function(e){return o(60,u=e);}),sr(e,O,function(e){return o(48,y=e);}),sr(e,B,function(e){return o(47,f=e);}),sr(e,W,function(e){return o(50,x=e);}),sr(e,_,function(e){return o(62,p=e);}),sr(e,N,function(e){return o(42,c=e);}),sr(e,Z,function(e){return o(61,h=e);}),sr(e,X,function(e){return o(44,m=e);}),sr(e,Y,function(e){return o(40,s=e);});var ee=Na({});sr(e,ee,function(e){return o(46,g=e);});var te=function te(e,t){return $r(ee,g[e.value]=t,g);},oe=Ha(ee,function(e){if(!e[void 0])return;var t=e[void 0];return v&&_e(v,t)?v:Fe(t);});sr(e,oe,function(e){return o(63,v=e);});var ie=Ha([R,oe,H,_,j,U,G],function(_ref424,s){var _ref425=_slicedToArray(_ref424,7),e=_ref425[0],t=_ref425[1],o=_ref425[2],i=_ref425[3],n=_ref425[4],r=_ref425[5],a=_ref425[6];if(!e||!t||!i)return $;var l=et(i),c=st(l),d=ss(i,o,n),u=st(d),h=Se(me(c),u),p=$e(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});});sr(e,ie,function(e){return o(45,$=e);});var ne=uc(x?20:0);var re;sr(e,ne,function(e){return o(39,a=e);});var ae={};var se,le,ce,de,ue,pe,ge={x:0,y:0};var fe=Na([]);sr(e,fe,function(e){return o(41,l=e);});var ye=function ye(e){var t=_objectSpread2(_objectSpread2({},e),{},{data:c,size:p,offset:_objectSpread2({},e.offset),mask:_objectSpread2({},e.mask),backgroundColor:h});return t.opacity=d,t.offset.y+=a,t.mask.y+=a,t.id="filter",t;},be=function be(){return u.filter(function(e){return "filter"!==e.id;});};Qr(function(){D.set([]);});return e.$$set=function(e){"isActive"in e&&T(o(0,R=e.isActive)),"isActiveFraction"in e&&k(o(1,P=e.isActiveFraction)),"stores"in e&&o(34,E=e.stores),"locale"in e&&o(2,I=e.locale),"filterFunctions"in e&&o(35,A=e.filterFunctions),"filterOptions"in e&&o(3,L=e.filterOptions);},e.$$.update=function(){if(262144&e.$$.dirty[1]&&q.set(b),262144&e.$$.dirty[1]&&K.set(b),262144&e.$$.dirty[1]&&J.set(b),262144&e.$$.dirty[1]&&b&&Q.set(!1),8&e.$$.dirty[0]&&o(38,i=yu(L)),640&e.$$.dirty[1]&&o(12,n=function(e,t){if(!e||!e.filter||!t)return 0;var o=e.filter;return t.findIndex(function(_ref426){var _ref427=_slicedToArray(_ref426,1),e=_ref427[0];if(!A[e])return !1;var t=A[e]();return ps(t,o);});}(s,i)),786432&e.$$.dirty[1]&&x&&ne.set(b?0:20),512&e.$$.dirty[0]|458752&e.$$.dirty[1]&&b&&f&&y&&pe&&o(37,ue={x:y.x-f.x,y:y.y-f.y+pe.y}),496&e.$$.dirty[0]|58096&e.$$.dirty[1]&&$&&ue&&ge&&de&&re){var _e157=ue.x+de.x+ge.x,_t128=ue.y,_o144=de.x+ue.x,_n47=_o144+de.width;fe.set(i.map(function(_ref428,r){var _ref429=_slicedToArray(_ref428,1),i=_ref429[0];var a=g[i],l=ge.x+a.x,c=l+a.width;if(c<0||l>de.width)return !1;var d=_e157+a.x,u=_t128+a.y,h=function(e){return {origin:me(e.origin),translation:me(e.translation),rotation:_objectSpread2({},e.rotation),scale:e.scale};}($);h.offset=he(.5*a.width+d,.5*a.height+u);h.maskOpacity=1,h.mask=at(d+0,u,a.width+0,a.height),h.maskFeather=[1,0,1,0,1,_n47,1,_n47],l<ce&&se<1&&(h.maskFeather[0]=se,h.maskFeather[1]=_o144,h.maskFeather[2]=1,h.maskFeather[3]=_o144+ce),c>de.width-ce&&le<1&&(h.maskFeather[4]=le,h.maskFeather[5]=_n47-ce,h.maskFeather[6]=1,h.maskFeather[7]=_n47),h.maskCornerRadius=re[i];var p=s&&Object.keys(s).filter(function(e){return "filter"!=e;}).map(function(e){return s[e];})||[];return M(A[i])&&p.push(A[i]()),h.colorMatrix=p.length?Yn(p):void 0,h.gamma=m,h;}).filter(Boolean));}if(7424&e.$$.dirty[1])if(d>0&&l){var _e158=[].concat(_toConsumableArray(be()),_toConsumableArray(l.map(ye)));D.set(_e158);}else D.set(be());256&e.$$.dirty[1]&&o(11,r=a?"transform: translateY(".concat(a,"px)"):void 0);},[R,P,I,L,se,le,ce,ge,de,pe,ae,r,n,w,z,D,O,B,W,V,_,N,Z,X,Y,ee,te,oe,ie,ne,function(e){e.target.className===Cy&&o(36,re=Object.keys(ae).reduce(function(e,t){var o=ae[t],i=getComputedStyle(o),n=["top-left","top-right","bottom-left","bottom-right"].map(function(e){return i.getPropertyValue("border-".concat(e,"-radius"));}).map(Rd).map(function(e){return 1.25*e;});return e[t]=n,e;},{}));},fe,function(_ref430){var e=_ref430.value;$r(Y,s=_objectSpread2(_objectSpread2({},s),{},{filter:M(A[e])?A[e]():void 0}),s),F.write();},"filter",E,A,re,ue,i,a,s,l,c,d,m,$,g,f,y,b,x,function(e,t){return te(e,t.detail);},function(e,t){ra[e?"unshift":"push"](function(){ae[t.value]=e,o(10,ae);});},function(e){return o(7,ge=e);},function(e){se=e,o(4,se);},function(e){le=e,o(5,le);},function(e){ce=e,o(6,ce);},function(e){return o(8,de=e.detail);},function(e){return o(9,pe=e.detail);},function(t){ia.call(this,e,t);}];}var My={util:["filter",/*#__PURE__*/function(_Wa39){function _class2(e){var _this42;_classCallCheck(this,_class2);_this42=_callSuper(this,_class2),Ba(_assertThisInitialized(_this42),e,Ty,ky,nr,{name:33,isActive:0,isActiveFraction:1,stores:34,locale:2,filterFunctions:35,filterOptions:3},null,[-1,-1,-1]);return _this42;}_inherits(_class2,_Wa39);return _createClass(_class2,[{key:"name",get:function get(){return this.$$.ctx[33];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"isActiveFraction",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({isActiveFraction:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[34];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"filterFunctions",get:function get(){return this.$$.ctx[35];},set:function set(e){this.$$set({filterFunctions:e}),fa();}},{key:"filterOptions",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({filterOptions:e}),fa();}}]);}(Wa)]};function Ry(e){var t,o,_i91,n;t=new Ad({props:{elasticity:e[6]*e[9],class:"PinturaControlListScroller",$$slots:{default:[Ey]},$$scope:{ctx:e}}});var r=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[4]},e[5]];var a={$$slots:{default:[Iy,function(_ref431){var e=_ref431.panel;return {42:e};},function(_ref432){var e=_ref432.panel;return [0,e?2048:0];}]},$$scope:{ctx:e}};for(var _e160=0;_e160<r.length;_e160+=1)a=Qn(a,r[_e160]);return _i91=new nd({props:a}),{c:function c(){Fa(t.$$.fragment),o=Ir(),Fa(_i91.$$.fragment);},m:function m(e,r){Da(t,e,r),Tr(e,o,r),Da(_i91,e,r),n=!0;},p:function p(e,o){var n={};64&o[0]&&(n.elasticity=e[6]*e[9]),38&o[0]|8192&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);var a=48&o[0]?Aa(r,[r[0],r[1],16&o[0]&&{panels:e[4]},32&o[0]&&La(e[5])]):{};128&o[0]|10240&o[1]&&(a.$$scope={dirty:o,ctx:e}),_i91.$set(a);},i:function i(e){n||(ka(t.$$.fragment,e),ka(_i91.$$.fragment,e),n=!0);},o:function o(e){Ca(t.$$.fragment,e),Ca(_i91.$$.fragment,e),n=!1;},d:function d(e){Oa(t,e),e&&Mr(o),Oa(_i91,e);}};}function Py(e){var t,o,i=e[43].label+"";return {c:function c(){t=Rr("span"),o=Er(i);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){4096&t[1]&&i!==(i=e[43].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function Ey(e){var t,_o145;var i=[{class:"PinturaControlList"},{tabs:e[1]},e[5]];var n={$$slots:{default:[Py,function(_ref433){var e=_ref433.tab;return {43:e};},function(_ref434){var e=_ref434.tab;return [0,e?4096:0];}]},$$scope:{ctx:e}};for(var _e162=0;_e162<i.length;_e162+=1)n=Qn(n,i[_e162]);return t=new Gc({props:n}),t.$on("select",e[24]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o145=!0;},p:function p(e,o){var n=34&o[0]?Aa(i,[i[0],2&o[0]&&{tabs:e[1]},32&o[0]&&La(e[5])]):{};12288&o[1]&&(n.$$scope={dirty:o,ctx:e}),t.$set(n);},i:function i(e){_o145||(ka(t.$$.fragment,e),_o145=!0);},o:function o(e){Ca(t.$$.fragment,e),_o145=!1;},d:function d(e){Oa(t,e);}};}function Iy(e){var t,_o146;var i=[e[7][e[42]]];var n={};for(var _e164=0;_e164<i.length;_e164+=1)n=Qn(n,i[_e164]);return t=new Pf({props:n}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o146=!0;},p:function p(e,o){var n=128&o[0]|2048&o[1]?Aa(i,[La(e[7][e[42]])]):{};t.$set(n);},i:function i(e){_o146||(ka(t.$$.fragment,e),_o146=!0);},o:function o(e){Ca(t.$$.fragment,e),_o146=!1;},d:function d(e){Oa(t,e);}};}function Ay(e){var t,_o147,_i92=e[5]&&Ry(e);return {c:function c(){t=Rr("div"),_i92&&_i92.c(),Dr(t,"slot","footer"),Dr(t,"style",e[3]);},m:function m(e,n){Tr(e,t,n),_i92&&_i92.m(t,null),_o147=!0;},p:function p(e,n){e[5]?_i92?(_i92.p(e,n),32&n[0]&&ka(_i92,1)):(_i92=Ry(e),_i92.c(),ka(_i92,1),_i92.m(t,null)):_i92&&(wa(),Ca(_i92,1,1,function(){_i92=null;}),Sa()),(!_o147||8&n[0])&&Dr(t,"style",e[3]);},i:function i(e){_o147||(ka(_i92),_o147=!0);},o:function o(e){Ca(_i92),_o147=!1;},d:function d(e){e&&Mr(t),_i92&&_i92.d();}};}function Ly(e){var t,_o148;return t=new Cf({props:{$$slots:{footer:[Ay]},$$scope:{ctx:e}}}),t.$on("measure",e[25]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o148=!0;},p:function p(e,o){var i={};254&o[0]|8192&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o148||(ka(t.$$.fragment,e),_o148=!0);},o:function o(e){Ca(t.$$.fragment,e),_o148=!1;},d:function d(e){Oa(t,e);}};}function zy(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m=Kn,$=function $(){return m(),m=rr(f,function(e){return o(21,c=e);}),f;};e.$$.on_destroy.push(function(){return m();});var g=t.stores,f=t.isActive;$();var _t$locale2=t.locale,y=_t$locale2===void 0?{}:_t$locale2,b=t.finetuneControlConfiguration,x=t.finetuneOptions,v=t.finetuneNudgePrecision;var _g6=g,w=_g6.history,S=_g6.animation,k=_g6.scrollElasticity,C=_g6.rangeInputElasticity,T=_g6.imageColorMatrix,R=_g6.imageConvolutionMatrix,P=_g6.imageGamma,E=_g6.imageVignette,A=_g6.imageNoise,L=_g6.allowPan,z=_g6.allowZoom,F=_g6.allowZoomControls,D=_g6.allowPlayPause;sr(e,S,function(e){return o(22,d=e);});var O={imageColorMatrix:T,imageConvolutionMatrix:R,imageGamma:P,imageVignette:E,imageNoise:A},B=oa("elasticityMultiplier");sr(e,B,function(e){return o(6,h=e);});var W="finetune-"+I(),V=Na({});sr(e,V,function(e){return o(23,u=e);});var _=Na({});sr(e,_,function(e){return o(7,p=e);});var N=[];var H=uc(d?20:0);sr(e,H,function(e){return o(20,l=e);});return e.$$set=function(e){"stores"in e&&o(15,g=e.stores),"isActive"in e&&$(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=function(){var t;2097152&e.$$.dirty[0]&&L.set(c),2097152&e.$$.dirty[0]&&z.set(c),2097152&e.$$.dirty[0]&&F.set(c),2097152&e.$$.dirty[0]&&c&&D.set(!0),327680&e.$$.dirty[0]&&o(1,i=x?x.map(function(_ref435){var _ref436=_slicedToArray(_ref435,2),e=_ref436[0],t=_ref436[1];return {id:e,label:M(t)?t(y):t};}):[]),2&e.$$.dirty[0]&&o(2,n=i.length?i[0].id:void 0),4&e.$$.dirty[0]&&o(5,r=n&&{name:W,selected:n}),2&e.$$.dirty[0]&&o(4,a=i.map(function(e){return e.id;})),131072&e.$$.dirty[0]&&b&&(t=b,N&&N.forEach(function(e){return e();}),N=a.map(function(e){var _t$e3=t[e],o=_t$e3.getStore,_t$e3$getValue=_t$e3.getValue,i=_t$e3$getValue===void 0?Z:_t$e3$getValue;return o(O).subscribe(function(t){var o=null!=t?i(t):t;$r(V,u=_objectSpread2(_objectSpread2({},u),{},_defineProperty({},e,o)),u);});})),8519680&e.$$.dirty[0]&&b&&u&&$r(_,p=Object.keys(u).reduce(function(e,t){var _b$t=b[t],o=_b$t.base,i=_b$t.min,n=_b$t.max,r=_b$t.getLabel,a=_b$t.getStore,_b$t$setValue=_b$t.setValue,s=_b$t$setValue===void 0?function(e,t){return e.set(t);}:_b$t$setValue,l=a(O),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:function oninputmove(e){s(l,e);},oninputend:function oninputend(e){s(l,e),w.write();},elasticity:h*C,labelReset:y.labelReset,nudgeMultiplier:v},e;},{}),p),6291456&e.$$.dirty[0]&&d&&H.set(c?0:20),1048576&e.$$.dirty[0]&&o(3,s=l?"transform: translateY(".concat(l,"px)"):void 0);},[f,i,n,s,a,r,h,p,S,k,B,V,_,H,"finetune",g,y,b,x,v,l,c,d,u,function(_ref437){var e=_ref437.detail;return o(2,n=e);},function(t){ia.call(this,e,t);}];}var Fy={util:["finetune",/*#__PURE__*/function(_Wa40){function _class3(e){var _this43;_classCallCheck(this,_class3);_this43=_callSuper(this,_class3),Ba(_assertThisInitialized(_this43),e,zy,Ly,nr,{name:14,stores:15,isActive:0,locale:16,finetuneControlConfiguration:17,finetuneOptions:18,finetuneNudgePrecision:19},null,[-1,-1]);return _this43;}_inherits(_class3,_Wa40);return _createClass(_class3,[{key:"name",get:function get(){return this.$$.ctx[14];}},{key:"stores",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"finetuneControlConfiguration",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({finetuneControlConfiguration:e}),fa();}},{key:"finetuneOptions",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({finetuneOptions:e}),fa();}},{key:"finetuneNudgePrecision",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({finetuneNudgePrecision:e}),fa();}}]);}(Wa)]},Dy=function Dy(e,t){var o=t.length;return e<0?e%o+o:e>=o?e%o:e;};function Oy(e,t,o){var i=e.slice();return i[46]=t[o].key,i[47]=t[o].index,i[48]=t[o].translate,i[49]=t[o].scale,i[50]=t[o].selected,i[12]=t[o].rotate,i[51]=t[o].dir,i[52]=t[o].center,i[53]=t[o].type,i[2]=t[o].visible,i;}function By(e){var t,o;return {c:function c(){t=Rr("div"),Dr(t,"class","PinturaShapeManipulator"),Dr(t,"data-control","point"),Dr(t,"style",o="pointer-events:none;transform: translate3d(".concat(e[52].x,"px, ").concat(e[52].y,"px, 0) scale(").concat(e[5],", ").concat(e[5],"); opacity: ").concat(e[4]));},m:function m(e,o){Tr(e,t,o);},p:function p(e,i){56&i[0]&&o!==(o="pointer-events:none;transform: translate3d(".concat(e[52].x,"px, ").concat(e[52].y,"px, 0) scale(").concat(e[5],", ").concat(e[5],"); opacity: ").concat(e[4]))&&Dr(t,"style",o);},d:function d(e){e&&Mr(t);}};}function Wy(e,t){var o,i,n,r,a,s,l,_c25,_d21,u;function h(){var _t129;for(var _len12=arguments.length,e=new Array(_len12),_key12=0;_key12<_len12;_key12++){e[_key12]=arguments[_key12];}return (_t129=t)[18].apply(_t129,[t[47]].concat(e));}var _p17="edge"===t[53]&&t[2]&&By(t);return {key:e,first:null,c:function c(){o=Rr("div"),l=Ir(),_p17&&_p17.c(),_c25=Ar(),Dr(o,"role","button"),Dr(o,"aria-label",i="Drag ".concat(t[53]," ").concat(t[46])),Dr(o,"tabindex",n="edge"===t[53]?-1:0),Dr(o,"class","PinturaShapeManipulator"),Dr(o,"data-control",r=t[53]),Dr(o,"data-selected",a=t[50]),Dr(o,"style",s="cursor:".concat(t[51]?t[51]+"-resize":"move",";opacity:").concat(t[4],";--tx:").concat(t[48].x,";--ty:").concat(t[48].y,";--r:").concat("edge"===t[53]?t[12]:0,"rad;--sx:").concat("point"===t[53]?t[5]:t[49].x,";--sy:").concat("point"===t[53]?t[5]:t[49].y,";")),this.first=o;},m:function m(e,i){Tr(e,o,i),Tr(e,l,i),_p17&&_p17.m(e,i),Tr(e,_c25,i),_d21||(u=[Lr(o,"nudge",h),gr(kd.call(null,o,{preventDefault:!0})),Lr(o,"interactionstart",function(){ir(t[9]("start",t[47]))&&t[9]("start",t[47]).apply(this,arguments);}),Lr(o,"interactionupdate",function(){ir(t[9]("move",t[47]))&&t[9]("move",t[47]).apply(this,arguments);}),Lr(o,"interactionend",function(){ir(t[9]("end",t[47]))&&t[9]("end",t[47]).apply(this,arguments);}),gr(Sd.call(null,o,{observeKeys:!0}))],_d21=!0);},p:function p(e,l){t=e,8&l[0]&&i!==(i="Drag ".concat(t[53]," ").concat(t[46]))&&Dr(o,"aria-label",i),8&l[0]&&n!==(n="edge"===t[53]?-1:0)&&Dr(o,"tabindex",n),8&l[0]&&r!==(r=t[53])&&Dr(o,"data-control",r),8&l[0]&&a!==(a=t[50])&&Dr(o,"data-selected",a),56&l[0]&&s!==(s="cursor:".concat(t[51]?t[51]+"-resize":"move",";opacity:").concat(t[4],";--tx:").concat(t[48].x,";--ty:").concat(t[48].y,";--r:").concat("edge"===t[53]?t[12]:0,"rad;--sx:").concat("point"===t[53]?t[5]:t[49].x,";--sy:").concat("point"===t[53]?t[5]:t[49].y,";"))&&Dr(o,"style",s),"edge"===t[53]&&t[2]?_p17?_p17.p(t,l):(_p17=By(t),_p17.c(),_p17.m(_c25.parentNode,_c25)):_p17&&(_p17.d(1),_p17=null);},d:function d(e){e&&Mr(o),e&&Mr(l),_p17&&_p17.d(e),e&&Mr(_c25),_d21=!1,or(u);}};}function Vy(e){var t,o,i,n;return {c:function c(){t=Rr("div"),Dr(t,"role","button"),Dr(t,"aria-label","Drag rotator"),Dr(t,"tabindex","0"),Dr(t,"class","PinturaShapeManipulator"),Dr(t,"data-control","rotate"),Dr(t,"style",o="transform: translate3d(".concat(e[0].x,"px, ").concat(e[0].y,"px, 0) scale(").concat(e[5],", ").concat(e[5],"); opacity: ").concat(e[4]));},m:function m(o,r){Tr(o,t,r),i||(n=[Lr(t,"nudge",e[11]),gr(kd.call(null,t,{preventDefault:!0})),Lr(t,"interactionstart",e[12]("start")),Lr(t,"interactionupdate",e[12]("move")),Lr(t,"interactionend",e[12]("end")),gr(Sd.call(null,t,{observeKeys:!0}))],i=!0);},p:function p(e,i){49&i[0]&&o!==(o="transform: translate3d(".concat(e[0].x,"px, ").concat(e[0].y,"px, 0) scale(").concat(e[5],", ").concat(e[5],"); opacity: ").concat(e[4]))&&Dr(t,"style",o);},d:function d(e){e&&Mr(t),i=!1,or(n);}};}function _y(e){var t,o,i=[],n=new Map(),r=e[3];var a=function a(e){return e[46];};for(var _t131=0;_t131<r.length;_t131+=1){var _o149=Oy(e,r,_t131),_s24=a(_o149);n.set(_s24,i[_t131]=Wy(_s24,_o149));}var s=e[1]&&Vy(e);return {c:function c(){for(var _e166=0;_e166<i.length;_e166+=1)i[_e166].c();t=Ir(),s&&s.c(),o=Ar();},m:function m(e,n){for(var _t133=0;_t133<i.length;_t133+=1)i[_t133].m(e,n);Tr(e,t,n),s&&s.m(e,n),Tr(e,o,n);},p:function p(e,l){1592&l[0]&&(r=e[3],i=Ia(i,l,a,1,e,r,n,t.parentNode,Pa,Wy,t,Oy)),e[1]?s?s.p(e,l):(s=Vy(e),s.c(),s.m(o.parentNode,o)):s&&(s.d(1),s=null);},i:Kn,o:Kn,d:function d(e){for(var _t135=0;_t135<i.length;_t135+=1)i[_t135].d(e);e&&Mr(t),s&&s.d(e),e&&Mr(o);}};}function Ny(e,t,o){var i,n,r,a;var s=ea(),l=.5*q,c=Y-l,d=Y+l,u=-Y,h=u-l,p=u+l,m=X-l,$=-X+l,g=l,f=-l,y=Y-q,b=y-l,x=y+l,v=X-q,w=v-l,S=v+l,k=u-q,C=k+l,T=k-l,M=u+q,R=M+l,P=M-l;var _t$visible2=t.visible,E=_t$visible2===void 0?!1:_t$visible2,_t$points=t.points,I=_t$points===void 0?[]:_t$points,A=t.rotatorPoint,L=t.selectedPoint,_t$enableDragEdges=t.enableDragEdges,z=_t$enableDragEdges===void 0?!0:_t$enableDragEdges,_t$enableDragPoints=t.enableDragPoints,F=_t$enableDragPoints===void 0?!0:_t$enableDragPoints,_t$enableRotatePoints=t.enableRotatePoints,D=_t$enableRotatePoints===void 0?!0:_t$enableRotatePoints;var O=oa("isAnimated");sr(e,O,function(e){return o(17,n=e);});var B=uc(.5,{precision:1e-4,stiffness:.3,damping:.7});sr(e,B,function(e){return o(5,a=e);});var W=uc(0,{precision:.001,stiffness:.3,damping:.7});sr(e,W,function(e){return o(4,r=e);});var V=function V(e){var t="";return (e<=d&&e>=c||e>=h&&e<=p)&&(t="ns"),(e<=$||e>=m||e>=f&&e<=g)&&(t="ew"),(e>=w&&e<=S||e<=R&&e>=P)&&(t="nesw"),(e>=b&&e<=x||e<=C&&e>=T)&&(t="nwse"),t;},_=function _(e,t){s("resizestart",{indexes:e,translation:ue(),isNudge:!0}),s("resizemove",{indexes:e,translation:t,isNudge:!0}),s("resizeend",{indexes:e,translation:ue(),isNudge:!0});};return e.$$set=function(e){"visible"in e&&o(2,E=e.visible),"points"in e&&o(13,I=e.points),"rotatorPoint"in e&&o(0,A=e.rotatorPoint),"selectedPoint"in e&&o(14,L=e.selectedPoint),"enableDragEdges"in e&&o(15,z=e.enableDragEdges),"enableDragPoints"in e&&o(16,F=e.enableDragPoints),"enableRotatePoints"in e&&o(1,D=e.enableRotatePoints);},e.$$.update=function(){131076&e.$$.dirty[0]&&B.set(E?1:.5,{hard:!1===n}),131076&e.$$.dirty[0]&&W.set(E?1:0,{hard:!1===n}),8192&e.$$.dirty[0]&&o(3,i=function(e,t){var o=0;var i=Ie(e),n=[],r=e.length;var _loop2=function _loop2(){var t=Dy(o-1,e),r=Dy(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){var _e167=ye(he(a.x-s.x,a.y-s.y)),_t136=ye(he(l.x-s.x,l.y-s.y)),_i93=he(_e167.x+_t136.x,_e167.y+_t136.y),_r38=z?F&&V(Math.atan2(_i93.y,_i93.x)):void 0;n.push({index:[o],key:"point-"+o,type:"point",selected:L===o,scale:{x:1,y:1},translate:{x:s.x,y:s.y},angle:void 0,rotate:D,center:s,dir:_r38});}if(!z)return 0;// continue
11
+ if(Array.isArray(z)&&!z.some(function(_ref438){var _ref439=_slicedToArray(_ref438,2),e=_ref439[0],t=_ref439[1];return o===e&&r===t;}))return 0;// continue
12
+ var d=he(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:Pe(s,l),y:1},translate:{x:s.x,y:s.y},angle:c,rotate:c,center:d,visible:Array.isArray(z),dir:V(Math.atan2(i.y-d.y,i.x-d.x))});},_ret2;for(;o<r;o++){_ret2=_loop2();if(_ret2===0)continue;}return n;}(I));},[A,D,E,i,r,a,O,B,W,function(e,t){return function(_ref440){var o=_ref440.detail;var i=o&&o.translation?o.translation:he(0,0);s("resize"+e,_objectSpread2(_objectSpread2({},o),{},{indexes:t,translation:i}));};},_,function(_ref441){var e=_ref441.detail;s("rotatestart",{translation:ue(),isNudge:!0}),s("rotatemove",{translation:e,isNudge:!0}),s("rotateend",{translation:ue(),isNudge:!0});},function(e){return function(_ref442){var t=_ref442.detail;var o=t&&t.translation?t.translation:he(0,0);s("rotate"+e,_objectSpread2(_objectSpread2({},t),{},{translation:o}));};},I,L,z,F,n,function(e,_ref443){var t=_ref443.detail;return _(e,t);}];}var Hy=/*#__PURE__*/function(_Wa41){function Hy(e){var _this44;_classCallCheck(this,Hy);_this44=_callSuper(this,Hy),Ba(_assertThisInitialized(_this44),e,Ny,_y,nr,{visible:2,points:13,rotatorPoint:0,selectedPoint:14,enableDragEdges:15,enableDragPoints:16,enableRotatePoints:1},null,[-1,-1]);return _this44;}_inherits(Hy,_Wa41);return _createClass(Hy);}(Wa);var jy=function jy(e,t){var o=Jp(e);return Se(o,t);},Uy=function Uy(e){return document.createTextNode(e);},Gy=function Gy(e){return (Yt()&&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 Zy(e){var t,o;return {c:function c(){t=Rr("pre"),Dr(t,"class","PinturaContentEditable"),Dr(t,"style",o=e[7]+";position:absolute;z-index:-1;pointer-events:none;");},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[0];},p:function p(e,i){1&i[0]&&(t.innerHTML=e[0]),128&i[0]&&o!==(o=e[7]+";position:absolute;z-index:-1;pointer-events:none;")&&Dr(t,"style",o);},d:function d(e){e&&Mr(t);}};}function Xy(e){var t,o,i,n,r,a,s=e[8]&&Zy(e);return {c:function c(){s&&s.c(),t=Ir(),o=Rr("pre"),Dr(o,"class","PinturaContentEditable"),Dr(o,"data-wrap-content",i=e[4]||e[5]?"wrap":"nowrap"),Dr(o,"contenteditable",""),Dr(o,"spellcheck",e[1]),Dr(o,"autocorrect",e[2]),Dr(o,"autocapitalize",e[3]),Dr(o,"style",n=e[8]?e[15](e[7]):e[7]);},m:function m(i,n){s&&s.m(i,n),Tr(i,t,n),Tr(i,o,n),e[26](o),r||(a=[Lr(o,"input",e[13]),Lr(o,"compositionend",e[12]),Lr(o,"paste",e[14]),Lr(o,"keydown",e[10]),Lr(o,"keyup",e[11]),Lr(o,"blur",e[9])],r=!0);},p:function p(e,r){e[8]?s?s.p(e,r):(s=Zy(e),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),48&r[0]&&i!==(i=e[4]||e[5]?"wrap":"nowrap")&&Dr(o,"data-wrap-content",i),2&r[0]&&Dr(o,"spellcheck",e[1]),4&r[0]&&Dr(o,"autocorrect",e[2]),8&r[0]&&Dr(o,"autocapitalize",e[3]),384&r[0]&&n!==(n=e[8]?e[15](e[7]):e[7])&&Dr(o,"style",n);},i:Kn,o:Kn,d:function d(i){s&&s.d(i),i&&Mr(t),i&&Mr(o),e[26](null),r=!1,or(a);}};}function Yy(e,t,o){var i,r,_t$spellcheck=t.spellcheck,a=_t$spellcheck===void 0?"false":_t$spellcheck,_t$autocorrect=t.autocorrect,s=_t$autocorrect===void 0?"off":_t$autocorrect,_t$autocapitalize=t.autocapitalize,l=_t$autocapitalize===void 0?"off":_t$autocapitalize,_t$wrapLines=t.wrapLines,c=_t$wrapLines===void 0?!0:_t$wrapLines,_t$allowNewline=t.allowNewline,d=_t$allowNewline===void 0?!0:_t$allowNewline,_t$textFormat=t.textFormat,u=_t$textFormat===void 0?"text":_t$textFormat,_t$formatInput=t.formatInput,h=_t$formatInput===void 0?Z:_t$formatInput,_t$formatPaste=t.formatPaste,m=_t$formatPaste===void 0?Z:_t$formatPaste,$=t.style,g=t.innerHTML,_t$oninput=t.oninput,f=_t$oninput===void 0?n:_t$oninput,_t$enableTextStyleSho=t.enableTextStyleShortcuts,y=_t$enableTextStyleSho===void 0?!1:_t$enableTextStyleSho;var b=function b(){if(!v)return;var e=document.createRange();e.selectNodeContents(v);var t=R();t.removeAllRanges(),t.addRange(e);},x=ea();var v;document.execCommand("defaultParagraphSeparator",!1,"br");var w=function w(e){return e.replace(/<\/?(?:i|b|em|u|s|strike|strong|font)>/,"").replace(/style=".*?"/g,"").replace(/\n/gim,"<br>");},S=function S(){o(0,g=v.innerHTML);var e=Gy(g);x("input",e),f(e),requestAnimationFrame(function(){return v&&v.scrollTo(0,0);});},k=function k(){P(v);var e="html"===u?v.innerHTML:w(v.innerHTML);o(6,v.innerHTML=h(e),v),E(v),S();},C={b:"bold",i:"italic",u:"underline",s:"strikethrough"},T=function T(e){var t=p("span");return t.dataset.bookmark=e,t;},M=function M(e,t,o){var i=T(o);if(e.nodeType===Node.TEXT_NODE){var _n48=e.textContent;if("start"===o){var _o150=Uy(_n48.substr(0,t)),_r39=Uy(_n48.substr(t));e.replaceWith(_o150,i,_r39);}else {var _o151=Uy(_n48.substr(0,t)),_r40=Uy(_n48.substr(t));e.replaceWith(_o151,i,_r40);}}else e.nodeType===Node.ELEMENT_NODE&&e.insertBefore(i,e.childNodes[t]);},R=function R(){var e=v.getRootNode();return "getSelection"in e?e.getSelection():document.getSelection();},P=function P(e){var t=R();if(!t.getRangeAt||!t.rangeCount)return;var o=t.getRangeAt(0),i=o.startOffset,n=o.endOffset,r=o.startContainer,a=o.endContainer;if(e.contains(o.startContainer)&&e.contains(o.endContainer))if(r.nodeType===Node.TEXT_NODE&&r===a){var _e168=r.textContent,_t137=_e168.substr(0,i),_o152=T("start"),_a20=n-i>0?_e168.substr(i,n):"",_s25=T("end"),_l21=_e168.substr(n);r.replaceWith(_t137,_o152,_a20,_s25,_l21);}else M(r,i,"start"),M(a,n+(r===a?1:0),"end");},E=function E(e){var t=I(e,"start"),o=I(e,"end");if(!t||!o)return;var i=document.createRange();i.setStart(t,0),i.setEnd(o,0);var n=R();n.removeAllRanges(),n.addRange(i),t.remove(),o.remove();},I=function I(e,t){var o=e.children;for(var _e170=0;_e170<o.length;_e170++){var _i94=o[_e170];if(_i94.dataset.bookmark===t)return _i94;if(_i94.children.length){var _e171=I(_i94,t);if(_e171)return _e171;}}};var A;return e.$$set=function(e){"spellcheck"in e&&o(1,a=e.spellcheck),"autocorrect"in e&&o(2,s=e.autocorrect),"autocapitalize"in e&&o(3,l=e.autocapitalize),"wrapLines"in e&&o(4,c=e.wrapLines),"allowNewline"in e&&o(5,d=e.allowNewline),"textFormat"in e&&o(16,u=e.textFormat),"formatInput"in e&&o(17,h=e.formatInput),"formatPaste"in e&&o(18,m=e.formatPaste),"style"in e&&o(19,$=e.style),"innerHTML"in e&&o(0,g=e.innerHTML),"oninput"in e&&o(20,f=e.oninput),"enableTextStyleShortcuts"in e&&o(21,y=e.enableTextStyleShortcuts);},e.$$.update=function(){var t;if(64&e.$$.dirty[0]&&o(25,i=!!v),33554433&e.$$.dirty[0]&&i&&g&&(t=g)!==v.innerHTML&&(o(6,v.innerHTML=t,v),v===document.activeElement&&b()),524336&e.$$.dirty[0])if(!c&&d){var _e172=$.includes(":right")?"text-indent:-100px!important":$.includes(":center")?"":"min-width:calc(100% + 100px)!important";o(7,A=$+";overflow:visible;"+_e172);}else o(7,A=$);524288&e.$$.dirty[0]&&o(8,r=$.includes("text-stroke"));},[g,a,s,l,c,d,v,A,r,function(){x("blur");},function(e){if(/escape/i.test(e.code))return e.stopPropagation(),void x("cancel");var t=e.ctrlKey||e.metaKey;if("html"===u&&t&&/b|i|u|s/.test(e.key))return y&&function(e){var t=C[e];t&&document.execCommand(t);}(e.key),void e.preventDefault();/enter/i.test(e.code)&&(e.stopPropagation(),e.isComposing||(t?x("confirm"):(d||e.preventDefault(),document.execCommand("insertLineBreak"),e.preventDefault())));},function(){},function(e){""!==e.data&&k();},function(e){var t=e.inputType;"insertCompositionText"!==t&&"deleteCompositionText"!==t&&k();},function(e){e.preventDefault();var t=e.clipboardData.getData("text/plain"),o="html"===u?t:w(t),i=m(o);if(!i.length)return;var n=R().getRangeAt(0);n.deleteContents(),n.insertNode(document.createTextNode(i)),S();},function(e){return e.replace("-webkit-text-stroke","--text-stroke").replace("text-shadow","--text-shadow");},u,h,m,$,f,y,function(){return k();},function(){return v&&v.focus();},b,i,function(e){ra[e?"unshift":"push"](function(){v=e,o(6,v);});}];}var qy=/*#__PURE__*/function(_Wa42){function qy(e){var _this45;_classCallCheck(this,qy);_this45=_callSuper(this,qy),Ba(_assertThisInitialized(_this45),e,Yy,Xy,nr,{spellcheck:1,autocorrect:2,autocapitalize:3,wrapLines:4,allowNewline:5,textFormat:16,formatInput:17,formatPaste:18,style:19,innerHTML:0,oninput:20,enableTextStyleShortcuts:21,confirm:22,focus:23,select:24},null,[-1,-1]);return _this45;}_inherits(qy,_Wa42);return _createClass(qy,[{key:"spellcheck",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({spellcheck:e}),fa();}},{key:"autocorrect",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({autocorrect:e}),fa();}},{key:"autocapitalize",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({autocapitalize:e}),fa();}},{key:"wrapLines",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({wrapLines:e}),fa();}},{key:"allowNewline",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({allowNewline:e}),fa();}},{key:"textFormat",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({textFormat:e}),fa();}},{key:"formatInput",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({formatInput:e}),fa();}},{key:"formatPaste",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({formatPaste:e}),fa();}},{key:"style",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({style:e}),fa();}},{key:"innerHTML",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({innerHTML:e}),fa();}},{key:"oninput",get:function get(){return this.$$.ctx[20];},set:function set(e){this.$$set({oninput:e}),fa();}},{key:"enableTextStyleShortcuts",get:function get(){return this.$$.ctx[21];},set:function set(e){this.$$set({enableTextStyleShortcuts:e}),fa();}},{key:"confirm",get:function get(){return this.$$.ctx[22];}},{key:"focus",get:function get(){return this.$$.ctx[23];}},{key:"select",get:function get(){return this.$$.ctx[24];}}]);}(Wa);var Ky=["i","b","u","strike"].map(function(e){return {tag:e,tagOpen:new RegExp("<".concat(e,">"),"g"),tagClose:new RegExp("</".concat(e,">"),"g"),placeholderOpen:new RegExp("___".concat(e,"O___"),"g"),placeholderClose:new RegExp("___".concat(e,"C___"),"g")};});var Jy=function Jy(e){return e=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ky;return t.forEach(function(_ref444){var t=_ref444.tag,o=_ref444.placeholderOpen,i=_ref444.placeholderClose;e=e.replace(o,"<".concat(t,">")).replace(i,"</".concat(t,">"));}),e;}(e=(e=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Ky;return t.forEach(function(_ref445){var t=_ref445.tag,o=_ref445.tagOpen,i=_ref445.tagClose;e=e.replace(o,"___".concat(t,"O___")).replace(i,"___".concat(t,"C___"));}),e;}(e)).replace(/ {2,}/g," ").replace(/\u00a0/g,"&nbsp;").split("\n").join("<br>"));},Qy=function Qy(e,t){return T(e)?parseFloat(e)/100*t:e;},eb=function eb(e,t){return {x:Ho(e.x,t.width),y:Ho(e.y,t.height)};};function tb(e,t,o){var i=e.slice();return i[299]=t[o],i[301]=o,i;}function ob(e,t){var o,i,n,r,a,s,l,_c26,d,u,h,_p18=t[299].name+"";function _m11(){return t[189](t[301]);}return n=new Gh({props:{color:t[299].color}}),{key:e,first:null,c:function c(){o=Rr("li"),i=Rr("button"),Fa(n.$$.fragment),r=Ir(),a=Rr("span"),s=Er(_p18),_c26=Ir(),Dr(i,"class","PinturaShapeListItem"),Dr(i,"type","button"),Dr(i,"aria-label",l="Select shape "+t[299].name),this.first=o;},m:function m(e,t){Tr(e,o,t),Sr(o,i),Da(n,i,null),Sr(i,r),Sr(i,a),Sr(a,s),Sr(o,_c26),d=!0,u||(h=Lr(i,"click",_m11),u=!0);},p:function p(e,o){t=e;var r={};2097152&o[0]&&(r.color=t[299].color),n.$set(r),(!d||2097152&o[0])&&_p18!==(_p18=t[299].name+"")&&Wr(s,_p18),(!d||2097152&o[0]&&l!==(l="Select shape "+t[299].name))&&Dr(i,"aria-label",l);},i:function i(e){d||(ka(n.$$.fragment,e),d=!0);},o:function o(e){Ca(n.$$.fragment,e),d=!1;},d:function d(e){e&&Mr(o),Oa(n),u=!1,h();}};}function ib(e){var t,_o153;return t=new Hy({props:{visible:!0,points:e[12],rotatorPoint:e[27],selectedPoint:e[16],enableDragEdges:e[17],enableDragPoints:e[29],enableRotatePoints:e[14]}}),t.$on("resizestart",e[38]),t.$on("resizemove",e[39]),t.$on("resizeend",e[40]),t.$on("rotatestart",e[41]),t.$on("rotatemove",e[42]),t.$on("rotateend",e[43]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o153=!0;},p:function p(e,o){var i={};4096&o[0]&&(i.points=e[12]),134217728&o[0]&&(i.rotatorPoint=e[27]),65536&o[0]&&(i.selectedPoint=e[16]),131072&o[0]&&(i.enableDragEdges=e[17]),536870912&o[0]&&(i.enableDragPoints=e[29]),16384&o[0]&&(i.enableRotatePoints=e[14]),t.$set(i);},i:function i(e){_o153||(ka(t.$$.fragment,e),_o153=!0);},o:function o(e){Ca(t.$$.fragment,e),_o153=!1;},d:function d(e){Oa(t,e);}};}function nb(e){var t,_o154,i,n;var r=[ab,rb],a=[];function s(e,t){return "modal"===e[4]?0:"inline"===e[4]?1:-1;}return ~(t=s(e))&&(_o154=a[t]=r[t](e)),{c:function c(){_o154&&_o154.c(),i=Ar();},m:function m(e,o){~t&&a[t].m(e,o),Tr(e,i,o),n=!0;},p:function p(e,n){var l=t;t=s(e),t===l?~t&&a[t].p(e,n):(_o154&&(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa()),~t?(_o154=a[t],_o154?_o154.p(e,n):(_o154=a[t]=r[t](e),_o154.c()),ka(_o154,1),_o154.m(i.parentNode,i)):_o154=null);},i:function i(e){n||(ka(_o154),n=!0);},o:function o(e){Ca(_o154),n=!1;},d:function d(e){~t&&a[t].d(e),e&&Mr(i);}};}function rb(e){var t,_o155,_i95,n,r,a={formatInput:e[45],wrapLines:!!e[13].width,textFormat:e[13].format,enableTextStyleShortcuts:e[5],allowNewline:e[28],style:e[26]};return _o155=new qy({props:a}),e[192](_o155),_o155.$on("input",e[46]),_o155.$on("keyup",e[49]),_o155.$on("cancel",e[51]),_o155.$on("confirm",e[50]),{c:function c(){t=Rr("div"),Fa(_o155.$$.fragment),Dr(t,"class","PinturaInlineInput"),Dr(t,"style",e[25]);},m:function m(a,s){Tr(a,t,s),Da(_o155,t,null),_i95=!0,n||(r=Lr(t,"focusout",e[193]),n=!0);},p:function p(e,n){var r={};8192&n[0]&&(r.wrapLines=!!e[13].width),8192&n[0]&&(r.textFormat=e[13].format),32&n[0]&&(r.enableTextStyleShortcuts=e[5]),268435456&n[0]&&(r.allowNewline=e[28]),67108864&n[0]&&(r.style=e[26]),_o155.$set(r),(!_i95||33554432&n[0])&&Dr(t,"style",e[25]);},i:function i(e){_i95||(ka(_o155.$$.fragment,e),_i95=!0);},o:function o(e){Ca(_o155.$$.fragment,e),_i95=!1;},d:function d(i){i&&Mr(t),e[192](null),Oa(_o155),n=!1,r();}};}function ab(e){var t,_o156;return t=new Ap({props:{panelOffset:e[2],onconfirm:e[50],oncancel:e[51],buttonCancel:{icon:e[6].shapeIconInputCancel,label:e[6].shapeLabelInputCancel},buttonConfirm:{icon:e[6].shapeIconInputConfirm,label:e[6].shapeLabelInputConfirm,hideLabel:!0},$$slots:{default:[sb]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o156=!0;},p:function p(e,o){var i={};4&o[0]&&(i.panelOffset=e[2]),64&o[0]&&(i.buttonCancel={icon:e[6].shapeIconInputCancel,label:e[6].shapeLabelInputCancel}),64&o[0]&&(i.buttonConfirm={icon:e[6].shapeIconInputConfirm,label:e[6].shapeLabelInputConfirm,hideLabel:!0}),83886336&o[0]|8388608&o[9]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o156||(ka(t.$$.fragment,e),_o156=!0);},o:function o(e){Ca(t.$$.fragment,e),_o156=!1;},d:function d(e){Oa(t,e);}};}function sb(e){var t,o,i;return {c:function c(){t=Rr("textarea"),Dr(t,"spellcheck","false"),Dr(t,"autocorrect","off"),Dr(t,"autocapitalize","off"),Dr(t,"style",e[26]);},m:function m(n,r){Tr(n,t,r),e[190](t),Vr(t,e[24]),o||(i=[Lr(t,"keydown",e[48]),Lr(t,"keypress",e[47]),Lr(t,"keyup",e[49]),Lr(t,"input",e[46]),Lr(t,"input",e[191])],o=!0);},p:function p(e,o){67108864&o[0]&&Dr(t,"style",e[26]),16777216&o[0]&&Vr(t,e[24]);},d:function d(n){n&&Mr(t),e[190](null),o=!1,or(i);}};}function lb(e){var t,_o157,_i96,n,r;return _o157=new Cp({props:{items:e[22],key:e[10]}}),{c:function c(){t=Rr("div"),Fa(_o157.$$.fragment),Dr(t,"class","PinturaShapeControls"),Dr(t,"style",e[23]);},m:function m(a,s){Tr(a,t,s),Da(_o157,t,null),_i96=!0,n||(r=[Lr(t,"measure",e[194]),gr(Mc.call(null,t))],n=!0);},p:function p(e,n){var r={};4194304&n[0]&&(r.items=e[22]),1024&n[0]&&(r.key=e[10]),_o157.$set(r),(!_i96||8388608&n[0])&&Dr(t,"style",e[23]);},i:function i(e){_i96||(ka(_o157.$$.fragment,e),_i96=!0);},o:function o(e){Ca(_o157.$$.fragment,e),_i96=!1;},d:function d(e){e&&Mr(t),Oa(_o157),n=!1,or(r);}};}function cb(e){var t,o,i,r,a,s,l,c,_d22,u,h=[],_p19=new Map(),m=e[21];var $=function $(e){return e[299].id;};for(var _t139=0;_t139<m.length;_t139+=1){var _o158=tb(e,m,_t139),_i97=$(_o158);_p19.set(_i97,h[_t139]=ob(_i97,_o158));}var g=e[15]&&ib(e),f=e[11]&&nb(e),y=e[18]>0&&lb(e);return {c:function c(){t=Rr("div"),o=Rr("nav"),i=Rr("ul");for(var _e174=0;_e174<h.length;_e174+=1)h[_e174].c();r=Ir(),g&&g.c(),a=Ir(),f&&f.c(),s=Ir(),y&&y.c(),Dr(o,"class","PinturaShapeList"),Dr(o,"data-visible",e[19]),Dr(t,"class","PinturaShapeEditor"),Dr(t,"tabindex","0");},m:function m(p,_m12){Tr(p,t,_m12),Sr(t,o),Sr(o,i);for(var _e176=0;_e176<h.length;_e176+=1)h[_e176].m(i,null);Sr(t,r),g&&g.m(t,null),Sr(t,a),f&&f.m(t,null),Sr(t,s),y&&y.m(t,null),e[195](t),c=!0,_d22||(u=[Lr(o,"focusin",e[54]),Lr(o,"focusout",e[55]),Lr(t,"keydown",function(){ir(e[0]?n:e[44])&&(e[0]?n:e[44]).apply(this,arguments);}),Lr(t,"nudge",function(){ir(e[0]?n:e[53])&&(e[0]?n:e[53]).apply(this,arguments);}),Lr(t,"measure",e[188]),Lr(t,"pointermove",function(){ir(e[0]?n:e[56])&&(e[0]?n:e[56]).apply(this,arguments);}),Lr(t,"pointerleave",function(){ir(e[0]?n:e[57])&&(e[0]?n:e[57]).apply(this,arguments);}),Lr(t,"interactionstart",function(){ir(e[0]?n:e[32])&&(e[0]?n:e[32]).apply(this,arguments);}),Lr(t,"interactionupdate",function(){ir(e[0]?n:e[34])&&(e[0]?n:e[34]).apply(this,arguments);}),Lr(t,"interactioncancel",function(){ir(e[0]?n:e[33])&&(e[0]?n:e[33]).apply(this,arguments);}),Lr(t,"interactionrelease",function(){ir(e[0]?n:e[35])&&(e[0]?n:e[35]).apply(this,arguments);}),Lr(t,"interactionend",function(){ir(e[0]?n:e[36])&&(e[0]?n:e[36]).apply(this,arguments);}),gr(Mc.call(null,t)),gr(kd.call(null,t)),gr(l=Sd.call(null,t,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:db,getEventPosition:e[196]}))],_d22=!0);},p:function p(n,r){e=n,2097282&r[0]&&(m=e[21],wa(),h=Ia(h,r,$,1,e,m,_p19,i,Ea,ob,null,tb),Sa()),(!c||524288&r[0])&&Dr(o,"data-visible",e[19]),e[15]?g?(g.p(e,r),32768&r[0]&&ka(g,1)):(g=ib(e),g.c(),ka(g,1),g.m(t,a)):g&&(wa(),Ca(g,1,1,function(){g=null;}),Sa()),e[11]?f?(f.p(e,r),2048&r[0]&&ka(f,1)):(f=nb(e),f.c(),ka(f,1),f.m(t,s)):f&&(wa(),Ca(f,1,1,function(){f=null;}),Sa()),e[18]>0?y?(y.p(e,r),262144&r[0]&&ka(y,1)):(y=lb(e),y.c(),ka(y,1),y.m(t,null)):y&&(wa(),Ca(y,1,1,function(){y=null;}),Sa()),l&&ir(l.update)&&8&r[0]&&l.update.call(null,{drag:!0,inertia:!0,multiTouch:!1,observeKeys:!0,shouldStartInteraction:db,getEventPosition:e[196]});},i:function i(e){if(!c){for(var _e178=0;_e178<m.length;_e178+=1)ka(h[_e178]);ka(g),ka(f),ka(y),c=!0;}},o:function o(e){for(var _e180=0;_e180<h.length;_e180+=1)Ca(h[_e180]);Ca(g),Ca(f),Ca(y),c=!1;},d:function d(o){o&&Mr(t);for(var _e182=0;_e182<h.length;_e182+=1)h[_e182].d();g&&g.d(),f&&f.d(),y&&y.d(),e[195](null),_d22=!1,or(u);}};}var db=function db(e,t){return e.target===t;};function ub(e,t,o){var i,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S,k,C,M,R,P,E,A,L,z,D,O,B,W,V,_,N,H,j,U,G,X,Y,q,K,J,Q,ee,te,oe,ie,ne,re,ae,se,ce,pe,$e,fe,ke,Te,Me,Ee,ze=Kn,Fe=function Fe(){return ze(),ze=rr(_e,function(e){return o(184,fe=e);}),_e;};e.$$.on_destroy.push(function(){return ze();});var _t$uid=t.uid,Oe=_t$uid===void 0?I():_t$uid,Be=t.ui,_t$disabled6=t.disabled,We=_t$disabled6===void 0?!1:_t$disabled6,_e=t.shapes;Fe();var Ne=t.selection,He=t.offset,_t$contextRotation=t.contextRotation,je=_t$contextRotation===void 0?0:_t$contextRotation,_t$contextFlipX=t.contextFlipX,Ue=_t$contextFlipX===void 0?!1:_t$contextFlipX,_t$contextFlipY=t.contextFlipY,Xe=_t$contextFlipY===void 0?!1:_t$contextFlipY,_t$contextZoom=t.contextZoom,qe=_t$contextZoom===void 0?1:_t$contextZoom,_t$active=t.active,Ke=_t$active===void 0?!1:_t$active,_t$opacity2=t.opacity,Je=_t$opacity2===void 0?1:_t$opacity2,Qe=t.parentRect,et=t.rootRect,tt=t.utilRect,rt=t.hoverColor,lt=t.caretColor,ct=t.gridColor,dt=t.snapColor,_t$textInputMode=t.textInputMode,ut=_t$textInputMode===void 0?"inline":_t$textInputMode,_t$oninteractionstart=t.oninteractionstart,ht=_t$oninteractionstart===void 0?n:_t$oninteractionstart,_t$oninteractionupdat=t.oninteractionupdate,pt=_t$oninteractionupdat===void 0?n:_t$oninteractionupdat,_t$oninteractionrelea=t.oninteractionrelease,mt=_t$oninteractionrelea===void 0?n:_t$oninteractionrelea,_t$oninteractionend=t.oninteractionend,$t=_t$oninteractionend===void 0?n:_t$oninteractionend,_t$oninteractioncance=t.oninteractioncancel,gt=_t$oninteractioncance===void 0?n:_t$oninteractioncance,_t$onaddshape=t.onaddshape,yt=_t$onaddshape===void 0?n:_t$onaddshape,_t$onupdateshape=t.onupdateshape,bt=_t$onupdateshape===void 0?n:_t$onupdateshape,_t$onselectshape=t.onselectshape,xt=_t$onselectshape===void 0?n:_t$onselectshape,_t$onblurshape=t.onblurshape,kt=_t$onblurshape===void 0?n:_t$onblurshape,_t$onremoveshape=t.onremoveshape,Ct=_t$onremoveshape===void 0?n:_t$onremoveshape,_t$ontapshape=t.ontapshape,Tt=_t$ontapshape===void 0?n:_t$ontapshape,_t$onhovershape=t.onhovershape,Mt=_t$onhovershape===void 0?n:_t$onhovershape,_t$ontriggerhistorywr=t.ontriggerhistorywrite,Rt=_t$ontriggerhistorywr===void 0?n:_t$ontriggerhistorywr,_t$onhovercanvas=t.onhovercanvas,Pt=_t$onhovercanvas===void 0?n:_t$onhovercanvas,_t$ontapcanvas=t.ontapcanvas,At=_t$ontapcanvas===void 0?n:_t$ontapcanvas,_t$onleavecanvas=t.onleavecanvas,Lt=_t$onleavecanvas===void 0?n:_t$onleavecanvas,_t$beforeSelectShape=t.beforeSelectShape,Wt=_t$beforeSelectShape===void 0?function(){return !0;}:_t$beforeSelectShape,_t$beforeDeselectShap=t.beforeDeselectShape,Vt=_t$beforeDeselectShap===void 0?function(){return !0;}:_t$beforeDeselectShap,_t$beforeRemoveShape=t.beforeRemoveShape,_t=_t$beforeRemoveShape===void 0?function(){return !0;}:_t$beforeRemoveShape,_t$beforeUpdateShape=t.beforeUpdateShape,Nt=_t$beforeUpdateShape===void 0?function(e,t,o){return t;}:_t$beforeUpdateShape,_t$willRenderShapeCon=t.willRenderShapeControls,Ht=_t$willRenderShapeCon===void 0?Z:_t$willRenderShapeCon,_t$willRenderShapeTex=t.willRenderShapeTextControls,jt=_t$willRenderShapeTex===void 0?Z:_t$willRenderShapeTex,_t$willStartInteracti=t.willStartInteraction,Ut=_t$willStartInteracti===void 0?function(e,t){return !0;}:_t$willStartInteracti,Gt=t.mapEditorPointToImagePoint,Zt=t.mapImagePointToEditorPoint,Xt=t.eraseRadius,Yt=t.selectRadius,_t$enableButtonFlipVe=t.enableButtonFlipVertical,qt=_t$enableButtonFlipVe===void 0?!1:_t$enableButtonFlipVe,_t$enableTapToAddText=t.enableTapToAddText,Kt=_t$enableTapToAddText===void 0?!0:_t$enableTapToAddText,_t$enableMultiSelect=t.enableMultiSelect,Jt=_t$enableMultiSelect===void 0?!1:_t$enableMultiSelect,_t$enableTextStyleCon=t.enableTextStyleControls,Qt=_t$enableTextStyleCon===void 0?!0:_t$enableTextStyleCon,eo=t.locale,_t$snapThreshold=t.snapThreshold,to=_t$snapThreshold===void 0?0:_t$snapThreshold,_t$snapPointer=t.snapPointer,oo=_t$snapPointer===void 0?!0:_t$snapPointer,_t$enableSnapToContex=t.enableSnapToContext,io=_t$enableSnapToContex===void 0?!0:_t$enableSnapToContex,_t$gridSize=t.gridSize,no=_t$gridSize===void 0?0:_t$gridSize;var ro=function ro(e){if(0===to)return [];var t;return io&&(t=_objectSpread2(_objectSpread2({},Qe),{},{x:0,y:0})),[].concat(_toConsumableArray(fe.filter(function(t){return t!==e;}).filter(function(e){return !zi(e);}).filter(function(e){return function(e){return !0!==e.disableAcceptSnap;}(e);}).map(function(e){return gn(_objectSpread2({},e),Qe);})),[t]).filter(Boolean);},ao=function ao(e,t,o,i){return 0===e?{snapTargets:[]}:{snapThreshold:e,gridSize:t,gridRect:o,snapTargets:ro(i)};},so=oa("isAnimated");sr(e,so,function(e){return o(185,Te=e);});var lo=function lo(e){return e.set(ar(e));},co=function co(e){return ar(e).find(zi);},uo=function uo(e,t){if(!co(t))return Wi(e),$o(e,t);},ho=function ho(e){co(e)&&e.update(function(e){return e.filter(function(e){return !zi(e);});});},po=function po(e){var t=co(e);if(t)return Vi(t),lo(e),t;},mo=function mo(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:function(e,t){return _objectSpread2(_objectSpread2({},e),t);};co(t)&&t.update(function(t){return t.map(function(t){return zi(t)?o(t,e):t;});});},$o=function $o(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_e;return t.update(function(t){return [].concat(_toConsumableArray(t),[e]);}),e;},go=function go(e,t,o){var i=Nt(_objectSpread2({},e),t,_objectSpread2({},o));return xn(e,i,o),e;},fo=function fo(e,t){var o=Pe(e,t),i=be(e,t),n=Math.PI/8,r=n*Math.round(i/n)-je%n;t.x=e.x+o*Math.cos(r),t.y=e.y+o*Math.sin(r);},yo=oa("keysPressed");sr(e,yo,function(e){return o(186,Me=e);});var bo=function bo(e,t,o){return 0===e||t&&o?e:t||o?-e:e;},xo=function xo(e){if(null===e.x&&null===e.y)return vo();e.x&&o(140,wo=Gt({x:e.x,y:0}).x),e.y&&o(141,So=Gt({x:0,y:e.y}).y);},vo=function vo(){o(140,wo=null),o(141,So=null);};var wo=null,So=null;var ko=function ko(e,t){var o=Zt(e);return Gt(we(o,t));},Co=function Co(e,t,o){var i=(o-t)/e+1;return Array.from({length:i},function(o,i){return t+i*e;});},To=function To(e){var t=[],o=[],i=e.points;if(void 0!==e.x1&&(i=[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}]),i){var _e183=i.map(Zt),_n49=it(_e183),_r41=_e183[0],_a21=_e183[_e183.length-1];t=[_n49.x,_n49.x+.5*_n49.width,_n49.x+_n49.width,_r41.x,_a21.x],o=[_n49.y,_n49.y+.5*_n49.height,_n49.y+_n49.height,_r41.y,_a21.y];}else if(e.text||void 0!==e.width||void 0!==e.rx){var _i98;if(e.text&&void 0===e.height){var _t140=ni(e.text,e);_i98=at(e.x,e.y,_t140.width,_t140.height);}else _i98=void 0!==e.width?ot(e):ot({x:e.x-e.rx,y:e.y-e.ry,width:2*e.rx,height:2*e.ry});var _n50=St(_i98).map(Zt),_r42=Math.abs(e.rotation)>0?ft(_i98,e.rotation).map(Zt):_n50,_a22=it(_r42),_s26=st(_a22),_l22=.5*_a22.width,_c27=.5*_a22.height;t=[_s26.x-_l22,_s26.x,_s26.x+_l22],o=[_s26.y-_c27,_s26.y,_s26.y+_c27];}else if(void 0!==e.x){var _i99=Zt(e);t=[_i99.x],o=[_i99.y];}return {x:t,y:o};},Mo=function Mo(e,t,o){var i,n,r,a=Number.Infinity,s=null,l=null;for(var _c29=0;_c29<e.length;_c29++){n=e[_c29];for(var _e185=0;_e185<t.length;_e185++)r=t[_e185],i=Math.abs(n-r),i<o&&(null===l||i<a)&&(a=i,s=n,l=r);}return {origin:s,target:l};},Ro=function Ro(e,t,o,i,n){var r={x:null,y:null},a={x:null,y:null},s=t.map(To);if(i>0){var _e186=Zt({x:0,y:0}),_t141=Zt({x:i,y:i}),_o159=Zt({x:n.width,y:n.height}),_r43=_t141.x-_e186.x,_a23=Co(_r43,_e186.x,_o159.x),_l23=Co(_r43,_e186.y,_o159.y);s.push({x:_a23,y:_l23});}return s.forEach(function(t){var _ref446=function(e,t,o){var i={x:null,y:null},n={x:null,y:null},r=Mo(e.x,t.x,o);null!==r.target&&(i.x=r.target,n.x=r.target-r.origin);var a=Mo(e.y,t.y,o);return null!==a.target&&(i.y=a.target,n.y=a.target-a.origin),{snapTranslation:n,snapLine:i};}(e,t,o),i=_ref446.snapTranslation,n=_ref446.snapLine;null!==i.x&&(null===a.x||Math.abs(i.x)<Math.abs(a.x))&&(a.x=i.x||0,r.x=n.x),null!==i.y&&(null===a.y||Math.abs(i.y)<Math.abs(a.y))&&(a.y=i.y||0,r.y=n.y);}),{snapTranslation:a,snapLines:r};},Po=function Po(e,t){return null!==t.x&&(e.x+=t.x),null!==t.y&&(e.y+=t.y),e;},Eo=function Eo(e,t,o,i){var _ref447=i||{},_ref447$snapThreshold=_ref447.snapThreshold,n=_ref447$snapThreshold===void 0?0:_ref447$snapThreshold,_ref447$gridSize=_ref447.gridSize,r=_ref447$gridSize===void 0?0:_ref447$gridSize,a=_ref447.gridRect,_ref447$snapTargets=_ref447.snapTargets,s=_ref447$snapTargets===void 0?[]:_ref447$snapTargets;var l=null;if(Ri(e)){if(n){var _i100=gn(_objectSpread2({},e),Qe),_l24=ko(vi(t),o),_c30=ko(wi(t),o),_d23=To(_objectSpread2(_objectSpread2({},_i100),{},{x1:_l24.x,y1:_l24.y,x2:_c30.x,y2:_c30.y})),_Ro2=Ro(_d23,s,n,r,a),_u7=_Ro2.snapTranslation,_h8=_Ro2.snapLines;Po(o,_u7),xo(_h8);}var _i101=ko(vi(t),o),_c31=ko(wi(t),o);l={x1:_i101.x,y1:_i101.y,x2:_c31.x,y2:_c31.y};}else if(e.points){if(Xi($i)&&Uo($i,{selectedPoint:void 0}),n){var _i102=gn(_objectSpread2({},e),Qe),_l25=To(_objectSpread2(_objectSpread2({},_i102),{},{points:t.points.map(function(e){return ko(e,o);})})),_Ro4=Ro(_l25,s,n,r,a),_c32=_Ro4.snapTranslation,_d24=_Ro4.snapLines;Po(o,_c32),xo(_d24);}l={points:t.points.map(function(e){return ko(e,o);})};}else if(Ti(e)||Si(e)||Mi(e)){if(n){var _i103=gn(_objectSpread2({},e),Qe),_l26=ko(t,o),_c33=To(_objectSpread2(_objectSpread2({},_i103),_l26)),_Ro6=Ro(_c33,s,n,r,a),_d25=_Ro6.snapTranslation,_u8=_Ro6.snapLines;Po(o,_d25),xo(_u8);}l=ko(t,o);}l&&(go(e,l,Qe),_o());},Io={0:1,1:0,2:3,3:2},Ao={0:3,1:2,2:1,3:0};var zo;var Do=function Do(e,t){var o=e.points.filter(function(e,o){return o!==t;});Uo(e,{points:o,selectedPoint:void 0});},Oo=function Oo(){if(fe.length)return fe.find(zi);},Bo=function Bo(){if(fe.length)return fe.findIndex(zi);},Wo=function Wo(){var e=Oo();if(e)return Vi(e),_o(),e;},Vo=function Vo(){if(!Oo())return;var e=_toConsumableArray(fe);e.splice(Bo(),1),_e.set(e);},_o=function _o(){_e.set(fe);},No=function No(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;t.filter(Boolean).forEach(function(t){return delete e[t];}),o&&_o();},Uo=function Uo(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;e=Object.assign(e,t),o&&_o();},Go=function Go(e,t,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!0;e[t]=o,i&&_o();},Zo=function Zo(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;fe.forEach(function(t){return Uo(t,e,!1);}),t&&_o();},Xo=function Xo(){return _toConsumableArray(fe).reverse().filter(Ai);},Yo=function Yo(){return _toConsumableArray(fe).reverse().find(Ai);},qo=function qo(){return !!Yo();},Ko=function Ko(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var i=fe.filter(function(e){return Hi(e)&&Ni(e);}),n=i.findIndex(function(t){return t===e;});if(!1===function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(!_t(e))return !1;_e.set(fe.filter(function(t){return t!==e;})),t||Ct(e);}(e,o))return;if(Qo=e,i.length-1<=0)return ei();if(!t)return !0;var r=n-1<0?i.length-1:n-1;return oi(i[r]),!0;},Jo=function Jo(){if(s){var _e187=[];return a.forEach(function(t,o){if(!Hi(t))return;Ko(t,o===a.length-1,!0)&&_e187.push(t);}),void(_e187.length&&Rt());}var e=Yo();e&&Ko(e);};var Qo=void 0;var ei=function ei(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var _e$storePrevious=e.storePrevious,t=_e$storePrevious===void 0?!0:_e$storePrevious;Object.keys(Dn).forEach(function(e){return Dn[e]={};});var o=ti();t&&(Qo=o),Zo({isSelected:!1,isEditing:!1,_prerender:!1}),o&&kt(o);},ti=function ti(){return fe.find(Ai);},oi=function oi(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(zi(e))return;var i=ti()||Qo,n=Ai(e);Qo=void 0,Wt(i,e)&&(o||ei(),function(e){e.isSelected=!0;}(e),!n&&xt(e),t&&_o());},ii=function ii(e){Rn&&Rn.confirm&&e.isEditing&&Rn.confirm();var t={isSelected:!1,isEditing:!1,_prerender:!1};e.selectedPoint>-1&&(t.selectedPoint=void 0),Uo(e,t),kt(e);},ri=function ri(e){Uo(e,{isSelected:!0,isEditing:!0,_prerender:"inline"===ut});},ai=function ai(e){Uo(e,{isSelected:!0,isEditing:!1,_prerender:!1});},si=function si(e){if(!e.length)return [];var t=e.filter(_t);return _e.set(fe.filter(function(e){return !t.includes(e);})),t;},li=function li(e){var t=ni(e.text,e);return at(e.x,e.y,e.width?Math.min(e.width,t.width):t.width,e.height?Math.min(e.height,t.height):t.height);},ci=function ci(e){if(Fi(e))return ot(e);if(Mi(e))return nt(e);var t=li(e);return t.width=Math.max(10,e.width||t.width),t;},di=function di(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){return !0;};return _toConsumableArray(e).reverse().filter(i).map(function(e){return {shape:e,priority:1};}).filter(function(e){var i=e.shape,n=gn(gi(i),Qe),r=o+.5*(n.strokeWidth||0);if(Ti(n))return Bt(t,r,n,i.rotation);if(Si(n)){var _o160=ci(n),_a24=Bt(t,r,_o160,i.rotation);var _s27=!1;if(_a24&&!Ai(i)){var _a25=li(n);"right"!==i.textAlign||i.flipX||(_a25.x=_o160.x+_o160.width-_a25.width),"center"===i.textAlign&&(_a25.x=_o160.x+.5*_o160.width-.5*_a25.width),_s27=Bt(t,r,_a25,i.rotation,st(_o160)),_s27||(e.priority=-1);}return _a24;}return Mi(n)?function(e,t,o,i,n,r){var a=zt(he(o.x,o.y),o.rx,o.ry,i,n,r,12);return Ot(e,t,a);}(t,r,n,i.rotation,i.flipX,i.flipY):Ri(n)?Ft(t,Math.max(16,r),vi(n),wi(n)):Pi(n)&&n.pathClose?Ot(t,r,n.points):!!Pi(n)&&(1===n.points.length?Re(t,n.points[0])<r*r:Dt(t,Math.max(16,r),n.points));}).sort(function(e,t){return e.priority<t.priority?1:e.priority>t.priority?-1:0;}).map(function(e){return e.shape;});},ui=function ui(e,t,o){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var n=Math.abs(i),r=Ze(t,o),a=Ye(r,n),s=function(_ref448,o){var e=_ref448.start,t=_ref448.end;if(0===o)return [he(e.x,e.y),he(e.x,e.y),he(t.x,t.y),he(t.x,t.y)];var i=Math.atan2(t.y-e.y,t.x-e.x),n=Math.sin(i)*o,r=Math.cos(i)*o;return [he(n+e.x,-r+e.y),he(-n+e.x,r+e.y),he(-n+t.x,r+t.y),he(n+t.x,-r+t.y)];}(a,n);return e.filter(function(e){var t=gn(gi(e),Qe);if(Ri(t)||Pi(t)){var _e188=t.points?_toConsumableArray(t.points):[vi(t),wi(t)];return !!Et(a,_e188);}return function(e,t){return !!e.find(function(e){return It(e,t);})||!!t.find(function(t){return It(t,e);});}(s,function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:12;if(Ti(e))return ft(e,e.rotation,st(e));if(Si(e)){var _t142=ci(e);return ft(_t142,e.rotation,st(_t142));}return Mi(e)?zt(he(e.x,e.y),e.rx,e.ry,e.rotation,e.flipX,e.flipY,t):[];}(t));});};var hi=void 0,pi=void 0,mi=void 0,$i=void 0,fi=void 0,yi=void 0,bi=!1,xi=!1,Ii=!1,Li=void 0;var Di=function Di(e){Li=e.map(function(e){return {shape:e,shapeOrigin:gi(e),shapeOriginComputed:gn(gi(e),Qe)};});},Oi=function Oi(){clearTimeout(pi),pi=void 0,o(143,Ii=!1),vo();};var Bi=null;var Ji=function Ji(e){var t=Lo(e.rotation)&&0!==e.rotation;if(Ti(e)){if(e.width<1&&e.height<1)return;var _o161=st(e),_i104=St(e);return (e.flipX||e.flipY)&&Ae(_i104,e.flipX,e.flipY,_o161.x,_o161.y),t?Le(_i104,e.rotation,_o161.x,_o161.y):_i104;}if(Mi(e)){if(e.rx<1&&e.ry<1)return;var _o162=e,_i105=St(nt(e));return (e.flipX||e.flipY)&&Ae(_i105,e.flipX,e.flipY,_o162.x,_o162.y),t?Le(_i105,e.rotation,_o162.x,_o162.y):_i105;}if(Ri(e))return [vi(e),wi(e)];if(Pi(e)){if(e.bitmap&&!e.pathClose){var _t143=it(e.points);_t143.x-=.5*e.strokeWidth,_t143.y-=.5*e.strokeWidth,_t143.width+=e.strokeWidth,_t143.height+=e.strokeWidth;return Ji(_objectSpread2(_objectSpread2({},e),_t143));}return _toConsumableArray(e.points);}if(Si(e)){if(e.width<5&&e.height<5)return;var _o163=ci(e);_o163.width=Math.max(10,_o163.width);var _i106=st(_o163),_n51=St(_o163);return (e.flipX||e.flipY)&&Ae(_n51,e.flipX,e.flipY,_i106.x,_i106.y),t?Le(_n51,e.rotation,_i106.x,_i106.y):_n51;}return [];},Qi=function Qi(e){var t=Ji(e);var o,i;return e.flipY?(o=Ie([t[0],t[1]]),i=ye(he(t[1].x-t[2].x,t[1].y-t[2].y))):(o=Ie([t[2],t[3]]),i=ye(he(t[2].x-t[1].x,t[2].y-t[1].y))),Ce(i,20/qe),{origin:o,dir:i};},en=function en(e){return function(t){return t.id===e;};},tn=function tn(e){var t=en(e);return function(e){return e.filter(function(e){return function(t){return !e(t);};}(t));};},on=function on(e){var t=en(e),o=tn(e);return function(){return Be.update(function(e){return e.some(t)?o(e):e;});};},nn=function nn(e){var t=tn(e);return function(){for(var _len13=arguments.length,e=new Array(_len13),_key13=0;_key13<_len13;_key13++){e[_key13]=arguments[_key13];}Be.update(function(o){return [].concat(_toConsumableArray(t(o)),_toConsumableArray(e.filter(Boolean)));});};},rn=on("markup-hover"),an=nn("markup-hover");var sn;var cn="markup-manipulator-segment-"+Oe,dn=on(cn),un=nn(cn),hn=function hn(e,t){var o=e[t],i=t-1<0?e[e.length-1]:e[t-1],n=t+1<e.length?e[t+1]:e[0],r=Se(me(i),o);ye(r);var a=we(Ce(r,10),o),s=Se(me(n),o);ye(s);return [a,o,we(Ce(s,10),o)];},pn=function pn(){o(144,sn=void 0),rn();},mn="markup-multi-selection-segment-"+Oe,$n=on(mn),fn=nn(mn),yn=function yn(e,t){if(to<=0)return e;if(t)return vo(),e;var o=Gt(e),n=ro(),_Ro7=Ro(To(o),n,to,no,i),r=_Ro7.snapTranslation,a=_Ro7.snapLines;return xo(a),Po(e,r),e;},vn=uc(0);sr(e,vn,function(e){return o(187,Ee=e);});var wn="markup-grid-line-"+Oe,Sn=on(wn),kn=nn(wn),Cn="markup-snap-line",Tn=on(Cn),Mn=nn(Cn);var Rn;var Pn=function Pn(e){o(8,Rn.innerHTML=Jy(e),Rn);},En=function En(e){var t=void 0===e.value?e.innerHTML:e.value,o="text"===r.format?Gy(t).split(/<br>|<br\/>/g).join("\n").replace(/&nbsp;/g,String.fromCharCode(160)).replace(/&amp;/g,"&"):t;return ki(r)&&!1!==r.disableNewline?function(e){var t=e.split(/[\n\r]/g);return t.length>1?t.map(function(e){return e.trim();}).filter(function(e){return e.length;}).join(" "):t[0];}(o):o;},In=function In(){var e=En(Rn),t=Gi(r,e),o=!0===t?e:t;var i=V.x,n=V.y;if(!r.height){var _e190=ft(_objectSpread2({},N),r.rotation),_t144=ni(o,h),_a27=ft(_objectSpread2({x:i,y:n},_t144),r.rotation),_e191=_slicedToArray(_e190,3),_s28=_e191[0],_l27=_e191[2],_a28=_slicedToArray(_a27,3),_c34=_a28[0],_d26=_a28[2];var _u9=_s28,_p20=_c34;r.flipX&&(_u9=_l27,_p20=_d26);var _m13=Se(me(_u9),_p20);i+=_m13.x,n+=_m13.y;}Uo(r,{x:T(W.x)?Ho(i,Qe.width):i,y:T(W.y)?Ho(n,Qe.height):n,text:o});},An=function An(){d&&Wo(),Rn&&Rn.confirm&&Rn.confirm(),In(),ai(r),bt(r);},Ln=function Ln(){d?Vo():(Uo(r,{text:W.text,x:W.x,y:W.y}),ai(r));},zn=function zn(e,t,_ref449){var o=_ref449.flipX,i=_ref449.flipY,n=_ref449.rotation;var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:"top left";var a,s;var _ft=ft(e,n),_ft2=_slicedToArray(_ft,4),l=_ft2[0],c=_ft2[1],d=_ft2[2],u=_ft2[3],_ft3=ft(t,n),_ft4=_slicedToArray(_ft3,4),h=_ft4[0],p=_ft4[1],m=_ft4[2],$=_ft4[3];if("top center"===r){a=Ie(i?[u,d]:[l,c]),s=Ie(i?[$,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?$:h);return Se(me(a),s);},Fn=function Fn(e,t,o){return he(T(e.x)?Ho(t.x+o.x,Qe.width):t.x+o.x,T(e.y)?Ho(t.y+o.y,Qe.height):t.y+o.y);},Dn={},On=function On(){return Do(r,r.selectedPoint);},Bn=function Bn(){return ri(r);},Wn=function Wn(){var e=Ge(ni(r.text,h),function(e){return Math.ceil(e);}),t=Fo(r,"height"),o=!t&&Fo(r,"width"),i=r.id;var n=Dn[i];n||(Dn[i]={},n=Dn[i]);var a=function a(e){var _h9=h,t=_h9.width,o=_objectWithoutProperties(_h9,_excluded4),i=ni(r.text,o),n=zn(at(h.x,h.y,e.width,e.height),at(h.x,h.y,i.width,i.height),h,"top "+r.textAlign),a=!1!==h.disableNewline;No(r,["width","height",a&&"textAlign"]),Uo(r,_objectSpread2({},Fn(r,h,n)));},s=function s(t){var o=Ve(n.width||h.width||e.width,e.height),i=n.textAlign||"left",a=zn(at(h.x,h.y,t.width,t.height),at(h.x,h.y,o.width,o.height),h,"top "+i);No(r,["height"]),Uo(r,_objectSpread2(_objectSpread2({},Fn(r,h,a)),{},{width:T(r.width)?Ho(o.width,Qe.width):o.width,textAlign:i}));},l=function l(t){var o=Ve(n.width||e.width,n.height||e.height),i=n.textAlign||"left",a=zn(at(h.x,h.y,t.width,t.height),at(h.x,h.y,o.width,o.height),h,"top "+i);Uo(r,_objectSpread2(_objectSpread2({},Fn(r,h,a)),{},{width:T(r.width)?Ho(o.width,Qe.width):o.width,height:T(r.width)?Ho(o.height,Qe.height):o.height,textAlign:i}));};if(t){n.textAlign=r.textAlign,n.width=h.width,n.height=h.height;var _e192=Ve(h.width,h.height);Zi(r,"auto-height")?s(_e192):Zi(r,"auto-width")&&a(_e192);}else if(o){n.textAlign=r.textAlign,n.width=h.width;var _t145=Ve(h.width,e.height);Zi(r,"auto-width")?a(_t145):Zi(r,"fixed-size")&&l(_t145);}else {n.textAlign=r.textAlign;var _t146=Ve(Math.ceil(e.width),Math.ceil(e.height));Zi(r,"fixed-size")?l(_t146):Zi(r,"auto-height")&&s(_t146);}},Vn=function Vn(e){e.stopPropagation();var t=r.flipX||!1;Go(r,"flipX",!t),bt(r);},_n=function _n(e){e.stopPropagation();var t=r.flipY||!1;Go(r,"flipY",!t),bt(r);},Nn=function Nn(e){Go(r,"opacity",e);},Hn=function Hn(e){Nn(e),bt(r);},jn=function jn(e){e.stopPropagation(),e.target.blur(),Jo();},Un=function Un(e){e.stopPropagation();fe.findIndex(function(e){return e===r;})!==fe.length-1&&(_e.set(fe.filter(function(e){return e!==r;}).concat([r])),bt(r));},Gn=function Gn(e){e.stopPropagation(),Zn();},Zn=function Zn(){var e=(s?a:[r]).filter(ji).map(function(e){var t=gi(e);t.id=I();var o=he(50,-50);if(Fo(t,"points")){var _e193=bn(t,["points"],Qe);_e193.points.forEach(function(e){e.x+=o.x,e.y+=o.y;}),xn(t,_e193,Qe);}else if(Ri(t)){var _e194=bn(t,["x1","y1","x2","y2"],Qe);_e194.x1+=o.x,_e194.y1+=o.y,_e194.x2+=o.x,_e194.y2+=o.y,xn(t,_e194,Qe);}else {var _e195=bn(t,["x","y"],Qe);_e195.x+=50,_e195.y-=50,xn(t,_e195,Qe);}return _e.set([].concat(_toConsumableArray(fe),[t])),yt(t),t;});if(e.length>1)return ei(),void e.forEach(function(e){oi(e,!0,!0);});oi(e[0]);},Xn=uc(0,{stiffness:.2,damping:.7});sr(e,Xn,function(e){return o(18,ke=e);});var Yn;var qn=function qn(e,t){var _t$disableTextLayout=t.disableTextLayout,o=_t$disableTextLayout===void 0?[]:_t$disableTextLayout;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;},Jn=function Jn(e,t){var _t$disableTextLayout2=t.disableTextLayout,o=_t$disableTextLayout2===void 0?[]:_t$disableTextLayout2;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;};var Qn=!1;var er=ue(),tr=void 0;var or=function or(e){Mt(e),o(144,sn=e);};var ir;Qr(function(){Tn(),Sn(),dn(),rn();});return e.$$set=function(e){"uid"in e&&o(58,Oe=e.uid),"ui"in e&&o(59,Be=e.ui),"disabled"in e&&o(0,We=e.disabled),"shapes"in e&&Fe(o(1,_e=e.shapes)),"selection"in e&&o(60,Ne=e.selection),"offset"in e&&o(2,He=e.offset),"contextRotation"in e&&o(61,je=e.contextRotation),"contextFlipX"in e&&o(62,Ue=e.contextFlipX),"contextFlipY"in e&&o(63,Xe=e.contextFlipY),"contextZoom"in e&&o(64,qe=e.contextZoom),"active"in e&&o(65,Ke=e.active),"opacity"in e&&o(66,Je=e.opacity),"parentRect"in e&&o(67,Qe=e.parentRect),"rootRect"in e&&o(3,et=e.rootRect),"utilRect"in e&&o(68,tt=e.utilRect),"hoverColor"in e&&o(69,rt=e.hoverColor),"caretColor"in e&&o(70,lt=e.caretColor),"gridColor"in e&&o(71,ct=e.gridColor),"snapColor"in e&&o(72,dt=e.snapColor),"textInputMode"in e&&o(4,ut=e.textInputMode),"oninteractionstart"in e&&o(73,ht=e.oninteractionstart),"oninteractionupdate"in e&&o(74,pt=e.oninteractionupdate),"oninteractionrelease"in e&&o(75,mt=e.oninteractionrelease),"oninteractionend"in e&&o(76,$t=e.oninteractionend),"oninteractioncancel"in e&&o(77,gt=e.oninteractioncancel),"onaddshape"in e&&o(78,yt=e.onaddshape),"onupdateshape"in e&&o(79,bt=e.onupdateshape),"onselectshape"in e&&o(80,xt=e.onselectshape),"onblurshape"in e&&o(81,kt=e.onblurshape),"onremoveshape"in e&&o(82,Ct=e.onremoveshape),"ontapshape"in e&&o(83,Tt=e.ontapshape),"onhovershape"in e&&o(84,Mt=e.onhovershape),"ontriggerhistorywrite"in e&&o(85,Rt=e.ontriggerhistorywrite),"onhovercanvas"in e&&o(86,Pt=e.onhovercanvas),"ontapcanvas"in e&&o(87,At=e.ontapcanvas),"onleavecanvas"in e&&o(88,Lt=e.onleavecanvas),"beforeSelectShape"in e&&o(89,Wt=e.beforeSelectShape),"beforeDeselectShape"in e&&o(90,Vt=e.beforeDeselectShape),"beforeRemoveShape"in e&&o(91,_t=e.beforeRemoveShape),"beforeUpdateShape"in e&&o(92,Nt=e.beforeUpdateShape),"willRenderShapeControls"in e&&o(93,Ht=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(94,jt=e.willRenderShapeTextControls),"willStartInteraction"in e&&o(95,Ut=e.willStartInteraction),"mapEditorPointToImagePoint"in e&&o(96,Gt=e.mapEditorPointToImagePoint),"mapImagePointToEditorPoint"in e&&o(97,Zt=e.mapImagePointToEditorPoint),"eraseRadius"in e&&o(98,Xt=e.eraseRadius),"selectRadius"in e&&o(99,Yt=e.selectRadius),"enableButtonFlipVertical"in e&&o(100,qt=e.enableButtonFlipVertical),"enableTapToAddText"in e&&o(101,Kt=e.enableTapToAddText),"enableMultiSelect"in e&&o(102,Jt=e.enableMultiSelect),"enableTextStyleControls"in e&&o(5,Qt=e.enableTextStyleControls),"locale"in e&&o(6,eo=e.locale),"snapThreshold"in e&&o(103,to=e.snapThreshold),"snapPointer"in e&&o(104,oo=e.snapPointer),"enableSnapToContext"in e&&o(105,io=e.enableSnapToContext),"gridSize"in e&&o(106,no=e.gridSize);},e.$$.update=function(){var t,n;if(32&e.$$.dirty[2]|8192&e.$$.dirty[3]&&o(172,i=no>0?_objectSpread2({x:0,y:0},Qe):void 0),1&e.$$.dirty[0]|536870912&e.$$.dirty[5]&&o(148,r=!We&&fe&&(Oo()||Yo())),512&e.$$.dirty[3]|536870912&e.$$.dirty[5]&&o(164,a=Jt?fe.filter(Ai):[]),512&e.$$.dirty[5]&&o(163,s=a.length>1),32&e.$$.dirty[2]|768&e.$$.dirty[5]&&o(183,l=s?a.map(function(e){return gn(gi(e),Qe);}):[]),16777216&e.$$.dirty[4]&&o(180,c=!!r),16777216&e.$$.dirty[4]&&o(166,d=r&&zi(r)),16777216&e.$$.dirty[4]|2048&e.$$.dirty[5]&&o(10,u=r&&!d?r.id:void 0),8&e.$$.dirty[0]|32&e.$$.dirty[2]|16777216&e.$$.dirty[4]&&o(13,h=et&&r&&gn(gi(r),Qe)),16777216&e.$$.dirty[4]|2048&e.$$.dirty[5]&&o(146,p=!(!r||!d)),8192&e.$$.dirty[0]|16&e.$$.dirty[2]|16777216&e.$$.dirty[4]&&o(179,m=r&&Je&&Ji(h)||[]),268435712&e.$$.dirty[5]&&o(176,$=s?l.map(Ji):[]),16777216&e.$$.dirty[4]|256&e.$$.dirty[5]&&o(182,g=!s&&r&&qi(t=r)&&Ki(t)&&!0!==t.disableResize&&(Fi(t)||Ci(t)||Mi(t)||Ri(t)||Pi(t)&&Fo(t,"pathClose"))&&!Ei(r)),16777216&e.$$.dirty[4]|256&e.$$.dirty[5]&&o(14,f=!s&&r&&function(e){return qi(e)&&!0!==e.disableRotate&&(Fi(e)||Fo(e,"text")||Mi(e));}(r)&&!Ei(r)),16777216&e.$$.dirty[4]|134217728&e.$$.dirty[5]&&o(17,y=g&&Fo(r,"text")&&!r.height?[[1,2],[3,0]]:(!r||!Ri(r)&&!Pi(r))&&g),131072&e.$$.dirty[0]|16777216&e.$$.dirty[4]|134217728&e.$$.dirty[5]&&o(29,b=!!r&&!Array.isArray(y)&&g),768&e.$$.dirty[5]&&o(181,x=s?function(e){var t=e.map(function(e){return Ji(gn(e,Qe));}).flat(),o=it(t);return St(o);}(a):[]),16777216&e.$$.dirty[4]|16777472&e.$$.dirty[5]&&o(15,v=r&&m.length>1||s),16&e.$$.dirty[3]|83886336&e.$$.dirty[5]&&o(177,w=s?x.map(Zt):m.map(Zt)),4&e.$$.dirty[0]|4194304&e.$$.dirty[5]&&o(12,S=w.map(function(e){return he(e.x-He.x,e.y-He.y);})),16777216&e.$$.dirty[4]&&o(16,k=r&&r.points&&Lo(r.selectedPoint)?r.selectedPoint:-1),65536&e.$$.dirty[0]&&o(156,C=k>=0),69632&e.$$.dirty[0]|2&e.$$.dirty[5]&&o(161,M=C?S[k]:void 0),16777216&e.$$.dirty[4]|33554432&e.$$.dirty[5]&&o(28,R=c&&(Ci(r)?!Fo(r,"disableNewline")||!r.disableNewline:!1===r.disableNewline)),16&e.$$.dirty[3]|1048576&e.$$.dirty[4]&&(sn&&Zt&&!Ai(sn)&&Ni(sn)?function(e){var t=Ji(gn(gi(e),Qe));if(!t)return;var o=t.map(Zt),i=!!e.pathClose||!(!e.bitmap&&(Pi(e)||Ri(e))),n="hook"===e.selectionStyle,r=n?o.map(function(e,t,o){return {id:"markup-hover",points:hn(o,t),strokeColor:[0,0,0,.1],strokeWidth:2};}):[{id:"markup-hover",points:o.map(function(e){return he(e.x+1,e.y+1);}),strokeColor:[0,0,0,.1],strokeWidth:2,pathClose:i}],a=n?o.map(function(e,t,o){return {id:"markup-hover",points:hn(o,t),strokeColor:rt,strokeWidth:2};}):[{id:"markup-hover",points:o,strokeColor:rt,strokeWidth:2,pathClose:i}];an.apply(void 0,_toConsumableArray(r).concat(_toConsumableArray(a)));}(sn):rn()),61440&e.$$.dirty[0]|16&e.$$.dirty[2]&&o(178,P=v&&f&&Je&&S?function(e){var t=Qi(e),o=Zt({x:t.origin.x+t.dir.x,y:t.origin.y+t.dir.y});return {origin:Zt(t.origin),position:o};}(h):void 0),4&e.$$.dirty[0]|8388608&e.$$.dirty[5]&&o(27,E=P&&he(P.position.x-He.x,P.position.y-He.y)),1&e.$$.dirty[6]&&o(171,D=!!(Me||[]).find(function(e){return [91,93,17].includes(e);})),2048&e.$$.dirty[3]|65536&e.$$.dirty[5]&&o(173,A=!(D||!oo)),16&e.$$.dirty[2]|18874368&e.$$.dirty[4]|4458496&e.$$.dirty[5]&&r&&w&&Je>0&&(r===sn&&pn(),function(e,t,o){if(!Ni(t))return;var i=Pi(t),n=i&&Fo(t,"pathClose"),r=n&&function(e){return e.strokeWidth&&function(e,t){var o=e.strokeColor;return !!o&&(3===o.length||o[3]>0);}(e);}(t),a=zi(t),s=Ei(t),l="hook"===t.selectionStyle,c=!0!==t.disableShowPoints,_t$selectionOpacity=t.selectionOpacity,d=_t$selectionOpacity===void 0?1:_t$selectionOpacity;if(a&&i&&!n)return;var u=[],h=_toConsumableArray(w),p=h[h.length-1],$=h[0],g=(s?.05:.1)*e*d,f=g>0,y=(s?.5:1)*e*d,b=y>0,x=[0,0,0],v=[1,1,1],S=s?1:1.5;Me.includes(16)&&p&&o&&fo(p,o);var k=(h.length&&n&&a&&o?Re($,o):1/0)<=256,C=(h.length&&n&&a&&o?Re(p,o):1/0)<=256;!k&&o&&h.push(o);var T=h.length>1,M=!!t.pathClose||!(!t.bitmap&&(Pi(t)||Ri(t)))||h.length>2&&k;T&&f&&(l?u.push.apply(u,_toConsumableArray(h.map(function(e,t,o){return {id:cn,points:hn(o,t),strokeColor:x,opacity:g};}))):u.push({id:cn,points:h.map(function(e){return he(e.x+1,e.y+1);}),pathClose:M,strokeColor:x,strokeWidth:2,opacity:g})),n&&f&&c&&u.push.apply(u,_toConsumableArray(h.map(function(e){return _objectSpread2(_objectSpread2({id:cn},e),{},{rx:2*S,ry:2*S,backgroundColor:x,opacity:g});}))),P&&f&&u.push({id:cn,points:[he(P.origin.x+1,P.origin.y+1),he(P.position.x+1,P.position.y+1)],strokeColor:x,strokeWidth:2,opacity:g}),T&&b&&(l?u.push.apply(u,_toConsumableArray(h.map(function(e,t,o){return {id:cn,points:hn(o,t),strokeColor:v,strokeWidth:S,opacity:y};}))):u.push({id:cn,points:h,pathClose:M,strokeColor:v,strokeWidth:S,backgroundColor:a&&n&&t.backgroundColor&&t.backgroundColor[3]>0?t.backgroundColor:[0,0,0,0],opacity:y})),n&&c&&u.push.apply(u,_toConsumableArray(h.map(function(e){return _objectSpread2(_objectSpread2({id:cn},e),{},{rx:3*S,ry:3*S,backgroundColor:[.5,.5,.5],strokeWidth:S,strokeColor:v});}))),n&&a&&c&&w.length>=3&&u.push(_objectSpread2(_objectSpread2({},$),{},{id:cn,rx:S*(k?5:4),ry:S*(k?5:4),backgroundColor:k?rt:[.5,.5,.5],strokeWidth:S,strokeColor:v})),n&&a&&r&&c&&!k&&m.length>=2&&u.push(_objectSpread2(_objectSpread2({},p),{},{id:cn,rx:S*(C?5:4),ry:S*(C?5:4),backgroundColor:C?rt:[.5,.5,.5],strokeWidth:S,strokeColor:v})),P&&b&&!l&&u.push({id:cn,points:[{x:P.origin.x,y:P.origin.y},{x:P.position.x,y:P.position.y}],strokeColor:v,strokeWidth:S,opacity:y}),un.apply(void 0,u);}(Je,r,d&&Pi(r)?yn(_objectSpread2({},tr),!A):void 0)),16777216&e.$$.dirty[4]&&(r||(pn(),dn())),16&e.$$.dirty[3]|2097152&e.$$.dirty[5])if($.length){$n();var _e196=$.map(function(e){return {id:mn,points:e.map(Zt),strokeWidth:1,strokeColor:[1,1,1,.5],pathClose:!0};});fn.apply(void 0,_toConsumableArray(_e196));}else $n();1048576&e.$$.dirty[4]&&o(174,L=!!sn),262144&e.$$.dirty[4]&&o(175,z=!!$i),2097152&e.$$.dirty[4]|1835008&e.$$.dirty[5]&&(!tr||z||L||yn(_objectSpread2({},tr),!A)),512&e.$$.dirty[2]|8208&e.$$.dirty[3]|131072&e.$$.dirty[5]|2&e.$$.dirty[6]&&no>0&&i&&Zt&&function(e,t,o,i){var n=Zt({x:0,y:0}),r=Zt({x:e,y:e}),a=Zt({x:t.width,y:t.height}),s=r.x-n.x;if(vn.set(s>6?1:0),i<=0)return Sn();var l=Co(s,n.x,a.x).map(function(e){return {id:wn,opacity:i,points:[{x:e,y:n.y},{x:e,y:a.y}],strokeWidth:1,strokeColor:o};}),c=Co(s,n.y,a.y).map(function(e){return {id:wn,opacity:i,points:[{x:n.x,y:e},{x:a.x,y:e}],strokeWidth:1,strokeColor:o};});kn.apply(void 0,_toConsumableArray(c).concat(_toConsumableArray(l)));}(no,i,ct,Ee),1024&e.$$.dirty[2]|16&e.$$.dirty[3]|196608&e.$$.dirty[4]|65536&e.$$.dirty[5]&&Zt&&(D?Tn():function(e,t,o){if(null===e&&null===t)return Tn();var i,n;null!==e&&(i={id:Cn,strokeColor:o,strokeWidth:1.5,points:[Zt({x:e,y:0}),Zt({x:e,y:Qe.height})]}),null!==t&&(n={id:Cn,strokeColor:o,strokeWidth:1.5,points:[Zt({x:0,y:t}),Zt({x:Qe.width,y:t})]}),Mn(i,n);}(wo,So,dt)),8&e.$$.dirty[2]&&function(e){if(!e)return Zo({_prerender:!1});var t=fe.find(function(e){return e.isEditing;});t&&Uo(t,{_prerender:"inline"===ut});}(Ke),1&e.$$.dirty[6]&&Me&&Me.length&&function(){var _Me=Me,_Me2=_slicedToArray(_Me,1),e=_Me2[0];8!==e&&46!==e||qo()&&(r.isEditing||(Pi(r)&&Lo(r.selectedPoint)?setTimeout(function(){return Do(r,r.selectedPoint);},0):setTimeout(function(){return Jo();},0)));}(),272&e.$$.dirty[0]&&Rn&&"inline"===ut&&Rn.focus(),16777216&e.$$.dirty[4]&&o(170,O=r&&Si(r)),16777216&e.$$.dirty[4]|32768&e.$$.dirty[5]&&o(11,B=O&&!1!==Gi(r)&&Ei(r)),2048&e.$$.dirty[0]&&o(165,W=B?_objectSpread2({},r):void 0),32&e.$$.dirty[2]|1024&e.$$.dirty[5]&&o(167,V=W&&gn(_objectSpread2({},W),Qe)),4096&e.$$.dirty[5]&&o(169,_=V&&ni(V.text,V)),20480&e.$$.dirty[5]&&(N=V&&at(V.x,V.y,_.width,_.height)),2048&e.$$.dirty[0]|16777216&e.$$.dirty[4]&&o(24,H=B?r.text:""),2056&e.$$.dirty[0]|32&e.$$.dirty[2]|16777216&e.$$.dirty[4]&&o(168,j=et&&r&&B&&gn(_objectSpread2(_objectSpread2({},gi(r)),{},{width:Lo(r.width)?Math.floor(r.width):void 0,height:Lo(r.height)?Math.floor(r.height):void 0}),Qe)),2064&e.$$.dirty[0]|8192&e.$$.dirty[5]&&o(26,U=B&&function(e,t){var _e$textAlign=e.textAlign,o=_e$textAlign===void 0?"left":_e$textAlign,_e$fontFamily=e.fontFamily,i=_e$fontFamily===void 0?"sans-serif":_e$fontFamily,_e$fontWeight=e.fontWeight,n=_e$fontWeight===void 0?"normal":_e$fontWeight,_e$fontStyle=e.fontStyle,r=_e$fontStyle===void 0?"normal":_e$fontStyle,_e$letterSpacing=e.letterSpacing,a=_e$letterSpacing===void 0?"normal":_e$letterSpacing,_e$textShadowX=e.textShadowX,s=_e$textShadowX===void 0?0:_e$textShadowX,_e$textShadowY=e.textShadowY,l=_e$textShadowY===void 0?0:_e$textShadowY,_e$textShadowBlur=e.textShadowBlur,c=_e$textShadowBlur===void 0?0:_e$textShadowBlur,d=e.textShadowColor,_e$textOutlineWidth=e.textOutlineWidth,u=_e$textOutlineWidth===void 0?0:_e$textOutlineWidth,h=e.textOutlineColor,p="!important",m="caret-color:".concat(X,";text-align:").concat(o).concat(p,";font-family:").concat(i).concat(p,";font-weight:").concat(n).concat(p,";font-style:").concat(r).concat(p,";letter-spacing:").concat(Lo(a)?a+"px":"normal").concat(p);if("modal"===t)return m;var $=u?";-webkit-text-stroke:".concat(2*u,"px ").concat(jo(h)," ").concat(p):"",g=c||s||l?";text-shadow:".concat(s,"px ").concat(l,"px ").concat(c,"px ").concat(jo(d)," ").concat(p):"";var f=e.fontSize,y=1,b="";f>1e3&&F()&&(y=f/1e3,b="transform-origin:0 0;transform:scale(".concat(y,")"),f=1e3);var x=e.lineHeight/y;var v=jo(e.color),w=.5*Math.max(0,f-x);return "--font-scalar:".concat(y,";--bottom-inset:").concat(w,"px;padding:").concat(w,"px 0 0").concat(p,";color:").concat(v).concat(p,";font-size:").concat(f,"px").concat(p,";line-height:").concat(x,"px").concat(p,";").concat(m,";").concat(b).concat($).concat(g);}(j,ut)),2052&e.$$.dirty[0]|1073741824&e.$$.dirty[1]|4&e.$$.dirty[2]|8192&e.$$.dirty[5]&&o(25,G=B&&function(e,t,o,i){var n,a;e.width&&e.height?(n=st(e),a=De(e)):(a=ni(r.text,h),a.width=h.width||a.width,n=he(e.x+.5*a.width,e.y+.5*a.height));var s=Math.max(0,e.fontSize-e.lineHeight)+e.lineHeight,l=Zt(n);var c=l.x-t.x-.5*a.width,d=l.y-t.y-.5*a.height,u=e.flipX,p=e.flipY,m=e.rotation;Ue&&Xe?(u=!u,p=!p):Ue?(u=!u,m=-m):Xe&&(p=!p,m=-m),m+=i;var $=o*(u?-1:1),g=o*(p?-1:1);return "--line-height:".concat(s,"px;width:").concat(a.width,"px;height:").concat(a.height,"px;transform:translate(").concat(c,"px,").concat(d,"px) rotate(").concat(m,"rad) scale(").concat($,", ").concat(g,")");}(j,He,qe,je)),256&e.$$.dirty[2]&&(X=lt?jo(lt):"auto"),2320&e.$$.dirty[0]&&B&&Rn&&"inline"===ut&&Pn(H),289406976&e.$$.dirty[4]&&o(152,Y=r&&!p?r:Y),268435456&e.$$.dirty[4]&&o(154,q=Y&&Ui(Y)),268435456&e.$$.dirty[4]&&o(149,K=Y&&Zi(Y)),268435456&e.$$.dirty[4]&&o(151,J=Y&&ji(Y)),268435456&e.$$.dirty[4]&&o(150,Q=Y&&Hi(Y)),268435456&e.$$.dirty[4]|256&e.$$.dirty[5]&&o(153,ee=!s&&Y&&function(e){return !0!==e.disableReorder;}(Y)),268435456&e.$$.dirty[4]&&o(147,te=Y&&!1!==Gi(Y)),268435456&e.$$.dirty[4]&&o(155,oe=Y&&Fo(Y,"backgroundImage")&&_i(Y,"opacity")),16777216&e.$$.dirty[4]&&o(158,ie=r&&"html"===r.format),20971520&e.$$.dirty[4]|8&e.$$.dirty[5]&&o(162,ne=r&&(!p||ie)),524288&e.$$.dirty[4]|1073741952&e.$$.dirty[5]&&Xn.set(ne&&!Ii?1:0,{hard:!1===Te}),4096&e.$$.dirty[0]|160&e.$$.dirty[5]&&o(160,re=ne&&S.length?(n=it(S),ve(he(n.x+.5*n.width,n.y),Qd)):re),512&e.$$.dirty[0]|64&e.$$.dirty[2]|96&e.$$.dirty[5]&&o(159,ae=(M||re)&&Yn&&tt&&function(e,t,o,i){var n=e.x,r=e.y,a=n+e.width;var s=Math.max(t.x-.5*o.width,n),l=Math.max(t.y-o.height+i,r);return s+o.width>a&&(s=a-o.width),he(s,l);}(tt,M||re,Yn,-16)),262144&e.$$.dirty[0]|16&e.$$.dirty[5]&&o(23,se=ae&&"transform: translate(".concat(ae.x,"px, ").concat(ae.y,"px);opacity:").concat(ke)),2048&e.$$.dirty[0]&&o(157,ce=B?"text":"shape"),1088&e.$$.dirty[0]|131&e.$$.dirty[3]|2139095040&e.$$.dirty[4]|536870927&e.$$.dirty[5]&&o(22,pe="text"===ce&&jt&&ie?Yp(function(){return jt([["div","text-styles",{class:"PinturaShapeControlsGroup"},_toConsumableArray([["bold",{label:"B",style:"font-weight:900;",title:"Bold",shortcut:["CMD","B"]}],["italic",{label:"I",style:"font-family:Times New Roman;font-style:italic;",title:"Italic",shortcut:["CMD","I"]}],["underline",{label:"U",style:"text-decoration:underline;",title:"Underline",shortcut:["CMD","U"]}],["strikeThrough",{label:"S",style:"text-decoration:line-through;",title:"Strikethrough",shortcut:["CMD","S"]}]].map(function(_ref450){var _ref451=_slicedToArray(_ref450,2),e=_ref451[0],t=_ref451[1];return ["Button","style-"+e,_objectSpread2(_objectSpread2({onclick:function onclick(){return document.execCommand(e);}},t),{},{style:"font-size:1.25em;text-underline-offset:1px;text-decoration-thickness:1.5px;font-weight:400;"+t.style})];}))],["div","text-reset",{class:"PinturaShapeControlsGroup"},[["Button","style-reset",{onclick:function onclick(){return document.execCommand("removeFormat");},style:"font-weight:400;",label:'<span style="font-size:1.25em;font-style:italic;font-family:Times New Roman;text-decoration:underline;">T</span><span style="position:relative;top:.175rem;">&times;</span>',title:"Remove styles"}]]]],u);}):"shape"===ce&&Ht&&u?Yp(function(){return Ht(C?[["div","epsilon",{class:"PinturaShapeControlsGroup"},[["Button","remove-point",{onclick:On,label:eo.shapeTitleButtonRemove,icon:eo.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]]]]:[oe&&["div","alpha",{class:"PinturaShapeControlsGroup"},[["ToggleSlider","adjust-opacity",{onrelease:Hn,onchange:Nn,step:.01,value:Fo(r,"opacity")?r.opacity:1,label:function label(e,t,o){return Math.round(e/o*100)+"%";},min:0,max:1,direction:"x"}]]],["div","beta",{class:"PinturaShapeControlsGroup"},[q&&["Button","flip-horizontal",{onclick:Vn,label:eo.shapeTitleButtonFlipHorizontal,icon:eo.shapeIconButtonFlipHorizontal,hideLabel:!0}],q&&qt&&["Button","flip-vertical",{onclick:_n,label:eo.shapeTitleButtonFlipVertical,icon:eo.shapeIconButtonFlipVertical,hideLabel:!0}],ee&&["Button","to-front",{onclick:Un,label:eo.shapeTitleButtonMoveToFront,icon:eo.shapeIconButtonMoveToFront,hideLabel:!0,disabled:fe[fe.length-1]===Y}],J&&["Button","duplicate",{onclick:Gn,label:eo.shapeTitleButtonDuplicate,icon:eo.shapeIconButtonDuplicate,shortcut:["CMD","D"],hideLabel:!0}],Q&&["Button","remove",{onclick:jn,label:eo.shapeTitleButtonRemove,icon:eo.shapeIconButtonRemove,shortcut:["Backspace"],hideLabel:!0}]].filter(Boolean)],te&&K&&["div","gamma",{class:"PinturaShapeControlsGroup"},[["Button","text-layout",{onclick:Wn,label:xu(Jn,eo,r),icon:xu(qn,eo,r),hideLabel:!0}]]],te&&["div","delta",{class:"PinturaShapeControlsGroup"},[["Button","edit-text",{label:eo.shapeLabelInputText,onclick:Bn}]]]].filter(Boolean),u);}):[]),64&e.$$.dirty[0]|536870912&e.$$.dirty[5]&&o(21,$e=fe.filter(Ni).filter(function(e){return e.id;}).filter(function(e){return !zi(e);}).map(function(e){return {id:e.id,color:Si(e)?e.color:Ri(e)?e.strokeColor:e.backgroundColor,name:e.name||eo["shapeLabelTool"+Qa(ln(e))]};}));},[We,_e,He,et,ut,Qt,eo,oi,Rn,Yn,u,B,S,h,f,v,k,y,ke,Qn,ir,$e,pe,se,H,G,U,E,R,b,so,yo,function(e){var t=e.detail.origin,i=Jt&&Me.includes(16);Li=void 0,o(142,$i=void 0),fi=void 0,yi=void 0,bi=!1,mi=void 0,xi=!1,vo(),clearTimeout(pi),pi=setTimeout(function(){return o(143,Ii=!0);},250);var n=Oo();if(!n||Pi(n)&&Fo(n,"pathClose")||Wo(),hi=Gt(me(t)),n&&Pi(n)&&Fo(n,"pathClose"))return ht(e);var l=di(fe,hi,Yt,function(e){return Ni(e);}),c=l.length&&l.shift();if(r&&Ei(r)&&(An(),Kt&&(xi=!0)),!c&&r&&Ei(r)&&ii(r),!Ut(t))return;if(c&&Ai(c))return bi=!0,o(142,$i=c),s?(i&&ii(c),void Di(a)):(fi=gi($i),void(yi=gn(gi($i),Qe)));mi=c||void 0;if(!ht(e)&&c){if(oi(c,!0,i),o(142,$i=c),s)return Di(a);fi=gi($i),yi=gn(gi($i),Qe);}},function(e){Oi(),gt(e);},function(e){var _e$detail2=e.detail,t=_e$detail2.translation,o=_e$detail2.ctrlKey,n=_e$detail2.metaKey,r=_e$detail2.shiftKey,s=_e$detail2.position;if($i){if(!Ki($i))return;if(Ei($i))return;if(r){var _e197=Math.abs(t.x),_o164=Math.abs(t.y);"x"===Bi&&(_o164-=64),"y"===Bi&&(_e197-=64),_e197>_o164?(t.y=0,Bi="x"):_o164>_e197&&(t.x=0,Bi="y");}else Bi=null;var _e198=o||n;if(Li){if(!a.every(Ki))return;return void Li.forEach(function(_ref452){var e=_ref452.shape,o=_ref452.shapeOriginComputed;Eo(e,o,t,_objectSpread2({},ao(0,no,i,e)));});}return Eo($i,yi,t,_objectSpread2({},ao(_e198?0:to,no,i,$i)));}pt(e);},function(e){if(Oi(),$i){if(s)return;if(Ei($i)&&Ln(),e.detail.isTap&&Pi($i)&&Yi($i)){var _t147=e.detail.position,_o165=Gt(me(_t147));return void function(e,t){var o=e.points,i=[];for(var _e200=0;_e200<o.length-1;_e200++)i.push([o[_e200],o[_e200+1]]);i.push([o[o.length-1],o[0]]);var n=i.findIndex(function(_ref453){var _ref454=_slicedToArray(_ref453,2),e=_ref454[0],o=_ref454[1];return Ft(t,6,e,o);});var r;var a=[];for(var _e202=0;_e202<i.length;_e202++)a.push(i[_e202][0]),_e202===n&&(r=_e202+1,a.push(t));Uo(e,{points:a,selectedPoint:r});}($i,_o165);}e.detail.isTap&&bi&&Si($i)&&!1!==Gi($i)&&ri($i);}else mt(e);},function(e){var t=mi&&e.detail.isTap,i=Jt&&Me.includes(16);if(e.detail.isTap&&setTimeout(function(){At({target:$i||mi,position:hi},0);}),$i)return Tt($i),n=$i,r=fi,JSON.stringify(n)!==JSON.stringify(r)&&bt($i),void o(142,$i=void 0);var n,r;var a=!0;if(!i){var _e203=ti();a=!_e203||Vt(_e203,mi||void 0),a&&ei({storePrevious:!1});}$t(e),a&&t&&oi(mi,!0,i);},vn,function(e){o(143,Ii=!0),o(142,$i=r),yi=h;},function(e){if(!$i)return void o(143,Ii=!1);var _e$detail3=e.detail,t=_e$detail3.translation,r=_e$detail3.indexes,a=_e$detail3.shiftKey,s=_e$detail3.ctrlKey,l=_e$detail3.metaKey,c=_e$detail3.isNudge;(function(e,t,o,i,r){var _ref455=r||{},a=_ref455.shiftKey,_ref455$snapThreshold=_ref455.snapThreshold,s=_ref455$snapThreshold===void 0?0:_ref455$snapThreshold,_ref455$gridSize=_ref455.gridSize,l=_ref455$gridSize===void 0?0:_ref455$gridSize,c=_ref455.gridRect,_ref455$snapTargets=_ref455.snapTargets,d=_ref455$snapTargets===void 0?[]:_ref455$snapTargets,u=s?function(e,t,o){var _Ro8=Ro(To(e),d,s,l,c),i=_Ro8.snapTranslation,n=_Ro8.snapLines;Po(t,i),xo(n);var r=ko(o(),t);e.x=r.x,e.y=r.y;}:n;if(Ri(e)||Pi(e)&&Fo(e,"pathClose")){var _o168=o,_o169=_slicedToArray(_o168,1),_n52=_o169[0],_r44=a?fo:function(e,t){return t;};var _s29,_l28,_c35;if(Ri(e))0===_n52?(_s29=function _s29(){return vi(t);},_l28=function _l28(e){return _r44(wi(t),e);},_c35=function _c35(e,t){e.x1=t.x,e.y1=t.y;}):1===_n52&&(_s29=function _s29(){return wi(t);},_l28=function _l28(e){return _r44(vi(t),e);},_c35=function _c35(e,t){e.x2=t.x,e.y2=t.y;});else {var _e204=t.points;_s29=function _s29(){return _objectSpread2({},_e204[_n52]);},_l28=function _l28(t){var o=_e204[Dy(_n52-1,_e204)],i=_e204[Dy(_n52+1,_e204)];_r44(o,t),_r44(i,t);},_c35=function _c35(e,t){return e.points=e.points.map(function(e,o){return _n52===o?t:e;});};}var _d27=ko(_s29(),i);u(_d27,i,_s29),_l28(_d27),_c35(e,_d27);}else if(Fi(e)||Mi(e)||Ci(e)){var _n53,_a29,_s30=!1;if(Mi(e))_n53=nt(t);else if(Fi(e))_n53=ot(t);else {_s30=!0,_n53=ot(t);var _e205=ni(t.text,t);_n53.height=_e205.height;}e.aspectRatio?_a29=e.aspectRatio:r.shiftKey&&!_s30&&(_a29=_n53.width/_n53.height);var _l29=ot(_n53),_c36=st(_l29),_d28=e.rotation,_h10=St(_l29),_p21=ft(_l29,_d28);if(1===o.length){var _t148=o[0];e.flipX&&(_t148=Io[_t148]),e.flipY&&(_t148=Ao[_t148]);var _h12=_slicedToArray(_h10,4),_n54=_h12[0],_r45=_h12[1],_s31=_h12[2],_l30=_h12[3],_m14=Zt(_p21[_t148]),_$8=we(_objectSpread2({},_m14),i),_g7=Gt(_$8);u(_g7,i,function(){return Gt(_m14);});var _f3=he(_g7.x-_p21[_t148].x,_g7.y-_p21[_t148].y),_y3=ge(me(_f3),-_d28),_b2=he(_h10[_t148].x+_y3.x,_h10[_t148].y+_y3.y);var _x110;0===_t148&&(_x110=_s31),1===_t148&&(_x110=_l30),2===_t148&&(_x110=_n54),3===_t148&&(_x110=_r45);var _v2=it([_x110,_b2]);if(_a29){var _vt2=vt(_v2,_a29),_e206=_vt2.width,_t149=_vt2.height,_wt15=wt(_v2),_wt16=_slicedToArray(_wt15,4),_o170=_wt16[0],_i107=_wt16[1],_n55=_wt16[2],_r46=_wt16[3];_v2.width=_e206,_v2.height=_t149,_b2.y<_x110.y&&(_v2.y=_n55-_t149),_b2.x<_x110.x&&(_v2.x=_i107-_e206);}var _w3=ft(_v2,_d28,_c36),_S=Ie(_w3),_k=ge(_w3[0],-_d28,_S),_C=ge(_w3[2],-_d28,_S),_T2=it([_k,_C]);go(e,Mi(e)?de(_T2):_T2,Qe);}else {o=o.map(function(t){return e.flipX&&(t=Io[t]),e.flipY&&(t=Ao[t]),t;});var _o$map7=o.map(function(e){return _p21[e];}),_o$map8=_slicedToArray(_o$map7,2),_t150=_o$map8[0],_n56=_o$map8[1],_r47={x:_t150.x+.5*(_n56.x-_t150.x),y:_t150.y+.5*(_n56.y-_t150.y)},_o$map9=o.map(function(e){return _h10[e];}),_o$map10=_slicedToArray(_o$map9,2),_l31=_o$map10[0],_m15=_o$map10[1],_o$map11=o.map(function(e){var t=e+2;return t<4?_h10[t]:_h10[t-4];}),_o$map12=_slicedToArray(_o$map11,2),_$9=_o$map12[0],_g8=_o$map12[1],_f4={x:_$9.x+.5*(_g8.x-_$9.x),y:_$9.y+.5*(_g8.y-_$9.y)},_y4=Zt(_r47),_b3=we(_objectSpread2({},_y4),i),_x111=Gt(_b3);u(_x111,i,function(){return Gt(_y4);});var _v3=he(_x111.x-_r47.x,_x111.y-_r47.y),_w4=ge(me(_v3),-_d28),_S2=Se(me(_l31),_m15),_k2=ve(_S2,function(e){return 1-Math.abs(Math.sign(e));}),_C2=he(_w4.x*_k2.x,_w4.y*_k2.y);we(_l31,_C2),we(_m15,_C2);var _T3=it(_h10);if(_a29){var _e207=_T3.width,_t151=_T3.height;0===_k2.y?_t151=_e207/_a29:_e207=_t151*_a29,_T3.width=_e207,_T3.height=_t151,0===_k2.y?_T3.y=_f4.y-.5*_t151:_T3.x=_f4.x-.5*_e207;}var _M=ft(_T3,_d28,_c36),_R=Ie(_M),_P=ge(_M[0],-_d28,_R),_E2=ge(_M[2],-_d28,_R),_I3=it([_P,_E2]);var _A;Mi(e)?_A=de(_I3):Fi(e)?_A=_I3:_s30&&(_A={x:_I3.x,y:_I3.y,width:_I3.width}),go(e,_A,Qe);}}_o();})($i,yi,r,t,_objectSpread2({shiftKey:!c&&a},ao(s||l?0:to,no,i,$i))),Xi($i)&&Re(t)>16&&Uo($i,{selectedPoint:void 0});},function(e){if(!$i)return void o(143,Ii=!1);oi($i);var _e$detail4=e.detail,t=_e$detail4.isTap,i=_e$detail4.translation,n=_e$detail4.indexes;t&&(Xi($i)&&Uo($i,{selectedPoint:$i.selectedPoint===n[0]?void 0:n[0]}),Tt($i)),o(142,$i=void 0),o(143,Ii=!1),bt(r);},function(e){zo=Qi(h).origin,o(143,Ii=!0),o(142,$i=r),yi=h;},function(e){if(!$i)return void o(143,Ii=!1);var _e$detail5=e.detail,t=_e$detail5.translation,i=_e$detail5.shiftKey;(function(e,t,o,i){var n=ci(gn(gi(e),Qe)),r=st(n),a=ko(zo,o);var s=be(a,r)+Math.PI/2;if(i.shiftKey){var _e208=Math.PI/16;s=_e208*Math.round(s/_e208)-je%_e208;}go(e,{rotation:s},Qe),_o();})($i,0,t,{shiftKey:i});},function(){$i?(oi($i),o(142,$i=void 0),o(143,Ii=!1),bt(r)):o(143,Ii=!1);},function(e){var t=e.key,o=/escape/i.test(t);if(qo())return o?(e.preventDefault(),e.stopPropagation(),ii(r)):void(J&&"d"===t&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),Zn()));},function(e){var t=Gi(r,e);return !0===t?e:t;},In,function(e){var t=e.target,o=e.key,i=t.value||t.innerText,n=t.selectionStart||0,a=t.selectionEnd||i.length,s=i.substring(0,n)+o+i.substring(a);if(Gi(r,s)!==s)return e.preventDefault();},function(e){return ki(r)&&/enter/i.test(e.code)&&!1!==r.disableNewline?e.preventDefault():/arrow/i.test(e.code)?e.stopPropagation():/escape/i.test(e.key)?Ln():void 0;},function(e){var t=e.key,o=e.ctrlKey,i=e.altKey;if(/enter/i.test(t)&&(o||i))return An();},An,Ln,Xn,function(e){var t=Xo();t&&(t.find(Ei)||t.find(function(e){return !Ki(e);})||t.forEach(function(t){o(142,$i=t),yi=gn(gi($i),Qe),Eo($i,yi,e.detail);}));},function(e){o(19,Qn=!0);},function(_ref456){var e=_ref456.relatedTarget;e&&e.classList.contains("shape-selector__button")||o(19,Qn=!1);},function(e){if("touch"===e.pointerType||"PinturaShapeEditor"!==e.target.className)return void Lt();(Ii||pi)&&or(void 0);var t=jy(e,et);o(145,tr=me(t));var i=ve(Gt(t),function(e){return Math.round(e);});if(xe(i,er))return;if(er=me(i),Pt(Ii,t,i),Ii||pi)return;if(p)return;var _di=di(fe,i,0,Ni),_di2=_slicedToArray(_di,1),n=_di2[0];n&&zi(n)||or(n);},function(e){"touch"!==e.pointerType&&Lt();},Oe,Be,Ne,je,Ue,Xe,qe,Ke,Je,Qe,tt,rt,lt,ct,dt,ht,pt,mt,$t,gt,yt,bt,xt,kt,Ct,Tt,Mt,Rt,Pt,At,Lt,Wt,Vt,_t,Nt,Ht,jt,Ut,Gt,Zt,Xt,Yt,qt,Kt,Jt,to,oo,io,no,lo,co,uo,ho,po,mo,$o,function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o,n,r,a=Mi(e),s=Si(e),l="relative"===t.position;var c=ro(),d=function d(e){if(!to)return e;var t=Gt(e),_Ro9=Ro(To(t),c,to,no,i),o=_Ro9.snapTranslation,n=_Ro9.snapLines;return Po(e,o),xo(n),e;},u=!!ti(),h=t.isSelection?Ne:_e,p="step"===t.inputMode;if(Pi(e)){if(p){var _t152=!1;var _i108=function _i108(e,o){var i=co(h),n=e&&he(Qy(e.x,Qe.width),Qy(e.y,Qe.height)),r=n&&Zt(n);Me.includes(16)&&r&&fo(r,o);var a=Gt(o),s=i.points.length?i.points[0]:a,c=he(Qy(s.x,Qe.width),Qy(s.y,Qe.height)),d=Zt(c),u=Re(d,o);if(!_t152&&1===i.points.length&&u<36)return ho(h);if(i.points.length>2&&u<=256){i.pathClose=!0,Ni(i)&&oi(i);var _e209=po(h);return void yt(_e209);}var p=i.strokeWidth&&i.strokeColor&&(void 0===i.strokeColor[3]||i.strokeColor[3]>0),m=Re(r,o);if(p&&i.points.length>1&&m<256){i.pathClose=!1,i.backgroundColor=[0,0,0,0],Ni(i)&&oi(i);var _e210=po(h);yt(_e210);}else if(!(i.points.length>0&&m<100))return l?eb(a,Qe):a;};return {start:function start(e){var a=co(h),s=e.detail.origin;if(n=4,o=d(me(s)),r=me(o),a){var _e211=a.points[a.points.length-1],_t153=_i108(_e211,o);return _t153&&(a.points=[].concat(_toConsumableArray(a.points),[_t153])),void mo({points:a.points},h);}_t152=!0;},update:function update(e){if(!_t152)return;var n=co(h);if(!n)return;var r=n.points[0],a=_i108(r,he(o.x+e.detail.translation.x,o.y+e.detail.translation.y));a&&(n.points[1]=a,mo({points:n.points},h));},release:function release(e){return e.detail.preventInertia();},cancel:function cancel(){ho(h);},end:function end(i){if(!_t152)return;var n=Gt(o),r=l?eb(n,Qe):n,a=i.detail.isTap;if(a){if(di(fe,n,0,Ni).length)return ho(h);}uo(_objectSpread2(_objectSpread2({},e),{},{points:[r]}),h);}};}return {start:function start(t){var i=t.detail.origin;n=4,o=me(i),r=me(o);var a=Gt(o),s=l?eb(a,Qe):a;uo(_objectSpread2(_objectSpread2({},e),{},{points:[s]}),h);},update:function update(e){var t=co(h);if(!t)return;var i=e.detail.translation,a=he(o.x+i.x,o.y+i.y),s=Pe(r,a);if(le(s,5)<=n)return;var c=be(a,r),d=n-s;r.x+=d*Math.cos(c),r.y+=d*Math.sin(c);var u=Gt(r),p=l?eb(u,Qe):u;mo({points:t.points.concat(p)},h);},release:function release(e){return e.detail.preventInertia();},cancel:function cancel(){ho(h);},end:function end(e){var t=co(h);if(!t)return;if(e.detail.isTap){var _e212=!1;if(t.bitmap?(mi&&(_e212=!0),u&&(_e212=!0)):_e212=!0,_e212)return ho(h);}var o=po(h);yt(o);}};}return a||s||Ti(e)?{start:function start(t){var i=t.detail.origin;o=d(me(i));var n=Gt(o),r=l?eb(n,Qe):n,s=-1*bo(je,Ue,Xe),c=_objectSpread2(_objectSpread2({},e),{},{rotation:s},r);c.flipX=Ue,c.flipY=Xe,delete c.position,c.opacity=0;(a?["rx","ry"]:["width","height"]).forEach(function(e){c[e]=l?"0%":0;}),uo(c,h);},update:function update(e){var t=co(h);if(!t)return;t.opacity=1;var i=t.aspectRatio,_e$detail6=e.detail,n=_e$detail6.translation,r=_e$detail6.shiftKey,s=_e$detail6.ctrlKey;!i&&r&&(i=1);var l=d(he(o.x+n.x,o.y+n.y)),c=Gt(o),u=Gt(l);if(i){var _e213=it([c,u]),_t154=vt(_e213,i),_o171=u.x<c.x?-1:1,_n57=u.y<c.y?-1:1;u.x=c.x+_t154.width*_o171,u.y=c.y+_t154.height*_n57;}var p={x:c.x+.5*(u.x-c.x),y:c.y+.5*(u.y-c.y)},m=bo(je,Ue,Xe);ge(c,m,p),ge(u,m,p);var $=Math.min(c.x,u.x),g=Math.min(c.y,u.y);var f=Math.max(c.x,u.x)-$,y=Math.max(c.y,u.y)-g,b={};a?(s?(b.x=c.x,b.y=c.y):(b.x=$+.5*f,b.y=g+.5*y),b.rx=.5*f,b.ry=.5*y):(s?(b.x=c.x-.5*f,b.y=c.y-.5*y):(b.x=$,b.y=g),b.width=f,b.height=y),mo(b,h,function(e,t){return go(e,t,Qe);});},release:function release(e){e.detail.preventInertia();},cancel:function cancel(){ho(h);},end:function end(e){var t=co(h);if(t){if(e.detail.isTap){if(Si(t)&&Kt&&xi)return ho(h);if(!Si(t)||!Kt||mi)return ho(h);delete t.width,delete t.height,!1!==t.disableNewline&&delete t.textAlign;var _e214=gn(_objectSpread2({},t),Qe),_i109=ni(t.text,_e214),_n58=Gt({x:o.x,y:o.y-.5*_i109.height}),_r48=Gt({x:o.x+_i109.width,y:o.y+.5*_i109.height}),_a30={x:_n58.x+.5*(_r48.x-_n58.x),y:_n58.y+.5*(_r48.y-_n58.y)},_s32=bo(je,Ue,Xe);ge(_n58,_s32,_a30),ge(_r48,_s32,_a30);var _l32=Math.min(_n58.x,_r48.x),_c37=Math.min(_n58.y,_r48.y);_l32<0&&(_l32=0),_c37<0&&(_c37=0),_l32+_i109.width>Qe.width&&(_l32=Qe.width-_i109.width),_c37+_i109.height>Qe.height&&(_c37=Qe.height-_i109.height),t.x=T(t.x)?Ho(_l32,Qe.width):_l32,t.y=T(t.y)?Ho(_c37,Qe.height):_c37;}if(t.opacity=1,Si(t))yt(t);else {var _e215=po(h);yt(_e215);}Ni(t)&&oi(t),Si(t)&&ri(t);}}}:Ri(e)?{start:function start(t){var i=t.detail.origin,n=Gt(d(i)),r=ve(n,Qd);o=me(i),uo(_objectSpread2(_objectSpread2({},e),{},{x1:l?Ho(r.x,Qe.width):r.x,y1:l?Ho(r.y,Qe.height):r.y,x2:l?Ho(r.x,Qe.width):r.x,y2:l?Ho(r.y,Qe.height):r.y,opacity:0}),h);},update:function update(e){if(!co(h))return;var t=e.detail.translation,i=d(we(me(o),t));if(Me.includes(16)){var _e216=Pe(o,i),_t155=be(o,i),_n59=Math.PI/4,_r49=_n59*Math.round(_t155/_n59);i.x=o.x+_e216*Math.cos(_r49),i.y=o.y+_e216*Math.sin(_r49);}var n=Gt(i);mo({x2:l?Ho(n.x,Qe.width):n.x,y2:l?Ho(n.y,Qe.height):n.y,opacity:1},h);},release:function release(e){return e.detail.preventInertia();},cancel:function cancel(){ho(h);},end:function end(e){var t=co(h);if(!t)return;if(e.detail.isTap)return ho(h);t.opacity=1;var o=po(h);yt(o),Ni(t)&&oi(o);}}:void 0;},function(){var e,t;var o=Xt*Xt,i=function i(e,t){var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var n=Re(e,t);if(!i&&n<2)return !1;var r=fe.filter(function(e){return !e.disableErase;});var a;a=n<o?di(fe,Gt(t),Xt):ui(r,Gt(e),Gt(t),Xt);return si(a).forEach(Ct),!0;};return {start:function start(o){e=he(Math.round(o.detail.origin.x),Math.round(o.detail.origin.y)),i(e,e,!0),t=e;},update:function update(o){var n=o.detail.translation,r=he(Math.round(e.x+n.x),Math.round(e.y+n.y));i(t,r)&&(t=me(r));},release:function release(e){return e.detail.preventInertia();},cancel:function cancel(){ho(collection);},end:function end(){}};},Oo,Bo,function(e){if(!Oo())return Wi(e),$o(e);},Wo,Vo,function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return _objectSpread2({id:I()},e);},_o,No,Uo,Go,function(e,t){var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;fe.forEach(function(o){return Go(o,e,t,!1);}),o&&_o();},Zo,Xo,Yo,qo,ei,ii,ri,ai,si,li,ci,di,ui,wo,So,$i,Ii,sn,tr,p,te,r,K,Q,J,Y,ee,q,oe,C,ce,ie,ae,re,M,ne,s,a,W,d,V,j,_,O,D,i,A,L,z,$,w,P,m,c,x,g,l,fe,Te,Me,Ee,function(t){ia.call(this,e,t);},function(e){return oi(_e[e]);},function(e){ra[e?"unshift":"push"](function(){Rn=e,o(8,Rn);});},function(){H=this.value,o(24,H),o(11,B),o(148,r),o(170,O),o(0,We),o(184,fe);},function(e){ra[e?"unshift":"push"](function(){Rn=e,o(8,Rn);});},function(){ir&&ir.focus();},function(e){return o(9,Yn=e.detail);},function(e){ra[e?"unshift":"push"](function(){ir=e,o(20,ir);});},function(e){return jy(e,et);}];}var hb=/*#__PURE__*/function(_Wa43){function hb(e){var _this46;_classCallCheck(this,hb);_this46=_callSuper(this,hb),Ba(_assertThisInitialized(_this46),e,ub,cb,nr,{uid:58,ui:59,disabled:0,shapes:1,selection:60,offset:2,contextRotation:61,contextFlipX:62,contextFlipY:63,contextZoom:64,active:65,opacity:66,parentRect:67,rootRect:3,utilRect:68,hoverColor:69,caretColor:70,gridColor:71,snapColor:72,textInputMode:4,oninteractionstart:73,oninteractionupdate:74,oninteractionrelease:75,oninteractionend:76,oninteractioncancel:77,onaddshape:78,onupdateshape:79,onselectshape:80,onblurshape:81,onremoveshape:82,ontapshape:83,onhovershape:84,ontriggerhistorywrite:85,onhovercanvas:86,ontapcanvas:87,onleavecanvas:88,beforeSelectShape:89,beforeDeselectShape:90,beforeRemoveShape:91,beforeUpdateShape:92,willRenderShapeControls:93,willRenderShapeTextControls:94,willStartInteraction:95,mapEditorPointToImagePoint:96,mapImagePointToEditorPoint:97,eraseRadius:98,selectRadius:99,enableButtonFlipVertical:100,enableTapToAddText:101,enableMultiSelect:102,enableTextStyleControls:5,locale:6,snapThreshold:103,snapPointer:104,enableSnapToContext:105,gridSize:106,syncShapeCollection:107,getShapeDraft:108,addShapeDraft:109,discardShapeDraft:110,confirmShapeDraft:111,updateShapeDraft:112,addShape:113,createShape:114,eraseShape:115,getMarkupItemDraft:116,getMarkupItemDraftIndex:117,addMarkupItemDraft:118,confirmMarkupItemDraft:119,discardMarkupItemDraft:120,createMarkupItem:121,syncShapes:122,removeMarkupShapeProps:123,updateMarkupShape:124,updateMarkupShapeProperty:125,updateMarkupItemsShapeProperty:126,updateMarkupShapeItems:127,getActiveMarkupItems:128,getActiveMarkupItem:129,hasActiveMarkupItem:130,blurShapes:131,selectShape:7,deselectMarkupItem:132,editMarkupItem:133,finishEditMarkupItem:134,removeMarkupItems:135,getTextShapeRect:136,getMarkupShapeRect:137,getShapesNearPosition:138,getShapesBetweenPoints:139},null,[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]);return _this46;}_inherits(hb,_Wa43);return _createClass(hb,[{key:"syncShapeCollection",get:function get(){return this.$$.ctx[107];}},{key:"getShapeDraft",get:function get(){return this.$$.ctx[108];}},{key:"addShapeDraft",get:function get(){return this.$$.ctx[109];}},{key:"discardShapeDraft",get:function get(){return this.$$.ctx[110];}},{key:"confirmShapeDraft",get:function get(){return this.$$.ctx[111];}},{key:"updateShapeDraft",get:function get(){return this.$$.ctx[112];}},{key:"addShape",get:function get(){return this.$$.ctx[113];}},{key:"createShape",get:function get(){return this.$$.ctx[114];}},{key:"eraseShape",get:function get(){return this.$$.ctx[115];}},{key:"getMarkupItemDraft",get:function get(){return this.$$.ctx[116];}},{key:"getMarkupItemDraftIndex",get:function get(){return this.$$.ctx[117];}},{key:"addMarkupItemDraft",get:function get(){return this.$$.ctx[118];}},{key:"confirmMarkupItemDraft",get:function get(){return this.$$.ctx[119];}},{key:"discardMarkupItemDraft",get:function get(){return this.$$.ctx[120];}},{key:"createMarkupItem",get:function get(){return this.$$.ctx[121];}},{key:"syncShapes",get:function get(){return this.$$.ctx[122];}},{key:"removeMarkupShapeProps",get:function get(){return this.$$.ctx[123];}},{key:"updateMarkupShape",get:function get(){return this.$$.ctx[124];}},{key:"updateMarkupShapeProperty",get:function get(){return this.$$.ctx[125];}},{key:"updateMarkupItemsShapeProperty",get:function get(){return this.$$.ctx[126];}},{key:"updateMarkupShapeItems",get:function get(){return this.$$.ctx[127];}},{key:"getActiveMarkupItems",get:function get(){return this.$$.ctx[128];}},{key:"getActiveMarkupItem",get:function get(){return this.$$.ctx[129];}},{key:"hasActiveMarkupItem",get:function get(){return this.$$.ctx[130];}},{key:"blurShapes",get:function get(){return this.$$.ctx[131];}},{key:"selectShape",get:function get(){return this.$$.ctx[7];}},{key:"deselectMarkupItem",get:function get(){return this.$$.ctx[132];}},{key:"editMarkupItem",get:function get(){return this.$$.ctx[133];}},{key:"finishEditMarkupItem",get:function get(){return this.$$.ctx[134];}},{key:"removeMarkupItems",get:function get(){return this.$$.ctx[135];}},{key:"getTextShapeRect",get:function get(){return this.$$.ctx[136];}},{key:"getMarkupShapeRect",get:function get(){return this.$$.ctx[137];}},{key:"getShapesNearPosition",get:function get(){return this.$$.ctx[138];}},{key:"getShapesBetweenPoints",get:function get(){return this.$$.ctx[139];}}]);}(Wa);function pb(e){var t,_o172,_i110;return _o172=new Cp({props:{items:e[2]}}),{c:function c(){t=Rr("ul"),Fa(_o172.$$.fragment),Dr(t,"class","PinturaShapeStyleList");},m:function m(e,n){Tr(e,t,n),Da(_o172,t,null),_i110=!0;},p:function p(e,t){var i={};4&t&&(i.items=e[2]),_o172.$set(i);},i:function i(e){_i110||(ka(_o172.$$.fragment,e),_i110=!0);},o:function o(e){Ca(_o172.$$.fragment,e),_i110=!1;},d:function d(e){e&&Mr(t),Oa(_o172);}};}function mb(e){var t,_o173;return t=new Ad({props:{class:"PinturaShapeStyles",elasticity:e[0],$$slots:{default:[$b]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o173=!0;},p:function p(e,o){var i={};1&o&&(i.elasticity=e[0]),131076&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o173||(ka(t.$$.fragment,e),_o173=!0);},o:function o(e){Ca(t.$$.fragment,e),_o173=!1;},d:function d(e){Oa(t,e);}};}function $b(e){var t,_o174,_i111;return _o174=new Cp({props:{items:e[2]}}),{c:function c(){t=Rr("ul"),Fa(_o174.$$.fragment),Dr(t,"class","PinturaShapeStyleList");},m:function m(e,n){Tr(e,t,n),Da(_o174,t,null),_i111=!0;},p:function p(e,t){var i={};4&t&&(i.items=e[2]),_o174.$set(i);},i:function i(e){_i111||(ka(_o174.$$.fragment,e),_i111=!0);},o:function o(e){Ca(_o174.$$.fragment,e),_i111=!1;},d:function d(e){e&&Mr(t),Oa(_o174);}};}function gb(e){var t,o,_i112,n;var r=[mb,pb],a=[];function s(e,t){return e[1]?0:1;}return o=s(e),_i112=a[o]=r[o](e),{c:function c(){t=Rr("div"),_i112.c(),Dr(t,"style",e[3]);},m:function m(e,i){Tr(e,t,i),a[o].m(t,null),n=!0;},p:function p(e,_ref457){var _ref458=_slicedToArray(_ref457,1),l=_ref458[0];var c=o;o=s(e),o===c?a[o].p(e,l):(wa(),Ca(a[c],1,1,function(){a[c]=null;}),Sa(),_i112=a[o],_i112?_i112.p(e,l):(_i112=a[o]=r[o](e),_i112.c()),ka(_i112,1),_i112.m(t,null)),(!n||8&l)&&Dr(t,"style",e[3]);},i:function i(e){n||(ka(_i112),n=!0);},o:function o(e){Ca(_i112),n=!1;},d:function d(e){e&&Mr(t),a[o].d();}};}function fb(e,t,o){var i,n,r,a,s,l,_t$isActive3=t.isActive,c=_t$isActive3===void 0?!1:_t$isActive3,_t$controls=t.controls,d=_t$controls===void 0?[]:_t$controls,u=t.locale,h=t.scrollElasticity,_t$scrollEnable=t.scrollEnable,p=_t$scrollEnable===void 0?!0:_t$scrollEnable,_t$hideTitles=t.hideTitles,m=_t$hideTitles===void 0?!1:_t$hideTitles,_t$willRenderControls=t.willRenderControls,$=_t$willRenderControls===void 0?Z:_t$willRenderControls;var g=oa("redrawTrigger");sr(e,g,function(e){return o(14,a=e);});var f=oa("env");sr(e,f,function(e){return o(13,r=e);});var y=oa("isAnimated");sr(e,y,function(e){return o(16,l=e);});var b=uc(0,{stiffness:.25,damping:.9});return sr(e,b,function(e){return o(15,s=e);}),e.$$set=function(e){"isActive"in e&&o(8,c=e.isActive),"controls"in e&&o(9,d=e.controls),"locale"in e&&o(10,u=e.locale),"scrollElasticity"in e&&o(0,h=e.scrollElasticity),"scrollEnable"in e&&o(1,p=e.scrollEnable),"hideTitles"in e&&o(11,m=e.hideTitles),"willRenderControls"in e&&o(12,$=e.willRenderControls);},e.$$.update=function(){65792&e.$$.dirty&&b.set(c?1:0,{hard:!1===l}),33024&e.$$.dirty&&o(3,i="opacity:".concat(s,";").concat(c?"":"pointer-events:none;").concat(s<=0?"visibility:hidden":"")),32256&e.$$.dirty&&o(2,n=a&&$(d.map(function(e){return ["ShapeStyle",e.id,{title:e.componentProps.title,locale:u,hideTitle:m,items:[[e.component,e.id,e.componentProps]]}];}),r,function(){return g.set({});}));},[h,p,n,i,g,f,y,b,c,d,u,m,$,r,a,s,l];}var yb=/*#__PURE__*/function(_Wa44){function yb(e){var _this47;_classCallCheck(this,yb);_this47=_callSuper(this,yb),Ba(_assertThisInitialized(_this47),e,fb,gb,nr,{isActive:8,controls:9,locale:10,scrollElasticity:0,scrollEnable:1,hideTitles:11,willRenderControls:12});return _this47;}_inherits(yb,_Wa44);return _createClass(yb);}(Wa);function bb(e,t,o){var i=e.slice();return i[15]=t[o].key,i[6]=t[o].controls,i[16]=t[o].isActive,i;}function xb(e,t){var o,_i113,n;return _i113=new yb({props:{isActive:t[16],controls:t[6],locale:t[1],scrollElasticity:t[2],scrollEnable:t[3],hideTitles:t[4],willRenderControls:t[5]}}),{key:e,first:null,c:function c(){o=Ar(),Fa(_i113.$$.fragment),this.first=o;},m:function m(e,t){Tr(e,o,t),Da(_i113,e,t),n=!0;},p:function p(e,o){t=e;var n={};128&o&&(n.isActive=t[16]),128&o&&(n.controls=t[6]),2&o&&(n.locale=t[1]),4&o&&(n.scrollElasticity=t[2]),8&o&&(n.scrollEnable=t[3]),16&o&&(n.hideTitles=t[4]),32&o&&(n.willRenderControls=t[5]),_i113.$set(n);},i:function i(e){n||(ka(_i113.$$.fragment,e),n=!0);},o:function o(e){Ca(_i113.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(o),Oa(_i113,e);}};}function vb(e){var t,o,_i115,n=[],r=new Map(),a=e[7];var s=function s(e){return e[15];};for(var _t157=0;_t157<a.length;_t157+=1){var _o175=bb(e,a,_t157),_i114=s(_o175);r.set(_i114,n[_t157]=xb(_i114,_o175));}return {c:function c(){t=Rr("div");for(var _e218=0;_e218<n.length;_e218+=1)n[_e218].c();Dr(t,"class",o=Bc(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]]));},m:function m(e,o){Tr(e,t,o);for(var _e220=0;_e220<n.length;_e220+=1)n[_e220].m(t,null);_i115=!0;},p:function p(e,_ref459){var _ref460=_slicedToArray(_ref459,1),l=_ref460[0];190&l&&(a=e[7],wa(),n=Ia(n,l,s,1,e,a,r,t,Ea,xb,null,bb),Sa()),(!_i115||9&l&&o!==(o=Bc(["PinturaShapeStyleEditor",!e[3]&&"PinturaShapeStyleEditorOverflow",e[0]])))&&Dr(t,"class",o);},i:function i(e){if(!_i115){for(var _e222=0;_e222<a.length;_e222+=1)ka(n[_e222]);_i115=!0;}},o:function o(e){for(var _e224=0;_e224<n.length;_e224+=1)Ca(n[_e224]);_i115=!1;},d:function d(e){e&&Mr(t);for(var _e226=0;_e226<n.length;_e226+=1)n[_e226].d();}};}function wb(e,t,o){var i,n,r,a=t.class,_t$controls2=t.controls,s=_t$controls2===void 0?{}:_t$controls2,l=t.shapeProps,c=t.onchange,d=t.locale,u=t.scrollElasticity,_t$scrollEnable2=t.scrollEnable,h=_t$scrollEnable2===void 0?!0:_t$scrollEnable2,_t$hideTitles2=t.hideTitles,p=_t$hideTitles2===void 0?!1:_t$hideTitles2,m=t.willRenderControls;var $=[];return e.$$set=function(e){"class"in e&&o(0,a=e.class),"controls"in e&&o(6,s=e.controls),"shapeProps"in e&&o(8,l=e.shapeProps),"onchange"in e&&o(9,c=e.onchange),"locale"in e&&o(1,d=e.locale),"scrollElasticity"in e&&o(2,u=e.scrollElasticity),"scrollEnable"in e&&o(3,h=e.scrollEnable),"hideTitles"in e&&o(4,p=e.hideTitles),"willRenderControls"in e&&o(5,m=e.willRenderControls);},e.$$.update=function(){64&e.$$.dirty&&o(11,i=Object.keys(s).filter(function(e){return s[e];})),2304&e.$$.dirty&&o(10,n=l&&Object.keys(l).length&&i&&_i(l)?function(e){return i.filter(function(t){return t.split("_").every(function(t){return Fo(e,t)&&_i(e,t);});}).map(function(t){var o=(e.settings&&e.settings[t]||{}).control||t,i=t.split("_"),n=i.length>1?i.map(function(t){return e[t];}):e[t];if(M(s[o])){var _s$o2=s[o](n,function(e){c(_defineProperty({},t,e));},{selectedShapeId:e.id}),_i116=_s$o2.title,_r50=_s$o2.component;return {id:o,component:Cp,componentProps:{title:_i116,items:_r50}};}var _s$o3=_slicedToArray(s[o],2),r=_s$o3[0],a=_s$o3[1];if(T(r)&&s[r]){var _s$r;var _e227=_objectSpread2({},a);(_s$r=_slicedToArray(s[r],2),r=_s$r[0],a=_s$r[1]),a=_objectSpread2(_objectSpread2({},a),_e227);}var l=M(a.options)?a.options(e):a.options;return "RadioGroup"===r&&(a.selectedIndex=-1),{id:o,component:r,componentProps:_objectSpread2(_objectSpread2({},a),{},{options:l,locale:d,value:n,optionLabelClass:"PinturaButtonLabel",onchange:function onchange(o){var n=S(o)&&!Do(o)?o.value:o;a.onchange&&a.onchange(n,e);var r=i.length>1?i.reduce(function(e,t,o){return _objectSpread2(_objectSpread2({},e),{},_defineProperty({},t,Array.isArray(n)?n[o]:n));},{}):_defineProperty({},t,n);c(r);}})};}).filter(Boolean);}(l):[]),1280&e.$$.dirty&&o(7,r=function(e,t){var o=$.find(function(t){return t.key===e;});return o||(o={key:e,controls:t},$.push(o)),$.forEach(function(e){return e.isActive=!1;}),o.controls=t,o.isActive=!0,$;}(l&&Object.keys(l).length?Object.keys(l).join("_"):"none",n||[]));},[a,d,u,h,p,m,s,r,l,c,n,i];}var Sb=/*#__PURE__*/function(_Wa45){function Sb(e){var _this48;_classCallCheck(this,Sb);_this48=_callSuper(this,Sb),Ba(_assertThisInitialized(_this48),e,wb,vb,nr,{class:0,controls:6,shapeProps:8,onchange:9,locale:1,scrollElasticity:2,scrollEnable:3,hideTitles:4,willRenderControls:5});return _this48;}_inherits(Sb,_Wa45);return _createClass(Sb);}(Wa);var kb=function kb(e){return /<svg /.test(e);};function Cb(e){var t,_o176;return t=new Cp({props:{items:e[10]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o176=!0;},p:function p(e,o){var i={};1024&o&&(i.items=e[10]),t.$set(i);},i:function i(e){_o176||(ka(t.$$.fragment,e),_o176=!0);},o:function o(e){Ca(t.$$.fragment,e),_o176=!1;},d:function d(e){Oa(t,e);}};}function Tb(e){var t,_o177,i,n;var r=[Rb,Mb],a=[];function s(e,t){return e[8]?0:1;}return t=s(e),_o177=a[t]=r[t](e),{c:function c(){_o177.c(),i=Ar();},m:function m(e,o){a[t].m(e,o),Tr(e,i,o),n=!0;},p:function p(e,n){var l=t;t=s(e),t===l?a[t].p(e,n):(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa(),_o177=a[t],_o177?_o177.p(e,n):(_o177=a[t]=r[t](e),_o177.c()),ka(_o177,1),_o177.m(i.parentNode,i));},i:function i(e){n||(ka(_o177),n=!0);},o:function o(e){Ca(_o177),n=!1;},d:function d(e){a[t].d(e),e&&Mr(i);}};}function Mb(e){var t,o,_i117,n,r=e[10]&&Pb(e);return _i117=new Ad({props:{scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Eb]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),r&&r.c(),o=Ir(),Fa(_i117.$$.fragment),Dr(t,"class","PinturaShapePresetsFlat");},m:function m(e,a){Tr(e,t,a),r&&r.m(t,null),Sr(t,o),Da(_i117,t,null),n=!0;},p:function p(e,n){e[10]?r?(r.p(e,n),1024&n&&ka(r,1)):(r=Pb(e),r.c(),ka(r,1),r.m(t,o)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());var a={};512&n&&(a.scrollAutoCancel=e[9]),1&n&&(a.elasticity=e[0]),536871070&n&&(a.$$scope={dirty:n,ctx:e}),_i117.$set(a);},i:function i(e){n||(ka(r),ka(_i117.$$.fragment,e),n=!0);},o:function o(e){Ca(r),Ca(_i117.$$.fragment,e),n=!1;},d:function d(e){e&&Mr(t),r&&r.d(),Oa(_i117);}};}function Rb(e){var t,_o178,i,n,r;_o178=new Ad({props:{elasticity:e[0],class:"PinturaShapePresetsGroups",$$slots:{default:[Db]},$$scope:{ctx:e}}});var a=[{class:"PinturaControlPanels"},{panelClass:"PinturaControlPanel"},{panels:e[11]},e[12]];var s={$$slots:{default:[Bb,function(_ref462){var e=_ref462.panel,t=_ref462.panelIsActive;return {26:e,27:t};},function(_ref463){var e=_ref463.panel,t=_ref463.panelIsActive;return (e?67108864:0)|(t?134217728:0);}]},$$scope:{ctx:e}};for(var _e229=0;_e229<a.length;_e229+=1)s=Qn(s,a[_e229]);return n=new nd({props:s}),{c:function c(){t=Rr("div"),Fa(_o178.$$.fragment),i=Ir(),Fa(n.$$.fragment),Dr(t,"class","PinturaShapePresetsGrouped");},m:function m(e,a){Tr(e,t,a),Da(_o178,t,null),Sr(t,i),Da(n,t,null),r=!0;},p:function p(e,t){var i={};1&t&&(i.elasticity=e[0]),536876128&t&&(i.$$scope={dirty:t,ctx:e}),_o178.$set(i);var r=6144&t?Aa(a,[a[0],a[1],2048&t&&{panels:e[11]},4096&t&&La(e[12])]):{};738206239&t&&(r.$$scope={dirty:t,ctx:e}),n.$set(r);},i:function i(e){r||(ka(_o178.$$.fragment,e),ka(n.$$.fragment,e),r=!0);},o:function o(e){Ca(_o178.$$.fragment,e),Ca(n.$$.fragment,e),r=!1;},d:function d(e){e&&Mr(t),Oa(_o178),Oa(n);}};}function Pb(e){var t,_o179;return t=new Cp({props:{items:e[10]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o179=!0;},p:function p(e,o){var i={};1024&o&&(i.items=e[10]),t.$set(i);},i:function i(e){_o179||(ka(t.$$.fragment,e),_o179=!0);},o:function o(e){Ca(t.$$.fragment,e),_o179=!1;},d:function d(e){Oa(t,e);}};}function Eb(e){var t,_o180;return t=new qd({props:{items:e[7],onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o180=!0;},p:function p(e,o){var i={};128&o&&(i.items=e[7]),2&o&&(i.onclickitem=e[1]),4&o&&(i.ongrabitem=e[2]),8&o&&(i.ondragitem=e[3]),16&o&&(i.ondropitem=e[4]),t.$set(i);},i:function i(e){_o180||(ka(t.$$.fragment,e),_o180=!0);},o:function o(e){Ca(t.$$.fragment,e),_o180=!1;},d:function d(e){Oa(t,e);}};}function Ib(e){var t,_o181;return t=new Cp({props:{items:e[10]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o181=!0;},p:function p(e,o){var i={};1024&o&&(i.items=e[10]),t.$set(i);},i:function i(e){_o181||(ka(t.$$.fragment,e),_o181=!0);},o:function o(e){Ca(t.$$.fragment,e),_o181=!1;},d:function d(e){Oa(t,e);}};}function Ab(e){var t,_o182;return t=new hd({props:{$$slots:{default:[Lb]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o182=!0;},p:function p(e,o){var i={};805306368&o&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o182||(ka(t.$$.fragment,e),_o182=!0);},o:function o(e){Ca(t.$$.fragment,e),_o182=!1;},d:function d(e){Oa(t,e);}};}function Lb(e){var t,o=e[28].icon+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){268435456&i&&o!==(o=e[28].icon+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function zb(e){var t,o,i=e[28].label+"";return {c:function c(){t=Rr("span"),o=Er(i);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){268435456&t&&i!==(i=e[28].label+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function Fb(e){var t,o,_i118,n=e[28].icon&&Ab(e),r=!e[28].hideLabel&&zb(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ar();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i118=!0;},p:function p(e,i){e[28].icon?n?(n.p(e,i),268435456&i&&ka(n,1)):(n=Ab(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[28].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=zb(e),r.c(),r.m(o.parentNode,o));},i:function i(e){_i118||(ka(n),_i118=!0);},o:function o(e){Ca(n),_i118=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}function Db(e){var t,_o183,_i119,n=e[10]&&Ib(e);var r=[{class:"PinturaControlList"},{tabs:e[5]},e[12],{layout:"compact"}];var a={$$slots:{default:[Fb,function(_ref464){var e=_ref464.tab;return {28:e};},function(_ref465){var e=_ref465.tab;return e?268435456:0;}]},$$scope:{ctx:e}};for(var _e231=0;_e231<r.length;_e231+=1)a=Qn(a,r[_e231]);return _o183=new Gc({props:a}),_o183.$on("select",e[18]),{c:function c(){n&&n.c(),t=Ir(),Fa(_o183.$$.fragment);},m:function m(e,r){n&&n.m(e,r),Tr(e,t,r),Da(_o183,e,r),_i119=!0;},p:function p(e,i){e[10]?n?(n.p(e,i),1024&i&&ka(n,1)):(n=Ib(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa());var a=4128&i?Aa(r,[r[0],32&i&&{tabs:e[5]},4096&i&&La(e[12]),r[3]]):{};805306368&i&&(a.$$scope={dirty:i,ctx:e}),_o183.$set(a);},i:function i(e){_i119||(ka(n),ka(_o183.$$.fragment,e),_i119=!0);},o:function o(e){Ca(n),Ca(_o183.$$.fragment,e),_i119=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),Oa(_o183,e);}};}function Ob(e){var t,_o184;return t=new qd({props:{items:e[13][e[26]].items,disabled:e[13][e[26]].disabled,onclickitem:e[1],ongrabitem:e[2],ondragitem:e[3],ondropitem:e[4]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o184=!0;},p:function p(e,o){var i={};67117056&o&&(i.items=e[13][e[26]].items),67117056&o&&(i.disabled=e[13][e[26]].disabled),2&o&&(i.onclickitem=e[1]),4&o&&(i.ongrabitem=e[2]),8&o&&(i.ondragitem=e[3]),16&o&&(i.ondropitem=e[4]),t.$set(i);},i:function i(e){_o184||(ka(t.$$.fragment,e),_o184=!0);},o:function o(e){Ca(t.$$.fragment,e),_o184=!1;},d:function d(e){Oa(t,e);}};}function Bb(e){var t,_o185;return t=new Ad({props:{scroll:e[27]?{scrollOffset:0,animate:!1}:void 0,scrollAutoCancel:e[9],elasticity:e[0],$$slots:{default:[Ob]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o185=!0;},p:function p(e,o){var 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:function i(e){_o185||(ka(t.$$.fragment,e),_o185=!0);},o:function o(e){Ca(t.$$.fragment,e),_o185=!1;},d:function d(e){Oa(t,e);}};}function Wb(e){var t,o,_i120,n;var r=[Tb,Cb],a=[];function s(e,t){return e[9]?0:e[10]?1:-1;}return ~(o=s(e))&&(_i120=a[o]=r[o](e)),{c:function c(){t=Rr("div"),_i120&&_i120.c(),Dr(t,"class","PinturaShapePresetsPalette");},m:function m(e,i){Tr(e,t,i),~o&&a[o].m(t,null),n=!0;},p:function p(e,_ref466){var _ref467=_slicedToArray(_ref466,1),n=_ref467[0];var l=o;o=s(e),o===l?~o&&a[o].p(e,n):(_i120&&(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa()),~o?(_i120=a[o],_i120?_i120.p(e,n):(_i120=a[o]=r[o](e),_i120.c()),ka(_i120,1),_i120.m(t,null)):_i120=null);},i:function i(e){n||(ka(_i120),n=!0);},o:function o(e){Ca(_i120),n=!1;},d:function d(e){e&&Mr(t),~o&&a[o].d();}};}function Vb(e,t,o){var i,r,a,s,l,c,d,u,h,p=t.locale,m=t.presets,$=t.scrollElasticity,_t$enableSelectImage=t.enableSelectImage,g=_t$enableSelectImage===void 0?!0:_t$enableSelectImage,_t$willRenderPresetTo=t.willRenderPresetToolbar,f=_t$willRenderPresetTo===void 0?Z:_t$willRenderPresetTo,_t$onaddpreset=t.onaddpreset,y=_t$onaddpreset===void 0?n:_t$onaddpreset,b=t.ongrabpreset,x=t.ondragpreset,v=t.ondroppreset;var w="presets-"+I(),S=function S(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return kb(e)?e:zo(e)?_o(e,t):"<img src=\"".concat(e,"\" alt=\"").concat(t,"\"/>");},k=function k(e){return N(Ht(e));},C=["src","alt","thumb","shape","id","mount","disabled"],M=function M(e){return e.map(function(e){return function(e){return Do(e)&&T(e[0])&&Do(e[1]);}(e)?_objectSpread2(_objectSpread2({},e[2]),{},{id:"".concat(w,"-").concat(e[0].toLowerCase()),label:e[0],items:M(e[1])}):function(e){var t,o,i,n,r,a,s,l=e;return T(e)?zo(e)?(t=e,r=e,n=S(t,r)):(t=e,r=k(t),n=S(t,r)):(t=e.src,r=e.alt||(T(t)?k(t):T(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(function(t,o){return C.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=function(e){"locale"in e&&o(14,p=e.locale),"presets"in e&&o(15,m=e.presets),"scrollElasticity"in e&&o(0,$=e.scrollElasticity),"enableSelectImage"in e&&o(16,g=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=function(){32768&e.$$.dirty&&o(7,i=M(m)),128&e.$$.dirty&&o(9,r=i.length),640&e.$$.dirty&&o(8,a=r&&i.some(function(e){return !!e.items;})),384&e.$$.dirty&&o(5,s=a&&i),384&e.$$.dirty&&o(13,l=a&&i.reduce(function(e,t){return e[t.id]=t,e;},{})),96&e.$$.dirty&&o(6,c=c||s&&(s.find(function(e){return !e.disabled;})||{}).id),64&e.$$.dirty&&o(12,d={name:w,selected:c}),32&e.$$.dirty&&o(11,u=s&&s.map(function(e){return e.id;})),212994&e.$$.dirty&&o(10,h=p&&f([g&&["Button","browse",{label:p.shapeLabelButtonSelectSticker,icon:p.shapeIconButtonSelectSticker,onclick:function onclick(){Xp().then(function(e){e&&y(e);});}}]]));},[$,y,b,x,v,s,c,i,a,r,h,u,d,l,p,m,g,f,function(_ref468){var e=_ref468.detail;return o(6,c=e);}];}var _b=/*#__PURE__*/function(_Wa46){function _b(e){var _this49;_classCallCheck(this,_b);_this49=_callSuper(this,_b),Ba(_assertThisInitialized(_this49),e,Vb,Wb,nr,{locale:14,presets:15,scrollElasticity:0,enableSelectImage:16,willRenderPresetToolbar:17,onaddpreset:1,ongrabpreset:2,ondragpreset:3,ondroppreset:4});return _this49;}_inherits(_b,_Wa46);return _createClass(_b);}(Wa);function Nb(e){var t,o,_i121,n;return t=new Cp({props:{items:e[30]}}),_i121=new Sb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[165]}}),{c:function c(){Fa(t.$$.fragment),o=Ir(),Fa(_i121.$$.fragment);},m:function m(e,r){Da(t,e,r),Tr(e,o,r),Da(_i121,e,r),n=!0;},p:function p(e,o){var n={};1073741824&o[0]&&(n.items=e[30]),t.$set(n);var r={};16&o[0]&&(r.locale=e[4]),262144&o[1]&&(r.shapeProps=e[49]),512&o[0]&&(r.controls=e[9]),_i121.$set(r);},i:function i(e){n||(ka(t.$$.fragment,e),ka(_i121.$$.fragment,e),n=!0);},o:function o(e){Ca(t.$$.fragment,e),Ca(_i121.$$.fragment,e),n=!1;},d:function d(e){Oa(t,e),e&&Mr(o),Oa(_i121,e);}};}function Hb(e){var t,_o186,_i122;return _o186=new uf({props:{$$slots:{default:[Nb]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),Fa(_o186.$$.fragment),Dr(t,"slot","header");},m:function m(e,n){Tr(e,t,n),Da(_o186,t,null),_i122=!0;},p:function p(e,t){var i={};1073742352&t[0]|262144&t[1]|67108864&t[6]&&(i.$$scope={dirty:t,ctx:e}),_o186.$set(i);},i:function i(e){_i122||(ka(_o186.$$.fragment,e),_i122=!0);},o:function o(e){Ca(_o186.$$.fragment,e),_i122=!1;},d:function d(e){e&&Mr(t),Oa(_o186);}};}function jb(e){var t,_o187;var i=[{locale:e[4]},{ui:e[69]},{shapes:e[5]},{selection:e[58]},{uid:e[20]},{parentRect:e[37]},{rootRect:e[55]},{utilRect:e[39]},{offset:e[50]},{disabled:e[38]},{contextRotation:e[23]},{contextFlipX:e[24]},{contextFlipY:e[25]},{contextZoom:e[36]?e[36].scale:void 0},{active:e[35]},{opacity:e[56]},{hoverColor:e[57]},{caretColor:e[57]},{snapColor:e[57]},{gridColor:[1,1,1,.125]},{eraseRadius:e[47]},{selectRadius:e[6]},{enableButtonFlipVertical:e[10]},{enableMultiSelect:e[14]},{mapEditorPointToImagePoint:e[21]},{mapImagePointToEditorPoint:e[22]},{enableTapToAddText:e[13]},{textInputMode:e[8]},{snapThreshold:e[16]},{snapPointer:!e[48]},{enableSnapToContext:e[17]},{gridSize:e[15]},{willStartInteraction:e[95]},{oninteractionstart:e[79]},{oninteractionupdate:e[80]},{oninteractionrelease:e[81]},{oninteractionend:e[83]},{oninteractioncancel:e[82]},{onleavecanvas:e[87]},{onhovercanvas:e[86]},{onhovershape:e[89]},{ontapcanvas:e[88]},{onaddshape:e[156]},{onselectshape:e[157]},{onblurshape:e[158]},{ontapshape:e[159]},{onupdateshape:e[160]},{onremoveshape:e[161]},{ontriggerhistorywrite:e[162]},e[42]];var n={};for(var _e233=0;_e233<i.length;_e233+=1)n=Qn(n,i[_e233]);return t=new hb({props:n}),e[163](t),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o187=!0;},p:function p(e,o){var n=66315632&o[0]|252381681&o[1]|255721600&o[2]|12&o[3]?Aa(i,[16&o[0]&&{locale:e[4]},128&o[2]&&{ui:e[69]},32&o[0]&&{shapes:e[5]},134217728&o[1]&&{selection:e[58]},1048576&o[0]&&{uid:e[20]},64&o[1]&&{parentRect:e[37]},16777216&o[1]&&{rootRect:e[55]},256&o[1]&&{utilRect:e[39]},524288&o[1]&&{offset:e[50]},128&o[1]&&{disabled:e[38]},8388608&o[0]&&{contextRotation:e[23]},16777216&o[0]&&{contextFlipX:e[24]},33554432&o[0]&&{contextFlipY:e[25]},32&o[1]&&{contextZoom:e[36]?e[36].scale:void 0},16&o[1]&&{active:e[35]},33554432&o[1]&&{opacity:e[56]},67108864&o[1]&&{hoverColor:e[57]},67108864&o[1]&&{caretColor:e[57]},67108864&o[1]&&{snapColor:e[57]},i[19],65536&o[1]&&{eraseRadius:e[47]},64&o[0]&&{selectRadius:e[6]},1024&o[0]&&{enableButtonFlipVertical:e[10]},16384&o[0]&&{enableMultiSelect:e[14]},2097152&o[0]&&{mapEditorPointToImagePoint:e[21]},4194304&o[0]&&{mapImagePointToEditorPoint:e[22]},8192&o[0]&&{enableTapToAddText:e[13]},256&o[0]&&{textInputMode:e[8]},65536&o[0]&&{snapThreshold:e[16]},131072&o[1]&&{snapPointer:!e[48]},131072&o[0]&&{enableSnapToContext:e[17]},32768&o[0]&&{gridSize:e[15]},4&o[3]&&{willStartInteraction:e[95]},131072&o[2]&&{oninteractionstart:e[79]},262144&o[2]&&{oninteractionupdate:e[80]},524288&o[2]&&{oninteractionrelease:e[81]},2097152&o[2]&&{oninteractionend:e[83]},1048576&o[2]&&{oninteractioncancel:e[82]},33554432&o[2]&&{onleavecanvas:e[87]},16777216&o[2]&&{onhovercanvas:e[86]},134217728&o[2]&&{onhovershape:e[89]},67108864&o[2]&&{ontapcanvas:e[88]},1&o[1]|8&o[3]&&{onaddshape:e[156]},1&o[1]&&{onselectshape:e[157]},1&o[1]&&{onblurshape:e[158]},1&o[1]&&{ontapshape:e[159]},1&o[1]|8&o[3]&&{onupdateshape:e[160]},1&o[1]|8&o[3]&&{onremoveshape:e[161]},8&o[3]&&{ontriggerhistorywrite:e[162]},2048&o[1]&&La(e[42])]):{};t.$set(n);},i:function i(e){_o187||(ka(t.$$.fragment,e),_o187=!0);},o:function o(e){Ca(t.$$.fragment,e),_o187=!1;},d:function d(o){e[163](null),Oa(t,o);}};}function Ub(e){var t,o,_i123,r,a,s=e[51]&&jb(e);return {c:function c(){t=Rr("div"),s&&s.c(),Dr(t,"slot","main"),Dr(t,"style",o="cursor:"+e[46]);},m:function m(o,l){Tr(o,t,l),s&&s.m(t,null),e[164](t),_i123=!0,r||(a=[Lr(t,"keydown",e[84]),gr(Ec.call(null,t)),Lr(t,"dropfiles",function(){ir(e[12]?e[94]:n)&&(e[12]?e[94]:n).apply(this,arguments);}),gr(Mc.call(null,t)),Lr(t,"measure",e[152])],r=!0);},p:function p(n,r){(e=n)[51]?s?(s.p(e,r),1048576&r[1]&&ka(s,1)):(s=jb(e),s.c(),ka(s,1),s.m(t,null)):s&&(wa(),Ca(s,1,1,function(){s=null;}),Sa()),(!_i123||32768&r[1]&&o!==(o="cursor:"+e[46]))&&Dr(t,"style",o);},i:function i(e){_i123||(ka(s),_i123=!0);},o:function o(e){Ca(s),_i123=!1;},d:function d(o){o&&Mr(t),s&&s.d(),e[164](null),r=!1,or(a);}};}function Gb(e){var t,_o188;return t=new _b({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o188=!0;},p:function p(e,o){var i={};16&o[0]&&(i.locale=e[4]),524288&o[0]&&(i.presets=e[19]),2048&o[0]&&(i.enableSelectImage=e[11]),4096&o[1]&&(i.willRenderPresetToolbar=e[43]),8192&o[1]&&(i.scrollElasticity=e[44]),t.$set(i);},i:function i(e){_o188||(ka(t.$$.fragment,e),_o188=!0);},o:function o(e){Ca(t.$$.fragment,e),_o188=!1;},d:function d(e){Oa(t,e);}};}function Zb(e){var t,o,_i124,n="stack"===e[7]&&Xb(e),r=(e[53]&&e[34]||"row"===e[7])&&Kb(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ar();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i124=!0;},p:function p(e,i){"stack"===e[7]?n?(n.p(e,i),128&i[0]&&ka(n,1)):(n=Xb(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[53]&&e[34]||"row"===e[7]?r?(r.p(e,i),128&i[0]|4194312&i[1]&&ka(r,1)):(r=Kb(e),r.c(),ka(r,1),r.m(o.parentNode,o)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());},i:function i(e){_i124||(ka(n),ka(r),_i124=!0);},o:function o(e){Ca(n),Ca(r),_i124=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}function Xb(e){var t,o,_i125,n;var r=[qb,Yb],a=[];function s(e,t){return e[45]?0:1;}return o=s(e),_i125=a[o]=r[o](e),{c:function c(){t=Rr("div"),_i125.c(),Dr(t,"class","PinturaControlPanels");},m:function m(e,i){Tr(e,t,i),a[o].m(t,null),n=!0;},p:function p(e,n){var l=o;o=s(e),o===l?a[o].p(e,n):(wa(),Ca(a[l],1,1,function(){a[l]=null;}),Sa(),_i125=a[o],_i125?_i125.p(e,n):(_i125=a[o]=r[o](e),_i125.c()),ka(_i125,1),_i125.m(t,null));},i:function i(e){n||(ka(_i125),n=!0);},o:function o(e){Ca(_i125),n=!1;},d:function d(e){e&&Mr(t),a[o].d();}};}function Yb(e){var t,_o189,_i126;return _o189=new Sb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollElasticity:e[44],willRenderControls:e[18]}}),{c:function c(){t=Rr("div"),Fa(_o189.$$.fragment),Dr(t,"class","PinturaControlPanel");},m:function m(e,n){Tr(e,t,n),Da(_o189,t,null),_i126=!0;},p:function p(e,t){var i={};16&t[0]&&(i.locale=e[4]),262144&t[1]&&(i.shapeProps=e[49]),512&t[0]&&(i.controls=e[9]),8192&t[1]&&(i.scrollElasticity=e[44]),262144&t[0]&&(i.willRenderControls=e[18]),_o189.$set(i);},i:function i(e){_i126||(ka(_o189.$$.fragment,e),_i126=!0);},o:function o(e){Ca(_o189.$$.fragment,e),_i126=!1;},d:function d(e){e&&Mr(t),Oa(_o189);}};}function qb(e){var t,_o190,_i127;return _o190=new _b({props:{locale:e[4],presets:e[19],enableSelectImage:e[11],willRenderPresetToolbar:e[43],onaddpreset:e[93],ongrabpreset:e[90],ondragpreset:e[91],ondroppreset:e[92],scrollElasticity:e[44]}}),{c:function c(){t=Rr("div"),Fa(_o190.$$.fragment),Dr(t,"class","PinturaControlPanel");},m:function m(e,n){Tr(e,t,n),Da(_o190,t,null),_i127=!0;},p:function p(e,t){var i={};16&t[0]&&(i.locale=e[4]),524288&t[0]&&(i.presets=e[19]),2048&t[0]&&(i.enableSelectImage=e[11]),4096&t[1]&&(i.willRenderPresetToolbar=e[43]),8192&t[1]&&(i.scrollElasticity=e[44]),_o190.$set(i);},i:function i(e){_i127||(ka(_o190.$$.fragment,e),_i127=!0);},o:function o(e){Ca(_o190.$$.fragment,e),_i127=!1;},d:function d(e){e&&Mr(t),Oa(_o190);}};}function Kb(e){var t,_o191;return t=new Ad({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[nx]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o191=!0;},p:function p(e,o){var i={};8192&o[1]&&(i.elasticity=e[44]),262801&o[0]|262154&o[1]|67108864&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o191||(ka(t.$$.fragment,e),_o191=!0);},o:function o(e){Ca(t.$$.fragment,e),_o191=!1;},d:function d(e){Oa(t,e);}};}function Jb(e){var t,_o192;return t=new Xu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[32],selectedIndex:e[32].findIndex(e[153]),onchange:e[78],$$slots:{option:[ox,function(_ref469){var e=_ref469.option;return {211:e};},function(_ref470){var e=_ref470.option;return [0,0,0,0,0,0,e?33554432:0];}]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o192=!0;},p:function p(e,o){var i={};16&o[0]&&(i.locale=e[4]),2&o[1]&&(i.options=e[32]),1&o[0]|2&o[1]&&(i.selectedIndex=e[32].findIndex(e[153])),16&o[0]|100663296&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o192||(ka(t.$$.fragment,e),_o192=!0);},o:function o(e){Ca(t.$$.fragment,e),_o192=!1;},d:function d(e){Oa(t,e);}};}function Qb(e){var t,_o193;return t=new hd({props:{$$slots:{default:[ex]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o193=!0;},p:function p(e,o){var i={};16&o[0]|100663296&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o193||(ka(t.$$.fragment,e),_o193=!0);},o:function o(e){Ca(t.$$.fragment,e),_o193=!1;},d:function d(e){Oa(t,e);}};}function ex(e){var t,o=(M(e[211].icon)?e[211].icon(e[4]):e[211].icon)+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){16&i[0]|33554432&i[6]&&o!==(o=(M(e[211].icon)?e[211].icon(e[4]):e[211].icon)+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function tx(e){var t,o,i=(M(e[211].label)?e[211].label(e[4]):e[211].label)+"";return {c:function c(){t=Rr("span"),o=Er(i);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){16&t[0]|33554432&t[6]&&i!==(i=(M(e[211].label)?e[211].label(e[4]):e[211].label)+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function ox(e){var t,o,_i128,n=e[211].icon&&Qb(e),r=!e[211].hideLabel&&tx(e);return {c:function c(){t=Rr("div"),n&&n.c(),o=Ir(),r&&r.c(),Dr(t,"slot","option");},m:function m(e,a){Tr(e,t,a),n&&n.m(t,null),Sr(t,o),r&&r.m(t,null),_i128=!0;},p:function p(e,i){e[211].icon?n?(n.p(e,i),33554432&i[6]&&ka(n,1)):(n=Qb(e),n.c(),ka(n,1),n.m(t,o)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),e[211].hideLabel?r&&(r.d(1),r=null):r?r.p(e,i):(r=tx(e),r.c(),r.m(t,null));},i:function i(e){_i128||(ka(n),_i128=!0);},o:function o(e){Ca(n),_i128=!1;},d:function d(e){e&&Mr(t),n&&n.d(),r&&r.d();}};}function ix(e){var t,_o194;return t=new Sb({props:{locale:e[4],shapeProps:e[49],onchange:e[85],controls:e[9],scrollEnable:!1,hideTitles:!0,willRenderControls:e[154]}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o194=!0;},p:function p(e,o){var i={};16&o[0]&&(i.locale=e[4]),262144&o[1]&&(i.shapeProps=e[49]),512&o[0]&&(i.controls=e[9]),262144&o[0]&&(i.willRenderControls=e[154]),t.$set(i);},i:function i(e){_o194||(ka(t.$$.fragment,e),_o194=!0);},o:function o(e){Ca(t.$$.fragment,e),_o194=!1;},d:function d(e){Oa(t,e);}};}function nx(e){var t,o,_i129,n=e[34]&&Jb(e),r="row"===e[7]&&ix(e);return {c:function c(){n&&n.c(),t=Ir(),r&&r.c(),o=Ar();},m:function m(e,a){n&&n.m(e,a),Tr(e,t,a),r&&r.m(e,a),Tr(e,o,a),_i129=!0;},p:function p(e,i){e[34]?n?(n.p(e,i),8&i[1]&&ka(n,1)):(n=Jb(e),n.c(),ka(n,1),n.m(t.parentNode,t)):n&&(wa(),Ca(n,1,1,function(){n=null;}),Sa()),"row"===e[7]?r?(r.p(e,i),128&i[0]&&ka(r,1)):(r=ix(e),r.c(),ka(r,1),r.m(o.parentNode,o)):r&&(wa(),Ca(r,1,1,function(){r=null;}),Sa());},i:function i(e){_i129||(ka(n),ka(r),_i129=!0);},o:function o(e){Ca(n),Ca(r),_i129=!1;},d:function d(e){n&&n.d(e),e&&Mr(t),r&&r.d(e),e&&Mr(o);}};}function rx(e){var t,_o195;return t=new Ad({props:{class:"PinturaControlListScroller",elasticity:e[44],$$slots:{default:[cx]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o195=!0;},p:function p(e,o){var i={};8192&o[1]&&(i.elasticity=e[44]),134217744&o[0]|8388608&o[1]|67108864&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o195||(ka(t.$$.fragment,e),_o195=!0);},o:function o(e){Ca(t.$$.fragment,e),_o195=!1;},d:function d(e){Oa(t,e);}};}function ax(e){var t,_o196;return t=new hd({props:{$$slots:{default:[sx]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o196=!0;},p:function p(e,o){var i={};16&o[0]|100663296&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o196||(ka(t.$$.fragment,e),_o196=!0);},o:function o(e){Ca(t.$$.fragment,e),_o196=!1;},d:function d(e){Oa(t,e);}};}function sx(e){var t,o=(M(e[211].icon)?e[211].icon(e[4]):e[211].icon)+"";return {c:function c(){t=Pr("g");},m:function m(e,i){Tr(e,t,i),t.innerHTML=o;},p:function p(e,i){16&i[0]|33554432&i[6]&&o!==(o=(M(e[211].icon)?e[211].icon(e[4]):e[211].icon)+"")&&(t.innerHTML=o);},d:function d(e){e&&Mr(t);}};}function lx(e){var t,o,i,n,r,a=(M(e[211].label)?e[211].label(e[4]):e[211].label)+"",s=e[211].icon&&ax(e);return {c:function c(){t=Rr("div"),s&&s.c(),o=Ir(),i=Rr("span"),n=Er(a),Dr(t,"slot","option");},m:function m(e,a){Tr(e,t,a),s&&s.m(t,null),Sr(t,o),Sr(t,i),Sr(i,n),r=!0;},p:function p(e,i){e[211].icon?s?(s.p(e,i),33554432&i[6]&&ka(s,1)):(s=ax(e),s.c(),ka(s,1),s.m(t,o)):s&&(wa(),Ca(s,1,1,function(){s=null;}),Sa()),(!r||16&i[0]|33554432&i[6])&&a!==(a=(M(e[211].label)?e[211].label(e[4]):e[211].label)+"")&&Wr(n,a);},i:function i(e){r||(ka(s),r=!0);},o:function o(e){Ca(s),r=!1;},d:function d(e){e&&Mr(t),s&&s.d();}};}function cx(e){var t,_o197;return t=new Xu({props:{locale:e[4],class:"PinturaControlList",optionClass:"PinturaControlListOption",layout:"row",options:e[54],selectedIndex:e[54].findIndex(e[155]),onchange:e[77],$$slots:{option:[lx,function(_ref471){var e=_ref471.option;return {211:e};},function(_ref472){var e=_ref472.option;return [0,0,0,0,0,0,e?33554432:0];}]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o197=!0;},p:function p(e,o){var i={};16&o[0]&&(i.locale=e[4]),8388608&o[1]&&(i.options=e[54]),134217728&o[0]|8388608&o[1]&&(i.selectedIndex=e[54].findIndex(e[155])),16&o[0]|100663296&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o197||(ka(t.$$.fragment,e),_o197=!0);},o:function o(e){Ca(t.$$.fragment,e),_o197=!1;},d:function d(e){Oa(t,e);}};}function dx(e){var t,o,_i130,n,r;var a=[Zb,Gb],s=[];function l(e,t){return e[52]?0:e[45]?1:-1;}~(o=l(e))&&(_i130=s[o]=a[o](e));var _c39=e[33]&&rx(e);return {c:function c(){t=Rr("div"),_i130&&_i130.c(),n=Ir(),_c39&&_c39.c(),Dr(t,"slot","footer"),Dr(t,"style",e[40]);},m:function m(e,i){Tr(e,t,i),~o&&s[o].m(t,null),Sr(t,n),_c39&&_c39.m(t,null),r=!0;},p:function p(e,d){var u=o;o=l(e),o===u?~o&&s[o].p(e,d):(_i130&&(wa(),Ca(s[u],1,1,function(){s[u]=null;}),Sa()),~o?(_i130=s[o],_i130?_i130.p(e,d):(_i130=s[o]=a[o](e),_i130.c()),ka(_i130,1),_i130.m(t,n)):_i130=null),e[33]?_c39?(_c39.p(e,d),4&d[1]&&ka(_c39,1)):(_c39=rx(e),_c39.c(),ka(_c39,1),_c39.m(t,null)):_c39&&(wa(),Ca(_c39,1,1,function(){_c39=null;}),Sa()),(!r||512&d[1])&&Dr(t,"style",e[40]);},i:function i(e){r||(ka(_i130),ka(_c39),r=!0);},o:function o(e){Ca(_i130),Ca(_c39),r=!1;},d:function d(e){e&&Mr(t),~o&&s[o].d(),_c39&&_c39.d();}};}function ux(e){var t,_o198;return t=new Cf({props:{hasHeader:e[41],$$slots:{footer:[dx],main:[Ub],header:[Hb]},$$scope:{ctx:e}}}),t.$on("measure",e[166]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o198=!0;},p:function p(e,o){var i={};1024&o[1]&&(i.hasHeader=e[41]),2080374769&o[0]|134216703&o[1]|67108864&o[6]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o198||(ka(t.$$.fragment,e),_o198=!0);},o:function o(e){Ca(t.$$.fragment,e),_o198=!1;},d:function d(e){Oa(t,e);}};}function hx(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S,k,C,M,R,P,E,I,A,L,z,F,D,O,B,W,V,_,N,H,j,U,G,X,Y,q,K,J,Q,ee,te,oe,ie,ne,re,ae,se,le,ce,de,ue,pe,me,$e,ge,fe,ye,be,xe=Kn,ve=function ve(){return xe(),xe=rr(Ae,function(e){return o(35,Y=e);}),Ae;},we=Kn,Se=function Se(){return we(),we=rr(Oe,function(e){return o(145,Q=e);}),Oe;},ke=Kn,Ce=function Ce(){return ke(),ke=rr(ft,function(e){return o(37,ae=e);}),ft;},Te=Kn,Me=function Me(){return Te(),Te=rr(ze,function(e){return o(151,$e=e);}),ze;},Re=Kn,Ee=function Ee(){return Re(),Re=rr(Le,function(e){return o(56,ye=e);}),Le;};e.$$.on_destroy.push(function(){return xe();}),e.$$.on_destroy.push(function(){return we();}),e.$$.on_destroy.push(function(){return ke();}),e.$$.on_destroy.push(function(){return Te();}),e.$$.on_destroy.push(function(){return Re();});var Ae=t.isActive;ve();var Le=t.isActiveFraction;Ee();var ze=t.isVisible;Me();var Fe=t.stores,_t$locale3=t.locale,De=_t$locale3===void 0?{}:_t$locale3,Oe=t.shapes;Se();var _t$toolbar=t.toolbar,Be=_t$toolbar===void 0?[]:_t$toolbar,_t$toolShapes=t.toolShapes,We=_t$toolShapes===void 0?{}:_t$toolShapes,Ve=t.toolActive,_e=t.toolSelectRadius,_t$toolRetainStyles=t.toolRetainStyles,Ne=_t$toolRetainStyles===void 0?!1:_t$toolRetainStyles,_t$toolbarLayout=t.toolbarLayout,He=_t$toolbarLayout===void 0?"stack":_t$toolbarLayout,je=t.textInputMode,_t$shapeControls=t.shapeControls,Ue=_t$shapeControls===void 0?{}:_t$shapeControls,_t$enableButtonFlipVe2=t.enableButtonFlipVertical,Ge=_t$enableButtonFlipVe2===void 0?!1:_t$enableButtonFlipVe2,_t$enablePresetSelect=t.enablePresetSelectImage,Ze=_t$enablePresetSelect===void 0?!0:_t$enablePresetSelect,_t$enablePresetDropIm=t.enablePresetDropImage,Xe=_t$enablePresetDropIm===void 0?!0:_t$enablePresetDropIm,_t$enableSelectToolTo=t.enableSelectToolToAddShape,Ye=_t$enableSelectToolTo===void 0?!1:_t$enableSelectToolTo,_t$enableAutoSelectMo=t.enableAutoSelectMoveTool,qe=_t$enableAutoSelectMo===void 0?["line","arrow","path","rectangle","ellipse","text"]:_t$enableAutoSelectMo,_t$enableTapToAddText2=t.enableTapToAddText,Ke=_t$enableTapToAddText2===void 0?!1:_t$enableTapToAddText2,_t$enableMoveTool=t.enableMoveTool,Je=_t$enableMoveTool===void 0?!1:_t$enableMoveTool,_t$enableViewTool=t.enableViewTool,Qe=_t$enableViewTool===void 0?!1:_t$enableViewTool,_t$enableToolShareSty=t.enableToolShareStyles,et=_t$enableToolShareSty===void 0?!0:_t$enableToolShareSty,_t$enableMultiSelect2=t.enableMultiSelect,tt=_t$enableMultiSelect2===void 0?!1:_t$enableMultiSelect2,_t$gridSize2=t.gridSize,ot=_t$gridSize2===void 0?0:_t$gridSize2,_t$snapThreshold2=t.snapThreshold,it=_t$snapThreshold2===void 0?0:_t$snapThreshold2,_t$enableSnapToContex2=t.enableSnapToContext,nt=_t$enableSnapToContex2===void 0?!0:_t$enableSnapToContex2,_t$willRenderHeaderTo=t.willRenderHeaderTools,rt=_t$willRenderHeaderTo===void 0?Z:_t$willRenderHeaderTo,at=t.willRenderPresetToolbar,lt=t.willRenderShapeStyleControls,ct=t.willStartInteraction,_t$shapePresets=t.shapePresets,dt=_t$shapePresets===void 0?[]:_t$shapePresets,ut=t.utilKey,ht=t.mapScreenPointToImagePoint,pt=t.mapImagePointToScreenPoint,_t$imageRotation=t.imageRotation,mt=_t$imageRotation===void 0?0:_t$imageRotation,_t$imageFlipX=t.imageFlipX,$t=_t$imageFlipX===void 0?!1:_t$imageFlipX,_t$imageFlipY=t.imageFlipY,gt=_t$imageFlipY===void 0?!1:_t$imageFlipY,ft=t.parentRect;Ce();var _t$hooks=t.hooks,yt=_t$hooks===void 0?{}:_t$hooks;var xt=oa("selection");sr(e,xt,function(e){return o(150,ue=e);});var vt=oa("isAnimated");sr(e,vt,function(e){return o(142,q=e);});var wt=oa("elasticityMultiplier");sr(e,wt,function(e){return o(146,ee=e);});var St=oa("ui");sr(e,St,function(e){return o(176,pe=e);});var kt=oa("keysPressed");var Ct;sr(e,kt,function(e){return o(149,de=e);});var _Fe=Fe,Tt=_Fe.env,Mt=_Fe.history,Rt=_Fe.rootRect,Pt=_Fe.rootColorSecondary,Et=_Fe.enablePanInput,It=_Fe.enablePanInputStatus,At=_Fe.enableZoomInput,Lt=_Fe.stageRect,zt=_Fe.utilRectPadded,Ft=_Fe.scrollElasticity,Dt=_Fe.imageOverlayMarkup,Ot=_Fe.imagePreviewModifiers,Bt=_Fe.imageCropRect,Wt=_Fe.shapePreprocessor,Vt=_Fe.stageScalar,_t=_Fe.imageSelectionRect,Nt=_Fe.imageTransformsInterpolated,Ht=_Fe.imageSelectionPan,jt=_Fe.imageSize,Ut=_Fe.allowPan,Gt=_Fe.allowZoom,Zt=_Fe.allowZoomControls,Xt=_Fe.allowPlayPause;sr(e,Tt,function(e){return o(143,K=e);}),sr(e,Rt,function(e){return o(55,fe=e);}),sr(e,Pt,function(e){return o(57,be=e);}),sr(e,It,function(e){return o(38,le=e);}),sr(e,Lt,function(e){return o(147,te=e);}),sr(e,zt,function(e){return o(39,me=e);}),sr(e,Ot,function(e){return o(177,ge=e);}),sr(e,Bt,function(e){return o(175,se=e);}),sr(e,Vt,function(e){return o(173,ne=e);}),sr(e,_t,function(e){return o(174,re=e);}),sr(e,Nt,function(e){return o(36,oe=e);}),sr(e,Ht,function(e){return o(172,ie=e);}),sr(e,jt,function(e){return o(148,ce=e);});var Yt=0,qt={};var Kt=function Kt(e){var _Ct$e=_slicedToArray(Ct[e],2),t=_Ct$e[0],o=_Ct$e[1];var i,n,r="relative"===o.position;var a=r?"0%":0,s=r?"0%":0;Ti(t)||Si(t)?(n=r?"20%":.2*ae.width,i=gi(t),i.x=a,i.y=s,xn(i,{width:n,height:n},ae)):Mi(t)?(n=r?"10%":.1*ae.width,i=gi(t),i.x=a,i.y=s,xn(i,{rx:n,ry:n},ae)):Ri(t)&&(n=r?"10%":.1*ae.width,i=gi(t),i.x1=a,i.y1=s,i.x2=a,i.y2=s),i&&Promise.resolve().then(function(){po(uo(i,void 0,n));});},Jt=function Jt(e){return ht(jy(e,fe));};var Qt,eo={};var to;var oo;var io=function io(e){if(!(Pi(e)&&Fo(e,"pathClose")))return;var t=_toConsumableArray(e.strokeColor);t[3]=1,Qt.updateMarkupShape(e,{pathClose:!1,strokeColor:t},!1),Qt.removeMarkupShapeProps(e,["backgroundColor"],!1),Qt.confirmMarkupItemDraft(),Qt.selectShape(e),V("addshape",e),Mt.write();};var no;var ro=function ro(e,t){var o={};return Object.entries(e).forEach(function(_ref473){var _ref474=_slicedToArray(_ref473,2),e=_ref474[0],i=_ref474[1];Fo(t,e)&&(o[e]=i);}),o;},ao=function ao(e,t){if(Lo(e))return e;if(e.endsWith("%")){return parseFloat(e)/100*t.width;}};var so=void 0,lo=void 0,co=void 0;var uo=function uo(e,t,o){var i=!1;t||(i=!0,t=W?ht(st(te)):st(se)),t.x-=ae.x||0,t.y-=ae.y||0,($t||gt)&&(e.flipX=$t,e.flipY=gt);var n=Qt.getShapesNearPosition(Q,t);if(i&&n.length){var _e234=.1*Math.min(se.width,se.height);t.x+=Math.round(-_e234+Math.random()*_e234*2),t.y+=Math.round(-_e234+Math.random()*_e234*2);}if(0!==mt&&(e.rotation=$t&&gt?-mt:$t||gt?mt:-mt),Fo(e,"width")&&Fo(e,"height")){var _bn2=bn(e,["width","height"],ae),_o199=_bn2.width,_i131=_bn2.height;xn(e,{x:t.x-.5*_o199,y:t.y-.5*_i131},ae);}else if(Mi(e))xn(e,{x:t.x,y:t.y},ae);else if(Ri(e)){var _bn4=bn(e,["x1","y1","x2","y2"],ae),_i132=_bn4.x1,_n60=_bn4.y1,_r51=_bn4.x2,_a31=_bn4.y2,_s33=Pe(he(_i132,_n60),he(_r51,_a31)),_l33=T(o)?cn(o,ae.width):_s33;xn(e,{x1:t.x-_l33,y1:t.y+_l33,x2:t.x+_l33,y2:t.y-_l33},ae);}else if(Pi(e)){var _bn6=bn(e,["points"],ae),_o200=_bn6.points,_i133=Ie(_o200);xn(e,{points:_o200.map(function(e){return {x:e.x+t.x-_i133.x,y:e.y+t.y-_i133.y};})},ae);}return e;},ho=function ho(e,t){var o=uo(xi(e,se),t);return e.shape&&(Fo(e.shape,"x")&&(o.x=e.shape.x),Fo(e.shape,"y")&&(o.y=e.shape.y)),po(o);},po=function po(e){var _yt=yt,_yt$beforeAddShape=_yt.beforeAddShape,t=_yt$beforeAddShape===void 0?function(){return !0;}:_yt$beforeAddShape;if(t(e))return Qt.addShape(e),Qt.selectShape(e),V("addshape",e),Mt.write(),e;};var mo=!1;var $o=function $o(){Mt.write();};var go;var fo=oa("redrawTrigger");sr(e,fo,function(e){return o(144,J=e);});var yo=[],bo=uc(q?20:0);sr(e,bo,function(e){return o(141,X=e);});return e.$$set=function(e){"isActive"in e&&ve(o(1,Ae=e.isActive)),"isActiveFraction"in e&&Ee(o(2,Le=e.isActiveFraction)),"isVisible"in e&&Me(o(3,ze=e.isVisible)),"stores"in e&&o(100,Fe=e.stores),"locale"in e&&o(4,De=e.locale),"shapes"in e&&Se(o(5,Oe=e.shapes)),"toolbar"in e&&o(101,Be=e.toolbar),"toolShapes"in e&&o(102,We=e.toolShapes),"toolActive"in e&&o(0,Ve=e.toolActive),"toolSelectRadius"in e&&o(6,_e=e.toolSelectRadius),"toolRetainStyles"in e&&o(103,Ne=e.toolRetainStyles),"toolbarLayout"in e&&o(7,He=e.toolbarLayout),"textInputMode"in e&&o(8,je=e.textInputMode),"shapeControls"in e&&o(9,Ue=e.shapeControls),"enableButtonFlipVertical"in e&&o(10,Ge=e.enableButtonFlipVertical),"enablePresetSelectImage"in e&&o(11,Ze=e.enablePresetSelectImage),"enablePresetDropImage"in e&&o(12,Xe=e.enablePresetDropImage),"enableSelectToolToAddShape"in e&&o(104,Ye=e.enableSelectToolToAddShape),"enableAutoSelectMoveTool"in e&&o(105,qe=e.enableAutoSelectMoveTool),"enableTapToAddText"in e&&o(13,Ke=e.enableTapToAddText),"enableMoveTool"in e&&o(106,Je=e.enableMoveTool),"enableViewTool"in e&&o(107,Qe=e.enableViewTool),"enableToolShareStyles"in e&&o(108,et=e.enableToolShareStyles),"enableMultiSelect"in e&&o(14,tt=e.enableMultiSelect),"gridSize"in e&&o(15,ot=e.gridSize),"snapThreshold"in e&&o(16,it=e.snapThreshold),"enableSnapToContext"in e&&o(17,nt=e.enableSnapToContext),"willRenderHeaderTools"in e&&o(109,rt=e.willRenderHeaderTools),"willRenderPresetToolbar"in e&&o(110,at=e.willRenderPresetToolbar),"willRenderShapeStyleControls"in e&&o(18,lt=e.willRenderShapeStyleControls),"willStartInteraction"in e&&o(111,ct=e.willStartInteraction),"shapePresets"in e&&o(19,dt=e.shapePresets),"utilKey"in e&&o(20,ut=e.utilKey),"mapScreenPointToImagePoint"in e&&o(21,ht=e.mapScreenPointToImagePoint),"mapImagePointToScreenPoint"in e&&o(22,pt=e.mapImagePointToScreenPoint),"imageRotation"in e&&o(23,mt=e.imageRotation),"imageFlipX"in e&&o(24,$t=e.imageFlipX),"imageFlipY"in e&&o(25,gt=e.imageFlipY),"parentRect"in e&&Ce(o(26,ft=e.parentRect)),"hooks"in e&&o(112,yt=e.hooks);},e.$$.update=function(){var t,ie,ne,re;if(33554432&e.$$.dirty[4]&&o(124,i=de.includes(18)),1049088&e.$$.dirty[3]&&(Ct&&We===Ct||o(113,Ct=We)),16&e.$$.dirty[1]&&Ut.set(Y),16&e.$$.dirty[1]&&Gt.set(Y),16&e.$$.dirty[1]&&Zt.set(Y),256&e.$$.dirty[3]&&o(33,n=Array.isArray(Be)&&Be.length>1&&Array.isArray(Be[0][1])),4&e.$$.dirty[1]|256&e.$$.dirty[3]&&o(54,r=n?Be.map(function(e,t){return [t,e[0]];}):[]),134217728&e.$$.dirty[0]|4&e.$$.dirty[1]|256&e.$$.dirty[3]&&o(140,a=n?Be[Yt][1]:Be),524288&e.$$.dirty[0]|155648&e.$$.dirty[3]|65536&e.$$.dirty[4]&&o(32,s=function(e,_ref475){var t=_ref475.willRenderPresetToolbar,o=_ref475.shapePresets,i=_ref475.enableViewTool,r=_ref475.enableMoveTool;var a=0!==o.length||t?e:e.filter(function(e){return "preset"!==e[0];});return n&&(a=[["move",function(e){return e.shapeLabelToolMove;},{icon:function icon(e){return e.shapeIconToolMove;}}],["view",function(e){return e.shapeLabelToolView;},{icon:function icon(e){return e.shapeIconToolView;}}]].concat(_toConsumableArray(a))),a=r?a:a.filter(function(e){return "move"!==e[0];}),i?a:a.filter(function(e){return "view"!==e[0];});}(a,{willRenderPresetToolbar:at,shapePresets:dt,enableMoveTool:Je,enableViewTool:Qe})),2&e.$$.dirty[1]&&o(138,d=!!s.length),1&e.$$.dirty[0]|2&e.$$.dirty[1]|16384&e.$$.dirty[4]&&d&&void 0===Ve&&o(0,Ve=s[0][0]),134217729&e.$$.dirty[0]|4&e.$$.dirty[1]|2097152&e.$$.dirty[3]|65536&e.$$.dirty[4]&&n&&o(114,qt=_objectSpread2(_objectSpread2({},qt),{},_defineProperty({},Yt,a.map(function(_ref476){var _ref477=_slicedToArray(_ref476,1),e=_ref477[0];return e;}).includes(Ve)?Ve:qt[Yt]||a[0][0]))),512&e.$$.dirty[0]&&o(137,l=!!Object.keys(Ue).length),2&e.$$.dirty[1]&&o(34,c=s.length>1),12&e.$$.dirty[1]&&o(53,u=c||n),1&e.$$.dirty[0]&&o(139,h=void 0!==Ve),57344&e.$$.dirty[4]&&o(52,p=(!h||d)&&l),536870912&e.$$.dirty[0]&&o(31,V=go&&(t=go,function(e,o){t.dispatchEvent(Dp(e,o));})),1&e.$$.dirty[0]|17&e.$$.dirty[1]&&Y&&V&&V("selectcontrol",Ve),16&e.$$.dirty[1]&&(Y?$r(Ot,ge[ut]={maskMarkupOpacity:.85},ge):delete ge[ut]),1&e.$$.dirty[0]|1048576&e.$$.dirty[3]&&o(136,m=Ve&&Ct[Ve]?Ct[Ve][1]:void 0),4096&e.$$.dirty[4]&&o(125,$=m&&m.isSelection?"selection":"shapes"),3&e.$$.dirty[4]&&function(e){if(!Qt)return;var t=Qt.getShapeDraft(xt);t&&(e&&(to=t.drawMode),Qt.updateShapeDraft({drawMode:e?"subtract":to},xt));}("selection"===$&&i),268435457&e.$$.dirty[0]&&Ve&&Qt){var _e235=Qt.getMarkupItemDraft();_e235&&io(_e235);}if(1&e.$$.dirty[0]&&Ve&&Qt&&"move"!==Ve&&Qt.blurShapes(),16&e.$$.dirty[1]|134217728&e.$$.dirty[4]&&o(51,g=$e&&Y),256&e.$$.dirty[1]|8388608&e.$$.dirty[4]&&o(50,f=me&&he(te.x-me.x,te.y-me.y)),512&e.$$.dirty[0]&&o(135,y=Object.keys(Ue)),16384&e.$$.dirty[0]|16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(122,b=tt?Y&&Q.filter(Ai):[]),536870912&e.$$.dirty[3]&&o(123,x=b.length>1),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(119,v=Y&&Q.filter(Ai)[0]),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(130,w=Y&&Q.find(function(e){return Li(e);})),16&e.$$.dirty[1]|2097152&e.$$.dirty[4]&&o(133,S=Y&&Q.find(function(e){return zi(e);})),1&e.$$.dirty[0]|16&e.$$.dirty[1]|1048576&e.$$.dirty[3]&&o(127,k=Y&&Ct[Ve]?sn(gi(_objectSpread2(_objectSpread2({},Ct[Ve][0]),pe[ut]?pe[ut][Ve]:{}))):{}),1048576&e.$$.dirty[3]&&Ct&&o(115,eo={}),1&e.$$.dirty[0]|4227072&e.$$.dirty[3]|2056&e.$$.dirty[4]&&o(126,C=k&&Object.keys(k).reduce(function(e,t){var o="disableStyle"===t,i="settings"===t,n=!!y.find(function(e){return e.split("_").includes(t);});if(!o&&!i&&!n)return e;if(void 0===k[t])return e;if(!0===k.disableStyle)return e;if(k.disableStyle&&k.disableStyle.includes(t))return e;if("strokeWidth"===t&&Object.keys(eo).includes("strokeWidth")&&void 0===eo[t]&&Fo(k,"points"))return e[t]=k[t],e;var _ref478=k.settings&&k.settings[t]||{},_ref478$share=_ref478.share,r=_ref478$share===void 0?!0:_ref478$share,a=et&&r?eo:eo[Ve]||{};return e[t]=Fo(a,t)?a[t]:k[t],e;},{})),1048577&e.$$.dirty[0]|1024&e.$$.dirty[3]|4&e.$$.dirty[4]&&(Ne?function(e,t,o){var i=pe[e],n=i?i[t]:{};St.set(_objectSpread2(_objectSpread2({},pe),{},_defineProperty({},e,_objectSpread2(_objectSpread2({},i),{},_defineProperty({},t,_objectSpread2(_objectSpread2({},n),o))))));}(ut,Ve,C):(ie=ut,St.set(_defineProperty({},ie,{})))),16&e.$$.dirty[1]|67108864&e.$$.dirty[3]|67108868&e.$$.dirty[4]&&o(134,M=ue&&Y?v||C:void 0),1610612736&e.$$.dirty[3]|1536&e.$$.dirty[4]&&o(49,R=x?function(e){var t={};return e.forEach(function(e){Object.entries(e).filter(function(_ref479){var _ref480=_slicedToArray(_ref479,1),e=_ref480[0];return !e.startsWith("_");}).forEach(function(_ref481){var _t$e4;var _ref482=_slicedToArray(_ref481,2),e=_ref482[0],o=_ref482[1];Fo(t,e)?"disableStyle"===e&&(_t$e4=t[e]).push.apply(_t$e4,_toConsumableArray(o)):t[e]=o;});}),t;}(b):M||S),1&e.$$.dirty[0]|8&e.$$.dirty[4]&&o(48,P=Fo(k,"eraseRadius")||Fo(k,"points")&&!Fo(k,"pathClose")||"move"===Ve||"view"===Ve),64&e.$$.dirty[1]|8&e.$$.dirty[4]&&o(47,E=k&&void 0!==k.eraseRadius?ao(k.eraseRadius,ae):void 0),16&e.$$.dirty[1]|33554432&e.$$.dirty[4]&&o(131,I=Y&&de.includes(32)),1&e.$$.dirty[0]|16&e.$$.dirty[1]&&o(132,A=Y&&"view"===Ve),384&e.$$.dirty[4]&&o(129,L=A||I),96&e.$$.dirty[4]&&o(128,z=!!L&&(!!w||ou(document.activeElement))),16&e.$$.dirty[1]|48&e.$$.dirty[4]&&Et.set(!Y||L&&!z),16&e.$$.dirty[1]|16&e.$$.dirty[4]&&At.set(!Y||!z),64&e.$$.dirty[1]|12&e.$$.dirty[4]&&o(120,F=k.cursorStyle?function(_ref483,o,i){var e=_ref483.cursorStyle,t=_ref483.cursorSize;var n;var r=o[t];if(void 0===r?n=ao(t,i):Lo(r)?n=r:T(r)&&(n=pn(t,o[t],i),"strokeWidth"===t&&(n*=.5)),!(n<=0||void 0===n))return {size:n,style:e};}(k,_objectSpread2(_objectSpread2({},k),C),ae):void 0),33554432&e.$$.dirty[3]|16777216&e.$$.dirty[4]&&o(121,D=co&&(re=ce,(ne=co).x>=0&&ne.y>=0&&ne.x<=re.width&&ne.y<=re.height)),1048576&e.$$.dirty[0]|160&e.$$.dirty[1]|427819008&e.$$.dirty[3]|3&e.$$.dirty[4])if(D&&!so&&F&&!le){var _e236=F.size*oe.scale,_t158={id:"cursor-"+ut,x:lo.x,y:lo.y,strokeWidth:.5,strokeColor:[0,0,0]};"ellipse"===F.style&&(_t158.rx=_e236,_t158.ry=_e236);var _o201={strokeWidth:2.5,strokeColor:[1,1,1],opacity:.75},_n61=[_objectSpread2(_objectSpread2({},_t158),_o201),_t158];if("selection"===$&&i){var _t159=_e236,_i134=lo.x+_t159,_r52=lo.y+_t159+4,_a32={id:"cursor-"+ut,strokeWidth:.75,strokeColor:[0,0,0],points:[{x:_i134,y:_r52},{x:_i134+4,y:_r52}]};_n61.push(_objectSpread2(_objectSpread2(_objectSpread2({},_a32),_o201),{},{strokeWidth:2,points:[{x:_i134-.5,y:_r52},{x:_i134+4.5,y:_r52}]}),_a32);}(function(e){Dt.update(function(t){return [].concat(_toConsumableArray(t.filter(function(e){return e.id!=="cursor-"+ut;})),_toConsumableArray(e));});})(_n61);}else Dt.update(function(e){return e.filter(function(e){return e.id!=="cursor-"+ut;});});1&e.$$.dirty[0]|128&e.$$.dirty[1]|478150656&e.$$.dirty[3]&&o(46,O=D?function(e,t,o,i,n,r){if(i)return n?"grabbing":"grab";if(e&&!t)return "none";if(!t)return "move"===r?"default":"crosshair";var a=t||o;return Ai(a)?Li(a)?"modal"===je?"default":"text":!Ki(a)||x&&!b.every(Ki)?"default":"move":"default";}(F,so,v,le,false,Ve):"default"),526337&e.$$.dirty[0]|131072&e.$$.dirty[3]&&o(45,B="preset"===Ve&&(dt.length>0||Ze||at)),64&e.$$.dirty[1]&&(W=!Fo(ae,"x")&&!Fo(ae,"y")),4194304&e.$$.dirty[4]&&o(44,_=ee*Ft),131072&e.$$.dirty[3]|1572864&e.$$.dirty[4]&&o(43,N=J&&at?function(e){return Yp(function(){return at(e,ho,_objectSpread2({},K),function(){return fo.set({});});});}:Z),524288&e.$$.dirty[3]&&o(42,H=Object.keys(yt).reduce(function(e,t){return "beforeAddShape"===t||void 0===yt[t]||(e[t]=yt[t]),e;},{})),16&e.$$.dirty[1]&&function(e){Q&&Oe.update(function(t){return t.map(function(t){return t._prerender=!!e&&Li(t),t;});});}(Y),65536&e.$$.dirty[3]|1572864&e.$$.dirty[4]&&o(30,j=J&&rt([],K,function(){return fo.set({});})),1073742336&e.$$.dirty[0]&&o(41,U=!!j.length||!!Object.keys(Ue).some(function(e){return yo.includes(e);})),16&e.$$.dirty[1]|262144&e.$$.dirty[4]&&q&&bo.set(Y?0:20),131072&e.$$.dirty[4]&&o(40,G=X?"transform: translateY(".concat(X,"px)"):void 0);},Xt.set(!1),[Ve,Ae,Le,ze,De,Oe,_e,He,je,Ue,Ge,Ze,Xe,Ke,tt,ot,it,nt,lt,dt,ut,ht,pt,mt,$t,gt,ft,Yt,Qt,go,j,V,s,n,c,Y,oe,ae,le,me,G,U,H,N,_,B,O,E,P,R,f,g,p,u,r,fe,ye,be,xt,vt,wt,St,kt,Tt,Rt,Pt,It,Lt,zt,Dt,Ot,Bt,Vt,_t,Nt,Ht,jt,function(_ref484,t){var e=_ref484.index;o(27,Yt=e),o(0,Ve=qt[e]);},function(_ref485,t){var e=_ref485.value;o(0,Ve=e),(Ye||/enter/i.test(t.key))&&Kt(e);},function(e){if("eraser"===Ve)oo=Qt.eraseShape();else if(Ve&&Ct[Ve]){var _Ct$Ve2=_slicedToArray(Ct[Ve],2),_e237=_Ct$Ve2[0],_Ct$Ve$2=_Ct$Ve2[1],_t160=_Ct$Ve$2===void 0?{}:_Ct$Ve$2,_M3=M,_o202=_M3.drawMode;"selection"===$&&"new"===_o202&&xt.set([]);var _n62={};"selection"===$&&(V("selectiondown",_toConsumableArray(ue)),i&&(to=_e237.drawMode,_n62.drawMode="subtract")),oo=Qt.createShape(_objectSpread2(_objectSpread2(_objectSpread2({},_e237),C),_n62),_t160);}else oo=void 0;return !!oo&&(oo.start(e),!0);},function(e){return !!oo&&(oo.update(e),!0);},function(e){return !!oo&&(oo.release(e),!0);},function(e){return !!oo&&(oo.cancel(e),oo=void 0,!0);},function(e){if(!oo)return !1;if(oo.end(e),oo=void 0,"selection"===$){if(e.detail.isTap){var _Ct$Ve4=_slicedToArray(Ct[Ve],1),_e238=_Ct$Ve4[0];_e238.bitmap||xt.set([]);}V("selectionup",_toConsumableArray(ue));}var t=Qt.getMarkupItemDraft(),i=Je&&(!0===qe||Array.isArray(qe)&&qe.includes(Ve));return t&&!t.isEditing||!i||o(0,Ve="move"),!0;},function(e){var t=e.key,o=Qt.getMarkupItemDraft();/escape/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),Qt.discardMarkupItemDraft(),oo=void 0),/enter/i.test(t)&&o&&(e.preventDefault(),e.stopPropagation(),io(o),oo=void 0);},function(e){Object.keys(e).forEach(function(t){var _ref486=k.settings&&k.settings[t]||{},_ref486$retain=_ref486.retain,i=_ref486$retain===void 0?!0:_ref486$retain,_ref486$share=_ref486.share,n=_ref486$share===void 0?!0:_ref486$share;i&&(et&&n?o(115,eo[t]=e[t],eo):(eo[Ve]||o(115,eo[Ve]={},eo),o(115,eo[Ve][t]=e[t],eo)));}),V("selectstyle",e),v&&(x?b.forEach(function(t){Qt.updateMarkupShape(t,ro(e,t));}):Qt.updateMarkupShape(v,e),clearTimeout(no),no=setTimeout(function(){$o();},200));},function(e,t,i){o(117,lo=t),o(118,co=i);},function(){o(118,co=void 0),o(117,lo=void 0);},function(e){V("markuptap",e);},function(e){return o(116,so=e);},function(){mo=!1;},function(e,t){if(mo)return;var _yt2=yt,_yt2$beforeAddShape=_yt2.beforeAddShape,o=_yt2$beforeAddShape===void 0?function(){return !0;}:_yt2$beforeAddShape,i=Jt(t),n=Qt.getMarkupItemDraft(),r=bt(se,{x:i.x+(ae.x||0),y:i.y+(ae.y||0)});if(n&&!r&&Qt.discardMarkupItemDraft(),r){if(!n){var _n63=xi(e,se),_r53=uo(_n63,i);return o(_r53)?(Wi(_r53),void Qt.addShape(_r53)):(mo=!0,void t.preventDefault());}Ti(n)&&(i.x-=.5*n.width,i.y-=.5*n.height),e.shape&&(Fo(e.shape,"x")&&(i.x=e.shape.x),Fo(e.shape,"y")&&(i.y=e.shape.y)),Qt.updateMarkupShape(n,i);}},function(e,t){if(mo)return;var o=Jt(t);if(!bt(se,{x:o.x+(ae.x||0),y:o.y+(ae.y||0)}))return void Qt.discardMarkupItemDraft();var i=Qt.confirmMarkupItemDraft();Qt.selectShape(i),V("addshape",i),Mt.write();},function(e){return ho(e);},function(e){return t=e.detail.resources,o=Jt(e.detail.event),t.forEach(function(e){return ho(e,o);});var t,o;},function(e){if(!ct)return !0;var t=rectClone(re);return rectScale(t,1/ne),rectTranslate(t,ie),rectScale(t,oe.scale),ct(e,_objectSpread2(_objectSpread2({},t),{},{x:t.x+te.x,y:t.y+te.y}));},$o,fo,yo,bo,Fe,Be,We,Ne,Ye,qe,Je,Qe,et,rt,at,ct,yt,Ct,qt,eo,so,lo,co,v,F,D,b,x,i,$,C,k,z,L,w,I,A,S,M,y,m,l,d,h,a,X,q,K,J,Q,ee,te,ce,de,ue,$e,function(t){ia.call(this,e,t);},function(e){return e[0]===Ve;},function(e,t,o){var i=e.filter(function(_ref487){var _ref488=_slicedToArray(_ref487,2),e=_ref488[1];return !yo.includes(e);});return lt?lt(i,t,o):i;},function(e){return e[0]===Yt;},function(e){Promise.resolve().then(function(){V("addshape",e),$o();});},function(e){V("selectshape",e);},function(e){Promise.resolve().then(function(){V("blurshape",e);});},function(e){V("tapshape",e);},function(e){V("updateshape",e),$o();},function(e){V("removeshape",e),$o();},function(){$o();},function(e){ra[e?"unshift":"push"](function(){Qt=e,o(28,Qt);});},function(e){ra[e?"unshift":"push"](function(){go=e,o(29,go);});},function(e){return e.filter(function(_ref489){var _ref490=_slicedToArray(_ref489,2),e=_ref490[1];return yo.includes(e);});},function(t){ia.call(this,e,t);}];}var px=/*#__PURE__*/function(_Wa47){function px(e){var _this50;_classCallCheck(this,px);_this50=_callSuper(this,px),Ba(_assertThisInitialized(_this50),e,hx,ux,nr,{isActive:1,isActiveFraction:2,isVisible:3,stores:100,locale:4,shapes:5,toolbar:101,toolShapes:102,toolActive:0,toolSelectRadius:6,toolRetainStyles:103,toolbarLayout:7,textInputMode:8,shapeControls:9,enableButtonFlipVertical:10,enablePresetSelectImage:11,enablePresetDropImage:12,enableSelectToolToAddShape:104,enableAutoSelectMoveTool:105,enableTapToAddText:13,enableMoveTool:106,enableViewTool:107,enableToolShareStyles:108,enableMultiSelect:14,gridSize:15,snapThreshold:16,enableSnapToContext:17,willRenderHeaderTools:109,willRenderPresetToolbar:110,willRenderShapeStyleControls:18,willStartInteraction:111,shapePresets:19,utilKey:20,mapScreenPointToImagePoint:21,mapImagePointToScreenPoint:22,imageRotation:23,imageFlipX:24,imageFlipY:25,parentRect:26,hooks:112},null,[-1,-1,-1,-1,-1,-1,-1]);return _this50;}_inherits(px,_Wa47);return _createClass(px,[{key:"isActive",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"isActiveFraction",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({isActiveFraction:e}),fa();}},{key:"isVisible",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({isVisible:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[100];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"shapes",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({shapes:e}),fa();}},{key:"toolbar",get:function get(){return this.$$.ctx[101];},set:function set(e){this.$$set({toolbar:e}),fa();}},{key:"toolShapes",get:function get(){return this.$$.ctx[102];},set:function set(e){this.$$set({toolShapes:e}),fa();}},{key:"toolActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({toolActive:e}),fa();}},{key:"toolSelectRadius",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({toolSelectRadius:e}),fa();}},{key:"toolRetainStyles",get:function get(){return this.$$.ctx[103];},set:function set(e){this.$$set({toolRetainStyles:e}),fa();}},{key:"toolbarLayout",get:function get(){return this.$$.ctx[7];},set:function set(e){this.$$set({toolbarLayout:e}),fa();}},{key:"textInputMode",get:function get(){return this.$$.ctx[8];},set:function set(e){this.$$set({textInputMode:e}),fa();}},{key:"shapeControls",get:function get(){return this.$$.ctx[9];},set:function set(e){this.$$set({shapeControls:e}),fa();}},{key:"enableButtonFlipVertical",get:function get(){return this.$$.ctx[10];},set:function set(e){this.$$set({enableButtonFlipVertical:e}),fa();}},{key:"enablePresetSelectImage",get:function get(){return this.$$.ctx[11];},set:function set(e){this.$$set({enablePresetSelectImage:e}),fa();}},{key:"enablePresetDropImage",get:function get(){return this.$$.ctx[12];},set:function set(e){this.$$set({enablePresetDropImage:e}),fa();}},{key:"enableSelectToolToAddShape",get:function get(){return this.$$.ctx[104];},set:function set(e){this.$$set({enableSelectToolToAddShape:e}),fa();}},{key:"enableAutoSelectMoveTool",get:function get(){return this.$$.ctx[105];},set:function set(e){this.$$set({enableAutoSelectMoveTool:e}),fa();}},{key:"enableTapToAddText",get:function get(){return this.$$.ctx[13];},set:function set(e){this.$$set({enableTapToAddText:e}),fa();}},{key:"enableMoveTool",get:function get(){return this.$$.ctx[106];},set:function set(e){this.$$set({enableMoveTool:e}),fa();}},{key:"enableViewTool",get:function get(){return this.$$.ctx[107];},set:function set(e){this.$$set({enableViewTool:e}),fa();}},{key:"enableToolShareStyles",get:function get(){return this.$$.ctx[108];},set:function set(e){this.$$set({enableToolShareStyles:e}),fa();}},{key:"enableMultiSelect",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({enableMultiSelect:e}),fa();}},{key:"gridSize",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({gridSize:e}),fa();}},{key:"snapThreshold",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({snapThreshold:e}),fa();}},{key:"enableSnapToContext",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({enableSnapToContext:e}),fa();}},{key:"willRenderHeaderTools",get:function get(){return this.$$.ctx[109];},set:function set(e){this.$$set({willRenderHeaderTools:e}),fa();}},{key:"willRenderPresetToolbar",get:function get(){return this.$$.ctx[110];},set:function set(e){this.$$set({willRenderPresetToolbar:e}),fa();}},{key:"willRenderShapeStyleControls",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({willRenderShapeStyleControls:e}),fa();}},{key:"willStartInteraction",get:function get(){return this.$$.ctx[111];},set:function set(e){this.$$set({willStartInteraction:e}),fa();}},{key:"shapePresets",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({shapePresets:e}),fa();}},{key:"utilKey",get:function get(){return this.$$.ctx[20];},set:function set(e){this.$$set({utilKey:e}),fa();}},{key:"mapScreenPointToImagePoint",get:function get(){return this.$$.ctx[21];},set:function set(e){this.$$set({mapScreenPointToImagePoint:e}),fa();}},{key:"mapImagePointToScreenPoint",get:function get(){return this.$$.ctx[22];},set:function set(e){this.$$set({mapImagePointToScreenPoint:e}),fa();}},{key:"imageRotation",get:function get(){return this.$$.ctx[23];},set:function set(e){this.$$set({imageRotation:e}),fa();}},{key:"imageFlipX",get:function get(){return this.$$.ctx[24];},set:function set(e){this.$$set({imageFlipX:e}),fa();}},{key:"imageFlipY",get:function get(){return this.$$.ctx[25];},set:function set(e){this.$$set({imageFlipY:e}),fa();}},{key:"parentRect",get:function get(){return this.$$.ctx[26];},set:function set(e){this.$$set({parentRect:e}),fa();}},{key:"hooks",get:function get(){return this.$$.ctx[112];},set:function set(e){this.$$set({hooks:e}),fa();}}]);}(Wa);var mx=function mx(e,t,o,i,n,r,a,s,l){var c=me(e),d=.5*o.width,u=.5*o.height,h=.5*t.width,p=.5*t.height,m=n.x+i.x,$=n.y+i.y;s&&(c.x=o.width-c.x),l&&(c.y=o.height-c.y);var g=Math.cos(r),f=Math.sin(r);c.x-=d,c.y-=u;var y=c.x*g-c.y*f,b=c.x*f+c.y*g;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+=$,c.x-=d*a,c.y-=u*a;var x=(n.x-m)*a,v=(n.y-$)*a,w=x*g-v*f,S=x*f+v*g;return c.x+=w,c.y+=S,c;},$x=function $x(e,t,o,i,n,r,a,s,l){var c=me(e),d=He(o),u=He(t),h=he(n.x+i.x,n.y+i.y),p=Math.cos(r),m=Math.sin(r);c.x-=u.x,c.y-=u.y;var $=(n.x-h.x)*a,g=(n.y-h.y)*a,f=$*p-g*m,y=$*m+g*p;c.x-=f,c.y-=y,c.x-=h.x,c.y-=h.y,c.x/=a,c.y/=a;var 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;},gx=function gx(e){return "boolean"==typeof e;};function fx(e){var t,o,_i135;function n(t){e[60](t);}var r={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[46],mapImagePointToScreenPoint:e[45],imageRotation:e[47],imageFlipX:e[44],imageFlipY:e[43],shapes:e[49],toolbar:e[21]||e[7],toolShapes:e[22]||e[8],toolRetainStyles:e[9],enableSelectToolToAddShape:e[31],enableTapToAddText:e[32],enableViewTool:e[30],enableMoveTool:e[34],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[35],snapThreshold:e[16],gridSize:Lo(e[18])?e[18]:e[15],enableSnapToContext:gx(e[19])?e[19]:e[17],enableToolShareStyles:e[13],shapeControls:e[23]||e[10],shapePresets:e[27],enableButtonFlipVertical:e[24],parentRect:e[50],enablePresetDropImage:e[26],enablePresetSelectImage:e[25],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[14],willRenderPresetToolbar:e[28]||e[20],willRenderShapeStyleControls:e[29],hooks:{willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new px({props:r}),ra.push(function(){return za(t,"toolActive",n);}),t.$on("measure",e[61]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i135=!0;},p:function p(e,i){var n={};32&i[0]&&(n.stores=e[5]),64&i[0]&&(n.locale=e[6]),4&i[0]&&(n.isActive=e[2]),8&i[0]&&(n.isActiveFraction=e[3]),16&i[0]&&(n.isVisible=e[4]),32768&i[1]&&(n.mapScreenPointToImagePoint=e[46]),16384&i[1]&&(n.mapImagePointToScreenPoint=e[45]),65536&i[1]&&(n.imageRotation=e[47]),8192&i[1]&&(n.imageFlipX=e[44]),4096&i[1]&&(n.imageFlipY=e[43]),2097280&i[0]&&(n.toolbar=e[21]||e[7]),4194560&i[0]&&(n.toolShapes=e[22]||e[8]),512&i[0]&&(n.toolRetainStyles=e[9]),1&i[1]&&(n.enableSelectToolToAddShape=e[31]),2&i[1]&&(n.enableTapToAddText=e[32]),1073741824&i[0]&&(n.enableViewTool=e[30]),8&i[1]&&(n.enableMoveTool=e[34]),4&i[1]&&(n.enableAutoSelectMoveTool=e[33]),16&i[1]&&(n.enableMultiSelect=e[35]),65536&i[0]&&(n.snapThreshold=e[16]),294912&i[0]&&(n.gridSize=Lo(e[18])?e[18]:e[15]),655360&i[0]&&(n.enableSnapToContext=gx(e[19])?e[19]:e[17]),8192&i[0]&&(n.enableToolShareStyles=e[13]),8389632&i[0]&&(n.shapeControls=e[23]||e[10]),134217728&i[0]&&(n.shapePresets=e[27]),16777216&i[0]&&(n.enableButtonFlipVertical=e[24]),67108864&i[0]&&(n.enablePresetDropImage=e[26]),33554432&i[0]&&(n.enablePresetSelectImage=e[25]),2048&i[0]&&(n.toolSelectRadius=e[11]),4096&i[0]&&(n.textInputMode=e[12]),16384&i[0]&&(n.willStartInteraction=e[14]),269484032&i[0]&&(n.willRenderPresetToolbar=e[28]||e[20]),536870912&i[0]&&(n.willRenderShapeStyleControls=e[29]),4064&i[1]&&(n.hooks={willRenderShapeControls:e[36],willRenderShapeTextControls:e[37],beforeAddShape:e[38],beforeRemoveShape:e[39],beforeDeselectShape:e[40],beforeSelectShape:e[41],beforeUpdateShape:e[42]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],pa(function(){return o=!1;})),t.$set(n);},i:function i(e){_i135||(ka(t.$$.fragment,e),_i135=!0);},o:function o(e){Ca(t.$$.fragment,e),_i135=!1;},d:function d(e){Oa(t,e);}};}function yx(e,t,o){var i,n,r,a,s,l,c,d,u;var h=t.isActive,p=t.isActiveFraction,m=t.isVisible,$=t.stores,_t$locale4=t.locale,g=_t$locale4===void 0?{}:_t$locale4,f=t.markupEditorToolbar,y=t.markupEditorToolStyles,b=t.markupEditorToolRetainStyles,x=t.markupEditorShapeStyleControls,v=t.markupEditorToolSelectRadius,w=t.markupEditorTextInputMode,S=t.markupEditorToolShareStyles,k=t.markupEditorWillStartInteraction,_t$markupEditorGridSi=t.markupEditorGridSize,C=_t$markupEditorGridSi===void 0?0:_t$markupEditorGridSi,_t$markupEditorSnapTh=t.markupEditorSnapThreshold,T=_t$markupEditorSnapTh===void 0?0:_t$markupEditorSnapTh,_t$markupEditorSnapTo=t.markupEditorSnapToContext,M=_t$markupEditorSnapTo===void 0?!1:_t$markupEditorSnapTo,R=t.annotateGridSize,P=t.annotateSnapToContext,E=t.willRenderShapePresetToolbar,I=t.annotateTools,A=t.annotateToolShapes,L=t.annotateShapeControls,z=t.annotateActiveTool,_t$annotateEnableButt=t.annotateEnableButtonFlipVertical,F=_t$annotateEnableButt===void 0?!1:_t$annotateEnableButt,_t$annotateEnableSele=t.annotateEnableSelectImagePreset,D=_t$annotateEnableSele===void 0?!1:_t$annotateEnableSele,_t$annotateEnableDrop=t.annotateEnableDropImagePreset,O=_t$annotateEnableDrop===void 0?!0:_t$annotateEnableDrop,_t$annotatePresets=t.annotatePresets,B=_t$annotatePresets===void 0?[]:_t$annotatePresets,W=t.annotateWillRenderShapePresetToolbar,V=t.annotateWillRenderShapeStyleControls,_=t.enableViewTool,N=t.enableSelectToolToAddShape,H=t.enableTapToAddText,j=t.enableAutoSelectMoveTool,U=t.enableMoveTool,G=t.enableMultiSelect,Z=t.willRenderShapeControls,X=t.willRenderShapeTextControls,Y=t.beforeAddShape,q=t.beforeRemoveShape,K=t.beforeDeselectShape,J=t.beforeSelectShape,Q=t.beforeUpdateShape;var _$10=$,ee=_$10.rootRect,te=_$10.imageAnnotation,oe=_$10.imageSize,ie=_$10.imageRotation,ne=_$10.imageFlipX,re=_$10.imageFlipY,ae=_$10.imageTransforms,se=_$10.imageTransformsInterpolated;return sr(e,ee,function(e){return o(59,d=e);}),sr(e,oe,function(e){return o(58,c=e);}),sr(e,ie,function(e){return o(47,u=e);}),sr(e,ne,function(e){return o(44,a=e);}),sr(e,re,function(e){return o(43,r=e);}),sr(e,ae,function(e){return o(57,l=e);}),sr(e,se,function(e){return o(56,s=e);}),e.$$set=function(e){"isActive"in e&&o(2,h=e.isActive),"isActiveFraction"in e&&o(3,p=e.isActiveFraction),"isVisible"in e&&o(4,m=e.isVisible),"stores"in e&&o(5,$=e.stores),"locale"in e&&o(6,g=e.locale),"markupEditorToolbar"in e&&o(7,f=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(8,y=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(9,b=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(10,x=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(11,v=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(12,w=e.markupEditorTextInputMode),"markupEditorToolShareStyles"in e&&o(13,S=e.markupEditorToolShareStyles),"markupEditorWillStartInteraction"in e&&o(14,k=e.markupEditorWillStartInteraction),"markupEditorGridSize"in e&&o(15,C=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(16,T=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(17,M=e.markupEditorSnapToContext),"annotateGridSize"in e&&o(18,R=e.annotateGridSize),"annotateSnapToContext"in e&&o(19,P=e.annotateSnapToContext),"willRenderShapePresetToolbar"in e&&o(20,E=e.willRenderShapePresetToolbar),"annotateTools"in e&&o(21,I=e.annotateTools),"annotateToolShapes"in e&&o(22,A=e.annotateToolShapes),"annotateShapeControls"in e&&o(23,L=e.annotateShapeControls),"annotateActiveTool"in e&&o(0,z=e.annotateActiveTool),"annotateEnableButtonFlipVertical"in e&&o(24,F=e.annotateEnableButtonFlipVertical),"annotateEnableSelectImagePreset"in e&&o(25,D=e.annotateEnableSelectImagePreset),"annotateEnableDropImagePreset"in e&&o(26,O=e.annotateEnableDropImagePreset),"annotatePresets"in e&&o(27,B=e.annotatePresets),"annotateWillRenderShapePresetToolbar"in e&&o(28,W=e.annotateWillRenderShapePresetToolbar),"annotateWillRenderShapeStyleControls"in e&&o(29,V=e.annotateWillRenderShapeStyleControls),"enableViewTool"in e&&o(30,_=e.enableViewTool),"enableSelectToolToAddShape"in e&&o(31,N=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(32,H=e.enableTapToAddText),"enableAutoSelectMoveTool"in e&&o(33,j=e.enableAutoSelectMoveTool),"enableMoveTool"in e&&o(34,U=e.enableMoveTool),"enableMultiSelect"in e&&o(35,G=e.enableMultiSelect),"willRenderShapeControls"in e&&o(36,Z=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(37,X=e.willRenderShapeTextControls),"beforeAddShape"in e&&o(38,Y=e.beforeAddShape),"beforeRemoveShape"in e&&o(39,q=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(40,K=e.beforeDeselectShape),"beforeSelectShape"in e&&o(41,J=e.beforeSelectShape),"beforeUpdateShape"in e&&o(42,Q=e.beforeUpdateShape);},e.$$.update=function(){503328768&e.$$.dirty[1]&&o(46,i=function i(e){return $x(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r);}),503328768&e.$$.dirty[1]&&o(45,n=function n(e){return mx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r);});},[z,"annotate",h,p,m,$,g,f,y,b,x,v,w,S,k,C,T,M,R,P,E,I,A,L,F,D,O,B,W,V,_,N,H,j,U,G,Z,X,Y,q,K,J,Q,r,a,n,i,u,ee,te,oe,ie,ne,re,ae,se,s,l,c,d,function(e){z=e,o(0,z);},function(t){ia.call(this,e,t);}];}var bx={util:["annotate",/*#__PURE__*/function(_Wa48){function _class4(e){var _this51;_classCallCheck(this,_class4);_this51=_callSuper(this,_class4),Ba(_assertThisInitialized(_this51),e,yx,fx,nr,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,markupEditorWillStartInteraction:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,annotateGridSize:18,annotateSnapToContext:19,willRenderShapePresetToolbar:20,annotateTools:21,annotateToolShapes:22,annotateShapeControls:23,annotateActiveTool:0,annotateEnableButtonFlipVertical:24,annotateEnableSelectImagePreset:25,annotateEnableDropImagePreset:26,annotatePresets:27,annotateWillRenderShapePresetToolbar:28,annotateWillRenderShapeStyleControls:29,enableViewTool:30,enableSelectToolToAddShape:31,enableTapToAddText:32,enableAutoSelectMoveTool:33,enableMoveTool:34,enableMultiSelect:35,willRenderShapeControls:36,willRenderShapeTextControls:37,beforeAddShape:38,beforeRemoveShape:39,beforeDeselectShape:40,beforeSelectShape:41,beforeUpdateShape:42},null,[-1,-1]);return _this51;}_inherits(_class4,_Wa48);return _createClass(_class4,[{key:"name",get:function get(){return this.$$.ctx[1];}},{key:"isActive",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"isActiveFraction",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({isActiveFraction:e}),fa();}},{key:"isVisible",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({isVisible:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"markupEditorToolbar",get:function get(){return this.$$.ctx[7];},set:function set(e){this.$$set({markupEditorToolbar:e}),fa();}},{key:"markupEditorToolStyles",get:function get(){return this.$$.ctx[8];},set:function set(e){this.$$set({markupEditorToolStyles:e}),fa();}},{key:"markupEditorToolRetainStyles",get:function get(){return this.$$.ctx[9];},set:function set(e){this.$$set({markupEditorToolRetainStyles:e}),fa();}},{key:"markupEditorShapeStyleControls",get:function get(){return this.$$.ctx[10];},set:function set(e){this.$$set({markupEditorShapeStyleControls:e}),fa();}},{key:"markupEditorToolSelectRadius",get:function get(){return this.$$.ctx[11];},set:function set(e){this.$$set({markupEditorToolSelectRadius:e}),fa();}},{key:"markupEditorTextInputMode",get:function get(){return this.$$.ctx[12];},set:function set(e){this.$$set({markupEditorTextInputMode:e}),fa();}},{key:"markupEditorToolShareStyles",get:function get(){return this.$$.ctx[13];},set:function set(e){this.$$set({markupEditorToolShareStyles:e}),fa();}},{key:"markupEditorWillStartInteraction",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({markupEditorWillStartInteraction:e}),fa();}},{key:"markupEditorGridSize",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({markupEditorGridSize:e}),fa();}},{key:"markupEditorSnapThreshold",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({markupEditorSnapThreshold:e}),fa();}},{key:"markupEditorSnapToContext",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({markupEditorSnapToContext:e}),fa();}},{key:"annotateGridSize",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({annotateGridSize:e}),fa();}},{key:"annotateSnapToContext",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({annotateSnapToContext:e}),fa();}},{key:"willRenderShapePresetToolbar",get:function get(){return this.$$.ctx[20];},set:function set(e){this.$$set({willRenderShapePresetToolbar:e}),fa();}},{key:"annotateTools",get:function get(){return this.$$.ctx[21];},set:function set(e){this.$$set({annotateTools:e}),fa();}},{key:"annotateToolShapes",get:function get(){return this.$$.ctx[22];},set:function set(e){this.$$set({annotateToolShapes:e}),fa();}},{key:"annotateShapeControls",get:function get(){return this.$$.ctx[23];},set:function set(e){this.$$set({annotateShapeControls:e}),fa();}},{key:"annotateActiveTool",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({annotateActiveTool:e}),fa();}},{key:"annotateEnableButtonFlipVertical",get:function get(){return this.$$.ctx[24];},set:function set(e){this.$$set({annotateEnableButtonFlipVertical:e}),fa();}},{key:"annotateEnableSelectImagePreset",get:function get(){return this.$$.ctx[25];},set:function set(e){this.$$set({annotateEnableSelectImagePreset:e}),fa();}},{key:"annotateEnableDropImagePreset",get:function get(){return this.$$.ctx[26];},set:function set(e){this.$$set({annotateEnableDropImagePreset:e}),fa();}},{key:"annotatePresets",get:function get(){return this.$$.ctx[27];},set:function set(e){this.$$set({annotatePresets:e}),fa();}},{key:"annotateWillRenderShapePresetToolbar",get:function get(){return this.$$.ctx[28];},set:function set(e){this.$$set({annotateWillRenderShapePresetToolbar:e}),fa();}},{key:"annotateWillRenderShapeStyleControls",get:function get(){return this.$$.ctx[29];},set:function set(e){this.$$set({annotateWillRenderShapeStyleControls:e}),fa();}},{key:"enableViewTool",get:function get(){return this.$$.ctx[30];},set:function set(e){this.$$set({enableViewTool:e}),fa();}},{key:"enableSelectToolToAddShape",get:function get(){return this.$$.ctx[31];},set:function set(e){this.$$set({enableSelectToolToAddShape:e}),fa();}},{key:"enableTapToAddText",get:function get(){return this.$$.ctx[32];},set:function set(e){this.$$set({enableTapToAddText:e}),fa();}},{key:"enableAutoSelectMoveTool",get:function get(){return this.$$.ctx[33];},set:function set(e){this.$$set({enableAutoSelectMoveTool:e}),fa();}},{key:"enableMoveTool",get:function get(){return this.$$.ctx[34];},set:function set(e){this.$$set({enableMoveTool:e}),fa();}},{key:"enableMultiSelect",get:function get(){return this.$$.ctx[35];},set:function set(e){this.$$set({enableMultiSelect:e}),fa();}},{key:"willRenderShapeControls",get:function get(){return this.$$.ctx[36];},set:function set(e){this.$$set({willRenderShapeControls:e}),fa();}},{key:"willRenderShapeTextControls",get:function get(){return this.$$.ctx[37];},set:function set(e){this.$$set({willRenderShapeTextControls:e}),fa();}},{key:"beforeAddShape",get:function get(){return this.$$.ctx[38];},set:function set(e){this.$$set({beforeAddShape:e}),fa();}},{key:"beforeRemoveShape",get:function get(){return this.$$.ctx[39];},set:function set(e){this.$$set({beforeRemoveShape:e}),fa();}},{key:"beforeDeselectShape",get:function get(){return this.$$.ctx[40];},set:function set(e){this.$$set({beforeDeselectShape:e}),fa();}},{key:"beforeSelectShape",get:function get(){return this.$$.ctx[41];},set:function set(e){this.$$set({beforeSelectShape:e}),fa();}},{key:"beforeUpdateShape",get:function get(){return this.$$.ctx[42];},set:function set(e){this.$$set({beforeUpdateShape:e}),fa();}}]);}(Wa)]};function xx(e){var t,o,_i136;function n(t){e[52](t);}var r={utilKey:e[1],stores:e[5],locale:e[6],isActive:e[2],isActiveFraction:e[3],isVisible:e[4],mapScreenPointToImagePoint:e[44],mapImagePointToScreenPoint:e[43],shapes:e[46],toolbar:e[20]||e[7],toolShapes:e[21]||e[8],toolRetainStyles:e[9],shapeControls:e[22]||e[10],shapePresets:e[26],enableSelectToolToAddShape:e[29],enableTapToAddText:e[30],enableViewTool:e[31],enableMoveTool:e[32],enableAutoSelectMoveTool:e[33],enableMultiSelect:e[34],snapThreshold:e[16],gridSize:Lo(e[18])?e[18]:e[15],enableSnapToContext:gx(e[19])?e[19]:e[17],enableToolShareStyles:e[13],enablePresetSelectImage:e[24],enablePresetDropImage:e[25],enableButtonFlipVertical:e[23],parentRect:e[45],toolSelectRadius:e[11],textInputMode:e[12],willStartInteraction:e[42],willRenderPresetToolbar:e[27]||e[14],willRenderShapeStyleControls:e[28],hooks:{willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}};return void 0!==e[0]&&(r.toolActive=e[0]),t=new px({props:r}),ra.push(function(){return za(t,"toolActive",n);}),t.$on("measure",e[53]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,o){Da(t,e,o),_i136=!0;},p:function p(e,i){var n={};32&i[0]&&(n.stores=e[5]),64&i[0]&&(n.locale=e[6]),4&i[0]&&(n.isActive=e[2]),8&i[0]&&(n.isActiveFraction=e[3]),16&i[0]&&(n.isVisible=e[4]),8192&i[1]&&(n.mapScreenPointToImagePoint=e[44]),4096&i[1]&&(n.mapImagePointToScreenPoint=e[43]),1048704&i[0]&&(n.toolbar=e[20]||e[7]),2097408&i[0]&&(n.toolShapes=e[21]||e[8]),512&i[0]&&(n.toolRetainStyles=e[9]),4195328&i[0]&&(n.shapeControls=e[22]||e[10]),67108864&i[0]&&(n.shapePresets=e[26]),536870912&i[0]&&(n.enableSelectToolToAddShape=e[29]),1073741824&i[0]&&(n.enableTapToAddText=e[30]),1&i[1]&&(n.enableViewTool=e[31]),2&i[1]&&(n.enableMoveTool=e[32]),4&i[1]&&(n.enableAutoSelectMoveTool=e[33]),8&i[1]&&(n.enableMultiSelect=e[34]),65536&i[0]&&(n.snapThreshold=e[16]),294912&i[0]&&(n.gridSize=Lo(e[18])?e[18]:e[15]),655360&i[0]&&(n.enableSnapToContext=gx(e[19])?e[19]:e[17]),8192&i[0]&&(n.enableToolShareStyles=e[13]),16777216&i[0]&&(n.enablePresetSelectImage=e[24]),33554432&i[0]&&(n.enablePresetDropImage=e[25]),8388608&i[0]&&(n.enableButtonFlipVertical=e[23]),2048&i[0]&&(n.toolSelectRadius=e[11]),4096&i[0]&&(n.textInputMode=e[12]),2048&i[1]&&(n.willStartInteraction=e[42]),134234112&i[0]&&(n.willRenderPresetToolbar=e[27]||e[14]),268435456&i[0]&&(n.willRenderShapeStyleControls=e[28]),2032&i[1]&&(n.hooks={willRenderShapeControls:e[35],willRenderShapeTextControls:e[36],beforeAddShape:e[37],beforeRemoveShape:e[38],beforeDeselectShape:e[39],beforeSelectShape:e[40],beforeUpdateShape:e[41]}),!o&&1&i[0]&&(o=!0,n.toolActive=e[0],pa(function(){return o=!1;})),t.$set(n);},i:function i(e){_i136||(ka(t.$$.fragment,e),_i136=!0);},o:function o(e){Ca(t.$$.fragment,e),_i136=!1;},d:function d(e){Oa(t,e);}};}function vx(e,t,o){var i,n,r,a,s;var l=t.isActive,c=t.isActiveFraction,d=t.isVisible,u=t.stores,_t$locale5=t.locale,h=_t$locale5===void 0?{}:_t$locale5,p=t.markupEditorToolbar,m=t.markupEditorToolStyles,$=t.markupEditorToolRetainStyles,g=t.markupEditorShapeStyleControls,f=t.markupEditorToolSelectRadius,y=t.markupEditorTextInputMode,b=t.markupEditorToolShareStyles,x=t.willRenderShapePresetToolbar,v=t.markupEditorGridSize,w=t.markupEditorSnapThreshold,_t$markupEditorSnapTo2=t.markupEditorSnapToContext,S=_t$markupEditorSnapTo2===void 0?!0:_t$markupEditorSnapTo2,k=t.decorateGridSize,C=t.decorateSnapToContext,T=t.decorateTools,M=t.decorateToolShapes,R=t.decorateShapeControls,P=t.decorateActiveTool,_t$decorateEnableButt=t.decorateEnableButtonFlipVertical,E=_t$decorateEnableButt===void 0?!1:_t$decorateEnableButt,_t$decorateEnableSele=t.decorateEnableSelectImagePreset,I=_t$decorateEnableSele===void 0?!1:_t$decorateEnableSele,_t$decorateEnableDrop=t.decorateEnableDropImagePreset,A=_t$decorateEnableDrop===void 0?!0:_t$decorateEnableDrop,_t$decoratePresets=t.decoratePresets,L=_t$decoratePresets===void 0?[]:_t$decoratePresets,z=t.decorateWillRenderShapePresetToolbar,F=t.decorateWillRenderShapeStyleControls,D=t.enableSelectToolToAddShape,O=t.enableTapToAddText,B=t.enableViewTool,W=t.enableMoveTool,V=t.enableAutoSelectMoveTool,_=t.enableMultiSelect,N=t.willRenderShapeControls,H=t.willRenderShapeTextControls,j=t.beforeAddShape,U=t.beforeRemoveShape,G=t.beforeDeselectShape,Z=t.beforeSelectShape,X=t.beforeUpdateShape,Y=t.markupEditorWillStartInteraction;var _u10=u,q=_u10.imageCropRect,K=_u10.imageDecoration,J=_u10.imageSelectionRectPresentation,Q=_u10.imageTransformsInterpolated;return sr(e,J,function(e){return o(50,a=e);}),sr(e,Q,function(e){return o(51,s=e);}),e.$$set=function(e){"isActive"in e&&o(2,l=e.isActive),"isActiveFraction"in e&&o(3,c=e.isActiveFraction),"isVisible"in e&&o(4,d=e.isVisible),"stores"in e&&o(5,u=e.stores),"locale"in e&&o(6,h=e.locale),"markupEditorToolbar"in e&&o(7,p=e.markupEditorToolbar),"markupEditorToolStyles"in e&&o(8,m=e.markupEditorToolStyles),"markupEditorToolRetainStyles"in e&&o(9,$=e.markupEditorToolRetainStyles),"markupEditorShapeStyleControls"in e&&o(10,g=e.markupEditorShapeStyleControls),"markupEditorToolSelectRadius"in e&&o(11,f=e.markupEditorToolSelectRadius),"markupEditorTextInputMode"in e&&o(12,y=e.markupEditorTextInputMode),"markupEditorToolShareStyles"in e&&o(13,b=e.markupEditorToolShareStyles),"willRenderShapePresetToolbar"in e&&o(14,x=e.willRenderShapePresetToolbar),"markupEditorGridSize"in e&&o(15,v=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(16,w=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(17,S=e.markupEditorSnapToContext),"decorateGridSize"in e&&o(18,k=e.decorateGridSize),"decorateSnapToContext"in e&&o(19,C=e.decorateSnapToContext),"decorateTools"in e&&o(20,T=e.decorateTools),"decorateToolShapes"in e&&o(21,M=e.decorateToolShapes),"decorateShapeControls"in e&&o(22,R=e.decorateShapeControls),"decorateActiveTool"in e&&o(0,P=e.decorateActiveTool),"decorateEnableButtonFlipVertical"in e&&o(23,E=e.decorateEnableButtonFlipVertical),"decorateEnableSelectImagePreset"in e&&o(24,I=e.decorateEnableSelectImagePreset),"decorateEnableDropImagePreset"in e&&o(25,A=e.decorateEnableDropImagePreset),"decoratePresets"in e&&o(26,L=e.decoratePresets),"decorateWillRenderShapePresetToolbar"in e&&o(27,z=e.decorateWillRenderShapePresetToolbar),"decorateWillRenderShapeStyleControls"in e&&o(28,F=e.decorateWillRenderShapeStyleControls),"enableSelectToolToAddShape"in e&&o(29,D=e.enableSelectToolToAddShape),"enableTapToAddText"in e&&o(30,O=e.enableTapToAddText),"enableViewTool"in e&&o(31,B=e.enableViewTool),"enableMoveTool"in e&&o(32,W=e.enableMoveTool),"enableAutoSelectMoveTool"in e&&o(33,V=e.enableAutoSelectMoveTool),"enableMultiSelect"in e&&o(34,_=e.enableMultiSelect),"willRenderShapeControls"in e&&o(35,N=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(36,H=e.willRenderShapeTextControls),"beforeAddShape"in e&&o(37,j=e.beforeAddShape),"beforeRemoveShape"in e&&o(38,U=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(39,G=e.beforeDeselectShape),"beforeSelectShape"in e&&o(40,Z=e.beforeSelectShape),"beforeUpdateShape"in e&&o(41,X=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(42,Y=e.markupEditorWillStartInteraction);},e.$$.update=function(){1048576&e.$$.dirty[1]&&o(49,i=s?s.scale:1),786432&e.$$.dirty[1]&&o(44,n=function n(e){var t=me(e);return t.x-=a.x,t.y-=a.y,t.x/=i,t.y/=i,t;}),786432&e.$$.dirty[1]&&o(43,r=function r(e){var t=me(e);return t.x*=i,t.y*=i,t.x+=a.x,t.y+=a.y,t;});},[P,"decorate",l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S,k,C,T,M,R,E,I,A,L,z,F,D,O,B,W,V,_,N,H,j,U,G,Z,X,Y,r,n,q,K,J,Q,i,a,s,function(e){P=e,o(0,P);},function(t){ia.call(this,e,t);}];}var wx={util:["decorate",/*#__PURE__*/function(_Wa49){function _class5(e){var _this52;_classCallCheck(this,_class5);_this52=_callSuper(this,_class5),Ba(_assertThisInitialized(_this52),e,vx,xx,nr,{name:1,isActive:2,isActiveFraction:3,isVisible:4,stores:5,locale:6,markupEditorToolbar:7,markupEditorToolStyles:8,markupEditorToolRetainStyles:9,markupEditorShapeStyleControls:10,markupEditorToolSelectRadius:11,markupEditorTextInputMode:12,markupEditorToolShareStyles:13,willRenderShapePresetToolbar:14,markupEditorGridSize:15,markupEditorSnapThreshold:16,markupEditorSnapToContext:17,decorateGridSize:18,decorateSnapToContext:19,decorateTools:20,decorateToolShapes:21,decorateShapeControls:22,decorateActiveTool:0,decorateEnableButtonFlipVertical:23,decorateEnableSelectImagePreset:24,decorateEnableDropImagePreset:25,decoratePresets:26,decorateWillRenderShapePresetToolbar:27,decorateWillRenderShapeStyleControls:28,enableSelectToolToAddShape:29,enableTapToAddText:30,enableViewTool:31,enableMoveTool:32,enableAutoSelectMoveTool:33,enableMultiSelect:34,willRenderShapeControls:35,willRenderShapeTextControls:36,beforeAddShape:37,beforeRemoveShape:38,beforeDeselectShape:39,beforeSelectShape:40,beforeUpdateShape:41,markupEditorWillStartInteraction:42},null,[-1,-1]);return _this52;}_inherits(_class5,_Wa49);return _createClass(_class5,[{key:"name",get:function get(){return this.$$.ctx[1];}},{key:"isActive",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"isActiveFraction",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({isActiveFraction:e}),fa();}},{key:"isVisible",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({isVisible:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"markupEditorToolbar",get:function get(){return this.$$.ctx[7];},set:function set(e){this.$$set({markupEditorToolbar:e}),fa();}},{key:"markupEditorToolStyles",get:function get(){return this.$$.ctx[8];},set:function set(e){this.$$set({markupEditorToolStyles:e}),fa();}},{key:"markupEditorToolRetainStyles",get:function get(){return this.$$.ctx[9];},set:function set(e){this.$$set({markupEditorToolRetainStyles:e}),fa();}},{key:"markupEditorShapeStyleControls",get:function get(){return this.$$.ctx[10];},set:function set(e){this.$$set({markupEditorShapeStyleControls:e}),fa();}},{key:"markupEditorToolSelectRadius",get:function get(){return this.$$.ctx[11];},set:function set(e){this.$$set({markupEditorToolSelectRadius:e}),fa();}},{key:"markupEditorTextInputMode",get:function get(){return this.$$.ctx[12];},set:function set(e){this.$$set({markupEditorTextInputMode:e}),fa();}},{key:"markupEditorToolShareStyles",get:function get(){return this.$$.ctx[13];},set:function set(e){this.$$set({markupEditorToolShareStyles:e}),fa();}},{key:"willRenderShapePresetToolbar",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({willRenderShapePresetToolbar:e}),fa();}},{key:"markupEditorGridSize",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({markupEditorGridSize:e}),fa();}},{key:"markupEditorSnapThreshold",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({markupEditorSnapThreshold:e}),fa();}},{key:"markupEditorSnapToContext",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({markupEditorSnapToContext:e}),fa();}},{key:"decorateGridSize",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({decorateGridSize:e}),fa();}},{key:"decorateSnapToContext",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({decorateSnapToContext:e}),fa();}},{key:"decorateTools",get:function get(){return this.$$.ctx[20];},set:function set(e){this.$$set({decorateTools:e}),fa();}},{key:"decorateToolShapes",get:function get(){return this.$$.ctx[21];},set:function set(e){this.$$set({decorateToolShapes:e}),fa();}},{key:"decorateShapeControls",get:function get(){return this.$$.ctx[22];},set:function set(e){this.$$set({decorateShapeControls:e}),fa();}},{key:"decorateActiveTool",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({decorateActiveTool:e}),fa();}},{key:"decorateEnableButtonFlipVertical",get:function get(){return this.$$.ctx[23];},set:function set(e){this.$$set({decorateEnableButtonFlipVertical:e}),fa();}},{key:"decorateEnableSelectImagePreset",get:function get(){return this.$$.ctx[24];},set:function set(e){this.$$set({decorateEnableSelectImagePreset:e}),fa();}},{key:"decorateEnableDropImagePreset",get:function get(){return this.$$.ctx[25];},set:function set(e){this.$$set({decorateEnableDropImagePreset:e}),fa();}},{key:"decoratePresets",get:function get(){return this.$$.ctx[26];},set:function set(e){this.$$set({decoratePresets:e}),fa();}},{key:"decorateWillRenderShapePresetToolbar",get:function get(){return this.$$.ctx[27];},set:function set(e){this.$$set({decorateWillRenderShapePresetToolbar:e}),fa();}},{key:"decorateWillRenderShapeStyleControls",get:function get(){return this.$$.ctx[28];},set:function set(e){this.$$set({decorateWillRenderShapeStyleControls:e}),fa();}},{key:"enableSelectToolToAddShape",get:function get(){return this.$$.ctx[29];},set:function set(e){this.$$set({enableSelectToolToAddShape:e}),fa();}},{key:"enableTapToAddText",get:function get(){return this.$$.ctx[30];},set:function set(e){this.$$set({enableTapToAddText:e}),fa();}},{key:"enableViewTool",get:function get(){return this.$$.ctx[31];},set:function set(e){this.$$set({enableViewTool:e}),fa();}},{key:"enableMoveTool",get:function get(){return this.$$.ctx[32];},set:function set(e){this.$$set({enableMoveTool:e}),fa();}},{key:"enableAutoSelectMoveTool",get:function get(){return this.$$.ctx[33];},set:function set(e){this.$$set({enableAutoSelectMoveTool:e}),fa();}},{key:"enableMultiSelect",get:function get(){return this.$$.ctx[34];},set:function set(e){this.$$set({enableMultiSelect:e}),fa();}},{key:"willRenderShapeControls",get:function get(){return this.$$.ctx[35];},set:function set(e){this.$$set({willRenderShapeControls:e}),fa();}},{key:"willRenderShapeTextControls",get:function get(){return this.$$.ctx[36];},set:function set(e){this.$$set({willRenderShapeTextControls:e}),fa();}},{key:"beforeAddShape",get:function get(){return this.$$.ctx[37];},set:function set(e){this.$$set({beforeAddShape:e}),fa();}},{key:"beforeRemoveShape",get:function get(){return this.$$.ctx[38];},set:function set(e){this.$$set({beforeRemoveShape:e}),fa();}},{key:"beforeDeselectShape",get:function get(){return this.$$.ctx[39];},set:function set(e){this.$$set({beforeDeselectShape:e}),fa();}},{key:"beforeSelectShape",get:function get(){return this.$$.ctx[40];},set:function set(e){this.$$set({beforeSelectShape:e}),fa();}},{key:"beforeUpdateShape",get:function get(){return this.$$.ctx[41];},set:function set(e){this.$$set({beforeUpdateShape:e}),fa();}},{key:"markupEditorWillStartInteraction",get:function get(){return this.$$.ctx[42];},set:function set(e){this.$$set({markupEditorWillStartInteraction:e}),fa();}}]);}(Wa)]};function Sx(e){var t,_o203;return t=new px({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[26],mapImagePointToScreenPoint:e[25],utilKey:"sticker",shapePresets:e[5],shapes:e[6]?e[35]:e[36],toolActive:"preset",imageFlipX:!!e[6]&&e[24],imageFlipY:!!e[6]&&e[23],imageRotation:e[6]?e[31]:0,parentRect:e[6]?e[37]:e[33],snapThreshold:e[29],gridSize:e[28],enableMultiSelect:e[12],enableSnapToContext:e[27],enablePresetDropImage:e[7],enablePresetSelectImage:e[30],enableButtonFlipVertical:e[10]||e[8],toolSelectRadius:e[15],willStartInteraction:e[22],willRenderPresetToolbar:e[11]||e[9]||e[16],hooks:{willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}}}),t.$on("measure",e[60]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o203=!0;},p:function p(e,o){var 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]),67108864&o[0]&&(i.mapScreenPointToImagePoint=e[26]),33554432&o[0]&&(i.mapImagePointToScreenPoint=e[25]),32&o[0]&&(i.shapePresets=e[5]),64&o[0]&&(i.shapes=e[6]?e[35]:e[36]),16777280&o[0]&&(i.imageFlipX=!!e[6]&&e[24]),8388672&o[0]&&(i.imageFlipY=!!e[6]&&e[23]),64&o[0]|1&o[1]&&(i.imageRotation=e[6]?e[31]:0),64&o[0]&&(i.parentRect=e[6]?e[37]:e[33]),536870912&o[0]&&(i.snapThreshold=e[29]),268435456&o[0]&&(i.gridSize=e[28]),4096&o[0]&&(i.enableMultiSelect=e[12]),134217728&o[0]&&(i.enableSnapToContext=e[27]),128&o[0]&&(i.enablePresetDropImage=e[7]),1073741824&o[0]&&(i.enablePresetSelectImage=e[30]),1280&o[0]&&(i.enableButtonFlipVertical=e[10]||e[8]),32768&o[0]&&(i.toolSelectRadius=e[15]),4194304&o[0]&&(i.willStartInteraction=e[22]),68096&o[0]&&(i.willRenderPresetToolbar=e[11]||e[9]||e[16]),4087808&o[0]&&(i.hooks={willRenderShapeControls:e[13],willRenderShapeTextControls:e[14],beforeAddShape:e[17],beforeRemoveShape:e[18],beforeDeselectShape:e[19],beforeSelectShape:e[20],beforeUpdateShape:e[21]}),t.$set(i);},i:function i(e){_o203||(ka(t.$$.fragment,e),_o203=!0);},o:function o(e){Ca(t.$$.fragment,e),_o203=!1;},d:function d(e){Oa(t,e);}};}function kx(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m,$,g,f;var y=t.isActive,b=t.isActiveFraction,x=t.isVisible,v=t.stores,_t$locale6=t.locale,w=_t$locale6===void 0?{}:_t$locale6,_t$stickers=t.stickers,S=_t$stickers===void 0?[]:_t$stickers,_t$stickerForceEnable=t.stickerForceEnable,k=_t$stickerForceEnable===void 0?!1:_t$stickerForceEnable,_t$stickerStickToImag=t.stickerStickToImage,C=_t$stickerStickToImag===void 0?!1:_t$stickerStickToImag,_t$stickerEnableSelec=t.stickerEnableSelectImagePreset,T=_t$stickerEnableSelec===void 0?!0:_t$stickerEnableSelec,_t$stickerEnableDropI=t.stickerEnableDropImagePreset,M=_t$stickerEnableDropI===void 0?!0:_t$stickerEnableDropI,_t$stickerEnableButto=t.stickerEnableButtonFlipVertical,R=_t$stickerEnableButto===void 0?!1:_t$stickerEnableButto,P=t.stickerWillRenderShapePresetToolbar,_t$stickerEnableSelec2=t.stickerEnableSelectImage,E=_t$stickerEnableSelec2===void 0?!0:_t$stickerEnableSelec2,_t$stickersEnableButt=t.stickersEnableButtonFlipVertical,I=_t$stickersEnableButt===void 0?!1:_t$stickersEnableButt,A=t.stickersWillRenderShapePresetToolbar,_t$markupEditorGridSi2=t.markupEditorGridSize,L=_t$markupEditorGridSi2===void 0?0:_t$markupEditorGridSi2,_t$markupEditorSnapTh2=t.markupEditorSnapThreshold,z=_t$markupEditorSnapTh2===void 0?0:_t$markupEditorSnapTh2,_t$markupEditorSnapTo3=t.markupEditorSnapToContext,F=_t$markupEditorSnapTo3===void 0?!1:_t$markupEditorSnapTo3,D=t.enableMultiSelect,O=t.annotateGridSize,B=t.annotateSnapToContext,W=t.decorateGridSize,V=t.decorateSnapToContext,_=t.willRenderShapeControls,N=t.willRenderShapeTextControls,H=t.markupEditorToolSelectRadius,j=t.willRenderShapePresetToolbar,U=t.beforeAddShape,G=t.beforeRemoveShape,Z=t.beforeDeselectShape,X=t.beforeSelectShape,Y=t.beforeUpdateShape,q=t.markupEditorWillStartInteraction;var _v4=v,K=_v4.rootRect,J=_v4.imageCropRect,Q=_v4.imageSelectionRectPresentation,ee=_v4.imageAnnotation,te=_v4.imageDecoration,oe=_v4.imageSize,ie=_v4.imageTransforms,ne=_v4.imageTransformsInterpolated,re=_v4.imageRotation,ae=_v4.imageFlipX,se=_v4.imageFlipY;return sr(e,K,function(e){return o(59,g=e);}),sr(e,Q,function(e){return o(55,d=e);}),sr(e,oe,function(e){return o(58,$=e);}),sr(e,ie,function(e){return o(57,m=e);}),sr(e,ne,function(e){return o(56,p=e);}),sr(e,re,function(e){return o(31,f=e);}),sr(e,ae,function(e){return o(24,h=e);}),sr(e,se,function(e){return o(23,u=e);}),e.$$set=function(e){"isActive"in e&&o(0,y=e.isActive),"isActiveFraction"in e&&o(1,b=e.isActiveFraction),"isVisible"in e&&o(2,x=e.isVisible),"stores"in e&&o(3,v=e.stores),"locale"in e&&o(4,w=e.locale),"stickers"in e&&o(5,S=e.stickers),"stickerForceEnable"in e&&o(44,k=e.stickerForceEnable),"stickerStickToImage"in e&&o(6,C=e.stickerStickToImage),"stickerEnableSelectImagePreset"in e&&o(45,T=e.stickerEnableSelectImagePreset),"stickerEnableDropImagePreset"in e&&o(7,M=e.stickerEnableDropImagePreset),"stickerEnableButtonFlipVertical"in e&&o(8,R=e.stickerEnableButtonFlipVertical),"stickerWillRenderShapePresetToolbar"in e&&o(9,P=e.stickerWillRenderShapePresetToolbar),"stickerEnableSelectImage"in e&&o(46,E=e.stickerEnableSelectImage),"stickersEnableButtonFlipVertical"in e&&o(10,I=e.stickersEnableButtonFlipVertical),"stickersWillRenderShapePresetToolbar"in e&&o(11,A=e.stickersWillRenderShapePresetToolbar),"markupEditorGridSize"in e&&o(47,L=e.markupEditorGridSize),"markupEditorSnapThreshold"in e&&o(48,z=e.markupEditorSnapThreshold),"markupEditorSnapToContext"in e&&o(49,F=e.markupEditorSnapToContext),"enableMultiSelect"in e&&o(12,D=e.enableMultiSelect),"annotateGridSize"in e&&o(50,O=e.annotateGridSize),"annotateSnapToContext"in e&&o(51,B=e.annotateSnapToContext),"decorateGridSize"in e&&o(52,W=e.decorateGridSize),"decorateSnapToContext"in e&&o(53,V=e.decorateSnapToContext),"willRenderShapeControls"in e&&o(13,_=e.willRenderShapeControls),"willRenderShapeTextControls"in e&&o(14,N=e.willRenderShapeTextControls),"markupEditorToolSelectRadius"in e&&o(15,H=e.markupEditorToolSelectRadius),"willRenderShapePresetToolbar"in e&&o(16,j=e.willRenderShapePresetToolbar),"beforeAddShape"in e&&o(17,U=e.beforeAddShape),"beforeRemoveShape"in e&&o(18,G=e.beforeRemoveShape),"beforeDeselectShape"in e&&o(19,Z=e.beforeDeselectShape),"beforeSelectShape"in e&&o(20,X=e.beforeSelectShape),"beforeUpdateShape"in e&&o(21,Y=e.beforeUpdateShape),"markupEditorWillStartInteraction"in e&&o(22,q=e.markupEditorWillStartInteraction);},e.$$.update=function(){33554432&e.$$.dirty[1]&&o(54,i=p?p.scale:1),49152&e.$$.dirty[1]&&o(30,n=!1!==T&&E),131072&e.$$.dirty[1]&&o(29,r=z),64&e.$$.dirty[0]|2686976&e.$$.dirty[1]&&o(28,a=C?Lo(O)?O:L:Lo(W)?W:L),64&e.$$.dirty[0]|5505024&e.$$.dirty[1]&&o(27,s=C?gx(B)?B:F:gx(V)?V:F),25165888&e.$$.dirty[0]|528482304&e.$$.dirty[1]&&o(26,l=C?function(e){return $x(e,g,$,p.origin,p.translation,m.rotation.z,p.scale,h,u);}:function(e){var t=me(e);return t.x-=d.x,t.y-=d.y,t.x/=i,t.y/=i,t;}),25165888&e.$$.dirty[0]|528482304&e.$$.dirty[1]&&o(25,c=C?function(e){return mx(e,g,$,p.origin,p.translation,m.rotation.z,p.scale,h,u);}:function(e){var t=me(e);return t.x*=i,t.y*=i,t.x+=d.x,t.y+=d.y,t;});},[y,b,x,v,w,S,C,M,R,P,I,A,D,_,N,H,j,U,G,Z,X,Y,q,u,h,c,l,s,a,r,n,f,K,J,Q,ee,te,oe,ie,ne,re,ae,se,"sticker",k,T,E,L,z,F,O,B,W,V,i,d,p,m,$,g,function(t){ia.call(this,e,t);}];}var Cx={util:["sticker",/*#__PURE__*/function(_Wa50){function _class6(e){var _this53;_classCallCheck(this,_class6);_this53=_callSuper(this,_class6),Ba(_assertThisInitialized(_this53),e,kx,Sx,nr,{name:43,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,stickers:5,stickerForceEnable:44,stickerStickToImage:6,stickerEnableSelectImagePreset:45,stickerEnableDropImagePreset:7,stickerEnableButtonFlipVertical:8,stickerWillRenderShapePresetToolbar:9,stickerEnableSelectImage:46,stickersEnableButtonFlipVertical:10,stickersWillRenderShapePresetToolbar:11,markupEditorGridSize:47,markupEditorSnapThreshold:48,markupEditorSnapToContext:49,enableMultiSelect:12,annotateGridSize:50,annotateSnapToContext:51,decorateGridSize:52,decorateSnapToContext:53,willRenderShapeControls:13,willRenderShapeTextControls:14,markupEditorToolSelectRadius:15,willRenderShapePresetToolbar:16,beforeAddShape:17,beforeRemoveShape:18,beforeDeselectShape:19,beforeSelectShape:20,beforeUpdateShape:21,markupEditorWillStartInteraction:22},null,[-1,-1]);return _this53;}_inherits(_class6,_Wa50);return _createClass(_class6,[{key:"name",get:function get(){return this.$$.ctx[43];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"isActiveFraction",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({isActiveFraction:e}),fa();}},{key:"isVisible",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({isVisible:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"stickers",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({stickers:e}),fa();}},{key:"stickerForceEnable",get:function get(){return this.$$.ctx[44];},set:function set(e){this.$$set({stickerForceEnable:e}),fa();}},{key:"stickerStickToImage",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({stickerStickToImage:e}),fa();}},{key:"stickerEnableSelectImagePreset",get:function get(){return this.$$.ctx[45];},set:function set(e){this.$$set({stickerEnableSelectImagePreset:e}),fa();}},{key:"stickerEnableDropImagePreset",get:function get(){return this.$$.ctx[7];},set:function set(e){this.$$set({stickerEnableDropImagePreset:e}),fa();}},{key:"stickerEnableButtonFlipVertical",get:function get(){return this.$$.ctx[8];},set:function set(e){this.$$set({stickerEnableButtonFlipVertical:e}),fa();}},{key:"stickerWillRenderShapePresetToolbar",get:function get(){return this.$$.ctx[9];},set:function set(e){this.$$set({stickerWillRenderShapePresetToolbar:e}),fa();}},{key:"stickerEnableSelectImage",get:function get(){return this.$$.ctx[46];},set:function set(e){this.$$set({stickerEnableSelectImage:e}),fa();}},{key:"stickersEnableButtonFlipVertical",get:function get(){return this.$$.ctx[10];},set:function set(e){this.$$set({stickersEnableButtonFlipVertical:e}),fa();}},{key:"stickersWillRenderShapePresetToolbar",get:function get(){return this.$$.ctx[11];},set:function set(e){this.$$set({stickersWillRenderShapePresetToolbar:e}),fa();}},{key:"markupEditorGridSize",get:function get(){return this.$$.ctx[47];},set:function set(e){this.$$set({markupEditorGridSize:e}),fa();}},{key:"markupEditorSnapThreshold",get:function get(){return this.$$.ctx[48];},set:function set(e){this.$$set({markupEditorSnapThreshold:e}),fa();}},{key:"markupEditorSnapToContext",get:function get(){return this.$$.ctx[49];},set:function set(e){this.$$set({markupEditorSnapToContext:e}),fa();}},{key:"enableMultiSelect",get:function get(){return this.$$.ctx[12];},set:function set(e){this.$$set({enableMultiSelect:e}),fa();}},{key:"annotateGridSize",get:function get(){return this.$$.ctx[50];},set:function set(e){this.$$set({annotateGridSize:e}),fa();}},{key:"annotateSnapToContext",get:function get(){return this.$$.ctx[51];},set:function set(e){this.$$set({annotateSnapToContext:e}),fa();}},{key:"decorateGridSize",get:function get(){return this.$$.ctx[52];},set:function set(e){this.$$set({decorateGridSize:e}),fa();}},{key:"decorateSnapToContext",get:function get(){return this.$$.ctx[53];},set:function set(e){this.$$set({decorateSnapToContext:e}),fa();}},{key:"willRenderShapeControls",get:function get(){return this.$$.ctx[13];},set:function set(e){this.$$set({willRenderShapeControls:e}),fa();}},{key:"willRenderShapeTextControls",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({willRenderShapeTextControls:e}),fa();}},{key:"markupEditorToolSelectRadius",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({markupEditorToolSelectRadius:e}),fa();}},{key:"willRenderShapePresetToolbar",get:function get(){return this.$$.ctx[16];},set:function set(e){this.$$set({willRenderShapePresetToolbar:e}),fa();}},{key:"beforeAddShape",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({beforeAddShape:e}),fa();}},{key:"beforeRemoveShape",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({beforeRemoveShape:e}),fa();}},{key:"beforeDeselectShape",get:function get(){return this.$$.ctx[19];},set:function set(e){this.$$set({beforeDeselectShape:e}),fa();}},{key:"beforeSelectShape",get:function get(){return this.$$.ctx[20];},set:function set(e){this.$$set({beforeSelectShape:e}),fa();}},{key:"beforeUpdateShape",get:function get(){return this.$$.ctx[21];},set:function set(e){this.$$set({beforeUpdateShape:e}),fa();}},{key:"markupEditorWillStartInteraction",get:function get(){return this.$$.ctx[22];},set:function set(e){this.$$set({markupEditorWillStartInteraction:e}),fa();}}]);}(Wa),function(_ref491){var e=_ref491.stickers,t=_ref491.stickerEnableSelectImage,o=_ref491.stickerEnableSelectImagePreset,i=_ref491.stickerEnableDropImagePreset,n=_ref491.stickerForceEnable;return e&&e.length||t||o||i||n;}]};function Tx(e){var t,o,i,n,r,a=(e[14](e[34].value)||"")+"",s=(M(e[34].label)?e[34].label(e[1]):e[34].label)+"";return {c:function c(){t=Rr("div"),o=new Nr(!1),i=Ir(),n=Rr("span"),r=Er(s),o.a=i,Dr(t,"slot","option");},m:function m(e,s){Tr(e,t,s),o.m(a,t),Sr(t,i),Sr(t,n),Sr(n,r);},p:function p(e,t){8&t[1]&&a!==(a=(e[14](e[34].value)||"")+"")&&o.p(a),2&t[0]|8&t[1]&&s!==(s=(M(e[34].label)?e[34].label(e[1]):e[34].label)+"")&&Wr(r,s);},d:function d(e){e&&Mr(t);}};}function Mx(e){var t,_o204;return t=new Xu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[6],onchange:e[12],$$slots:{option:[Tx,function(_ref492){var e=_ref492.option;return {34:e};},function(_ref493){var e=_ref493.option;return [0,e?8:0];}]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o204=!0;},p:function p(e,o){var 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]|24&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o204||(ka(t.$$.fragment,e),_o204=!0);},o:function o(e){Ca(t.$$.fragment,e),_o204=!1;},d:function d(e){Oa(t,e);}};}function Rx(e){var t,_o205,i,n,r;return _o205=new Sb({props:{locale:e[1],class:"PinturaControlPanels",shapeProps:e[4],onchange:e[13],controls:e[3],scrollElasticity:e[7]}}),n=new Ad({props:{elasticity:e[10],$$slots:{default:[Mx]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),Fa(_o205.$$.fragment),i=Ir(),Fa(n.$$.fragment),Dr(t,"slot","footer"),Dr(t,"style",e[5]);},m:function m(e,a){Tr(e,t,a),Da(_o205,t,null),Sr(t,i),Da(n,t,null),r=!0;},p:function p(e,i){var a={};2&i[0]&&(a.locale=e[1]),16&i[0]&&(a.shapeProps=e[4]),8&i[0]&&(a.controls=e[3]),128&i[0]&&(a.scrollElasticity=e[7]),_o205.$set(a);var s={};70&i[0]|16&i[1]&&(s.$$scope={dirty:i,ctx:e}),n.$set(s),(!r||32&i[0])&&Dr(t,"style",e[5]);},i:function i(e){r||(ka(_o205.$$.fragment,e),ka(n.$$.fragment,e),r=!0);},o:function o(e){Ca(_o205.$$.fragment,e),Ca(n.$$.fragment,e),r=!1;},d:function d(e){e&&Mr(t),Oa(_o205),Oa(n);}};}function Px(e){var t,_o206;return t=new Cf({props:{$$slots:{footer:[Rx]},$$scope:{ctx:e}}}),t.$on("measure",e[23]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o206=!0;},p:function p(e,o){var i={};254&o[0]|16&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o206||(ka(t.$$.fragment,e),_o206=!0);},o:function o(e){Ca(t.$$.fragment,e),_o206=!1;},d:function d(e){Oa(t,e);}};}function Ex(e,t,o){var i,n,r,a,s,l,c,d,u=Kn,h=function h(){return u(),u=rr(p,function(e){return o(20,s=e);}),p;};e.$$.on_destroy.push(function(){return u();});var p=t.isActive;h();var m=t.stores,_t$locale7=t.locale,$=_t$locale7===void 0?{}:_t$locale7,_t$frameStyles=t.frameStyles,g=_t$frameStyles===void 0?{}:_t$frameStyles,_t$frameOptions=t.frameOptions,f=_t$frameOptions===void 0?[]:_t$frameOptions,y=t.markupEditorShapeStyleControls;var b=oa("elasticityMultiplier");sr(e,b,function(e){return o(22,d=e);});var _m16=m,x=_m16.history,v=_m16.animation,w=_m16.scrollElasticity,S=_m16.imageFrame,k=_m16.allowPan,C=_m16.allowZoom,T=_m16.allowZoomControls,M=_m16.allowPlayPause;sr(e,v,function(e){return o(21,l=e);}),sr(e,S,function(e){return o(4,c=e);});var R={};var P;var E=uc(l?20:0);return sr(e,E,function(e){return o(19,a=e);}),e.$$set=function(e){"isActive"in e&&h(o(0,p=e.isActive)),"stores"in e&&o(17,m=e.stores),"locale"in e&&o(1,$=e.locale),"frameStyles"in e&&o(18,g=e.frameStyles),"frameOptions"in e&&o(2,f=e.frameOptions),"markupEditorShapeStyleControls"in e&&o(3,y=e.markupEditorShapeStyleControls);},e.$$.update=function(){1048576&e.$$.dirty[0]&&k.set(s),1048576&e.$$.dirty[0]&&C.set(s),1048576&e.$$.dirty[0]&&T.set(s),1048576&e.$$.dirty[0]&&s&&M.set(!0),4194304&e.$$.dirty[0]&&o(7,i=d*w),20&e.$$.dirty[0]&&o(6,n=c?f.findIndex(function(_ref494){var _ref495=_slicedToArray(_ref494,1),e=_ref495[0];return e===c.id;}):0),3145728&e.$$.dirty[0]&&l&&E.set(s?0:20),524288&e.$$.dirty[0]&&o(5,r=a?"transform: translateY(".concat(a,"px)"):void 0);},[p,$,f,y,c,r,n,i,b,v,w,S,function(_ref496){var e=_ref496.value;var t=g[e];if(!t||!t.shape)return S.set(void 0),void x.write();var o=t.shape,i=_objectSpread2(_objectSpread2({id:e},gi(o)),Object.keys(R).reduce(function(e,t){return o[t]?(e[t]=R[t],e):e;},{}));S.set(i),x.write();},function(e){Fo(e,"frameColor")&&(R.frameColor=e.frameColor),c&&(xn(c,e),S.set(c),clearTimeout(P),P=setTimeout(function(){x.write();},200));},function(e){var t=g[e];var o;if(t&&t.thumb)return o=t.thumb,/div/i.test(o)||kb(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\">".concat(o,"</svg>"):"<img src=\"".concat(o,"\" alt=\"\"/>");},E,"frame",m,g,a,s,l,d,function(t){ia.call(this,e,t);}];}var Ix={util:["frame",/*#__PURE__*/function(_Wa51){function _class7(e){var _this54;_classCallCheck(this,_class7);_this54=_callSuper(this,_class7),Ba(_assertThisInitialized(_this54),e,Ex,Px,nr,{name:16,isActive:0,stores:17,locale:1,frameStyles:18,frameOptions:2,markupEditorShapeStyleControls:3},null,[-1,-1]);return _this54;}_inherits(_class7,_Wa51);return _createClass(_class7,[{key:"name",get:function get(){return this.$$.ctx[16];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[17];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"frameStyles",get:function get(){return this.$$.ctx[18];},set:function set(e){this.$$set({frameStyles:e}),fa();}},{key:"frameOptions",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({frameOptions:e}),fa();}},{key:"markupEditorShapeStyleControls",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({markupEditorShapeStyleControls:e}),fa();}}]);}(Wa),function(_ref497){var e=_ref497.src;return e&&!Os(e);}]};function Ax(e){var t,o,i,n,r,a,s,l;return {c:function c(){t=Rr("div"),o=Rr("input"),n=Ir(),r=Rr("label"),a=Er(e[1]),Dr(o,"id",e[0]),Dr(o,"type","number"),Dr(o,"min","1"),Dr(o,"inputmode","numeric"),Dr(o,"pattern","[0-9]*"),Dr(o,"data-state",e[3]),Dr(o,"autocomplete","off"),Dr(o,"placeholder",e[4]),o.value=i=void 0===e[5]?"":e[7](e[5]+""),Dr(r,"for",e[0]),Dr(r,"title",e[2]),Dr(r,"aria-label",e[2]),Dr(t,"class","PinturaInputDimension");},m:function m(i,c){Tr(i,t,c),Sr(t,o),Sr(t,n),Sr(t,r),Sr(r,a),s||(l=Lr(o,"input",e[8]),s=!0);},p:function p(e,_ref498){var _ref499=_slicedToArray(_ref498,1),t=_ref499[0];1&t&&Dr(o,"id",e[0]),8&t&&Dr(o,"data-state",e[3]),16&t&&Dr(o,"placeholder",e[4]),160&t&&i!==(i=void 0===e[5]?"":e[7](e[5]+""))&&o.value!==i&&(o.value=i),2&t&&Wr(a,e[1]),1&t&&Dr(r,"for",e[0]),4&t&&Dr(r,"title",e[2]),4&t&&Dr(r,"aria-label",e[2]);},i:Kn,o:Kn,d:function d(e){e&&Mr(t),s=!1,l();}};}function Lx(e,t,o){var i=t.id,n=t.label,r=t.title,a=t.state,s=t.placeholder,l=t.value,c=t.onchange,_t$format=t.format,d=_t$format===void 0?function(e){return e.replace(/\D/g,"");}:_t$format;return e.$$set=function(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,function(e){return c(d(e.currentTarget.value));}];}var zx=/*#__PURE__*/function(_Wa52){function zx(e){var _this55;_classCallCheck(this,zx);_this55=_callSuper(this,zx),Ba(_assertThisInitialized(_this55),e,Lx,Ax,nr,{id:0,label:1,title:2,state:3,placeholder:4,value:5,onchange:6,format:7});return _this55;}_inherits(zx,_Wa52);return _createClass(zx);}(Wa);function Fx(e){var t;return {c:function c(){t=Pr("g");},m:function m(o,i){Tr(o,t,i),t.innerHTML=e[2];},p:function p(e,o){4&o&&(t.innerHTML=e[2]);},d:function d(e){e&&Mr(t);}};}function Dx(e){var t,o,i,n,r,a,s,l;return r=new hd({props:{$$slots:{default:[Fx]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),o=Rr("input"),i=Ir(),n=Rr("label"),Fa(r.$$.fragment),Dr(o,"id",e[0]),Dr(o,"class","implicit"),Dr(o,"type","checkbox"),o.checked=e[1],Dr(n,"for",e[0]),Dr(n,"title",e[3]);},m:function m(c,d){Tr(c,t,d),Sr(t,o),Sr(t,i),Sr(t,n),Da(r,n,null),a=!0,s||(l=Lr(o,"change",e[5]),s=!0);},p:function p(e,_ref500){var _ref501=_slicedToArray(_ref500,1),t=_ref501[0];(!a||1&t)&&Dr(o,"id",e[0]),(!a||2&t)&&(o.checked=e[1]);var i={};68&t&&(i.$$scope={dirty:t,ctx:e}),r.$set(i),(!a||1&t)&&Dr(n,"for",e[0]),(!a||8&t)&&Dr(n,"title",e[3]);},i:function i(e){a||(ka(r.$$.fragment,e),a=!0);},o:function o(e){Ca(r.$$.fragment,e),a=!1;},d:function d(e){e&&Mr(t),Oa(r),s=!1,l();}};}function Ox(e,t,o){var i=t.id,n=t.locked,r=t.icon,a=t.title,s=t.onchange;return e.$$set=function(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,function(e){return s(e.currentTarget.checked);}];}var Bx=/*#__PURE__*/function(_Wa53){function Bx(e){var _this56;_classCallCheck(this,Bx);_this56=_callSuper(this,Bx),Ba(_assertThisInitialized(_this56),e,Ox,Dx,nr,{id:0,locked:1,icon:2,title:3,onchange:4});return _this56;}_inherits(Bx,_Wa53);return _createClass(Bx);}(Wa);function Wx(e){var t;return {c:function c(){t=Er("Save");},m:function m(e,o){Tr(e,t,o);},d:function d(e){e&&Mr(t);}};}function Vx(e){var t,o,i,n,r,a,s,l,_c40,_d29,u,h,p,m=e[1].resizeLabelFormCaption+"";return l=new Cp({props:{items:e[4]}}),_d29=new xd({props:{type:"submit",class:"implicit",$$slots:{default:[Wx]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("form"),o=Rr("div"),i=Rr("fieldset"),n=Rr("legend"),r=Er(m),a=Ir(),s=Rr("div"),Fa(l.$$.fragment),_c40=Ir(),Fa(_d29.$$.fragment),Dr(n,"class","implicit"),Dr(s,"class","PinturaFieldsetInner"),Dr(o,"class","PinturaFormInner"),Dr(t,"slot","footer"),Dr(t,"style",e[3]);},m:function m(_m17,$){Tr(_m17,t,$),Sr(t,o),Sr(o,i),Sr(i,n),Sr(n,r),Sr(i,a),Sr(i,s),Da(l,s,null),e[65](s),Sr(o,_c40),Da(_d29,o,null),u=!0,h||(p=[Lr(s,"focusin",e[15]),Lr(s,"focusout",e[16]),Lr(t,"submit",zr(e[17]))],h=!0);},p:function p(e,o){(!u||2&o[0])&&m!==(m=e[1].resizeLabelFormCaption+"")&&Wr(r,m);var i={};16&o[0]&&(i.items=e[4]),l.$set(i);var n={};16&o[3]&&(n.$$scope={dirty:o,ctx:e}),_d29.$set(n),(!u||8&o[0])&&Dr(t,"style",e[3]);},i:function i(e){u||(ka(l.$$.fragment,e),ka(_d29.$$.fragment,e),u=!0);},o:function o(e){Ca(l.$$.fragment,e),Ca(_d29.$$.fragment,e),u=!1;},d:function d(o){o&&Mr(t),Oa(l),e[65](null),Oa(_d29),h=!1,or(p);}};}function _x(e){var t,_o207;return t=new Cf({props:{$$slots:{footer:[Vx]},$$scope:{ctx:e}}}),t.$on("measure",e[66]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o207=!0;},p:function p(e,o){var i={};30&o[0]|16&o[3]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o207||(ka(t.$$.fragment,e),_o207=!0);},o:function o(e){Ca(t.$$.fragment,e),_o207=!1;},d:function d(e){Oa(t,e);}};}function Nx(e,t,o){var i,n,r,a,s,l,c,d,u,h,p,m,$,g,f,y,b,x,v,w,S,k,C,M,R,P,E,A,L,z,F=Kn,D=function D(){return F(),F=rr(B,function(e){return o(49,p=e);}),B;};e.$$.on_destroy.push(function(){return F();});var O=function O(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var o=arguments.length>2&&arguments[2]!==undefined?arguments[2]:9999;if(T(e)&&!(e=e.replace(/\D/g,"")).length)return;var i=Math.round(e);return Number.isNaN(i)?void 0:ls(i,t,o);};var B=t.isActive;D();var W=t.stores,_t$locale8=t.locale,V=_t$locale8===void 0?{}:_t$locale8,_t$resizeMinSize=t.resizeMinSize,_=_t$resizeMinSize===void 0?Ve(1,1):_t$resizeMinSize,_t$resizeMaxSize=t.resizeMaxSize,N=_t$resizeMaxSize===void 0?Ve(9999,9999):_t$resizeMaxSize,_t$resizeAspectRatioL=t.resizeAspectRatioLocked,H=_t$resizeAspectRatioL===void 0?!1:_t$resizeAspectRatioL,_t$resizeEnableButton=t.resizeEnableButtonLockAspectRatio,j=_t$resizeEnableButton===void 0?!0:_t$resizeEnableButton,U=t.resizeSizePresetOptions,X=t.resizeWidthPresetOptions,Y=t.resizeHeightPresetOptions,_t$resizeWillRenderFo=t.resizeWillRenderFooter,q=_t$resizeWillRenderFo===void 0?Z:_t$resizeWillRenderFo;var K=uc(0,{stiffness:.15,damping:.3});sr(e,K,function(e){return o(54,y=e);});var _W=W,J=_W.animation,Q=_W.imageSize,ee=_W.imageCropRect,te=_W.imageCropRectAspectRatio,oe=_W.imageCropAspectRatio,ie=_W.imageOutputSize,ne=_W.imageSelectionZoom,re=_W.imageSelectionPan,ae=_W.history,se=_W.env,le=_W.allowPan,ce=_W.allowZoom,de=_W.allowZoomControls,he=_W.allowPlayPause;sr(e,J,function(e){return o(50,m=e);}),sr(e,Q,function(e){return o(73,A=e);}),sr(e,ee,function(e){return o(52,g=e);}),sr(e,te,function(e){return o(53,f=e);}),sr(e,oe,function(e){return o(72,M=e);}),sr(e,ie,function(e){return o(61,C=e);}),sr(e,ne,function(e){return o(74,L=e);}),sr(e,re,function(e){return o(75,z=e);}),sr(e,se,function(e){return o(51,$=e);});var pe=I();var me,$e,ge,fe,ye,be,xe=ue();var ve=function ve(e,t,o,i,n){return null!=e&&o!==t?e>=i[t]&&e<=n[t]?"valid":"invalid":"undetermined";},we=function we(e,t,o){return Math.round(null!=e?e/t:o.height);},Se=function Se(){H&&$e&&ge&&("width"===fe?o(39,ge=Math.round($e/f)):"height"===fe?o(38,$e=Math.round(ge*f)):("width"===ye?o(39,ge=Math.round($e/f)):"height"===ye&&o(38,$e=Math.round(ge*f)),ke()));},ke=function ke(e){var t=O($e),i=O(ge),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?G(n,r):f;var l=Ve(n,r);Ue(N,l)||(l=vt(N,s)),Ue(l,_)||(l=xt(_,s)),o(38,$e=null!=t?Math.round(l.width):void 0),o(39,ge=null!=i?Math.round(l.height):void 0);},Ce=function Ce(){ke();var _ref502=C||{},e=_ref502.width,t=_ref502.height;e===$e&&t===ge||($e||ge?($e&&ge&&$r(oe,M=$e/ge,M),$r(ie,C=Ve($e,ge),C)):($r(oe,M=A.width/A.height,M),$r(oe,M=void 0,M),$r(ie,C=void 0,C)),ae.write());},Te=ie.subscribe(function(e){if(!e)return o(38,$e=void 0),void o(39,ge=void 0);o(38,$e=e.width),o(39,ge=e.height),ke();}),Me=oe.subscribe(function(e){($e||ge)&&e&&($e&&ge&&G($e,ge)!==e?(o(39,ge=$e/e),ke(e)):ke());}),Re=function Re(e){return T(e[0])?(e[1]=e[1].map(Re),e):Lo(e)?[e,""+e]:e;},Pe=function Pe(e){if(T(e[0]))return e[1]=e[1].map(Pe),e;var _e239=_slicedToArray(e,2),t=_e239[0],o=_e239[1];if(Lo(t)&&Lo(o)){var _e240=t,_i137=o;o="".concat(_e240," &times; ").concat(_i137),t=[_e240,_i137];}return [t,o];},Ee=Na();sr(e,Ee,function(e){return o(60,k=e);});var Ie=Na();sr(e,Ie,function(e){return o(64,E=e);});var Ae=Na();sr(e,Ae,function(e){return o(58,w=e);});var Le=Na();sr(e,Le,function(e){return o(63,P=e);});var ze=Na();sr(e,ze,function(e){return o(56,x=e);});var Fe=Na();sr(e,Fe,function(e){return o(62,R=e);});var De=Ha([ie,Ie],function(_ref503,o){var _ref504=_slicedToArray(_ref503,2),e=_ref504[0],t=_ref504[1];if(!t)return o(-1);var i=t.findIndex(function(_ref505){var _ref506=_slicedToArray(_ref505,1),t=_ref506[0];if(!t&&!e)return !0;if(!t)return !1;var _t161=_slicedToArray(t,2),o=_t161[0],i=_t161[1];return e.width===o&&e.height===i;});o(i<0?0:i);});sr(e,De,function(e){return o(59,S=e);});var Oe=Ha([ie,Le],function(_ref507,o){var _ref508=_slicedToArray(_ref507,2),e=_ref508[0],t=_ref508[1];if(!t)return o(-1);var i=t.findIndex(function(_ref509){var _ref510=_slicedToArray(_ref509,1),t=_ref510[0];return !t&&!e||!!t&&e.width===t;});o(i<0?0:i);});sr(e,Oe,function(e){return o(57,v=e);});var We=Ha([ie,Fe],function(_ref511,o){var _ref512=_slicedToArray(_ref511,2),e=_ref512[0],t=_ref512[1];if(!t)return o(-1);var i=t.findIndex(function(_ref513){var _ref514=_slicedToArray(_ref513,1),t=_ref514[0];return !t&&!e||!!t&&e.height===t;});o(i<0?0:i);});sr(e,We,function(e){return o(55,b=e);});var _e=void 0,Ne=void 0;var He=oa("redrawTrigger"),je=uc(m?20:0);return sr(e,je,function(e){return o(48,h=e);}),Qr(function(){Te(),Me();}),e.$$set=function(e){"isActive"in e&&D(o(0,B=e.isActive)),"stores"in e&&o(30,W=e.stores),"locale"in e&&o(1,V=e.locale),"resizeMinSize"in e&&o(31,_=e.resizeMinSize),"resizeMaxSize"in e&&o(32,N=e.resizeMaxSize),"resizeAspectRatioLocked"in e&&o(28,H=e.resizeAspectRatioLocked),"resizeEnableButtonLockAspectRatio"in e&&o(33,j=e.resizeEnableButtonLockAspectRatio),"resizeSizePresetOptions"in e&&o(34,U=e.resizeSizePresetOptions),"resizeWidthPresetOptions"in e&&o(35,X=e.resizeWidthPresetOptions),"resizeHeightPresetOptions"in e&&o(36,Y=e.resizeHeightPresetOptions),"resizeWillRenderFooter"in e&&o(37,q=e.resizeWillRenderFooter);},e.$$.update=function(){262144&e.$$.dirty[1]&&le.set(!p),262144&e.$$.dirty[1]&&ce.set(!p),262144&e.$$.dirty[1]&&de.set(!p),262144&e.$$.dirty[1]&&p&&he.set(!0),536870920&e.$$.dirty[1]&&U&&($r(Ee,k=U.map(Pe),k),$r(Ie,E=yu(k),E)),536870912&e.$$.dirty[1]&&o(47,a=!!k),268435456&e.$$.dirty[1]|4&e.$$.dirty[2]&&o(46,i=S>-1&&E[S][1]),134217744&e.$$.dirty[1]&&X&&($r(Ae,w=X.map(Re),w),$r(Le,P=yu(w),P)),134283264&e.$$.dirty[1]&&o(44,s=!a&&w),67108864&e.$$.dirty[1]|2&e.$$.dirty[2]&&o(45,n=v>-1&&P[v][1]),33554464&e.$$.dirty[1]&&Y&&($r(ze,x=Y.map(Re),x),$r(Fe,R=yu(x),R)),33619968&e.$$.dirty[1]&&o(43,l=!a&&x),16777216&e.$$.dirty[1]|1&e.$$.dirty[2]&&o(42,r=b>-1&&R[b][1]),77824&e.$$.dirty[1]&&o(41,c=!a&&!s&&!l),268435458&e.$$.dirty[0]|1072824263&e.$$.dirty[1]&&o(4,d=He&&Yp(function(){return q([a&&["Dropdown","size-presets",{label:i,options:k,onchange:function onchange(e){return (t=e.value)&&!_e&&(_e=_objectSpread2({},g),Ne=M),t?($r(oe,M=G(t[0],t[1]),M),$r(ie,C=Be(t),C)):($r(ee,g=_e,g),$r(oe,M=Ne,M),$r(ie,C=void 0,C),_e=void 0,Ne=void 0),void ae.write();var t;},selectedIndex:S}],s&&["Dropdown","width-presets",{label:n,options:w,onchange:function onchange(e){o(38,$e=e.value),Ce();},selectedIndex:v}],s&&l&&["span","times",{class:"PinturaResizeLabel",innerHTML:"&times;"}],l&&["Dropdown","height-presets",{label:r,options:x,onchange:function onchange(e){o(39,ge=e.value),Ce();},selectedIndex:b}],c&&[zx,"width-input",{id:"width-"+pe,title:V.resizeTitleInputWidth,label:V.resizeLabelInputWidth,placeholder:(e=O(ge),t=f,d=g,Math.round(null!=e?e*t:d.width)),value:$e,state:ve(O($e),"width",fe,_,N),onchange:function onchange(e){o(38,$e=e),Se();}}],c&&j&&[Bx,"aspect-ratio-lock",{id:"aspect-ratio-lock-"+pe,title:V.resizeTitleButtonMaintainAspectRatio,icon:T(V.resizeIconButtonMaintainAspectRatio)?V.resizeIconButtonMaintainAspectRatio:V.resizeIconButtonMaintainAspectRatio(H,y),locked:H,onchange:function onchange(e){o(28,H=e),Se();}}],c&&[zx,"height-input",{id:"height-"+pe,title:V.resizeTitleInputHeight,label:V.resizeLabelInputHeight,placeholder:we(O($e),f,g),value:ge,state:ve(O(ge),"height",fe,_,N),onchange:function onchange(e){o(39,ge=e),Se();}}]].filter(Boolean),_objectSpread2({},$),function(){return He.set({});});var e,t,d;}).filter(Boolean)),268435456&e.$$.dirty[0]&&K.set(H?1:0),512&e.$$.dirty[1]&&fe&&(ye=fe),262144&e.$$.dirty[1]&&p&&(xe=z,be=L),1074003968&e.$$.dirty[1]&&(p?setTimeout(function(){return e=C,$r(re,z=ue(),z),void $r(ne,L=e&&g?e.width/g.width||e.height/g.height:1,L);var e;},0):($r(re,z=xe,z),$r(ne,L=be,L))),786432&e.$$.dirty[1]&&m&&je.set(p?0:20),131072&e.$$.dirty[1]&&o(3,u=h?"transform: translateY(".concat(h,"px)"):void 0);},[B,V,me,u,d,K,J,Q,ee,te,oe,ie,ne,re,se,function(e){var t=e.target.id;/width/.test(t)?o(40,fe="width"):/height/.test(t)?o(40,fe="height"):/aspectRatio/i.test(t)?o(40,fe="lock"):o(40,fe=void 0);},function(e){me.contains(e.relatedTarget)||Ce(),o(40,fe=void 0);},Ce,Ee,Ie,Ae,Le,ze,Fe,De,Oe,We,je,H,"resize",W,_,N,j,U,X,Y,q,$e,ge,fe,c,r,l,s,n,i,a,h,p,m,$,g,f,y,b,x,v,w,S,k,C,R,P,E,function(e){ra[e?"unshift":"push"](function(){me=e,o(2,me);});},function(t){ia.call(this,e,t);}];}var Hx={util:["resize",/*#__PURE__*/function(_Wa54){function _class8(e){var _this57;_classCallCheck(this,_class8);_this57=_callSuper(this,_class8),Ba(_assertThisInitialized(_this57),e,Nx,_x,nr,{name:29,isActive:0,stores:30,locale:1,resizeMinSize:31,resizeMaxSize:32,resizeAspectRatioLocked:28,resizeEnableButtonLockAspectRatio:33,resizeSizePresetOptions:34,resizeWidthPresetOptions:35,resizeHeightPresetOptions:36,resizeWillRenderFooter:37},null,[-1,-1,-1,-1]);return _this57;}_inherits(_class8,_Wa54);return _createClass(_class8,[{key:"name",get:function get(){return this.$$.ctx[29];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[30];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"resizeMinSize",get:function get(){return this.$$.ctx[31];},set:function set(e){this.$$set({resizeMinSize:e}),fa();}},{key:"resizeMaxSize",get:function get(){return this.$$.ctx[32];},set:function set(e){this.$$set({resizeMaxSize:e}),fa();}},{key:"resizeAspectRatioLocked",get:function get(){return this.$$.ctx[28];},set:function set(e){this.$$set({resizeAspectRatioLocked:e}),fa();}},{key:"resizeEnableButtonLockAspectRatio",get:function get(){return this.$$.ctx[33];},set:function set(e){this.$$set({resizeEnableButtonLockAspectRatio:e}),fa();}},{key:"resizeSizePresetOptions",get:function get(){return this.$$.ctx[34];},set:function set(e){this.$$set({resizeSizePresetOptions:e}),fa();}},{key:"resizeWidthPresetOptions",get:function get(){return this.$$.ctx[35];},set:function set(e){this.$$set({resizeWidthPresetOptions:e}),fa();}},{key:"resizeHeightPresetOptions",get:function get(){return this.$$.ctx[36];},set:function set(e){this.$$set({resizeHeightPresetOptions:e}),fa();}},{key:"resizeWillRenderFooter",get:function get(){return this.$$.ctx[37];},set:function set(e){this.$$set({resizeWillRenderFooter:e}),fa();}}]);}(Wa)]};function jx(e){var t,_o208;return t=new px({props:{stores:e[3],locale:e[4],isActive:e[0],isActiveFraction:e[1],isVisible:e[2],mapScreenPointToImagePoint:e[10],mapImagePointToScreenPoint:e[9],enableMultiSelect:e[6],utilKey:"redact",imageRotation:e[11],imageFlipX:e[8],imageFlipY:e[7],shapes:e[12],toolbar:["rect"],toolShapes:{rectangle:[{x:0,y:0,width:0,height:0}]},toolActive:"rectangle",parentRect:e[14],enablePresetDropImage:!1,enablePresetSelectImage:!1,willStartInteraction:e[5],hooks:{willRenderShapeControls:e[25]}}}),t.$on("measure",e[26]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o208=!0;},p:function p(e,_ref515){var _ref516=_slicedToArray(_ref515,1),o=_ref516[0];var 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]),1024&o&&(i.mapScreenPointToImagePoint=e[10]),512&o&&(i.mapImagePointToScreenPoint=e[9]),64&o&&(i.enableMultiSelect=e[6]),2048&o&&(i.imageRotation=e[11]),256&o&&(i.imageFlipX=e[8]),128&o&&(i.imageFlipY=e[7]),32&o&&(i.willStartInteraction=e[5]),t.$set(i);},i:function i(e){_o208||(ka(t.$$.fragment,e),_o208=!0);},o:function o(e){Ca(t.$$.fragment,e),_o208=!1;},d:function d(e){Oa(t,e);}};}function Ux(e,t,o){var i,n,r,a,s,l,c,d,u;var h=t.isActive,p=t.isActiveFraction,m=t.isVisible,$=t.stores,_t$locale9=t.locale,g=_t$locale9===void 0?{}:_t$locale9,f=t.markupEditorWillStartInteraction,y=t.enableMultiSelect;var _$11=$,b=_$11.imageRedaction,x=_$11.rootRect,v=_$11.imageSize,w=_$11.imageRotation,S=_$11.imageFlipX,k=_$11.imageFlipY,C=_$11.imageTransforms,T=_$11.imageTransformsInterpolated;sr(e,x,function(e){return o(24,d=e);}),sr(e,v,function(e){return o(23,c=e);}),sr(e,w,function(e){return o(11,u=e);}),sr(e,S,function(e){return o(8,a=e);}),sr(e,k,function(e){return o(7,r=e);}),sr(e,C,function(e){return o(22,l=e);}),sr(e,T,function(e){return o(21,s=e);});return e.$$set=function(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,$=e.stores),"locale"in e&&o(4,g=e.locale),"markupEditorWillStartInteraction"in e&&o(5,f=e.markupEditorWillStartInteraction),"enableMultiSelect"in e&&o(6,y=e.enableMultiSelect);},e.$$.update=function(){31457664&e.$$.dirty&&o(10,i=function i(e){return $x(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r);}),31457664&e.$$.dirty&&o(9,n=function n(e){return mx(e,d,c,s.origin,s.translation,l.rotation.z,s.scale,a,r);});},[h,p,m,$,g,f,y,r,a,n,i,u,b,x,v,w,S,k,C,T,"redact",s,l,c,d,function(e){var t=Gm(e[0]);return Jm("to-front",t),e;},function(t){ia.call(this,e,t);}];}var Gx={util:["redact",/*#__PURE__*/function(_Wa55){function _class9(e){var _this58;_classCallCheck(this,_class9);_this58=_callSuper(this,_class9),Ba(_assertThisInitialized(_this58),e,Ux,jx,nr,{name:20,isActive:0,isActiveFraction:1,isVisible:2,stores:3,locale:4,markupEditorWillStartInteraction:5,enableMultiSelect:6});return _this58;}_inherits(_class9,_Wa55);return _createClass(_class9,[{key:"name",get:function get(){return this.$$.ctx[20];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"isActiveFraction",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({isActiveFraction:e}),fa();}},{key:"isVisible",get:function get(){return this.$$.ctx[2];},set:function set(e){this.$$set({isVisible:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[3];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[4];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"markupEditorWillStartInteraction",get:function get(){return this.$$.ctx[5];},set:function set(e){this.$$set({markupEditorWillStartInteraction:e}),fa();}},{key:"enableMultiSelect",get:function get(){return this.$$.ctx[6];},set:function set(e){this.$$set({enableMultiSelect:e}),fa();}}]);}(Wa),function(_ref517){var e=_ref517.src;return e&&!Os(e);}]};function Zx(e){var t,o,i=(M(e[32].label)?e[32].label(e[1]):e[32].label)+"";return {c:function c(){t=Rr("span"),o=Er(i);},m:function m(e,i){Tr(e,t,i),Sr(t,o);},p:function p(e,t){2&t[0]|2&t[1]&&i!==(i=(M(e[32].label)?e[32].label(e[1]):e[32].label)+"")&&Wr(o,i);},d:function d(e){e&&Mr(t);}};}function Xx(e){var t,o,i,n=(e[11](e[32].value)||"")+"",r=e[32].label&&Zx(e);return {c:function c(){t=Rr("div"),o=new Nr(!1),i=Ir(),r&&r.c(),o.a=i,Dr(t,"slot","option");},m:function m(e,a){Tr(e,t,a),o.m(n,t),Sr(t,i),r&&r.m(t,null);},p:function p(e,i){2&i[1]&&n!==(n=(e[11](e[32].value)||"")+"")&&o.p(n),e[32].label?r?r.p(e,i):(r=Zx(e),r.c(),r.m(t,null)):r&&(r.d(1),r=null);},d:function d(e){e&&Mr(t),r&&r.d();}};}function Yx(e){var t,_o209;return t=new Xu({props:{locale:e[1],class:"PinturaControlList",layout:"row",options:e[2],selectedIndex:e[4],onchange:e[10],$$slots:{option:[Xx,function(_ref518){var e=_ref518.option;return {32:e};},function(_ref519){var e=_ref519.option;return [0,e?2:0];}]},$$scope:{ctx:e}}}),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o209=!0;},p:function p(e,o){var 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]|6&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o209||(ka(t.$$.fragment,e),_o209=!0);},o:function o(e){Ca(t.$$.fragment,e),_o209=!1;},d:function d(e){Oa(t,e);}};}function qx(e){var t,_o210,_i138;return _o210=new Ad({props:{elasticity:e[5],$$slots:{default:[Yx]},$$scope:{ctx:e}}}),{c:function c(){t=Rr("div"),Fa(_o210.$$.fragment),Dr(t,"slot","footer"),Dr(t,"style",e[3]);},m:function m(e,n){Tr(e,t,n),Da(_o210,t,null),_i138=!0;},p:function p(e,n){var r={};32&n[0]&&(r.elasticity=e[5]),22&n[0]|4&n[1]&&(r.$$scope={dirty:n,ctx:e}),_o210.$set(r),(!_i138||8&n[0])&&Dr(t,"style",e[3]);},i:function i(e){_i138||(ka(_o210.$$.fragment,e),_i138=!0);},o:function o(e){Ca(_o210.$$.fragment,e),_i138=!1;},d:function d(e){e&&Mr(t),Oa(_o210);}};}function Kx(e){var t,_o211;return t=new Cf({props:{$$slots:{footer:[qx]},$$scope:{ctx:e}}}),t.$on("measure",e[22]),{c:function c(){Fa(t.$$.fragment);},m:function m(e,i){Da(t,e,i),_o211=!0;},p:function p(e,o){var i={};62&o[0]|4&o[1]&&(i.$$scope={dirty:o,ctx:e}),t.$set(i);},i:function i(e){_o211||(ka(t.$$.fragment,e),_o211=!0);},o:function o(e){Ca(t.$$.fragment,e),_o211=!1;},d:function d(e){Oa(t,e);}};}function Jx(e,t,o){var i,n,r,a,s,l,c,d,u,h,p=Kn,m=function m(){return p(),p=rr($,function(e){return o(17,l=e);}),$;};e.$$.on_destroy.push(function(){return p();});var $=t.isActive;m();var g=t.stores,_t$locale10=t.locale,f=_t$locale10===void 0?{}:_t$locale10,_t$fillOptions=t.fillOptions,y=_t$fillOptions===void 0?[]:_t$fillOptions;var b=function b(e){return e.map(function(e){return function(e){return Do(e)&&T(e[0])&&Do(e[1]);}(e)?[e[0],b(e[1]),e[2]]:function(e){return [Array.isArray(e)&&3===e.length?[].concat(_toConsumableArray(e),[1]):e,void 0,{disabled:!1}];}(e);});},x=oa("elasticityMultiplier");sr(e,x,function(e){return o(21,h=e);});var _g9=g,v=_g9.history,w=_g9.animation,S=_g9.scrollElasticity,k=_g9.imageBackgroundColor,C=_g9.imageBackgroundImage,M=_g9.allowPan,R=_g9.allowZoom,P=_g9.allowZoomControls,E=_g9.allowPlayPause;sr(e,w,function(e){return o(18,c=e);}),sr(e,k,function(e){return o(20,u=e);}),sr(e,C,function(e){return o(19,d=e);});var I=uc(c?20:0);return sr(e,I,function(e){return o(16,s=e);}),e.$$set=function(e){"isActive"in e&&m(o(0,$=e.isActive)),"stores"in e&&o(14,g=e.stores),"locale"in e&&o(1,f=e.locale),"fillOptions"in e&&o(15,y=e.fillOptions);},e.$$.update=function(){32768&e.$$.dirty[0]&&o(2,i=b(y)),131072&e.$$.dirty[0]&&M.set(l),131072&e.$$.dirty[0]&&R.set(l),131072&e.$$.dirty[0]&&P.set(l),131072&e.$$.dirty[0]&&l&&E.set(!0),2097152&e.$$.dirty[0]&&o(5,n=h*S),1572868&e.$$.dirty[0]&&o(4,r=i.findIndex(function(_ref520){var _ref521=_slicedToArray(_ref520,1),e=_ref521[0];return d?e===d:Array.isArray(e)?ps(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(".concat(s,"px)"):void 0);},[$,f,i,a,r,n,x,w,k,C,function(_ref522){var e=_ref522.value;T(e)&&($r(k,u=void 0,u),$r(C,d=e,d)),Do(e)&&($r(k,u=e,u),$r(C,d=void 0,d)),v.write();},function(e){if(T(e))return "<div class=\"PinturaFillTile\"><img src=\"".concat(e,"\" alt=\"\" width=\"48\" height=\"64\"/></div>");if(Do(e)){var _e$map5=e.map(function(e,t){return t<3?Math.round(255*e):e;}),_e$map6=_slicedToArray(_e$map5,4),_t162=_e$map6[0],_o212=_e$map6[1],_i139=_e$map6[2],_n64=_e$map6[3];return "<div class=\"PinturaFillTile\" data-transparent=\"".concat(_n64<1,"\"><div style=\"background-color:rgba(").concat(_t162,",").concat(_o212,",").concat(_i139,",").concat(_n64,")\"></div></div>");}return "<div></div>";},I,"fill",g,y,s,l,c,d,u,h,function(t){ia.call(this,e,t);}];}var Qx={util:["fill",/*#__PURE__*/function(_Wa56){function _class10(e){var _this59;_classCallCheck(this,_class10);_this59=_callSuper(this,_class10),Ba(_assertThisInitialized(_this59),e,Jx,Kx,nr,{name:13,isActive:0,stores:14,locale:1,fillOptions:15},null,[-1,-1]);return _this59;}_inherits(_class10,_Wa56);return _createClass(_class10,[{key:"name",get:function get(){return this.$$.ctx[13];}},{key:"isActive",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({isActive:e}),fa();}},{key:"stores",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({stores:e}),fa();}},{key:"locale",get:function get(){return this.$$.ctx[1];},set:function set(e){this.$$set({locale:e}),fa();}},{key:"fillOptions",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({fillOptions:e}),fa();}}]);}(Wa),function(_ref523){var e=_ref523.src,t=_ref523.fillOptions;return e&&!Os(e)&&t&&t.length;}]};var iv='<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>',nv='<path fill="none" d="M9 15 L12 9 L15 15 M10 13.5 h3" stroke="currentColor" stroke-width=".125em"/>';var rv={labelReset:"Reset",labelDefault:"Default",labelAuto:"Auto",labelNone:"None",labelEdit:"Edit",labelClose:"Close",labelSupportError:function labelSupportError(e){return 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:iv,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:iv,statusLabelLoadImage:function statusLabelLoadImage(e){return 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:function 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;";}};var av={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:""+nv,shapeIconButtonTextLayoutAutoHeight:'<g fill="currentColor"><circle cx="4" cy="12" r="1.5"/><circle cx="20" cy="12" r="1.5"/></g>'+nv,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>'+nv,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",shapeTitleTextOutline:"Text outline",shapeTitleTextOutlineWidth:"Width",shapeTitleTextShadow:"Text shadow",shapeTitleTextShadowBlur:"Blur",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="1" y="1" width="22" height="22" rx="4"/></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>',shapeTitleSelectionMode:"Selection mode",shapeTitleBrushSize:"Brush size",shapeLabelSelectionModeNew:"New",shapeLabelSelectionModeAdd:"Add",shapeLabelSelectionModeSubtract:"Remove",shapeLabelToolSelectionBrush:"Brush",shapeLabelToolSelectionLassoo:"Lassoo",shapeLabelToolSelectionRectangle:"Rectangle marquee",shapeLabelToolSelectionEllipse:"Ellipse marquee",shapeIconSelectionModeNew:'<g fill="none" fill-rule="evenodd" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 17H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v1.5"/><rect width="12" height="12" x="9" y="9" fill="currentColor" fill-opacity=".25" rx="2"/></g>',shapeIconSelectionModeAdd:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-8a2 2 0 0 1-2-2v-2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><path d="M13 15h4M15 13v4"/></g>',shapeIconSelectionModeSubtract:'<g fill="none" fill-rule="evenodd" stroke="currentColor"><path fill="currentColor" fill-opacity=".25" stroke-linecap="round" stroke-linejoin="round" d="M15 3a2 2 0 0 1 2 2v4h-6a2 2 0 0 0-1.995 1.85L9 11v6H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h10Z"/><rect width="12" height="12" x="9" y="9" stroke-linecap="round" stroke-linejoin="round" rx="2"/><path d="M13 15h4"/></g>',shapeIconToolSelectionBrush:'<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" fill-rule="evenodd" stroke-linejoin="round"/></g>',shapeIconToolSelectionLassoo:'<g fill="none" fill-rule="evenodd" stroke-width=".125em" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.428 17.702a18.46 18.46 0 0 0 4.085-1.595c5.851-3.112 9.019-8.599 7.074-12.256-1.945-3.657-8.265-4.1-14.116-.988C2.619 5.974-.55 11.46 1.396 15.118c.63 1.186 1.72 2.033 3.105 2.532"/><ellipse cx="8" cy="18.5" rx="3.5" ry="2.833" transform="rotate(-15 8 18.5)"/><path stroke-linecap="round" d="M5 18c3.347 1.048 5.514 1.881 6.5 2.5.859.54 1.517.994 1.5 2.364"/></g>',shapeIconToolSelectionRectangle:'<g stroke-width=".125em" stroke="currentColor"><path d="M9 1 h6 m4 0 h4v4 m0 4 v6 m0 4 v4h-4 m-4 0 h-6 m-4 0 h-4v-4 m0 -4 v-6 m0 -4 v-4h4" fill="none" /></g>',shapeIconToolSelectionEllipse:'<path stroke-width=".125em" stroke="currentColor" d="M1.21 9.853a11.054 11.054 0 0 0 0 4.294m1.643 3.965a11.054 11.054 0 0 0 3.035 3.035m3.965 1.644a11.054 11.054 0 0 0 4.294 0m3.965-1.644a11.054 11.054 0 0 0 3.035-3.035m1.644-3.965a11.054 11.054 0 0 0 0-4.294m-1.644-3.965a11.054 11.054 0 0 0-3.035-3.035m-3.965-1.644a11.054 11.054 0 0 0-4.294 0M5.888 2.853a11.054 11.054 0 0 0-3.035 3.035"/>'};var sv={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:function cropIconSelectPreset(e,t){var _ref525=t?[t<1?1:.3,1===t?.85:.5,t>1?1:.3]:[.2,.3,.4],_ref526=_slicedToArray(_ref525,3),o=_ref526[0],i=_ref526[1],n=_ref526[2];return "<g fill=\"currentColor\">\n <rect opacity=\"".concat(o,"\" x=\"2\" y=\"4\" width=\"10\" height=\"18\" rx=\"1\"/>\n <rect opacity=\"").concat(i,"\" x=\"4\" y=\"8\" width=\"14\" height=\"14\" rx=\"1\"/>\n <rect opacity=\"").concat(n,"\" x=\"6\" y=\"12\" width=\"17\" height=\"10\" rx=\"1\"/>\n </g>");},cropIconCropBoundary:function cropIconCropBoundary(e,t){var _ref527=t?[.3,1,0,0]:[0,0,.3,1],_ref528=_slicedToArray(_ref527,4),o=_ref528[0],i=_ref528[1],n=_ref528[2],r=_ref528[3];return "<g fill=\"currentColor\">\n <rect opacity=\"".concat(o,"\" x=\"2\" y=\"3\" width=\"20\" height=\"20\" rx=\"1\"/>\n <rect opacity=\"").concat(i,"\" x=\"7\" y=\"8\" width=\"10\" height=\"10\" rx=\"1\"/>\n <rect opacity=\"").concat(n,"\" x=\"4\" y=\"8\" width=\"14\" height=\"14\" rx=\"1\"/>\n <rect opacity=\"").concat(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"},lv={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 '},cv={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"},dv={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>'},hv=function hv(e,t){var o=Object.getOwnPropertyDescriptors(e);Object.keys(o).forEach(function(i){o[i].get?Object.defineProperty(t,i,{get:function get(){return e[i];},set:function set(t){return e[i]=t;}}):t[i]=e[i];});},pv=function pv(e){var t={},_Yo7=Yo(),o=_Yo7.sub,i=_Yo7.pub;c()&&null!==document.doctype||console.warn("Browser is in quirks mode, add <!DOCTYPE html> to page to fix render issues");var r=Ts();hv(r,t);var a=function(e,t){var o={},i=new Im({target:e,props:{stores:t,pluginComponents:Array.from(Bm)}});var n=!1;var r=function r(){n||(c()&&window.removeEventListener("pagehide",r),i&&(n=!0,i.$destroy()));};Fm||(Fm=new Set(rd(Im).filter(function(e){return !Lm.includes(e);}))),Fm.forEach(function(e){Object.defineProperty(o,e,{get:function get(){return i[e];},set:zm.includes(e)?function(t){i[e]=_objectSpread2(_objectSpread2({},i[e]),t);}:function(t){return i[e]=t;}});}),Object.defineProperty(o,"previewImageData",{get:function get(){return i.imagePreviewCurrent;}}),Dm.forEach(function(e){var t=Om[e],n=t[0];Object.defineProperty(o,e,{get:function get(){return i.pluginInterface[n][e];},set:function set(o){var n=t.reduce(function(t,n){return t[n]=_objectSpread2(_objectSpread2({},i.pluginOptions[n]),{},_defineProperty({},e,o)),t;},{});i.pluginOptions=_objectSpread2(_objectSpread2({},i.pluginOptions),n);}});}),Object.defineProperty(o,"element",{get:function get(){return i.root;},set:function set(){}});var a=i.history;return es(o,{on:function on(e,t){if(n)return function(){};if(/undo|redo|revert|writehistory/.test(e))return a.on(e,t);var o=[i.sub(e,t),i.$on(e,function(e){return t(e instanceof CustomEvent&&!e.detail?void 0:e);})].filter(Boolean);return function(){return o.forEach(function(e){return e();});};},updateImagePreview:function updateImagePreview(e){i.imagePreviewSrc=e;},close:function close(){return !n&&i.pub("close");},destroy:r}),Object.defineProperty(o,"history",{get:function get(){return {undo:function undo(){return a.undo();},redo:function redo(){return a.redo();},revert:function revert(){return a.revert();},get:function get(){return a.get();},getCollapsed:function getCollapsed(){return a.get().splice(0,a.index+1);},set:function set(e){return a.set(e);},write:function write(e){return a.write(e);},get length(){return a.length();},get index(){return a.index;},set index(e){a.index=e;}};}}),c()&&window.addEventListener("pagehide",r),o;}(e,r.stores);hv(a,t);var s=["loadImage","processImage","abortProcessImage","abortLoadImage"].map(function(e){return a.on(e,function(t){var o=r[e](t&&t.detail);o instanceof Promise&&o.catch(n);});}),l=function l(e,t){var i=o(e,t),n=r.on(e,t),s=a.on(e,t);return function(){i(),n(),s();};};t.handleEvent=n;var d=Vm.map(function(e){return l(e,function(o){return t.handleEvent(e,o);});});return es(t,{on:l,updateImage:function updateImage(e){return new Promise(function(o,i){var n=t.history.get(),a=t.history.index,s=t.imageState;r.loadImage(e).then(function(e){t.history.set(n),t.history.index=a,t.imageState=s,o(e);}).catch(i);});},close:function close(){i("close");},destroy:function destroy(){[].concat(_toConsumableArray(s),_toConsumableArray(d)).forEach(function(e){return e();}),a.destroy(),r.destroy(),i("destroy");}}),setTimeout(function(){return i("init",t);},0),t;};var gv=c()&&/*#__PURE__*/function(_HTMLElement){function _class12(){var _this61;_classCallCheck(this,_class12);_this61=_callSuper(this,_class12),_this61._editor=void 0,_this61._unsubs=void 0;return _this61;}_inherits(_class12,_HTMLElement);return _createClass(_class12,[{key:"attributeChangedCallback",value:function attributeChangedCallback(e,t,o){this[e]=o;}},{key:"connectedCallback",value:function connectedCallback(){this._editor=pv(this),hv(this._editor,this),this._editor.src=this.getAttribute("src"),this._unsubs=_m(this._editor,this);}},{key:"disconnectedCallback",value:function disconnectedCallback(){this._editor.destroy(),this._unsubs.forEach(function(e){return e();});}}],[{key:"observedAttributes",get:function get(){return ["src"];}}]);}(/*#__PURE__*/_wrapNativeSuper(HTMLElement));var fv=function fv(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var o=T(e)?document.querySelector(e):e;if(!Vt(o))return;t.class=t.class?"pintura-editor "+t.class:"pintura-editor";var i=pv(o);return Object.assign(i,t);};var yv=Ra.document,bv=Ra.window;function xv(e){var t,o,i,n;return ha(e[27]),{c:function c(){t=Ir(),o=Rr("div"),Dr(o,"class",e[4]),Dr(o,"style",e[5]);},m:function m(r,a){Tr(r,t,a),Tr(r,o,a),e[28](o),i||(n=[Lr(bv,"keydown",e[10]),Lr(bv,"orientationchange",e[11]),Lr(bv,"resize",e[27]),Lr(yv.body,"focusin",function(){ir(!e[1]&&e[7])&&(!e[1]&&e[7]).apply(this,arguments);}),Lr(yv.body,"focusout",function(){ir(e[2]&&e[8])&&(e[2]&&e[8]).apply(this,arguments);}),Lr(o,"wheel",e[9],{passive:!1})],i=!0);},p:function p(t,i){e=t,16&i[0]&&Dr(o,"class",e[4]),32&i[0]&&Dr(o,"style",e[5]);},i:Kn,o:Kn,d:function d(r){r&&Mr(t),r&&Mr(o),e[28](null),i=!1,or(n);}};}function vv(e,t,o){var i,n,r,a,s,l,d,u;var h=ea();var m=t.root,_t$preventZoomViewpor=t.preventZoomViewport,$=_t$preventZoomViewpor===void 0?!0:_t$preventZoomViewpor,_t$preventScrollBodyI=t.preventScrollBodyIfNeeded,g=_t$preventScrollBodyI===void 0?!0:_t$preventScrollBodyI,_t$preventFooterOverl=t.preventFooterOverlapIfNeeded,f=_t$preventFooterOverl===void 0?!0:_t$preventFooterOverl,y=t.class,b=!0,x=!1,v=!1,w=c()&&document.documentElement,S=c()&&document.body,k=c()&&document.head;var C=uc(0,{precision:.001,damping:.5});sr(e,C,function(e){return o(26,u=e);});var T=C.subscribe(function(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"));});var M=!1,R=void 0,P=void 0,E=void 0;var I=function I(){return document.querySelector("meta[name=viewport]");},A=function A(){return Array.from(document.querySelectorAll("meta[name=theme-color]"));};var L;var z=function z(e,t){var o=function o(){e()?t():requestAnimationFrame(o);};requestAnimationFrame(o);};var F,D,O=0,B=void 0;var W=function W(){D||(D=p("div",{style:"position:fixed;height:100vh;top:0"}),S.append(D));};Kr(function(){f&&fo()&&W();}),Jr(function(){D&&(o(21,B=D.offsetHeight),D.remove(),D=void 0);});var V=void 0;var _=function _(){return w.style.setProperty("--pintura-document-height",window.innerHeight+"px");};return Qr(function(){w.classList.remove("PinturaModalBodyLock"),T();}),e.$$set=function(e){"root"in e&&o(0,m=e.root),"preventZoomViewport"in e&&o(12,$=e.preventZoomViewport),"preventScrollBodyIfNeeded"in e&&o(13,g=e.preventScrollBodyIfNeeded),"preventFooterOverlapIfNeeded"in e&&o(14,f=e.preventFooterOverlapIfNeeded),"class"in e&&o(15,y=e.class);},e.$$.update=function(){67895298&e.$$.dirty[0]&&o(25,i=v||x?u:b?0:1),4096&e.$$.dirty[0]&&(n="width=device-width,height=device-height,initial-scale=1"+($?",maximum-scale=1,user-scalable=0":"")),786434&e.$$.dirty[0]&&o(22,r=!v&&!b&&!x),12&e.$$.dirty[0]&&(M||o(20,F=O)),2097160&e.$$.dirty[0]&&o(24,a=Lo(B)?"--viewport-pad-footer:"+(B>O?0:1):""),51380224&e.$$.dirty[0]&&o(5,s="opacity:".concat(i,";height:").concat(F,"px;--editor-modal:1;").concat(a)),32768&e.$$.dirty[0]&&o(4,l=Bc(["pintura-editor","PinturaModal",y])),8192&e.$$.dirty[0]&&o(23,d=g&&fo()&&/15_/.test(navigator.userAgent)),12582912&e.$$.dirty[0]&&d&&function(e){e?(V=window.scrollY,w.classList.add("PinturaDocumentLock"),_(),window.addEventListener("resize",_)):(window.removeEventListener("resize",_),w.classList.remove("PinturaDocumentLock"),Lo(V)&&window.scrollTo(0,V),V=void 0);}(r);},[m,b,M,O,l,s,C,function(e){ou(e.target)&&(o(2,M=!0),L=O);},function(e){if(ou(e.target))if(clearTimeout(undefined),L===O)o(2,M=!1);else {var _e8=O;z(function(){return O!==_e8;},function(){return o(2,M=!1);});}},function(e){e.target&&/PinturaStage/.test(e.target.className)&&e.preventDefault();},function(e){var t=e.key;if(!/escape/i.test(t))return;var o=e.target;if(o&&/input|textarea/i.test(o.nodeName))return;var i=document.querySelectorAll(".PinturaModal");i[i.length-1]===m&&h("close");},W,$,g,f,y,function(){if(v||!b)return;o(19,v=!0);var e=I()||p("meta",{name:"viewport"});R=!R&&e.getAttribute("content"),e.setAttribute("content",n+(/cover/.test(R)?",viewport-fit=cover":"")),e.parentNode||k.append(e);var t=getComputedStyle(m).getPropertyValue("--color-background"),i=A();if(i.length)P=i.map(function(e){return e.getAttribute("content");});else {var _e28=p("meta",{name:"theme-color"});k.append(_e28),i.push(_e28);}i.forEach(function(e){return e.setAttribute("content","rgb(".concat(t,")"));}),clearTimeout(E),E=setTimeout(function(){return C.set(1);},250);},function(){if(x||b)return;clearTimeout(E),o(18,x=!0);var e=I();R?e.setAttribute("content",R):e.remove();var t=A();P?t.forEach(function(e,t){e.setAttribute("content",P[t]);}):t.forEach(function(e){return e.remove();}),C.set(0);},x,v,F,B,r,d,a,i,u,function(){o(3,O=bv.innerHeight);},function(e){ra[e?"unshift":"push"](function(){m=e,o(0,m);});}];}var wv=/*#__PURE__*/function(_Wa58){function wv(e){var _this62;_classCallCheck(this,wv);_this62=_callSuper(this,wv),Ba(_assertThisInitialized(_this62),e,vv,xv,nr,{root:0,preventZoomViewport:12,preventScrollBodyIfNeeded:13,preventFooterOverlapIfNeeded:14,class:15,show:16,hide:17},null,[-1,-1]);return _this62;}_inherits(wv,_Wa58);return _createClass(wv,[{key:"root",get:function get(){return this.$$.ctx[0];},set:function set(e){this.$$set({root:e}),fa();}},{key:"preventZoomViewport",get:function get(){return this.$$.ctx[12];},set:function set(e){this.$$set({preventZoomViewport:e}),fa();}},{key:"preventScrollBodyIfNeeded",get:function get(){return this.$$.ctx[13];},set:function set(e){this.$$set({preventScrollBodyIfNeeded:e}),fa();}},{key:"preventFooterOverlapIfNeeded",get:function get(){return this.$$.ctx[14];},set:function set(e){this.$$set({preventFooterOverlapIfNeeded:e}),fa();}},{key:"class",get:function get(){return this.$$.ctx[15];},set:function set(e){this.$$set({class:e}),fa();}},{key:"show",get:function get(){return this.$$.ctx[16];}},{key:"hide",get:function get(){return this.$$.ctx[17];}}]);}(Wa);var Sv=function Sv(e,t,o,i){var n=he(t.x-e.x,t.y-e.y),r=ye(n),a=5*o;var s;s=i?.5*a:Math.ceil(.5*(a-1));var l=Ce(me(r),s);return {anchor:me(e),offset:l,normal:r,solid:i,size:a,sizeHalf:s};},kv=function kv(e,t,o){var i=e.strokeWidth,n=e.strokeColor,r=e.strokeJoin,a=e.strokeCap,s=_objectWithoutProperties(e,_excluded5),l=t.anchor,c=t.offset,d=t.normal,u=t.solid,h=t.size,p=t.sizeHalf,m=l.x,$=l.y,g=Ce(me(d),h),f=he(m+g.x,$+g.y);if(Ce(g,.55),u){we(o,c);var _e38=Ce(me(d),.5*p);return [_objectSpread2(_objectSpread2({},s),{},{points:[he(m-_e38.x,$-_e38.y),he(f.x-g.y,f.y+g.x),he(f.x+g.y,f.y-g.x)],pathClose:!0,backgroundColor:n})];}{var _e78=Ce(function(e){var t=e.x;return e.x=-e.y,e.y=t,e;}(me(d)),.5),_t101=he(m-_e78.x,$-_e78.y),_o115=he(m+_e78.x,$+_e78.y);return [_objectSpread2(_objectSpread2({},s),{},{points:[he(f.x+g.y,f.y-g.x),_t101,he(m,$),_o115,he(f.x-g.y,f.y+g.x)],pathClose:!1,strokeWidth:i,strokeColor:n,strokeJoin:r,strokeCap:a})];}},Cv=function Cv(e,t,o){var i=e.strokeWidth,n=e.strokeColor,r=_objectWithoutProperties(e,_excluded6),a=t.anchor,s=t.solid,l=t.offset,c=t.normal,d=t.sizeHalf;return we(o,l),s&&we(o,$e(me(c))),[_objectSpread2(_objectSpread2({},r),{},{x:a.x,y:a.y,rx:d,ry:d,backgroundColor:s?n:void 0,strokeWidth:s?void 0:i,strokeColor:s?void 0:n})];},Tv=function Tv(e,t){var o=e.strokeWidth,i=e.strokeColor,n=e.strokeJoin,r=e.strokeCap,a=_objectWithoutProperties(e,_excluded7),s=t.anchor,l=t.offset;return [_objectSpread2(_objectSpread2({},a),{},{points:[he(s.x-l.y,s.y+l.x),he(s.x+l.y,s.y-l.x)],strokeWidth:o,strokeColor:i,strokeJoin:n,strokeCap:r})];},Mv=function Mv(e,t,o){var i=e.strokeWidth,n=e.strokeColor,r=_objectWithoutProperties(e,_excluded8),a=t.anchor,s=t.solid,l=t.offset,c=t.normal,d=t.sizeHalf;return we(o,l),[_objectSpread2(_objectSpread2({},r),{},{x:a.x-d,y:a.y-d,width:2*d,height:2*d,rotation:(u=c,Math.atan2(u.y,u.x)),backgroundColor:s?n:void 0,strokeWidth:s?void 0:i,strokeColor:s?void 0:n})];var u;},Rv=function Rv(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(t){if(!t.lineStart&&!t.lineEnd)return;var o=[],i=t.x1,n=t.y1,r=t.x2,a=t.y2,s=t.lineStart,l=t.lineEnd,c=t.strokeWidth,d=t.strokeColor,u=t.strokeJoin,h=t.strokeCap,p=t.strokeDash,m=t.bitmap,$=t.aboveFrame,g=t.opacity,f=he(i,n),y=he(r,a),b=[f,y],x={bitmap:m,aboveFrame:$,opacity:g,strokeColor:d,strokeWidth:c,strokeJoin:u,strokeCap:h};if(s){var _s$split3=s.split("-"),_s$split4=_slicedToArray(_s$split3,2),_t103=_s$split4[0],_i141=_s$split4[1],_n65=e[_t103];if(_n65){var _e127=Sv(f,y,c,!!_i141);o.push.apply(o,_toConsumableArray(_n65(x,_e127,f)));}}if(l){var _l$split3=l.split("-"),_l$split4=_slicedToArray(_l$split3,2),_t105=_l$split4[0],_i142=_l$split4[1],_n66=e[_t105];if(_n66){var _e141=Sv(y,f,c,!!_i142);o.push.apply(o,_toConsumableArray(_n66(x,_e141,y)));}}return [_objectSpread2(_objectSpread2({},x),{},{strokeDash:p,points:b})].concat(o);};},Pv=function Pv(){return {arrow:kv,circle:Cv,square:Mv,bar:Tv};},Ev=function Ev(e,t){var o=parseFloat(e)*t;return T(e)?o+"%":o;},Iv=function Iv(e,t){return T(e)?cn(e,t):e;},Av=function Av(e){return [_objectSpread2(_objectSpread2({},e),{},{frameStyle:"line",frameInset:0,frameOffset:0,frameSize:e.frameSize?Ev(e.frameSize,2):"2.5%",frameRadius:e.frameRound?Ev(e.frameSize,2):0})];},Lv=function Lv(_ref461,_ref529){var e=_ref461.width,t=_ref461.height,o=_ref461.frameImage,_ref461$frameSize=_ref461.frameSize,i=_ref461$frameSize===void 0?"15%":_ref461$frameSize,_ref461$frameOutset=_ref461.frameOutset,n=_ref461$frameOutset===void 0?0:_ref461$frameOutset,_ref461$frameSlices=_ref461.frameSlices,r=_ref461$frameSlices===void 0?{x1:.15,y1:.15,x2:.85,y2:.85}:_ref461$frameSlices;var a=_ref529.isPreview;if(!o)return [];var s=Math.sqrt(e*t),l=Iv(i,s),c=a?l:Math.round(l),d=c,u=Iv(n,s),h=2*u,p=r.x1,m=r.x2,$=r.y1,g=r.y2,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:$},{x:p,y:$}],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:g},{x:m,y:g},{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:$},{x:p,y:$},{x:p,y:g},{x:0,y:g}],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:$},{x:1,y:$},{x:1,y:g},{x:m,y:g}],backgroundImage:o},_objectSpread2(_objectSpread2({},v),{},{x:f.x0-u,y:f.y0-u,backgroundCorners:[{x:0,y:0},{x:p,y:0},{x:p,y:$},{x:0,y:$}]}),_objectSpread2(_objectSpread2({},v),{},{x:f.x2+u,y:f.y0-u,backgroundCorners:[{x:m,y:0},{x:1,y:0},{x:1,y:$},{x:m,y:$}]}),_objectSpread2(_objectSpread2({},v),{},{x:f.x2+u,y:f.y2+u,backgroundCorners:[{x:m,y:g},{x:1,y:g},{x:1,y:1},{x:m,y:1}]}),_objectSpread2(_objectSpread2({},v),{},{x:f.x0-u,y:f.y2+u,backgroundCorners:[{x:0,y:g},{x:p,y:g},{x:p,y:1},{x:0,y:1}]})];},zv=function zv(_ref530,_ref531){var e=_ref530.x,t=_ref530.y,o=_ref530.width,i=_ref530.height,_ref530$frameInset=_ref530.frameInset,n=_ref530$frameInset===void 0?"3.5%":_ref530$frameInset,_ref530$frameSize=_ref530.frameSize,r=_ref530$frameSize===void 0?".25%":_ref530$frameSize,_ref530$frameColor=_ref530.frameColor,a=_ref530$frameColor===void 0?[1,1,1]:_ref530$frameColor,_ref530$frameOffset=_ref530.frameOffset,s=_ref530$frameOffset===void 0?"5%":_ref530$frameOffset,_ref530$frameAmount=_ref530.frameAmount,l=_ref530$frameAmount===void 0?1:_ref530$frameAmount,_ref530$frameRadius=_ref530.frameRadius,c=_ref530$frameRadius===void 0?0:_ref530$frameRadius,_ref530$expandsCanvas=_ref530.expandsCanvas,d=_ref530$expandsCanvas===void 0?!1:_ref530$expandsCanvas;var u=_ref531.isPreview;var h=Math.sqrt(o*i);var p=Iv(r,h);var m=Iv(n,h),$=Iv(s,h);var g=0;u||(p=Math.max(1,Math.round(p)),g=p%2==0?0:.5);var f=Iv(Ev(c,l),h);return new Array(l).fill(void 0).map(function(n,r){var s=$*r;var 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+g,y:c+g,width:h-l,height:y-c,cornerRadius:f>0?f-s:0,strokeWidth:p,strokeColor:a,expandsCanvas:d};});},Fv=function Fv(_ref532,_ref533){var e=_ref532.x,t=_ref532.y,o=_ref532.width,i=_ref532.height,_ref532$frameSize=_ref532.frameSize,n=_ref532$frameSize===void 0?".25%":_ref532$frameSize,_ref532$frameOffset=_ref532.frameOffset,r=_ref532$frameOffset===void 0?0:_ref532$frameOffset,_ref532$frameInset=_ref532.frameInset,a=_ref532$frameInset===void 0?"2.5%":_ref532$frameInset,_ref532$frameColor=_ref532.frameColor,s=_ref532$frameColor===void 0?[1,1,1]:_ref532$frameColor;var l=_ref533.isPreview;var c=Math.sqrt(o*i);var d=Iv(n,c),u=Iv(a,c),h=Iv(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);var m=h-u,$=e+u+p,g=t+u+p,f=e+o-u-p,y=t+i-u-p;return [{points:[he($+m,g),he(f-m,g)]},{points:[he(f,g+m),he(f,y-m)]},{points:[he(f-m,y),he($+m,y)]},{points:[he($,y-m),he($,g+m)]}].map(function(e){return e.strokeWidth=d,e.strokeColor=s,e;});},Dv=function Dv(_ref534,_ref535){var e=_ref534.x,t=_ref534.y,o=_ref534.width,i=_ref534.height,_ref534$frameSize=_ref534.frameSize,n=_ref534$frameSize===void 0?".25%":_ref534$frameSize,_ref534$frameInset=_ref534.frameInset,r=_ref534$frameInset===void 0?"2.5%":_ref534$frameInset,_ref534$frameLength=_ref534.frameLength,a=_ref534$frameLength===void 0?"2.5%":_ref534$frameLength,_ref534$frameColor=_ref534.frameColor,s=_ref534$frameColor===void 0?[1,1,1]:_ref534$frameColor;var l=_ref535.isPreview;var c=Math.sqrt(o*i);var d=Iv(n,c),u=Iv(r,c),h=Iv(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);var m=e+u+p,$=t+u+p,g=e+o-u-p,f=t+i-u-p;return [{points:[he(m,$+h),he(m,$),he(m+h,$)]},{points:[he(g-h,$),he(g,$),he(g,$+h)]},{points:[he(g,f-h),he(g,f),he(g-h,f)]},{points:[he(m+h,f),he(m,f),he(m,f-h)]}].map(function(e){return e.strokeWidth=d,e.strokeColor=s,e;});},Ov=function Ov(_ref536,_ref537){var e=_ref536.x,t=_ref536.y,o=_ref536.width,i=_ref536.height,_ref536$frameColor=_ref536.frameColor,n=_ref536$frameColor===void 0?[1,1,1]:_ref536$frameColor;var r=_ref537.isPreview;var a=Math.sqrt(o*i),s=.1*a;var l=.2*a,c=0;var 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);},Bv=function Bv(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return function(t,o){if(!Fo(t,"frameStyle"))return;var i=t.frameStyle,n=e[i];if(!n)return;var r=t.frameStyle,a=_objectWithoutProperties(t,_excluded9);return n(a,o);};},Wv=function Wv(){return {solid:Av,hook:Dv,line:zv,edge:Fv,polaroid:Ov,nine:Lv};},Vv=function Vv(e){var t=function t(o){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{isPreview:!0};var n=e.map(function(e){var n=e(o,i);if(n)return n.map(function(e){return t(e,i);});}).filter(Boolean).flat();return n.length?n.flat().map(function(e,t){return e.id=o.id+"_"+t,e;}):o;};return t;};"undefined"!=typeof window&&function(e){if(!e)return;var _map7=[[108,111,99,97,116,105,111,110],[82,101,103,69,120,112],[116,101,115,116],[112,113,105,110,97,92,46,110,108]].map(function(e){return e.map(function(e){return String.fromCharCode(e);}).join("");}),_map8=_slicedToArray(_map7,4),t=_map8[0],o=_map8[1],i=_map8[2],n=_map8[3];e._4pf3wm7=new e[o](n)[i](e[t]);}(window);var _v=pl,Nv=$l,jv=function jv(){return {read:s,apply:w};},Uv=function Uv(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=e.blurAmount,o=e.dataSizeScalar,i=e.scrambleAmount,n=e.backgroundColor;return function(e,r){return function(){var _ref538=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee58(e){var t,o,i,_t$dataSize,n,_t$dataSizeScalar,r,_t$scrambleAmount,a,_t$blurAmount,s,_t$outputFormat,l,_t$backgroundColor,c,d,u,h,m,f,y,_t124,b,x,_e163,v,_e165,_t126,_o136,_args2=arguments;return _regeneratorRuntime().wrap(function _callee58$(_context59){while(1)switch(_context59.prev=_context59.next){case 0:t=_args2.length>1&&_args2[1]!==undefined?_args2[1]:{};if(e){_context59.next=3;break;}return _context59.abrupt("return");case 3:o=e.width,i=e.height,_t$dataSize=t.dataSize,n=_t$dataSize===void 0?96:_t$dataSize,_t$dataSizeScalar=t.dataSizeScalar,r=_t$dataSizeScalar===void 0?1:_t$dataSizeScalar,_t$scrambleAmount=t.scrambleAmount,a=_t$scrambleAmount===void 0?4:_t$scrambleAmount,_t$blurAmount=t.blurAmount,s=_t$blurAmount===void 0?6:_t$blurAmount,_t$outputFormat=t.outputFormat,l=_t$outputFormat===void 0?"canvas":_t$outputFormat,_t$backgroundColor=t.backgroundColor,c=_t$backgroundColor===void 0?[0,0,0]:_t$backgroundColor,d=Math.round(n*r),u=Math.min(d/o,d/i),h=Math.floor(o*u),m=Math.floor(i*u),f=p("canvas",{width:h,height:m}),y=f.getContext("2d",{willReadFrequently:!0});if(c.length=3,y.fillStyle=jo(c),y.fillRect(0,0,h,m),g(e)){_t124=p("canvas",{width:o,height:i});_t124.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),y.drawImage(_t124,0,0,h,m),$(_t124);}else y.drawImage(e,0,0,h,m);b=y.getImageData(0,0,h,m),x=[];if(a>0&&x.push([nc,{amount:a}]),s>0)for(_e163=0;_e163<s;_e163++)x.push([Ro,{matrix:rc}]);if(!x.length){_context59.next=16;break;}_e165=function _e165(t,o){return "(err, imageData) => {\n(".concat(t[o][0].toString(),")(Object.assign({ imageData: imageData }, filterInstructions[").concat(o,"]), \n").concat(t[o+1]?_e165(t,o+1):"done",")\n}");};_t126="function (options, done) {\nconst filterInstructions = options.filterInstructions;\nconst imageData = options.imageData;\n(".concat(_e165(x,0),")(null, imageData)\n}");_context59.next=12;return L(_t126,[{imageData:b,filterInstructions:x.map(function(e){return e[1];})}],[b.data.buffer]);case 12:_o136=_context59.sent;v=Co(_o136);_context59.next=17;break;case 16:v=b;case 17:return _context59.abrupt("return","canvas"===l?(y.putImageData(v,0,0),f):v);case 18:case"end":return _context59.stop();}},_callee58);}));return function(_x112){return _ref538.apply(this,arguments);};}()(e,_objectSpread2(_objectSpread2({blurAmount:t,scrambleAmount:i,backgroundColor:n},r),{},{dataSizeScalar:o||r.dataSizeScalar}));};},qv=lf,Qv={markupEditorToolbar:dg(),markupEditorToolStyles:lg(),markupEditorShapeStyleControls:lf()},tw=xy,ow=My,iw=Fy,nw=bx,rw=wx,aw=Cx,sw=Ix,lw=Gx,cw=Hx,dw=Qx,hw=z$,pw=f$,mw=j$,$w=rv,gw=av,fw=sv,yw=lv,bw={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"},xw={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"},vw={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:function resizeIconButtonMaintainAspectRatio(e,t){return "<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 ".concat(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>");}},ww={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>'},Sw={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>'},kw={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>'},Cw=cv,Tw=dv,Pw=fv,Ew=function Ew(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments.length>1?arguments[1]:undefined;var _Yo8=Yo(),o=_Yo8.sub,i=_Yo8.pub,r={},a=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments.length>1?arguments[1]:undefined;return new wv({target:t||document.body,props:{class:e.class,preventZoomViewport:e.preventZoomViewport,preventScrollBodyIfNeeded:e.preventScrollBodyIfNeeded,preventFooterOverlapIfNeeded:e.preventFooterOverlapIfNeeded}});}(e,t),s=function s(){a.hide&&a.hide();},l=function l(){a.show&&a.show();},c=pv(a.root);hv(c,r),r.handleEvent=n,c.handleEvent=function(e,t){if("init"===e)return r.handleEvent(e,r);r.handleEvent(e,t);},c.on("close",/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee59(){var t;return _regeneratorRuntime().wrap(function _callee59$(_context60){while(1)switch(_context60.prev=_context60.next){case 0:t=e.willClose;if(t){_context60.next=3;break;}return _context60.abrupt("return",s());case 3:_context60.next=5;return t();case 5:_context60.t0=_context60.sent;if(!_context60.t0){_context60.next=8;break;}s();case 8:case"end":return _context60.stop();}},_callee59);})));var d=function d(e,t){return /show|hide/.test(e)?o(e,t):c.on(e,t);},u=["show","hide"].map(function(e){return d(e,function(t){return r.handleEvent(e,t);});}),h=function h(){u.forEach(function(e){return e();}),s(),a.$destroy(),c.destroy();};return es(r,{on:d,destroy:h,hide:s,show:l}),Object.defineProperty(r,"modal",{get:function get(){return a.root;},set:function set(){}}),a.$on("close",c.close),a.$on("show",function(){return i("show");}),a.$on("hide",function(){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(r,e),r;},Iw=function Iw(e,t){return fv(e,_objectSpread2(_objectSpread2({},t),{},{layout:"overlay"}));},zw=function zw(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return Vv([Bv(Wv()),Rv(Pv())].concat(_toConsumableArray(e)));},Fw=function Fw(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t,o=void 0;Array.isArray(e.imageReader)||(o=e.imageReader,delete e.imageReader),Array.isArray(e.imageWriter)?t=Nv():(t=M(e.imageWriter)?e.imageWriter:Nv(e.imageWriter),delete e.imageWriter);var i=void 0;return M(e.imageScrambler)||(i=e.imageScrambler,delete e.imageScrambler),{imageReader:_v(o),imageWriter:t,imageOrienter:jv(),imageScrambler:Uv(i)};},Ow=function Ow(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};Wm(tw,ow,iw,nw,rw,aw,sw,lw,cw,dw);var t=Fw(e),o=_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},$w),gw),fw),yw),bw),xw),Cw),Tw),vw),ww),Sw),kw),e.locale);delete e.locale;var i="function"==typeof e.shapePreprocessor?e.shapePreprocessor:zw(e.shapePreprocessor);if(delete e.shapePreprocessor,e.markupEditorShapeStyleControls){Object.entries(e.markupEditorShapeStyleControls).every(function(_ref542){var _ref543=_slicedToArray(_ref542,2),e=_ref543[0],t=_ref543[1];return /Options$/.test(e)||!Array.isArray(t);})&&(e.markupEditorShapeStyleControls=qv(_objectSpread2({},e.markupEditorShapeStyleControls)));}return ja([_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},t),{},{shapePreprocessor:i,utils:["trim","crop","filter","finetune","retouch","annotate","decorate","sticker","fill","frame","redact","resize"]},hw),pw),mw),Qv),{},{stickerStickToImage:!0,locale:o}),e]);};
13
+
14
+ export { Pw as appendEditor, U as blobToFile, B as canvasToBlob, Zh as colorStringToColorArray, Wv as createDefaultFrameStyles, jv as createDefaultImageOrienter, _v as createDefaultImageReader, Uv as createDefaultImageScrambler, Nv as createDefaultImageWriter, Pv as createDefaultLineEndStyles, zw as createDefaultShapePreprocessor, Bv as createFrameStyleProcessor, Rv as createLineEndProcessor, Vg as createMarkupEditorBackgroundColorControl, rg as createMarkupEditorBrushSizeControl, Bg as createMarkupEditorColorControl, wg as createMarkupEditorColorOptions, _g as createMarkupEditorFontColorControl, Dg as createMarkupEditorFontFamilyControl, Pg as createMarkupEditorFontFamilyOptions, kg as createMarkupEditorFontScaleOptions, Kg as createMarkupEditorFontSizeControl, Xg as createMarkupEditorFontStyleControl, Eg as createMarkupEditorFontStyleOptions, Zg as createMarkupEditorLineEndStyleControl, Ig as createMarkupEditorLineEndStyleOptions, Jg as createMarkupEditorLineHeightControl, Tg as createMarkupEditorLineHeightScaleOptions, Gg as createMarkupEditorLineStartStyleControl, jg as createMarkupEditorOptionControl, ng as createMarkupEditorSelectionModeControl, qv as createMarkupEditorShapeStyleControls, Ng as createMarkupEditorStrokeColorControl, Rg as createMarkupEditorStrokeScaleOptions, Hg as createMarkupEditorStrokeWidthControl, Qg as createMarkupEditorTextAlignControl, sg as createMarkupEditorToolStyle, Fl as degToRad, _m as dispatchEditorEvents, T$ as effectBrightness, A$ as effectClarity, M$ as effectContrast, P$ as effectExposure, E$ as effectGamma, R$ as effectSaturation, L$ as effectTemperature, I$ as effectVignette, i$ as filterChrome, a$ as filterCold, n$ as filterFade, l$ as filterMonoDefault, c$ as filterMonoNoir, u$ as filterMonoStark, d$ as filterMonoWash, o$ as filterPastel, p$ as filterSepiaBlues, $$ as filterSepiaColor, h$ as filterSepiaDefault, m$ as filterSepiaRust, r$ as filterWarm, V$ as frameEdgeCross, _$ as frameEdgeOverlap, W$ as frameEdgeSeparate, N$ as frameHook, B$ as frameLineMultiple, O$ as frameLineSingle, H$ as framePolaroid, D$ as frameSolidRound, F$ as frameSolidSharp, Ow as getEditorDefaults, I as getUniqueId, $w as locale_en_gb, Qv as markup_editor_defaults, gw as markup_editor_locale_en_gb, Ew as openEditor, Iw as overlayEditor, nw as plugin_annotate, Sw as plugin_annotate_locale_en_gb, tw as plugin_crop, fw as plugin_crop_locale_en_gb, rw as plugin_decorate, ww as plugin_decorate_locale_en_gb, dw as plugin_fill, yw as plugin_fill_locale_en_gb, ow as plugin_filter, pw as plugin_filter_defaults, bw as plugin_filter_locale_en_gb, iw as plugin_finetune, hw as plugin_finetune_defaults, xw as plugin_finetune_locale_en_gb, sw as plugin_frame, mw as plugin_frame_defaults, Cw as plugin_frame_locale_en_gb, lw as plugin_redact, Tw as plugin_redact_locale_en_gb, cw as plugin_resize, vw as plugin_resize_locale_en_gb, aw as plugin_sticker, kw as plugin_sticker_locale_en_gb, Ms as processImage, Jm as removeNode, Tn as shapeGetCenter, Np as supportsWebGL };
15
+ //# sourceMappingURL=pintura.js.map