From 50076e68d6e5d0e05b1380204cd48c73846ac56d Mon Sep 17 00:00:00 2001 From: daybrush Date: Tue, 22 Dec 2020 03:46:36 +0900 Subject: [PATCH] chore: Release 0.22.0 --- .gitignore | 2 +- CHANGELOG.md | 25 + demo/index.html | 2 +- demo/static/js/2.46694990.chunk.js | 3 + ...SE.txt => 2.46694990.chunk.js.LICENSE.txt} | 0 demo/static/js/2.46694990.chunk.js.map | 1 + demo/static/js/2.4f099a54.chunk.js | 3 - demo/static/js/2.4f099a54.chunk.js.map | 1 - demo/static/js/main.3b9c2de8.chunk.js | 2 + demo/static/js/main.3b9c2de8.chunk.js.map | 1 + demo/static/js/main.b4f396a0.chunk.js | 2 - demo/static/js/main.b4f396a0.chunk.js.map | 1 - dist/moveable.cjs.js | 506 + dist/moveable.cjs.js.map | 1 + dist/moveable.esm.js | 490 + dist/moveable.esm.js.map | 1 + dist/moveable.js | 18814 ++++++++++++++++ dist/moveable.js.map | 1 + dist/moveable.min.js | 10 + dist/moveable.min.js.map | 1 + package-lock.json | 76 +- package.json | 4 +- .../projects/ngx-moveable/package-lock.json | 48 +- .../projects/ngx-moveable/package.json | 4 +- packages/preact-moveable/package-lock.json | 56 +- packages/preact-moveable/package.json | 4 +- .../react-compat-moveable/package-lock.json | 62 +- packages/react-compat-moveable/package.json | 4 +- packages/react-moveable/package-lock.json | 2 +- packages/react-moveable/package.json | 2 +- packages/svelte-moveable/package-lock.json | 90 +- packages/svelte-moveable/package.json | 4 +- storybook/package-lock.json | 6 +- storybook/package.json | 2 +- 34 files changed, 20040 insertions(+), 191 deletions(-) create mode 100644 demo/static/js/2.46694990.chunk.js rename demo/static/js/{2.4f099a54.chunk.js.LICENSE.txt => 2.46694990.chunk.js.LICENSE.txt} (100%) create mode 100644 demo/static/js/2.46694990.chunk.js.map delete mode 100644 demo/static/js/2.4f099a54.chunk.js delete mode 100644 demo/static/js/2.4f099a54.chunk.js.map create mode 100644 demo/static/js/main.3b9c2de8.chunk.js create mode 100644 demo/static/js/main.3b9c2de8.chunk.js.map delete mode 100644 demo/static/js/main.b4f396a0.chunk.js delete mode 100644 demo/static/js/main.b4f396a0.chunk.js.map create mode 100644 dist/moveable.cjs.js create mode 100644 dist/moveable.cjs.js.map create mode 100644 dist/moveable.esm.js create mode 100644 dist/moveable.esm.js.map create mode 100644 dist/moveable.js create mode 100644 dist/moveable.js.map create mode 100644 dist/moveable.min.js create mode 100644 dist/moveable.min.js.map diff --git a/.gitignore b/.gitignore index 5e70f72a6..14bf40b31 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ node_modules/ *.DS_Store .DS_Store doc/ -dist/ + demo/dist/ packages/*/dist/ release/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 87d4e2a45..e2dc43b1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Expand the functions of `translate` and `rotate` properties. + +## [0.22.0] - 2020-12-22 +* `moveable` 0.22.0 +* `react-moveable` 0.25.0 +* `preact-moveable` 0.24.0 +* `ngx-moveable` 0.18.0 +* `svelte-moveable` 0.13.0 + +### Added +* Support Custom Able +* Support Tree Shaking (React) +* Support live element guidelines #317 +* Support partial element guidelines #357 +* Add `setFixedDirection`, `setRatio` properties in Resizable, Scalable #355 #362 +* Add `absoluteDist`, `absoluteDelta`, `absoluteRotate` properties #377 +* Support function element type + +### Fixed +* Fix SVG deletion #359 +* Fix Group's dragTarget #373 +* Fix Groups' updateTarget #366 +* Fix floating point issue #376 +* Fix snapCenter caculation +* Fix guideline scale #380 + ## [0.21.1] - 2020-11-16 * `moveable` 0.21.1 * `react-moveable` 0.24.1 diff --git a/demo/index.html b/demo/index.html index 191138377..2e5f384af 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1 +1 @@ -Moveable is Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable!
\ No newline at end of file +Moveable is Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable!
\ No newline at end of file diff --git a/demo/static/js/2.46694990.chunk.js b/demo/static/js/2.46694990.chunk.js new file mode 100644 index 000000000..886aa5345 --- /dev/null +++ b/demo/static/js/2.46694990.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.46694990.chunk.js.LICENSE.txt */ +(this["webpackJsonp@scena/react-editor"]=this["webpackJsonp@scena/react-editor"]||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(122)},function(e,t,n){"use strict";n.d(t,"l",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"f",(function(){return o})),n.d(t,"k",(function(){return a})),n.d(t,"c",(function(){return A})),n.d(t,"j",(function(){return s})),n.d(t,"m",(function(){return l})),n.d(t,"i",(function(){return u})),n.d(t,"g",(function(){return c})),n.d(t,"n",(function(){return h})),n.d(t,"e",(function(){return g})),n.d(t,"b",(function(){return v})),n.d(t,"h",(function(){return B})),n.d(t,"T",(function(){return J})),n.d(t,"x",(function(){return w})),n.d(t,"I",(function(){return E})),n.d(t,"G",(function(){return y})),n.d(t,"D",(function(){return C})),n.d(t,"H",(function(){return Q})),n.d(t,"F",(function(){return x})),n.d(t,"E",(function(){return F})),n.d(t,"R",(function(){return S})),n.d(t,"Q",(function(){return H})),n.d(t,"P",(function(){return O})),n.d(t,"O",(function(){return T})),n.d(t,"S",(function(){return N})),n.d(t,"t",(function(){return _})),n.d(t,"w",(function(){return M})),n.d(t,"U",(function(){return R})),n.d(t,"J",(function(){return D})),n.d(t,"z",(function(){return P})),n.d(t,"y",(function(){return k})),n.d(t,"M",(function(){return I})),n.d(t,"u",(function(){return K})),n.d(t,"B",(function(){return L})),n.d(t,"N",(function(){return z})),n.d(t,"v",(function(){return j})),n.d(t,"r",(function(){return X})),n.d(t,"s",(function(){return V})),n.d(t,"q",(function(){return Y})),n.d(t,"a",(function(){return q})),n.d(t,"C",(function(){return Z})),n.d(t,"o",(function(){return $})),n.d(t,"K",(function(){return ee})),n.d(t,"A",(function(){return te})),n.d(t,"p",(function(){return ne})),n.d(t,"L",(function(){return re}));var r="rgba",i=["rgb",r,"hsl","hsla"],o="function",a="property",A="array",s="object",l="string",u="number",c="undefined"!==typeof window,f="undefined"!==typeof document&&document,d=["webkit","ms","moz","o"],p=function(e){if(!f)return"";var t=(f.body||f.documentElement).style,n=d.length;if("undefined"!==typeof t[e])return e;for(var r=0;r-1&&(a=U(o,t,i+1,r)),-1===a)break;i=a}return-1}function S(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,o=[],a=[],A=0;A-1)l=U(s,r,A+1,i);else if(s===t){a.length&&(o.push(a.join("")),a=[]);continue}}-1===l&&(l=i-1),a.push(r.slice(A,l+1).join("")),A=l}return a.length&&o.push(a.join("")),o}function H(e){return S(e,"")}function O(e){return S(e,",")}function T(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function N(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function _(e){return e.replace(/[\s-_]([a-z])/g,(function(e,t){return t.toUpperCase()}))}function M(e,t){return void 0===t&&(t="-"),e.replace(/([a-z])([A-Z])/g,(function(e,n,r){return""+n+t+r.toLowerCase()}))}function R(e){return[].slice.call(e)}function D(){return Date.now?Date.now():(new Date).getTime()}function P(e,t,n){void 0===n&&(n=-1);for(var r=e.length,i=0;i-1?e[r]:n}var I=function(){var e=D(),t=c&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame);return t?t.bind(window):function(t){var n=D();return window.setTimeout((function(){t(n-e)}),1e3/60)}}(),K=function(){var e=c&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame);return e?e.bind(window):function(e){clearTimeout(e)}}();function L(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in t)t.push(n);return t}function z(e,t){void 0===t&&(t=[]),e.sort((function(e,n){var r=t.indexOf(e),i=t.indexOf(n);return-1===i&&-1===r?0:-1===r?1:-1===i?-1:r-i}))}function j(e,t){var n=N(e),r=n.value,i=n.unit;if(y(t)){var o=t[i];if(o){if(F(o))return o(r);if(b[i])return b[i](r,o)}}else if("%"===i)return r*t/100;return b[i]?b[i](r):r}function X(e,t,n){return Math.max(t,Math.min(e,n))}function G(e,t,n){return[[t[0],t[0]*e[1]/e[0]],[t[1]*e[0]/e[1],t[1]]].filter((function(e){return e.every((function(e,r){return n?e<=t[r]:e>=t[r]}))}))[0]||e}function V(e,t,n,r){if(!r)return e.map((function(e,r){return X(e,t[r],n[r])}));var i=e[0],o=e[1],a=G(e,t,!1),A=a[0],s=a[1],l=G(e,n,!0),u=l[0],c=l[1];return iu||o>c)&&(i=u,o=c),[i,o]}function Y(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}function W(e){var t=function(e){return e.replace("#","")}(e),n=parseInt(t.substring(0,2),16),r=parseInt(t.substring(2,4),16),i=parseInt(t.substring(4,6),16),o=parseInt(t.substring(6,8),16)/255;return isNaN(o)&&(o=1),[n,r,i,o]}function J(e){if("#"===e.charAt(0))return 4===e.length||5===e.length?W(function(e){var t=e.charAt(1),n=e.charAt(2),r=e.charAt(3),i=e.charAt(4);return["#",t,t,n,n,r,r,i,i].join("")}(e)):W(e);if(-1!==e.indexOf("(")){var t=T(e),n=t.prefix,i=t.value;if(!n||!i)return;var o=O(i),a=[0,0,0,1],A=o.length;switch(n){case"rgb":case r:for(var s=0;s1?t-1:0),a=1;a>>0};function o(e,t,n,i){var o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",e),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var i=n.trim();return(i?Object(r.P)(i):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(i||document.head||document.body).appendChild(o),o}var a=function(e){var t,n="rCS"+i(e).toString(36),r=0;return{className:n,inject:function(i,a){void 0===a&&(a={});var A,s=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),l=0===r;return(s||l)&&(A=o(n,e,a,s)),l&&(t=A),s||++r,{destroy:function(){s?(i.removeChild(A),A=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}},A=n(0),s=n(7),l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function u(e,t){function n(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&o.splice(a,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t=0?i:i+2*Math.PI}function o(e){var t=function(e){return[0,1].map((function(t){return function(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}(e.map((function(e){return e[t]})))}))}(e),n=i(t,e[0]),r=i(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function a(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function A(e){return e.length<3?0:Math.abs(function(e){for(var t=0,n=e.length-1;n>=0;--n)t+=e[n];return t}(e.map((function(t,n){var r=e[n+1]||e[0];return t[0]*r[1]-r[0]*t[1]}))))/2}function s(e,t){var n=t.width,r=t.height,i=t.left,o=t.top,a=l(e),A=a.minX,s=a.minY,u=a.maxX,c=a.maxY,f=n/(u-A),d=r/(c-s);return e.map((function(e){return[i+(e[0]-A)*f,o+(e[1]-s)*d]}))}function l(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]}));return{minX:Math.min.apply(Math,t),minY:Math.min.apply(Math,n),maxX:Math.max.apply(Math,t),maxY:Math.max.apply(Math,n)}}function u(e,t,n){var i=e[0],o=e[1],a=l(t),A=a.minX,s=a.minY,u=a.maxX,h=a.maxY,g=[[A,o],[u,o]],v=[[i,s],[i,h]],B=c(g[0],g[1]),m=c(v[0],v[1]),b=p(t),w=[],E=[];return b.forEach((function(e){var t=c(e[0],e[1]),n=d(f(B,t),[g,e]),r=d(f(m,t),[v,e]);1===n.length&&e[0][1]===o||w.push.apply(w,n),1===r.length&&e[0][0]===i||E.push.apply(E,r),t[0]||w.push.apply(w,n),t[1]||E.push.apply(E,r)})),!n&&(r(w,(function(e){return e[0]===i}))>-1||r(E,(function(e){return e[1]===o}))>-1)||!!(w.filter((function(e){return e[0]>i})).length%2&&E.filter((function(e){return e[1]>o})).length%2)}function c(e,t){var n=e[0],r=e[1],i=t[0],o=t[1];if(n===i&&r===o)return[0,0,0];if(n===i)return[1,0,-n];if(r===o)return[0,1,-r];var a=(i-n)/(r-o);return[1,a,-n-a*r]}function f(e,t){var n,r,i=e[0],o=e[1],a=e[2],A=t[0],s=t[1],l=t[2],u=0===i&&0===A,c=0===o&&0===s;if(u&&c)return[];if(u){var f=-a/o;return f!==-l/s?[]:[[-1/0,f],[1/0,f]]}if(c){var d=-a/i;return d!==-l/A?[]:[[d,-1/0],[d,1/0]]}return 0===i?[[n=-(s*(r=-a/o)+l)/A,r]]:0===A?[[n=-(o*(r=-l/s)+a)/i,r]]:0===o?[[n=-a/i,r=-(A*n+l)/s]]:0===s?[[n=-l/A,r=-(i*n+a)/o]]:[[n=(o*l-s*a)/(s*i-o*A),r=-(i*n+a)/o]]}function d(e,t){var n=t.map((function(e){return[0,1].map((function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]}))}));if(2===e.length){var r=e[0],i=r[0],o=r[1];if(i===e[1][0]){var a=Math.max.apply(Math,n.map((function(e){return e[1][0]}))),A=Math.min.apply(Math,n.map((function(e){return e[1][1]})));return a>A?[]:[[i,a],[i,A]]}if(o===e[1][1]){var s=Math.max.apply(Math,n.map((function(e){return e[0][0]}))),l=Math.min.apply(Math,n.map((function(e){return e[0][1]})));return s>l?[]:[[s,o],[l,o]]}}return e.filter((function(e){return n.every((function(t){return t[0][0]<=e[0]&&e[0]<=t[0][1]&&t[1][0]<=e[1]&&e[1]<=t[1][1]}))}))}function p(e){return function(){for(var e=0,t=0,n=arguments.length;t=128?"#000":"#fff"},t.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}};t.default=t},function(e,t,n){"use strict";n.d(t,"b",(function(){return v})),n.d(t,"c",(function(){return g}));var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e){return e&&"object"===typeof e}function o(e){return Array.isArray(e)}function a(e){return"string"===typeof e}function A(e,t,n,r){e.addEventListener(t,n,r)}function s(e,t,n){e.removeEventListener(t,n)}var l=function(){return(l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n-1&&r.splice(o,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t1&&this.trigger(e+"."+i.join("."),r)},t}(u);t.a=m},function(e,t,n){var r=n(87),i=n(142),o=n(200),a=n(17);e.exports=function(e,t){return(a(e)?r:o)(e,i(t,3))}},function(e,t,n){e.exports=n(128)},function(e,t,n){var r=n(36),i=n(133),o=n(134),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?i(e):o(e)}},function(e,t,n){var r=n(155),i=n(158);e.exports=function(e,t){var n=i(e,t);return r(n)?n:void 0}},function(e,t,n){"use strict";var r=n(1);var i=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0};function o(e,t,n,i){var o=document.createElement("style");return o.setAttribute("type","text/css"),o.setAttribute("data-styled-id",e),n.nonce&&o.setAttribute("nonce",n.nonce),o.innerHTML=function(e,t,n){return n.original?t:t.replace(/([^};{\s}][^};{]*|^\s*){/gm,(function(t,n){var i=n.trim();return(i?Object(r.P)(i):[""]).map((function(t){var n=t.trim();return 0===n.indexOf("@")?n:n.indexOf(":global")>-1?n.replace(/\:global/g,""):n.indexOf(":host")>-1?""+n.replace(/\:host/g,"."+e):n?"."+e+" "+n:"."+e})).join(", ")+" {"}))}(e,t,n),(i||document.head||document.body).appendChild(o),o}t.a=function(e){var t,n="rCS"+i(e).toString(36),r=0;return{className:n,inject:function(i,a){void 0===a&&(a={});var A,s=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),l=0===r;return(s||l)&&(A=o(n,e,a,s)),l&&(t=A),s||++r,{destroy:function(){s?(i.removeChild(A),A=null):(r>0&&--r,0===r&&t&&(t.parentNode.removeChild(t),t=null))}}}}}},function(e,t,n){"use strict";n.d(t,"b",(function(){return Se}));var r=n(34),i=n(7),o=("undefined"!==typeof document&&document,['"',"'",'\\"',"\\'"]),a={cm:function(e){return 96*e/2.54},mm:function(e){return 96*e/254},in:function(e){return 96*e},pt:function(e){return 96*e/72},pc:function(e){return 96*e/6},"%":function(e,t){return e*t/100},vw:function(e,t){return void 0===t&&(t=window.innerWidth),e/100*t},vh:function(e,t){return void 0===t&&(t=window.innerHeight),e/100*t},vmax:function(e,t){return void 0===t&&(t=Math.max(window.innerWidth,window.innerHeight)),e/100*t},vmin:function(e,t){return void 0===t&&(t=Math.min(window.innerWidth,window.innerHeight)),e/100*t}};function A(e){return"undefined"===typeof e}function s(e){return e&&"object"===typeof e}function l(e){return Array.isArray(e)}function u(e){return"string"===typeof e}function c(e){return"function"===typeof e}function f(e,t,n,r){for(var i=n;i-1&&(A=f(a,t,i+1,r)),-1===A)break;i=A}return-1}function d(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,a=[],A=[],s=0;s-1)u=f(l,r,s+1,i);else if(l===t){A.length&&(a.push(A.join("")),A=[]);continue}}-1===u&&(u=i-1),A.push(r.slice(s,u+1).join("")),s=u}return A.length&&a.push(A.join("")),a}function p(e){return d(e,"")}function h(e){return d(e,",")}function g(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function v(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function B(e,t,n){void 0===n&&(n=-1);for(var r=e.length,i=0;i=t[r]}))}))[0]||e}function y(e,t,n,r){if(!r)return e.map((function(e,r){return function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t[r],n[r])}));var i=e[0],o=e[1],a=E(e,t,!1),A=a[0],s=a[1],l=E(e,n,!0),u=l[0],c=l[1];return iu||o>c)&&(i=u,o=c),[i,o]}function C(e){for(var t=e.length,n=0,r=t-1;r>=0;--r)n+=e[r];return t?n/t:0}function Q(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=Math.atan2(r,n);return i>=0?i:i+2*Math.PI}function x(e){var t=function(e){return[0,1].map((function(t){return C(e.map((function(e){return e[t]})))}))}(e),n=Q(t,e[0]),r=Q(t,e[1]);return nr&&r-n<-Math.PI?1:-1}function F(e,t){return e.classList?e.classList.contains(t):!!e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}function U(e,t,n,r,i,o){for(var a=0;a'}var le=Object(r.a)().browser.webkit,ue=le&&function(){var e=/applewebkit\/([^\s]+)/g.exec(navigator.userAgent.toLowerCase());return!!e&&parseFloat(e[1])<605}(),ce="moveable-",fe="\n{\n\tposition: absolute;\n\twidth: 1px;\n\theight: 1px;\n\tleft: 0;\n\ttop: 0;\n z-index: 3000;\n --moveable-color: #4af;\n --zoom: 1;\n --zoompx: 1px;\n will-change: transform;\n}\n.control-box {\n z-index: 0;\n}\n.line, .control {\n\tleft: 0;\n top: 0;\n will-change: transform;\n}\n.control {\n\tposition: absolute;\n\twidth: 14px;\n\theight: 14px;\n\tborder-radius: 50%;\n\tborder: 2px solid #fff;\n\tbox-sizing: border-box;\n background: #4af;\n background: var(--moveable-color);\n\tmargin-top: -7px;\n margin-left: -7px;\n border: 2px solid #fff;\n z-index: 10;\n}\n.padding {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100px;\n height: 100px;\n transform-origin: 0 0;\n}\n.line {\n\tposition: absolute;\n\twidth: 1px;\n height: 1px;\n background: #4af;\n background: var(--moveable-color);\n\ttransform-origin: 0px 50%;\n}\n.line.dashed {\n box-sizing: border-box;\n background: transparent;\n}\n.line.dashed.horizontal {\n border-top: 1px dashed #4af;\n border-top-color: #4af;\n border-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\n border-left: 1px dashed #4af;\n border-left-color: #4af;\n border-left-color: var(--moveable-color);\n}\n.line.vertical {\n transform: translateX(-50%);\n}\n.line.horizontal {\n transform: translateY(-50%);\n}\n.line.vertical.bold {\n width: 2px;\n}\n.line.horizontal.bold {\n height: 2px;\n}\n\n.control.origin {\n\tborder-color: #f55;\n\tbackground: #fff;\n\twidth: 12px;\n\theight: 12px;\n\tmargin-top: -6px;\n margin-left: -6px;\n\tpointer-events: none;\n}\n"+[0,15,30,45,60,75,90,105,120,135,150,165].map((function(e){return'\n.direction[data-rotation="'+e+'"] {\n\t'+function(e){var t=se(1,e),n=se(2,e),r=45*Math.round(e/45)%180,i=135===r?"nwse-resize":45===r?"nesw-resize":90===r?"ew-resize":"ns-resize";return"cursor:"+i+";cursor: url('"+t+"') 16 16, "+i+";cursor: -webkit-image-set(url('"+t+"') 1x, url('"+n+"') 2x) 16 16, "+i+";"}(e)+"\n}\n"})).join("\n")+"\n.group {\n z-index: -1;\n}\n.area {\n position: absolute;\n}\n.area-pieces {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n}\n.area.avoid, .area.pass {\n pointer-events: none;\n}\n.area.avoid+.area-pieces {\n display: block;\n}\n.area-piece {\n position: absolute;\n}\n\n"+(ue?':global svg *:before {\n\tcontent:"";\n\ttransform-origin: inherit;\n}':"")+"\n",de=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],pe=Math.pow(10,10),he=-pe,ge=["n","w","s","e","nw","ne","sw","se"],ve={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},Be={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},me=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager"];function be(){for(var e=[],t=0;t9),(t?"matrix3d":"matrix")+"("+k(e,!t).join(",")+")"}function Oe(e){if(!e)return{x:0,y:0,width:0,height:0};var t=e.clientWidth,n=e.clientHeight,r=e.viewBox,i=r&&r.baseVal||{x:0,y:0,width:0,height:0};return{x:i.x,y:i.y,width:i.width||t,height:i.height||n}}function Te(e,t){var n=e.clientWidth,r=e.clientHeight,i=Oe(e),o=i.width,a=i.height,A=n/o,s=r/a,l=e.preserveAspectRatio.baseVal,u=l.align,c=l.meetOrSlice,f=[0,0],d=[A,s],p=[0,0];if(1!==u){var h=(u-2)%3,g=Math.floor((u-2)/3);f[0]=o*h/2,f[1]=a*g/2;var v=2===c?Math.max(s,A):Math.min(A,s);d[0]=v,d[1]=v,p[0]=(n-o)/2*h,p[1]=(r-a)/2*g}var B=j(d,t);return B[t*(t-1)]=p[0],B[t*(t-1)+1]=p[1],we(B,t,f)}function Ne(e,t,n){return I(e,N(t,n),n)}function _e(e,t,n,r){return[[0,0],[t,0],[0,n],[t,n]].map((function(t){return Ne(e,t,r)}))}function Me(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){return e[1]})),r=Math.min.apply(Math,t),i=Math.min.apply(Math,n),o=Math.max.apply(Math,t),a=Math.max.apply(Math,n);return{left:r,top:i,right:o,bottom:a,width:o-r,height:a-i}}function Re(e,t,n,r){return Me(_e(e,t,n,r))}function De(e,t,n,r){var i=16===e.length?4:3,o=_e(e,n,r,i),a=o[0],A=a[0],s=a[1],l=o[1],u=l[0],c=l[1],f=o[2],d=f[0],p=f[1],h=o[3],g=h[0],v=h[1],B=Ne(e,t,i),m=B[0],b=B[1],w=Math.min(A,u,d,g),E=Math.min(s,c,p,v),y=Math.max(A,u,d,g);return A=A-w||0,{left:w,top:E,right:y,bottom:Math.max(s,c,p,v),origin:[m=m-w||0,b=b-E||0],pos1:[A,s=s-E||0],pos2:[u=u-w||0,c=c-E||0],pos3:[d=d-w||0,p=p-E||0],pos4:[g=g-w||0,v=v-E||0],direction:x(o)}}function Pe(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ke(e,t){return Pe([t[0]-e[0],t[1]-e[1]])}function Ie(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=Q(e,t));var i=ke(e,t);return{transform:"translateY(-50%) translate("+e[0]+"px, "+e[1]+"px) rotate("+r+"rad) scaleY("+n+")",width:i+"px"}}function Ke(e,t){for(var n=[],r=2;r0?e[0]:e[1],t>0?e[1]:e[0])}function je(e,t,n,r,i){var o=1,a=[0,0],A={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},s={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},l={left:0,right:0,top:0,bottom:0,width:0,height:0,clientLeft:0,clientTop:0,clientWidth:0,clientHeight:0,scrollWidth:0,scrollHeight:0},u=Ue(t,n,i,!1);if(t){var c=u.is3d?4:3,f=De(u.offsetMatrix,D(u.transformOrigin,function(e,t){void 0===t&&(t=Math.sqrt(e.length));for(var n=[],r=e[t*t-1],i=0;i-1&&(n[0]=-1),t.indexOf("e")>-1&&(n[0]=1),t.indexOf("n")>-1&&(n[1]=-1),t.indexOf("s")>-1&&(n[1]=1),n}}}function Ve(e,t){return[D(t,e[0]),D(t,e[1]),D(t,e[2]),D(t,e[3])]}function Ye(e){var t=e.left,n=e.top;return Ve([e.pos1,e.pos2,e.pos3,e.pos4],[t,n])}function We(e,t){return t?Math.round(e/t)*t:e}function Je(e,t){return e.forEach((function(n,r){e[r]=We(e[r],t)})),e}function qe(e,t){e[t]&&(e[t].unset(),e[t]=null)}function Ze(e,t,n){var r=t.datas;r.datas||(r.datas={});var i=ae(ae({},n),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,moveable:e,datas:r.datas});return r.isStartEvent?r.lastEvent=i:r.isStartEvent=!0,i}function $e(e,t,n){var r=t.datas,i="isDrag"in n?n.isDrag:t.isDrag;return r.datas||(r.datas={}),ae(ae({isDrag:i},n),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,lastEvent:r.lastEvent,isDouble:t.isDouble,datas:r.datas})}function et(e,t,n,r){return e.triggerEvent(t,n,r)}function tt(e,t){return window.getComputedStyle(e,t)}function nt(e,t,n){var r={},i={};return e.filter((function(e){var o=e.name;if(r[o]||!t.some((function(t){return e[t]})))return!1;if(!n&&e.ableGroup){if(i[e.ableGroup])return!1;i[e.ableGroup]=!0}return r[o]=!0,!0}))}function rt(e,t){return e===t||null==e&&null==t}function it(e,t){var n=[],r=[];return e.forEach((function(i,o){var a=t(i,o,e),A=r.indexOf(a),s=n[A]||[];-1===A&&(r.push(a),n.push(s)),s.push(i)})),n}function ot(e){return e.reduce((function(e,t){return e.concat(t)}),[])}function at(){for(var e=[],t=0;t-1}))).filter((function(e){return e.canPinch&&e[u]})),f=Ze(e,t,{});r&&(f.targets=r);var d=et(e,l,f);n.isPinch=!1!==d,n.ables=c;var p=n.isPinch;return!!p&&(c.forEach((function(n){if(o[n.name]=o[n.name]||{},n[u]){var r=ae(ae({},t),{datas:o[n.name],parentRotate:i,isPinch:!0});n[u](e,r)}})),e.state.snapRenderInfo={request:t.isRequest,direction:[0,0]},p)},pinch:function(e,t){var n=t.datas,r=t.scale,i=t.distance,o=t.originalDatas,a=t.inputEvent,A=t.targets,s=t.angle;if(n.isPinch){var l=i*(1-1/r),u=Ze(e,t,{});A&&(u.targets=A),et(e,"onPinch"+(A?"Group":""),u);var c=n.ables,f="drag"+(A?"Group":"")+"Control";return c.forEach((function(n){n[f]&&n[f](e,ae(ae({},t),{datas:o[n.name],inputEvent:a,parentDistance:l,parentRotate:s,isPinch:!0}))})),u}},pinchEnd:function(e,t){var n=t.datas,r=t.isPinch,i=t.inputEvent,o=t.targets,a=t.originalDatas;if(n.isPinch){var A="onPinch"+(o?"Group":"")+"End",s=$e(e,t,{isDrag:r});o&&(s.targets=o),et(e,A,s);var l=n.ables,u="drag"+(o?"Group":"")+"ControlEnd";return l.forEach((function(n){n[u]&&n[u](e,ae(ae({},t),{isDrag:r,datas:a[n.name],inputEvent:i,isPinch:!0}))})),r}},pinchGroupStart:function(e,t){return this.pinchStart(e,ae(ae({},t),{targets:e.props.targets}))},pinchGroup:function(e,t){return this.pinch(e,ae(ae({},t),{targets:e.props.targets}))},pinchGroupEnd:function(e,t){return this.pinchEnd(e,ae(ae({},t),{targets:e.props.targets}))}};function vt(e,t,n,r,i){var o=t.gesto.move(n,e.inputEvent),a=o.originalDatas||o.datas,A=a.draggable||(a.draggable={});return ae(ae({},i?st(t,o):o),{isDrag:!0,isPinch:!!r,parentEvent:!0,datas:A,originalDatas:e.originalDatas})}var Bt=function(){function e(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var t=e.prototype;return t.dragStart=function(e,t){this.isDrag=!1,this.isFlag=!1;var n=t.originalDatas;return this.datas=n,n.draggable||(n.draggable={}),ae(ae({},this.move(e,t.inputEvent)),{type:"dragstart"})},t.drag=function(e,t){return this.move([e[0]-this.prevX,e[1]-this.prevY],t)},t.move=function(e,t){var n,r;return this.isFlag?(n=this.prevX+e[0],r=this.prevY+e[1],this.isDrag=!0):(this.prevX=e[0],this.prevY=e[1],this.startX=e[0],this.startY=e[1],n=e[0],r=e[1],this.isFlag=!0),this.prevX=n,this.prevY=r,{type:"drag",clientX:n,clientY:r,inputEvent:t,isDrag:this.isDrag,distX:n-this.startX,distY:r-this.startY,deltaX:e[0],deltaY:e[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function mt(e,t,n){var r=n.originalDatas;r.groupable=r.groupable||{};var i=r.groupable;i.childDatas=i.childDatas||[];var o=i.childDatas,a=n.inputEvent,A=n.isPinch,s=n.clientX,l=n.clientY,u=n.distX,c=n.distY;return e.moveables.map((function(e,n){return o[n]=o[n]||{},o[n][t]=o[n][t]||{},{inputEvent:a,datas:o[n][t],originalDatas:o[n],isPinch:A,clientX:s,clientY:l,distX:u,distY:c}}))}function bt(e,t,n,r,i,o){var a=!!n.match(/Start$/g),A=!!n.match(/End$/g),s=i.isPinch,l=i.datas,u=mt(e,t.name,i),c=e.moveables,f=u.map((function(e,i){var u=c[i],f=e;a?f=(new Bt).dragStart(r,e):(u.state.gesto||(u.state.gesto=l.childGestos[i]),f=vt(e,u.state,r,s,o));var d=t[n](u,ae(ae({},f),{parentFlag:!0}));return A&&(u.state.gesto=null),d}));return a&&(l.childGestos=c.map((function(e){return e.state.gesto}))),f}function wt(e,t,n,r,i,o){void 0===i&&(i=function(e,t){return t});var a=!!n.match(/End$/g),A=mt(e,t.name,r),s=e.moveables;return A.map((function(e,r){var A,l=s[r];A=i(l,e);var u=t[n](l,ae(ae({},A),{parentFlag:!0}));return u&&o&&o(l,e,u,r),a&&(l.state.gesto=null),u}))}function Et(e,t){var n=t.clientX,r=t.clientY,i=t.datas,o=e.state,a=o.moveableClientRect,A=o.rootMatrix,s=o.is3d,l=o.pos1,u=P(At(A,[n-a.left,r-a.top],s?4:3),l),c=St({datas:i,distX:u[0],distY:u[1]});return[c[0],c[1]]}function yt(e,t){var n=t.datas,r=e.state,i=r.allMatrix,o=r.beforeMatrix,a=r.is3d,A=r.left,s=r.top,l=r.origin,u=r.offsetMatrix,c=r.targetMatrix,f=r.transformOrigin,d=a?4:3;n.is3d=a,n.matrix=i,n.targetMatrix=c,n.beforeMatrix=o,n.offsetMatrix=u,n.transformOrigin=f,n.inverseMatrix=T(i,d),n.inverseBeforeMatrix=T(o,d),n.absoluteOrigin=N(D([A,s],l),d),n.startDragBeforeDist=I(n.inverseBeforeMatrix,n.absoluteOrigin,d),n.startDragDist=I(n.inverseMatrix,n.absoluteOrigin,d)}function Ct(e,t){var n=e.datas,r=e.originalDatas.beforeRenderable,i=n.transformIndex,o=r.nextTransforms,a=r.nextTransformAppendedIndexes,A=-1===i?o.length:i+a.filter((function(e){return e=0&&(e[0]>=0&&t.push(3),e[0]<=0&&t.push(2)),e[1]<=0&&(e[0]>=0&&t.push(1),e[0]<=0&&t.push(0)),t}function Ot(e,t){return Ht(t).map((function(t){return e[t]}))}function Tt(e,t){var n=Ot(e,t);return[C(n.map((function(e){return e[0]}))),C(n.map((function(e){return e[1]})))]}function Nt(e,t,n,r){return R(e,we(t,r,n),r)}function _t(e){var t=e.originalDatas.beforeRenderable;return{setTransform:function(n,r){void 0===r&&(r=-1),t.startTransforms=l(n)?n:p(n),Rt(e,r)},setTransformIndex:function(t){Rt(e,t)}}}function Mt(e){Rt(e,-1)}function Rt(e,t){var n=e.originalDatas.beforeRenderable,r=e.datas;if(r.transformIndex=t,-1!==t){var i=n.startTransforms[t];if(i){var o=q([i]);r.startValue=o[0].functionValue}}}function Dt(e,t){e.originalDatas.beforeRenderable.nextTransforms=p(t)}function Pt(e,t,n,r,i){return Dt(i,t),{transform:t,drag:Xn.drag(e,vt(i,e.state,n,r,!1))}}function kt(e,t,n,r,i){var o=e.state,a=o.left,A=o.top,s=e.props.groupable,l=s?a:0,u=s?A:0,c=P(r,Kt(e,n,function(e,t,n){var r=e.transformOrigin,i=e.offsetMatrix,o=e.is3d,a=t.beforeTransform,A=t.afterTransform,s=o?4:3;return Nt(i,_(R(R(a,W([n]),4),A,4),4,s),r,s)}(e.state,i,t)));return P(c,[l,u])}function It(e){var t=e.state,n=t.width,r=t.height,i=t.transformOrigin;return[i[0]/(n/2)-1,i[1]/(r/2)-1]}function Kt(e,t,n){void 0===n&&(n=e.state.allMatrix);var r=e.state,i=r.width,o=r.height,a=r.is3d?4:3;return Ne(n,[i/2*(1+t[0]),o/2*(1+t[1])],a)}function Lt(e,t,n,r,i,o){var a=e.props.groupable,A=e.state,s=A.transformOrigin,l=A.targetMatrix,u=A.offsetMatrix,c=A.is3d,f=A.width,d=A.height,p=A.left,h=A.top,g=c?4:3,B=a?p:0,m=a?h:0;return P(function(e,t,n,r,i,o){var a=Tt(_e(t,n,r,i),o);return[e[0]-a[0],e[1]-a[1]]}(i,Nt(u,l,function(e,t,n,r,i,o){return void 0===r&&(r=t),void 0===i&&(i=n),void 0===o&&(o=[0,0]),e?e.map((function(e,a){var A=v(e),s=A.value,l=A.unit,u=a?i:r,c=a?n:t;return"%"===e||isNaN(s)?c*(u?o[a]/u:0):"%"!==l?s:c*s/100})):o}(o,t,n,f,d,s),g),t,n,g,r),[B,m])}function zt(e,t){return Tt(Ye(e.state),t)}function jt(e,t,n){var r=Ne(e,[t.clientLeft,t.clientTop],n);return[t.left+r[0],t.top+r[1]]}function Xt(e,t,n,r,i,o){var a=i[0],A=i[1],s=o[0],l=o[1],u=[],c=r?0:1,f="vertical"===t?"horizontal":"vertical",d=it(e.filter((function(e){return e.type===t})),(function(e){return e.element})).map((function(e){return e[0]})).filter((function(e){var t=e.pos,n=e.sizes;return t[c]<=l&&s<=t[c]+n[c]}));return d.forEach((function(e){var t=e.pos[r],i=t+e.sizes[r];d.forEach((function(e){var o=e.pos,s=e.sizes,l=e.element,c=o[r],p=c+s[r],h=0,g=0,v=!0;if(i<=c)a<(h=p-(g=i-c))-n&&(v=!1);else{if(!(p<=t))return;A>(h=c-(g=t-p))+n&&(v=!1)}if(v&&u.push({pos:"vertical"===f?[h,o[1]]:[o[0],h],element:l,sizes:s,size:0,type:f,gap:g,gapGuidelines:d}),i<=a&&A<=c){var B=(c+i-(A-a))/2;We(a-(B-n),.1)>=0&&u.push({pos:"vertical"===f?[B,o[1]]:[o[0],B],element:l,sizes:s,size:0,type:f,gap:i-a,gapGuidelines:d})}}))})),u}function Gt(e,t,n,r,i,o,a){return void 0===o&&(o=0),void 0===a&&(a=0),r&&r.forEach((function(n){e.push({type:"horizontal",pos:[0,We(n-a,.1)],size:t})})),i&&i.forEach((function(t){e.push({type:"vertical",pos:[We(t-o,.1),0],size:n})})),e}function Vt(e,t){var n=[],r=e.state;if(t&&r.guidelines&&r.guidelines.length)return n;var i=e.props,o=i.elementGuidelines,a=void 0===o?[]:o,A=i.snapCenter;if(!a.length)return n;var s=r.containerClientRect,l=r.targetClientRect,u=l.top,c=l.left,f=r.rootMatrix,d=r.is3d?4:3,p=jt(f,s,d),h=p[0],g=p[1],v=Ye(r),B=Object(Z.c)(v),m=P([B.minX,B.minY],At(f,[c-h,u-g],d)).map((function(e){return t=e,Math.round(t%1===-.5?t-1:t);var t})),b=m[0],w=m[1];return a.map((function(e){return"parentElement"in e?{element:e}:e})).filter((function(e){return e.refresh&&t||!e.refresh&&!t})).forEach((function(e){var t=e.element,r=e.top,i=e.left,o=e.right,a=e.bottom,s=t.getBoundingClientRect(),l=s.left-h,u=s.top-g,c=u+s.height,p=l+s.width,v=At(f,[l,u],d),B=v[0],m=v[1],E=At(f,[p,c],d),y=E[0],C=E[1],Q=y-B,x=C-m,F=[Q,x];!1!==r&&n.push({type:"vertical",element:t,pos:[We(B+b,.1),m],size:x,sizes:F}),!1!==a&&n.push({type:"vertical",element:t,pos:[We(y+b,.1),m],size:x,sizes:F}),!1!==i&&n.push({type:"horizontal",element:t,pos:[B,We(m+w,.1)],size:Q,sizes:F}),!1!==o&&n.push({type:"horizontal",element:t,pos:[B,We(C+w,.1)],size:Q,sizes:F}),A&&(n.push({type:"vertical",element:t,pos:[We((B+y)/2+b,.1),m],size:x,sizes:F,center:!0}),n.push({type:"horizontal",element:t,pos:[B,We((m+C)/2+w,.1)],size:Q,sizes:F,center:!0}))})),n}function Yt(e){var t=e.state,n=t.staticGuidelines,r=t.containerClientRect,i=r.scrollHeight,o=r.scrollWidth,a=r.clientHeight,A=r.clientWidth,s=r.overflow,l=r.clientLeft,u=r.clientTop,c=e.props,f=c.snapHorizontal,d=void 0===f||f,p=c.snapVertical,h=void 0===p||p,g=c.snapGap,v=void 0===g||g,B=c.verticalGuidelines,m=c.horizontalGuidelines,b=c.snapThreshold,w=void 0===b?5:b,E=Ae(n,Vt(e,!0));if(v){var y=Me(Ye(e.state)),C=y.top,Q=y.left,x=y.bottom,F=y.right,U=n.filter((function(e){return e.element}));E.push.apply(E,Ae(Xt(U,"horizontal",w,0,[Q,F],[C,x]),Xt(U,"vertical",w,1,[C,x],[Q,F])))}return Gt(E,s?o:A,s?i:a,d&&m,h&&B,l,u),E}function Wt(e,t,n,r,i){var o=e.props,a=o.snapElement,s=void 0===a||a,l=function(){for(var e=[],t=0;ta)})).sort((function(e,t){return e.dist-t.dist}));return{pos:n,index:r,guidelineInfos:i}})).filter((function(e){return e.guidelineInfos.length>0})).sort((function(e,t){return e.guidelineInfos[0].dist-t.guidelineInfos[0].dist})),c=u.length>0;return{isSnap:c,index:c?u[0].index:-1,posInfos:u}}function en(e,t){var n=Math.abs(e.offset),r=Math.abs(t.offset);return e.isBound&&t.isBound?r-n:e.isBound?-1:t.isBound?1:e.isSnap&&t.isSnap?r-n:e.isSnap?-1:t.isSnap||n<1e-7?1:r<1e-7?-1:n-r}function tn(e,t){return e.slice().sort((function(e,n){var r=e.sign[t],i=n.sign[t],o=e.offset[t],a=n.offset[t];return r?i?en({isBound:e.isBound,isSnap:e.isSnap,offset:o},{isBound:n.isBound,isSnap:n.isSnap,offset:a}):-1:1}))[0]}function nn(e,t){var n=C([t[0][0],t[1][0]]),r=C([t[0][1],t[1][1]]);return{vertical:n<=e[0],horizontal:r<=e[1]}}function rn(e,t){var n,r,i=t[0],o=t[1],a=o[0]-i[0],A=o[1]-i[1];if(Math.abs(a)<1e-7&&(a=0),Math.abs(A)<1e-7&&(A=0),a)if(A){n=A/a*(e[0]-i[0])+i[1],r=e[1]}else n=i[1],r=e[1];else n=i[0],r=e[0];return n-r}function on(e,t,n){void 0===n&&(n=1e-7);var r=rn(e[0],t)<=0;return e.slice(1).every((function(e){var i=rn(e,t);return i<=0===r||Math.abs(i)<=n}))}function an(e,t,n,r,i){return void 0===i&&(i=0),r&&t-i<=e||!r&&e<=n+i?{isBound:!0,offset:r?t-e:n-e}:{isBound:!1,offset:0}}function An(e,t,n,r,i){var o=e[0],a=e[1],A=t[0],s=t[1],l=ct(a[1]-o[1]),u=ct(a[0]-o[0]),c=ct(s[1]-A[1]);if(!ct(s[0]-A[0])){if(i&&!l)return{isBound:!1,offset:0};if(u)return an(l/u*(A[0]-o[0])+o[1],A[1],s[1],n,r);var f=A[0]-o[0];return{isBound:d=Math.abs(f)<=(r||0),offset:d?f:0}}if(!c){if(i&&!u)return{isBound:!1,offset:0};if(l)return an((A[1]-o[1])/(l/u)+o[0],A[0],s[0],n,r);var d;f=A[1]-o[1];return{isBound:d=Math.abs(f)<=(r||0),offset:d?f:0}}return{isBound:!1,offset:0}}function sn(e,t,n,r){return t.map((function(t){var i=t[0],o=t[1],a=t[2],A=function(e,t,n){var r=e.props.innerBounds;if(!r)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var i=r.left,o=r.top,a=r.width,A=r.height,s=[[i,o],[i,o+A]],l=[[i,o],[i+a,o]],u=[[i+a,o],[i+a,o+A]],c=[[i,o+A],[i+a,o+A]],f=nn(n,t),d=f.horizontal,p=f.vertical;if(on([n,[i,o],[i+a,o],[i,o+A],[i+a,o+A]],t))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var h=An(t,l,p),g=An(t,c,p),v=An(t,s,d),B=An(t,u,d),m=h.isBound&&g.isBound,b=h.isBound||g.isBound,w=v.isBound&&B.isBound,E=v.isBound||B.isBound,y=at(h.offset,g.offset),C=at(v.offset,B.offset),Q=[0,0],x=!1,F=!1;return Math.abs(C)o&&A.push({isBound:!0,offset:o-r,pos:r}),i-1.1||e[0]>t.right&&Math.abs(e[0]-t.right)>.1||e[1].1||e[1]>t.bottom&&Math.abs(e[1]-t.bottom)>.1}))}function gn(e,t,n,r,i){var o=e.props.bounds,a=i*Math.PI/180;if(!o)return[];var A=o.left,s=void 0===A?-1/0:A,l=o.top,u=void 0===l?-1/0:l,c=o.right,f=void 0===c?1/0:c,d=o.bottom,p=void 0===d?1/0:d,h=s-r[0],g=f-r[0],v=u-r[1],B=p-r[1],m={left:h,top:v,right:g,bottom:B};if(!hn(n,m,0))return[];var b=[];return[[h,0],[g,0],[v,1],[B,1]].forEach((function(e,r){var i=e[0],o=e[1];n.forEach((function(e){var n=Q([0,0],e);b.push.apply(b,function(e,t,n){var r=Pe(e),i=Math.sqrt(r*r-t*t)||0;return[i,-i].sort((function(t,r){return Math.abs(t-e[n?0:1])-Math.abs(r-e[n?0:1])})).map((function(e){return Q([0,0],n?[e,t]:[t,e])}))}(e,i,o).map((function(e){return a+e-n})).filter((function(e){return!hn(t,m,e)})).map((function(e){return We(180*e/Math.PI,1e-7)})))}))})),b}var vn=["horizontal","left","top","width","Y","X"],Bn=["vertical","top","left","height","X","Y"];function mn(e){var t=e.state;t.guidelines&&t.guidelines.length||(t.staticGuidelines=Vt(e,!1),t.guidelines=Yt(e),t.enableSnap=!0)}function bn(e,t){var n=e.props,r=n.snappable,i=n.bounds,o=n.innerBounds,a=n.verticalGuidelines,A=n.horizontalGuidelines,s=e.state,l=s.guidelines,u=s.enableSnap;return!(!r||!u||t&&!0!==r&&r.indexOf(t)<0)&&!!(i||o||l&&l.length||a&&a.length||A&&A.length)}function wn(e,t,n,r,i){var o=function(e,t,n,r){var i=t[0]-e[0],o=t[1]-e[1];Math.abs(i)<1e-7&&(i=0);Math.abs(o)<1e-7&&(o=0);if(!i)return r?[0,0]:[0,n];if(!o)return r?[n,0]:[0,0];var a=o/i,A=e[1]-a*e[0];if(r){var s=a*(t[0]+n)+A;return[n,s-t[1]]}return[(t[1]+n-A)/a-t[0],n]}(e,t,n,r);if(!o)return[0,0];var a=St({datas:i,distX:o[0],distY:o[1]});return[a[0],a[1]]}function En(e,t,n,r,i,o){var a=_e(e,t,n,o?4:3);return Ve(a,P(r,function(e,t){return Tt(e,t.map((function(e){return-e})))}(a,i)))}function yn(e,t){return e.isBound?e.offset:t.isSnap?t.offset:0}function Cn(e,t){return e.isBound?e.offset:t.isSnap?Zt(t).offset:0}function Qn(e,t,n,r){var i=function(e,t,n){var r=e.props.bounds||{},i=r.left,o=void 0===i?-1/0:i,a=r.top,A=void 0===a?-1/0:a,s=r.right,l=void 0===s?1/0:s,u=r.bottom,c=void 0===u?1/0:u,f=n[0],d=n[1],p=P(n,t),h=p[0],g=p[1];Math.abs(h)<1e-7&&(h=0),Math.abs(g)<1e-7&&(g=0);var v=g>0,B=h>0,m={isBound:!1,offset:0,pos:0},b={isBound:!1,offset:0,pos:0};if(0===h&&0===g)return{vertical:m,horizontal:b};if(0===h)v?cd&&(b.pos=A,b.offset=d-A);else if(0===g)B?lf&&(m.pos=o,m.offset=f-o);else{var w=g/h,E=n[1]-w*f,y=0,C=0,Q=!1;B&&l<=f?(y=w*l+E,C=l,Q=!0):!B&&f<=o&&(y=w*o+E,C=o,Q=!0),Q&&(yc)&&(Q=!1),Q||(v&&c<=d?(C=((y=c)-E)/w,Q=!0):!v&&d<=A&&(C=((y=A)-E)/w,Q=!0)),Q&&(m.isBound=!0,m.pos=C,m.offset=f-C,b.isBound=!0,b.pos=y,b.offset=d-y)}return{vertical:m,horizontal:b}}(e,t,n),o=i.horizontal,a=i.vertical,A=r?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(e,t,n){var r=n[0],i=n[1],o=t[0],a=t[1],A=P(n,t),s=A[0],l=A[1],u=l>0,c=s>0;s=ct(s),l=ct(l);var f={isSnap:!1,offset:0,pos:0},d={isSnap:!1,offset:0,pos:0};if(0===s&&0===l)return{vertical:f,horizontal:d};var p=Wt(e,s?[r]:[],l?[i]:[]),h=p.vertical,g=p.horizontal;h.posInfos.filter((function(e){var t=e.pos;return c?t>=o:t<=o})),g.posInfos.filter((function(e){var t=e.pos;return u?t>=a:t<=a})),h.isSnap=h.posInfos.length>0,g.isSnap=g.posInfos.length>0;var v=Zt(h),B=v.isSnap,m=v.guideline,b=Zt(g),w=b.isSnap,E=b.guideline,y=w?E.pos[1]:0,C=B?m.pos[0]:0;if(0===s)w&&(d.isSnap=!0,d.pos=E.pos[1],d.offset=i-d.pos);else if(0===l)B&&(f.isSnap=!0,f.pos=C,f.offset=r-C);else{var Q=l/s,x=n[1]-Q*r,F=0,U=0,S=!1;B?(F=Q*(U=C)+x,S=!0):w&&(U=((F=y)-x)/Q,S=!0),S&&(f.isSnap=!0,f.pos=U,f.offset=r-U,d.isSnap=!0,d.pos=F,d.offset=i-F)}return{vertical:f,horizontal:d}}(e,t,n),s=A.horizontal,l=A.vertical,u=yn(o,s),c=yn(a,l),f=Math.abs(u),d=Math.abs(c);return{horizontal:{isBound:o.isBound,isSnap:s.isSnap,offset:u,dist:f},vertical:{isBound:a.isBound,isSnap:l.isSnap,offset:c,dist:d}}}function xn(e,t,n,r){void 0===r&&(r=n);var i=dn(e.props.bounds,r.map((function(e){return e[0]})),r.map((function(e){return e[1]}))),o=i.horizontal,a=i.vertical,A=t?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Wt(e,n.map((function(e){return e[0]})),n.map((function(e){return e[1]})),e.props.snapCenter),s=A.horizontal,l=A.vertical,u=Cn(o[0],s),c=Cn(a[0],l),f=Math.abs(u),d=Math.abs(c);return{horizontal:{isBound:o[0].isBound,isSnap:s.isSnap,snapIndex:s.index,offset:u,dist:f,bounds:o,snap:s},vertical:{isBound:a[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:c,dist:d,bounds:a,snap:l}}}function Fn(e,t,n,r,i){void 0===i&&(i={});var o=dn(t,n,r),a=o.horizontal,A=o.vertical,s=i.isRequest?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:Jt(e,n,r,i),l=s.horizontal,u=s.vertical,c=Cn(a[0],l),f=Cn(A[0],u),d=Math.abs(c),p=Math.abs(f);return{horizontal:{isBound:a[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:c,dist:d,bounds:a,snap:l},vertical:{isBound:A[0].isBound,isSnap:u.isSnap,snapIndex:u.index,offset:f,dist:p,bounds:A,snap:u}}}function Un(e){return e?e/Math.abs(e):0}function Sn(e,t,n,r,i,o){return n.map((function(n){var a=n[0],A=n[1],s=Tt(t,a),l=Tt(t,A),u=r?Qn(e,s,l,i):xn(e,i,[l]),c=u.horizontal,f=c.offset,d=c.isBound,p=c.isSnap,h=u.vertical,g=h.offset,v=h.isBound,B=h.isSnap,m=P(A,a);if(!g&&!f)return{isBound:v||d,isSnap:B||p,sign:m,offset:[0,0]};var b=function(e,t,n,r){var i=Q(e,t)/Math.PI*180,o=n.vertical,a=o.isBound,A=o.isSnap,s=o.dist,l=n.horizontal,u=l.isBound,c=l.isSnap,f=i%180,d=f<3||f>177,p=f>87&&f<93;return l.dist1e-7)d=-g[0],p=a*Math.abs(o+d)/Math.abs(o)-a;else if(g[1]&&Math.abs(a)>1e-7){var v=a;p=-g[1],d=o*Math.abs(a+p)/Math.abs(v)-o}if(e&&s&&A)if(Math.abs(d)>1e-7&&Math.abs(d)1e-7&&Math.abs(p)-1||t.push(n)}))})),t}function Rn(e,t,n,r){var i=e-n,o=i<0?i+t:r;return{size:(i<0?0:i)-o,pos:o}}function Dn(e,t,n,r){var i=[],o=it(e.filter((function(e){var t=e.element,n=e.gap;return t&&!n})),(function(e){var n=e.element,o=e.pos,a=o[r],A=(Math.min(0,a-t)<0?-1:1)+"_"+o[r?0:1],s=function(e,t,n){var r=B(e,t);return r>-1?e[r]:n}(i,(function(e){var t=e[0],r=e[1];return n===t&&a===r}));return s?s[2]:(i.push([n,a,A]),A)}));return o.forEach((function(e){e.sort((function(e,i){return Rn(e.pos[r],e.size,t,n).size-Rn(i.pos[r],e.size,t,n).size||e.pos[r?0:1]-i.pos[r?0:1]}))})),o}function Pn(e,t,n,r,i,o,a,A,s,l,u,c){var f=n[0],d=n[1],p=n[2],h=n[3],g=n[4],v=n[5],B=e.props,m=B.zoom,b=B.isDisplaySnapDigit,w=void 0===b||b;return ot(t.map((function(e,t){var n=!0;return e.map((function(e,B){var b,E,y=e.pos,C=e.size,Q=Rn(y[l],C,i,o),x=Q.pos,F=Q.size;if(F0?u(S):""))}))})))}function kn(e,t,n,r,i,o,a){var A=n[0],s=n[1],l=n[2],u=n[3],c=n[4],f=e.props.zoom;return t.map((function(e,t){var n,d=e.type,p=e.pos;return a.createElement("div",{className:be("line",A,"guideline","target","bold",d),key:A+"TargetGuideline"+t,style:(n={},n[s]=r+"px",n[l]=-i+p+"px",n[u]=o+"px",n.transform="translate"+c+"(-50%) scale"+c+"("+f+")",n)})}))}function In(e,t,n,r,i,o,a){var A=n[0],s=n[1],l=n[2],u=n[3],c=n[4],f=e.props.zoom;return t.map((function(e,t){var n,d=e.pos,p=e.size,h=e.element;return a.createElement("div",{className:be("line",A,"guideline",h?"bold":""),key:A+"Guideline"+t,style:(n={},n[s]=-r+d[o]+"px",n[l]=-i+d[o?0:1]+"px",n[u]=p+"px",n.transform="translate"+c+"(-50%) scale"+c+"("+f+")",n)})}))}function Kn(e,t,n,r){var i=e.filter((function(e){var n=e.element,r=e.gap,i=e.type;return n&&r&&i===t})),o="vertical"===t?[0,1]:[1,0],a=o[0],A=o[1];return ot(i.map((function(e){var t=e.pos,i=e.gap,o=e.gapGuidelines,s=e.sizes,l=function(){for(var e=[],t=0;t0&&l>u?l=2*(l-u/2):l<0&&l<-u&&(l=2*(l+u/2));var c=(l>0?0:r[A])+l/2;return Ae(function(e,t,n,r,i,o,a){var A=Math.abs(o),s=i[t]+(o>0?r[0]:0);return e.filter((function(e){return e.pos[t]<=n[t]})).sort((function(e,n){var r=e.pos;return n.pos[t]-r[t]})).filter((function(e){var n=e.pos,r=e.sizes,i=n[t];return We(i+r[t],1e-4)===We(s-A,1e-4)&&(s=i,!0)})).map((function(e){var r=-n[t]+e.pos[t]+e.sizes[t];return ae(ae({},e),{gap:o,renderPos:t?[a,r]:[r,a]})}))}(o,a,n,r,t,i,c),function(e,t,n,r,i,o,a){var A=Math.abs(o),s=i[t]+(o<0?r[t]:0);return e.filter((function(e){return e.pos[t]>n[t]})).sort((function(e,n){var r=e.pos,i=n.pos;return r[t]-i[t]})).filter((function(e){var n=e.pos,r=e.sizes,i=n[t];return We(i,1e-4)===We(s+A,1e-4)&&(s=i+r[t],!0)})).map((function(e){var r=-n[t]+e.pos[t]-A;return ae(ae({},e),{gap:o,renderPos:t?[a,r]:[r,a]})}))}(o,a,n,r,t,i,c))})))}function Ln(e,t,n,r,i,o){var a=r[0],A=r[1],s=r[2],l=r[3],u=r[4],c=r[5],f=e.props,d=f.snapDigit,p=void 0===d?0:d,h=f.isDisplaySnapDigit,g=void 0===h||h,v=f.zoom,B="vertical"===n?"horizontal":"vertical",m="vertical"===n?[0,1]:[1,0],b=m[0],w=m[1];return t.map((function(e,t){var n,r,f=e.renderPos,d=e.gap,h=Math.abs(d),m=g?parseFloat(h.toFixed(p)):0;return o.createElement("div",{key:B+"GapGuideline"+t,className:be("guideline-group",a),style:(n={},n[A]=f[b]+"px",n[s]=f[w]+"px",n[l]=h+"px",n)},o.createElement("div",{className:be("line",a,"guideline","gap"),style:(r={},r[l]="100%",r.transform="translate"+u+"(-50%) scale"+u+"("+v+")",r)}),o.createElement("div",{className:be("size-value","gap"),style:{transform:"translate"+c+"(-50%) scale("+v+")"}},m>0?i(m):""))}))}function zn(e,t,n,r,i,o){var a=dn(o||e.props.bounds,t,n),A=a.vertical,s=a.horizontal;A.forEach((function(e){e.isBound&&r.push({type:"bounds",pos:e.pos})})),s.forEach((function(e){e.isBound&&i.push({type:"bounds",pos:e.pos})}));var l=function(e){var t=e.props.innerBounds;if(!t)return{vertical:[],horizontal:[]};var n=e.getRect(),r=n.pos1,i=n.pos2,o=n.pos3,a=n.pos4,A=Tt([r,i,o,a],[0,0]),s=t.left,l=t.top,u=t.width,c=t.height,f=[[s,l],[s,l+c]],d=[[s,l],[s+u,l]],p=[[s+u,l],[s+u,l+c]],h=[[s,l+c],[s+u,l+c]],g=[],v=[],B={top:!1,bottom:!1,left:!1,right:!1};return[[r,i],[i,a],[a,o],[o,r]].forEach((function(e){var t=nn(A,e),n=t.horizontal,r=t.vertical,i=An(e,d,r,1,!0),o=An(e,h,r,1,!0),a=An(e,f,n,1,!0),m=An(e,p,n,1,!0);i.isBound&&!B.top&&(g.push(l),B.top=!0),o.isBound&&!B.bottom&&(g.push(l+c),B.bottom=!0),a.isBound&&!B.left&&(v.push(s),B.left=!0),m.isBound&&!B.right&&(v.push(s+u),B.right=!0)})),{horizontal:g,vertical:v}}(e),u=l.vertical,c=l.horizontal;u.forEach((function(e){B(r,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||r.push({type:"bounds",pos:e})})),c.forEach((function(e){B(i,(function(t){var n=t.type,r=t.pos;return"bounds"===n&&r===e}))>=0||i.push({type:"bounds",pos:e})}))}var jn={name:"snappable",props:{snappable:[Boolean,Array],snapCenter:Boolean,snapHorizontal:Boolean,snapVertical:Boolean,snapElement:Boolean,snapGap:Boolean,isDisplaySnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[":host {\n --bounds-color: #d66;\n}\n.guideline {\n pointer-events: none;\n z-index: 2;\n}\n.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}\n.guideline-group {\n position: absolute;\n top: 0;\n left: 0;\n}\n.guideline-group .size-value {\n position: absolute;\n color: #f55;\n font-size: 12px;\n font-weight: bold;\n}\n.guideline-group.horizontal .size-value {\n transform-origin: 50% 100%;\n transform: translateX(-50%);\n left: 50%;\n bottom: 5px;\n}\n.guideline-group.vertical .size-value {\n transform-origin: 0% 50%;\n top: 50%;\n transform: translateY(-50%);\n left: 5px;\n}\n.guideline.gap {\n background: #f55;\n}\n.size-value.gap {\n color: #f55;\n}\n"],render:function(e,t){var n=e.state,r=n.top,i=n.left,o=n.pos1,a=n.pos2,A=n.pos3,s=n.pos4,l=n.snapRenderInfo,u=n.targetClientRect,c=n.containerClientRect,f=n.is3d,d=n.rootMatrix;if(!l||!bn(e,""))return[];var p=f?4:3,h=Math.min(o[0],a[0],A[0],s[0]),g=Math.min(o[1],a[1],A[1],s[1]),v=jt(d,c,p),B=At(d,[u.left-v[0],u.top-v[1]],p),m=B[0],b=B[1],w=e.props,E=w.snapThreshold,y=void 0===E?5:E,C=w.snapDigit,Q=void 0===C?0:C,x=w.snapDistFormat,F=void 0===x?function(e){return e}:x,U=l.externalPoses||[],S=Ye(e.state),H=[],O=[],T=[],N=[],_=[],M=Me(S),R=M.width,D=M.height,P=M.top,k=M.left,I=M.bottom,K=M.right,L=U.length>0,z=L?Me(U):{};if(!l.request){if(l.direction&&_.push(function(e,t,n){var r=[];if(n[0]&&n[1])r=[n,[-n[0],n[1]],[n[0],-n[1]]].map((function(e){return Tt(t,e)}));else if(n[0]||n[1])e.props.keepRatio?r=[[-1,-1],[-1,1],[1,-1],[1,1],n].map((function(e){return Tt(t,e)})):(r=Ot(t,n)).length>1&&r.push([(r[0][0]+r[1][0])/2,(r[0][1]+r[1][1])/2]);else for(var i=[t[0],t[1],t[3],t[2],t[0]],o=0;o<4;++o)r.push(i[o]),r.push([(i[o][0]+i[o+1][0])/2,(i[o][1]+i[o+1][1])/2]);return Wt(e,r.map((function(e){return e[0]})),r.map((function(e){return e[1]})),!0,1)}(e,S,l.direction)),l.snap){var j=Me(S);l.center&&(j.middle=(j.top+j.bottom)/2,j.center=(j.left+j.right)/2),_.push(qt(e,j,!0,1))}L&&(l.center&&(z.middle=(z.top+z.bottom)/2,z.center=(z.left+z.right)/2),_.push(qt(e,z,!0,1))),_.forEach((function(e){var t=e.vertical.posInfos,n=e.horizontal.posInfos;H.push.apply(H,t.map((function(e){return{type:"snap",pos:e.pos}}))),O.push.apply(O,n.map((function(e){return{type:"snap",pos:e.pos}}))),T.push.apply(T,Mn(t)),N.push.apply(N,Mn(n))}))}zn(e,[k,K],[P,I],H,O),L&&zn(e,[z.left,z.right],[z.top,z.bottom],H,O,l.externalBounds);var X=Dn(N,m,R,0),G=Dn(T,b,D,1),V=Kn(T,"vertical",[i,r],[R,D]),Y=Kn(N,"horizontal",[i,r],[R,D]),W=Ae(T,N);return et(e,"onSnap",{guidelines:W.filter((function(e){return!e.element})),elements:it(W.filter((function(e){return e.element})),(function(e){return e.element})),gaps:Ae(V,Y)},!0),Ae(Ln(e,V,"vertical",vn,F,t),Ln(e,Y,"horizontal",Bn,F,t),Pn(e,X,vn,h,m,R,r,y,Q,0,F,t),Pn(e,G,Bn,g,b,D,i,y,Q,1,F,t),kn(e,O,vn,h,r,R,t),kn(e,H,Bn,g,i,D,t),In(e,N,vn,i,r,0,t),In(e,T,Bn,r,i,1,t))},dragStart:function(e,t){e.state.snapRenderInfo={request:t.isRequest,snap:!0,center:!0},mn(e)},drag:function(e,t){e.state.guidelines=Yt(e)},pinchStart:function(e){this.unset(e)},dragEnd:function(e){this.unset(e)},dragControlCondition:function(e){return!(!ft(e)&&!Jn(e))||(!e.isRequest&&e.inputEvent?F(e.inputEvent.target,be("snap-control")):void 0)},dragControlStart:function(e){e.state.snapRenderInfo=null,mn(e)},dragControl:function(e){e.state.guidelines=Yt(e)},dragControlEnd:function(e){this.unset(e)},dragGroupStart:function(e,t){this.dragStart(e,t)},dragGroup:function(e){e.state.guidelines=Yt(e)},dragGroupEnd:function(e){this.unset(e)},dragGroupControlStart:function(e){e.state.snapRenderInfo=null,mn(e)},dragGroupControl:function(e){e.state.guidelines=Yt(e)},dragGroupControlEnd:function(e){this.unset(e)},unset:function(e){var t=e.state;t.enableSnap=!1,t.guidelines=[],t.snapRenderInfo=null}},Xn={name:"draggable",props:{draggable:Boolean,throttleDrag:Number,throttleDragRotate:Number,startDragRotate:Number,edgeDraggable:Boolean},events:{onDragStart:"dragStart",onDrag:"drag",onDragEnd:"dragEnd",onDragGroupStart:"dragGroupStart",onDragGroup:"dragGroup",onDragGroupEnd:"dragGroupEnd"},render:function(e,t){var n=e.props,r=n.throttleDragRotate,i=n.zoom,o=e.state,a=o.dragInfo,A=o.beforeOrigin;if(!r||!a)return[];var s=a.dist;if(!s[0]&&!s[1])return[];var l=Pe(s),u=Q(s,[0,0]);return[t.createElement("div",{className:be("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:l+"px",transform:"translate("+A[0]+"px, "+A[1]+"px) rotate("+u+"rad) scaleY("+i+")"}})]},dragStart:function(e,t){var n=t.datas,r=t.parentEvent,i=t.parentGesto,o=e.state,a=o.target;if(o.gesto)return!1;o.gesto=i||e.targetGesto;var A=window.getComputedStyle(a);n.datas={},n.left=parseFloat(A.left||"")||0,n.top=parseFloat(A.top||"")||0,n.bottom=parseFloat(A.bottom||"")||0,n.right=parseFloat(A.right||"")||0,n.startValue=[0,0],yt(e,t),Mt(t),function(e,t){t.absolutePoses=Ye(e.state)}(e,n),n.prevDist=[0,0],n.prevBeforeDist=[0,0],n.isDrag=!1;var s=Ze(e,t,ae({set:function(e){n.startValue=e}},_t(t)));return!1!==(r||et(e,"onDragStart",s))?(n.isDrag=!0,e.state.dragInfo={startRect:e.getRect(),dist:[0,0]}):(o.gesto=null,n.isPinch=!1),!!n.isDrag&&s},drag:function(e,t){Ct(t,"translate");var n=t.datas,r=t.parentEvent,i=t.parentFlag,o=t.isPinch,a=t.isRequest,A=t.distX,s=t.distY,l=n.isDrag,u=n.prevDist,c=n.prevBeforeDist,f=n.startValue;if(l){var d=e.props,p=d.parentMoveable,h=r?0:d.throttleDrag||0,g=r?0:d.throttleDragRotate||0,v=!1,B=0;if(!r&&g>0&&(A||s)){var m=d.startDragRotate||0,b=We(m+180*Q([0,0],[A,s])/Math.PI,g)-m,w=s*Math.abs(Math.cos((b-90)/180*Math.PI)),E=Pe([A*Math.abs(Math.cos(b/180*Math.PI)),w]);B=b*Math.PI/180,A=E*Math.cos(B),s=E*Math.sin(B)}if(!o&&!r&&!i&&(!g||A||s)){var y=_n(e,A,s,g,a,n),C=y[0],x=y[1],F=C.isSnap,U=C.isBound,S=C.offset,H=x.isSnap,O=x.isBound;v=F||H||U||O,A+=S,s+=x.offset}n.passDeltaX=A-(n.passDistX||0),n.passDeltaY=s-(n.passDistY||0),n.passDistX=A,n.passDistY=s;var T=D(Ut({datas:n,distX:A,distY:s}),f),N=D(xt({datas:n,distX:A,distY:s}),f);g||v||(Je(N,h),Je(T,h));var _=P(T,f),M=P(N,f),R=P(M,u),k=P(_,c);n.prevDist=M,n.prevBeforeDist=_;var I=n.left+_[0],K=n.top+_[1],L=n.right-_[0],z=n.bottom-_[1],j=Qt(n,"translate("+N[0]+"px, "+N[1]+"px)","translate("+M[0]+"px, "+M[1]+"px)");if(e.state.dragInfo.dist=r?[0,0]:M,r||p||!R.every((function(e){return!e}))||!k.some((function(e){return!e}))){var X=e.state,G=Ze(e,t,{transform:j,dist:M,delta:R,translate:N,beforeDist:_,beforeDelta:k,beforeTranslate:T,left:I,top:K,right:L,bottom:z,width:X.width,height:X.height,isPinch:o});return!r&&et(e,"onDrag",G),G}}},dragEnd:function(e,t){var n=t.parentEvent,r=t.datas,i=t.isDrag;if(e.state.gesto=null,e.state.dragInfo=null,r.isDrag)return r.isDrag=!1,!n&&et(e,"onDragEnd",$e(e,t,{})),i},dragGroupStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY,o=this.dragStart(e,t);if(!o)return!1;var a=bt(e,this,"dragStart",[r||0,i||0],t,!1),A=et(e,"onDragGroupStart",ae(ae({},o),{targets:e.props.targets,events:a}));return n.isDrag=!1!==A,!!n.isDrag&&o},dragGroup:function(e,t){if(t.datas.isDrag){var n=this.drag(e,t),r=t.datas,i=bt(e,this,"drag",[r.passDeltaX,r.passDeltaY],t,!1);if(n){var o=ae({targets:e.props.targets,events:i},n);return et(e,"onDragGroup",o),o}}},dragGroupEnd:function(e,t){var n=t.isDrag;if(t.datas.isDrag)return this.dragEnd(e,t),bt(e,this,"dragEnd",[0,0],t,!1),et(e,"onDragGroupEnd",$e(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=e.getRect(),r=0,i=0;return{isControl:!1,requestStart:function(){return{datas:t}},request:function(e){return"x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?i=e.y-n.top:"deltaY"in e&&(i+=e.deltaY),{datas:t,distX:r,distY:i}},requestEnd:function(){return{datas:t,isDrag:!0}}}},unset:function(e){e.state.dragInfo=null}};function Gn(e,t,n,r,i,o){var a=e.state.is3d?4:3,A=Ne(e.state.rootMatrix,i,a),s=D([o.left,o.top],A);t.startAbsoluteOrigin=s,t.prevDeg=Q(s,[n,r])/Math.PI*180,t.prevSnapDeg=t.prevDeg,t.startDeg=t.prevDeg,t.loop=0}function Vn(e,t,n,r,i,o){var a=n.prevDeg,A=Tn(e,t,n.origin,r);return n.prevDeg=A,[A-a,A,o+A]}function Yn(e,t,n,r,i,o,a,A){var s=n.prevDeg,l=n.prevSnapDeg,u=n.startDeg,c=n.loop;s>r&&s>270&&r<90?++n.loop:s270&&--n.loop;var f=n.loop,d=360*c+l-u+o,p=360*f+r-u+o;n.prevDeg=p-360*f+u-o;var h=i*((p=We(p,a))-o);return A&&(p=(h=Tn(e,t,n.origin,h))/i+o),n.prevSnapDeg=p-360*f+u-o,[i*(p-d),h,o+h]}function Wn(e,t,n,r,i,o,a,A){return Yn(e,t,n,Q(n.startAbsoluteOrigin,[i,o])/Math.PI*180,r,a,A,!0)}function Jn(e){return e.isRequest?"rotatable"===e.requestAble:F(e.inputEvent.target,be("rotation-control"))}var qn={name:"rotatable",canPinch:!0,props:{rotatable:Boolean,rotationPosition:String,throttleRotate:Number},events:{onRotateStart:"rotateStart",onRotate:"rotate",onRotateEnd:"rotateEnd",onRotateGroupStart:"rotateGroupStart",onRotateGroup:"rotateGroup",onRotateGroupEnd:"rotateGroupEnd"},css:[".rotation {\n position: absolute;\n height: 40px;\n width: 1px;\n transform-origin: 50% 100%;\n height: calc(40px * var(--zoom));\n top: auto;\n left: 0;\n bottom: 100%;\n will-change: transform;\n }\n .rotation .rotation-line {\n display: block;\n width: 100%;\n height: 100%;\n transform-origin: 50% 50%;\n }\n .rotation .rotation-control {\n border-color: #4af;\n border-color: var(--moveable-color);\n background:#fff;\n cursor: alias;\n }"],render:function(e,t){var n=e.props,r=n.rotatable,i=n.rotationPosition,o=n.zoom,a=e.state,A=a.renderPoses,s=a.direction;if(!r)return null;var l=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],A=(e||"top").split("-"),s=A[0],l=A[1],u=[r,i];"left"===s?u=[o,r]:"right"===s?u=[i,a]:"bottom"===s&&(u=[a,o]);var c=[(u[0][0]+u[1][0])/2,(u[0][1]+u[1][1])/2],f=ze(u,n);if(l){var d="top"===l||"left"===l,p="bottom"===s||"left"===s;c=u[d&&!p||!d&&p?0:1]}return[c,f]}(i,A,s),u=l[0],c=l[1];return t.createElement("div",{key:"rotation",className:be("rotation"),style:{transform:"translate(-50%) translate("+u[0]+"px, "+u[1]+"px) rotate("+c+"rad)"}},t.createElement("div",{className:be("line rotation-line"),style:{transform:"scaleX("+o+")"}}),t.createElement("div",{className:be("control rotation-control"),style:{transform:"translate(0.5px) scale("+o+")"}}))},dragControlCondition:Jn,dragControlStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY,o=t.parentRotate,a=t.parentFlag,A=t.isPinch,s=t.isRequest,l=e.state,u=l.target,c=l.left,f=l.top,d=l.origin,p=l.beforeOrigin,h=l.direction,g=l.beforeDirection,v=l.targetTransform,B=l.moveableClientRect;if(!s&&!u)return!1;var m=e.getRect();if(n.rect=m,n.transform=v,n.left=c,n.top=f,n.fixedPosition=Kt(e,It(e)),n.absoluteInfo={origin:m.origin,startValue:m.rotation},Gn(e,n.absoluteInfo,r,i,d,B),s||A||a){var b=o||0;n.beforeInfo={origin:m.beforeOrigin,prevDeg:b,startDeg:b,prevSnapDeg:b,loop:0},n.afterInfo={origin:m.origin,prevDeg:b,startDeg:b,prevSnapDeg:b,loop:0}}else n.beforeInfo={origin:m.beforeOrigin},n.afterInfo={origin:m.origin},Gn(e,n.beforeInfo,r,i,p,B),Gn(e,n.afterInfo,r,i,d,B);n.direction=h,n.beforeDirection=g,n.startValue=0,n.datas={},Mt(t);var w=Ze(e,t,ae(ae({set:function(e){n.startValue=e*Math.PI/180}},_t(t)),{dragStart:Xn.dragStart(e,(new Bt).dragStart([0,0],t))})),E=et(e,"onRotateStart",w);return n.isRotate=!1!==E,e.state.snapRenderInfo={request:t.isRequest},!!n.isRotate&&w},dragControl:function(e,t){var n,r,i,o,a,A,s,l,u,c=t.datas,f=t.clientX,d=t.clientY,p=t.parentRotate,h=t.parentFlag,g=t.isPinch,v=t.groupDelta,B=c.beforeDirection,m=c.beforeInfo,b=c.afterInfo,w=c.absoluteInfo,E=c.isRotate,y=c.startValue,C=c.rect;if(E){Ct(t,"rotate");var Q,x,F,U,S,H,O,T,N,_=B*function(e){return De(e.datas.beforeTransform,[50,50],100,100).direction}(t),M=e.props,R=M.throttleRotate,k=void 0===R?0:R,I=M.parentMoveable,K=180/Math.PI*y,L=w.startValue;if(!h&&"parentDist"in t){var z=t.parentDist;Q=(n=Vn(e,C,b,z,0,K))[0],x=n[1],F=n[2],U=(r=Vn(e,C,m,z,0,K))[0],S=r[1],H=r[2],O=(i=Vn(e,C,w,z,0,L))[0],T=i[1],N=i[2]}else g||h?(Q=(o=Yn(e,C,b,p,_,K,k))[0],x=o[1],F=o[2],U=(a=Yn(e,C,m,p,B,K,k))[0],S=a[1],H=a[2],O=(A=Yn(e,C,w,p,_,L,k))[0],T=A[1],N=A[2]):(Q=(s=Wn(e,C,b,_,f,d,K,k))[0],x=s[1],F=s[2],U=(l=Wn(e,C,m,B,f,d,K,k))[0],S=l[1],H=l[2],O=(u=Wn(e,C,w,_,f,d,L,k))[0],T=u[1],N=u[2]);if(O||Q||U||I){var j=Qt(c,"rotate("+F+"deg)","rotate("+x+"deg)"),X=function(e,t,n,r){return kt(e,"rotate("+t+"deg)",It(e),n,r)}(e,x,c.fixedPosition,c),G=P(D(v||[0,0],X),c.prevInverseDist||[0,0]);c.prevInverseDist=X;var V=Ze(e,t,ae({delta:Q,dist:x,rotate:F,beforeDist:S,beforeDelta:U,beforeRotate:H,absoluteDist:T,absoluteDelta:O,absoluteRotate:N,isPinch:!!g},Pt(e,j,G,g,t)));return et(e,"onRotate",V),V}}},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isRotate&&(n.isRotate=!1,et(e,"onRotateEnd",$e(e,t,{})),r)},dragGroupControlCondition:Jn,dragGroupControlStart:function(e,t){var n=t.datas,r=e.state,i=r.left,o=r.top,a=r.beforeOrigin,A=this.dragControlStart(e,t);if(!A)return!1;A.set(n.beforeDirection*e.rotation);var s=wt(e,this,"dragControlStart",t,(function(e,t){var n=e.state,r=n.left,A=n.top,s=n.beforeOrigin,l=D(P([r,A],[i,o]),P(s,a));return t.datas.groupClient=l,ae(ae({},t),{parentRotate:0})})),l=et(e,"onRotateGroupStart",ae(ae({},A),{targets:e.props.targets,events:s}));return n.isRotate=!1!==l,!!n.isRotate&&A},dragGroupControl:function(e,t){var n=t.datas;if(n.isRotate){var r=this.dragControl(e,t);if(r){var i=n.beforeDirection,o=r.beforeDist,a=r.beforeDelta/180*Math.PI,A=wt(e,this,"dragControl",t,(function(e,t){var n=t.datas.groupClient,r=n[0],A=n[1],s=K([r,A],a*i),l=s[0],u=s[1],c=[l-r,u-A];return t.datas.groupClient=[l,u],ae(ae({},t),{parentRotate:o,groupDelta:c})}));e.rotation=i*r.beforeRotate;var s=ae({targets:e.props.targets,events:A,set:function(t){e.rotation=t}},r);return et(e,"onRotateGroup",s),s}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isRotate)return this.dragControlEnd(e,t),wt(e,this,"dragControlEnd",t),et(e,"onRotateGroupEnd",$e(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=0,r=e.getRotation();return{isControl:!0,requestStart:function(e){return{datas:t}},request:function(e){return"deltaRotate"in e?n+=e.deltaRotate:"rotate"in e&&(n=e.rotate-r),{datas:t,parentDist:n}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function Zn(e,t,n){var r=e.state,i=r.renderPoses,o=r.rotation,a=e.props,A=a.renderDirections,s=void 0===A?t:A,l=a.zoom,u=e.state.direction,c={};return s.forEach((function(e){c[e]=!0})),s.map((function(e){var t=ve[e];if(!t||!c[e])return null;var r=We(o/Math.PI*180,15)+Be[e];return u<1&&(r=360-r),r%=180,n.createElement("div",{className:be("control","direction",e),"data-rotation":r,"data-direction":e,key:"direction-"+e,style:Ke.apply(void 0,Ae([o,l],t.map((function(e){return i[e]}))))})}))}function $n(e,t,n,r,i,o){for(var a=[],A=6;A0&&(V[0]=1)),I||(K[1]<0?V[1]=-1:K[1]>0&&(V[1]=1)),N=V,M=(_=V)[0]*K[0],R=_[1]*K[1]}}var Y=_[0]||D?Math.max(k+M,1e-7):k,W=_[1]||D?Math.max(I+R,1e-7):I;D&&k&&I&&(x?W=Y/C:Y=W*C);var J=[0,0];if(A||(J=function(e,t,n,r,i,o,a){if(!bn(e,"resizable"))return[0,0];var A=e.state,s=A.allMatrix,l=A.is3d;return On(e,(function(e,o){return En(s,t+e,n+o,i,r,l)}),t,n,r,i,o,a)}(e,Y,W,N,P,d,r)),f&&(!f[0]&&(J[0]=0),!f[1]&&(J[1]=0)),D){_[0]&&_[1]&&J[0]&&J[1]&&(Math.abs(J[0])>Math.abs(J[1])?J[1]=0:J[0]=0);var q=!J[0]&&!J[1];q&&(x?Y=We(Y,S):W=We(W,S)),_[0]&&!_[1]||J[0]&&!J[1]||q&&x?W=(Y+=J[0])/C:(!_[0]&&_[1]||!J[0]&&J[1]||q&&!x)&&(Y=(W+=J[1])*C)}else k+M<-T&&(J[0]=0),k+R<-T&&(J[1]=0),Y+=J[0],W+=J[1],J[0]||(Y=We(Y,S)),J[1]||(W=We(W,S));Y=(n=y([Y,W],w,E,D))[0],W=n[1];var Z=[(M=(Y=Math.round(Y))-k)-m,(R=(W=Math.round(W))-I)-b];r.prevWidth=M,r.prevHeight=R;var $=Lt(e,Y,W,g,P,h);if(H||!Z.every((function(e){return!e}))||!$.every((function(e){return!e}))){var ee=Ze(e,t,{width:v+M,height:B+R,offsetWidth:Y,offsetHeight:W,direction:N,dist:[M,R],delta:Z,isPinch:!!A,drag:Xn.drag(e,vt(t,e.state,$,!!A,!1))});return et(e,"onResize",ee),ee}}},dragControlAfter:function(e,t){var n=t.datas,r=n.isResize,i=n.startOffsetWidth,o=n.startOffsetHeight,a=n.prevWidth,A=n.prevHeight;if(r){var s=e.state,l=s.width-(i+a),u=s.height-(o+A),c=Math.abs(l)>3,f=Math.abs(u)>3;return c&&(n.startWidth+=l,n.startOffsetWidth+=l,n.prevWidth+=l),f&&(n.startHeight+=u,n.startOffsetHeight+=u,n.prevHeight+=u),c||f?(this.dragControl(e,t),!0):void 0}},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isResize&&(n.isResize=!1,et(e,"onResizeEnd",$e(e,t,{})),r)},dragGroupControlCondition:ft,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var i=mt(e,"resizable",t);function o(t,r){var i=n.fixedDirection,o=n.fixedPosition,a=zt(t,i),A=I(L(-e.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),s=A[0],l=A[1];return r.datas.originalX=s,r.datas.originalY=l,r}var a=wt(e,this,"dragControlStart",t,(function(e,t){return o(e,t)})),A=ae(ae({},r),{targets:e.props.targets,events:a,setFixedDirection:function(t){r.setFixedDirection(t),a.forEach((function(n,r){n.setFixedDirection(t),o(e.moveables[r],i[r])}))}}),s=et(e,"onResizeGroupStart",A);return n.isResize=!1!==s,!!n.isResize&&r},dragGroupControl:function(e,t){var n=t.datas;if(n.isResize){var r=this.dragControl(e,t);if(r){var i=r.offsetWidth,o=r.offsetHeight,a=r.dist,A=e.props.keepRatio,s=[i/(i-a[0]),o/(o-a[1])],l=n.fixedPosition,u=wt(e,this,"dragControl",t,(function(t,n){var r=I(L(e.rotation/180*Math.PI,3),[n.datas.originalX*s[0],n.datas.originalY*s[1],1],3),i=r[0],o=r[1];return ae(ae({},n),{parentDist:null,parentScale:s,dragClient:D(l,[i,o]),parentKeepRatio:A})})),c=ae({targets:e.props.targets,events:u},r);return et(e,"onResizeGroup",c),c}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isResize)return this.dragControlEnd(e,t),wt(e,this,"dragControlEnd",t),et(e,"onResizeGroupEnd",$e(e,t,{targets:e.props.targets})),n},request:function(e){var t={},n=0,r=0,i=e.getRect();return{isControl:!0,requestStart:function(e){return{datas:t,parentDirection:e.direction||[1,1]}},request:function(e){return"offsetWidth"in e?n=e.offsetWidth-i.offsetWidth:"deltaWidth"in e&&(n+=e.deltaWidth),"offsetHeight"in e?r=e.offsetHeight-i.offsetHeight:"deltaHeight"in e&&(r+=e.deltaHeight),{datas:t,parentDist:[n,r]}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},rr={name:"scalable",ableGroup:"size",canPinch:!0,props:{scalable:Boolean,throttleScale:Number,renderDirections:String,keepRatio:Boolean},events:{onScaleStart:"scaleStart",onScale:"scale",onScaleEnd:"scaleEnd",onScaleGroupStart:"scaleGroupStart",onScaleGroup:"scaleGroup",onScaleGroupEnd:"scaleGroupEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.scalable,o=n.edge;if(!r&&i)return o?tr(e,t):er(e,t)},dragControlCondition:ft,dragControlStart:function(e,t){var n=t.datas,r=t.isPinch,i=t.inputEvent,o=t.parentDirection||(r?[0,0]:Ge(i.target)),a=e.state,A=a.width,s=a.height,l=a.targetTransform,u=a.target;if(!o||!u)return!1;r||yt(e,t),Mt(t),n.datas={},n.transform=l,n.prevDist=[1,1],n.direction=o,n.width=A,n.height=s,n.startValue=[1,1];var c=!o[0]&&!o[1]||o[0]||!o[1];function f(t){n.fixedDirection=t,n.fixedPosition=zt(e,t)}n.isWidth=c,f([-o[0],-o[1]]);var d=Ze(e,t,ae(ae({direction:o,set:function(e){n.startValue=e},setFixedDirection:f},_t(t)),{dragStart:Xn.dragStart(e,(new Bt).dragStart([0,0],t))}));return!1!==et(e,"onScaleStart",d)&&(n.isScale=!0,e.state.snapRenderInfo={request:t.isRequest,direction:o}),!!n.isScale&&d},dragControl:function(e,t){Ct(t,"scale");var n=t.datas,r=t.distX,i=t.distY,o=t.parentScale,a=t.parentDistance,A=t.parentKeepRatio,s=t.parentFlag,u=t.isPinch,c=t.dragClient,f=t.parentDist,d=t.isRequest,p=n.prevDist,h=n.direction,g=n.width,v=n.height,B=n.isScale,m=n.startValue,b=n.isWidth,w=n.fixedDirection;if(!B)return!1;var E=e.props,y=E.throttleScale,C=E.parentMoveable,x=h;h[0]||h[1]||(x=[1,1]);var F=e.props.keepRatio||A,U=e.state,S=g*m[0],H=v*m[1],O=S/H,T=1,N=1,_=c;if(c||(_=!s&&u?zt(e,[0,0]):n.fixedPosition),f)T=(g+f[0])/g,N=(v+f[1])/v;else if(o)T=o[0],N=o[1];else if(u)a&&(T=(g+a)/g,N=(v+a*v/g)/v);else{var M=St({datas:n,distX:r,distY:i}),R=x[0]*M[0],D=x[1]*M[1];if(F&&g&&v){var k=Q([0,0],M),I=Q([0,0],x),K=Q([0,0],[S,H]),L=Pe([R,D]),z=Math.cos(k-I)*L;x[0]?x[1]?(R=Math.cos(K)*z,D=Math.sin(K)*z):D=(R=z)/O:R=(D=z)*O}T=(g+R)/g,N=(v+D)/v}T=x[0]||F?T*m[0]:m[0],N=x[1]||F?N*m[1]:m[1],0===T&&(T=1e-9*(p[0]>0?1:-1)),0===N&&(N=1e-9*(p[1]>0?1:-1));var j=[T/m[0],N/m[1]],X=[T,N];if(!u&&e.props.groupable){var G=(U.snapRenderInfo||{}).direction;l(G)&&(G[0]||G[1])&&(U.snapRenderInfo={direction:h,request:t.isRequest})}var V=[0,0];if(u||(V=Nn(e,j,h,d,n)),F){x[0]&&x[1]&&V[0]&&V[1]&&(Math.abs(V[0])>Math.abs(V[1])?V[1]=0:V[0]=0);var Y=!V[0]&&!V[1];if(Y&&(b?j[0]=We(j[0]*m[0],y)/m[0]:j[1]=We(j[1]*m[1],y)/m[1]),x[0]&&!x[1]||V[0]&&!V[1]||Y&&b){j[0]+=V[0];var W=g*j[0]*m[0]/O;j[1]=W/v/m[1]}else if(!x[0]&&x[1]||!V[0]&&V[1]||Y&&!b){j[1]+=V[1];var J=v*j[1]*m[1]*O;j[0]=J/g/m[0]}}else j[0]+=V[0],j[1]+=V[1],V[0]||(j[0]=We(j[0]*m[0],y)/m[0]),V[1]||(j[1]=We(j[1]*m[1],y)/m[1]);0===j[0]&&(j[0]=1e-9*(p[0]>0?1:-1)),0===j[1]&&(j[1]=1e-9*(p[1]>0?1:-1));var q,Z,$=[j[0]/p[0],j[1]/p[1]];Z=m,X=[(q=j)[0]*Z[0],q[1]*Z[1]];var ee=function(e,t,n,r,i){return kt(e,"scale("+t.join(", ")+")",n,r,i)}(e,j,w,_,n),te=P(ee,n.prevInverseDist||[0,0]);if(n.prevDist=j,n.prevInverseDist=ee,T===p[0]&&N===p[1]&&te.every((function(e){return!e}))&&!C)return!1;var ne=Qt(n,"scale("+X.join(", ")+")","scale("+j.join(", ")+")"),re=Ze(e,t,ae({offsetWidth:g,offsetHeight:v,direction:h,scale:X,dist:j,delta:$,isPinch:!!u},Pt(e,ne,te,u,t)));return et(e,"onScale",re),re},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isScale&&(n.isScale=!1,et(e,"onScaleEnd",$e(e,t,{})),r)},dragGroupControlCondition:ft,dragGroupControlStart:function(e,t){var n=t.datas,r=this.dragControlStart(e,t);if(!r)return!1;var i=mt(e,"resizable",t);function o(t,r){var i=n.fixedDirection,o=n.fixedPosition,a=zt(t,i),A=I(L(-e.rotation/180*Math.PI,3),[a[0]-o[0],a[1]-o[1],1],3),s=A[0],l=A[1];return r.datas.originalX=s,r.datas.originalY=l,r}n.moveableScale=e.scale;var a=wt(e,this,"dragControlStart",t,(function(e,t){return o(e,t)})),A=ae(ae({},r),{targets:e.props.targets,events:a,setFixedDirection:function(t){r.setFixedDirection(t),a.forEach((function(n,r){n.setFixedDirection(t),o(e.moveables[r],i[r])}))}}),s=et(e,"onScaleGroupStart",A);return n.isScale=!1!==s,!!n.isScale&&A},dragGroupControl:function(e,t){var n=t.datas;if(n.isScale){var r=this.dragControl(e,t);if(r){var i=n.moveableScale;e.scale=[r.scale[0]*i[0],r.scale[1]*i[1]];var o=e.props.keepRatio,a=r.dist,A=r.scale,s=n.fixedPosition,l=wt(e,this,"dragControl",t,(function(t,n){var r=I(L(e.rotation/180*Math.PI,3),[n.datas.originalX*a[0],n.datas.originalY*a[1],1],3),i=r[0],l=r[1];return ae(ae({},n),{parentDist:null,parentScale:A,parentKeepRatio:o,dragClient:D(s,[i,l])})})),u=ae({targets:e.props.targets,events:l},r);return et(e,"onScaleGroup",u),u}}},dragGroupControlEnd:function(e,t){var n=t.isDrag;if(t.datas.isScale)return this.dragControlEnd(e,t),wt(e,this,"dragControlEnd",t),et(e,"onScaleGroupEnd",$e(e,t,{targets:e.props.targets})),n},request:function(){var e={},t=0,n=0;return{isControl:!0,requestStart:function(t){return{datas:e,parentDirection:t.direction||[1,1]}},request:function(r){return t+=r.deltaWidth,n+=r.deltaHeight,{datas:e,parentDist:[t,n]}},requestEnd:function(){return{datas:e,isDrag:!0}}}}};function ir(e,t){return e.map((function(e,n){return r=e,i=t[n],(r*(a=2)+i*(o=1))/(o+a);var r,i,o,a}))}function or(e,t,n){var r=Q(e,t),i=Q(e,n)-r;return i>=0?i:i+2*Math.PI}var ar={name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(e,t){var n=e.props,r=n.resizable,i=n.scalable,o=n.warpable,a=n.zoom;if(r||i||!o)return[];var A=e.state,s=A.pos1,l=A.pos2,u=A.pos3,c=A.pos4,f=ir(s,l),d=ir(l,s),p=ir(s,u),h=ir(u,s),g=ir(u,c),v=ir(c,u),B=ir(l,c),m=ir(c,l);return Ae([t.createElement("div",{className:be("line"),key:"middeLine1",style:Ie(f,g,a)}),t.createElement("div",{className:be("line"),key:"middeLine2",style:Ie(d,v,a)}),t.createElement("div",{className:be("line"),key:"middeLine3",style:Ie(p,B,a)}),t.createElement("div",{className:be("line"),key:"middeLine4",style:Ie(h,m,a)})],er(e,t))},dragControlCondition:function(e){return!e.isRequest&&F(e.inputEvent.target,be("direction"))},dragControlStart:function(e,t){var n=t.datas,r=t.inputEvent,i=e.props.target,o=Ge(r.target);if(!o||!i)return!1;var a=e.state,A=a.transformOrigin,s=a.is3d,l=a.targetTransform,u=a.targetMatrix,c=a.width,f=a.height,d=a.left,p=a.top;return n.datas={},n.targetTransform=l,n.warpTargetMatrix=s?u:_(u,3,4),n.targetInverseMatrix=O(T(n.warpTargetMatrix,4),3,4),n.direction=o,n.left=d,n.top=p,yt(e,t),Mt(t),n.poses=[[0,0],[c,0],[0,f],[c,f]].map((function(e){return P(e,A)})),n.nextPoses=n.poses.map((function(e){var t=e[0],r=e[1];return I(n.warpTargetMatrix,[t,r,0,1],4)})),n.startValue=z(4),n.prevMatrix=z(4),n.absolutePoses=Ye(a),n.posIndexes=Ht(o),a.snapRenderInfo={request:t.isRequest,direction:o},!1!==et(e,"onWarpStart",Ze(e,t,ae({set:function(e){n.startValue=e}},_t(t))))&&(n.isWarp=!0),n.isWarp},dragControl:function(e,t){var n=t.datas,r=t.isRequest,i=t.distX,o=t.distY,a=n.targetInverseMatrix,A=n.prevMatrix,s=n.isWarp,l=n.startValue,u=n.poses,c=n.posIndexes,f=n.absolutePoses;if(!s)return!1;if(Ct(t,"matrix3d"),bn(e,"warpable")){var d=c.map((function(e){return f[e]}));d.length>1&&d.push([(d[0][0]+d[1][0])/2,(d[0][1]+d[1][1])/2]);var p=xn(e,r,d.map((function(e){return[e[0]+i,e[1]+o]}))),h=p.horizontal,g=p.vertical;o-=h.offset,i-=g.offset}var v=St({datas:n,distX:i,distY:o},!0),B=n.nextPoses.slice();if(c.forEach((function(e){B[e]=D(B[e],v)})),!de.every((function(e){return function(e,t){var n=or(e[0],e[1],e[2]),r=or(t[0],t[1],t[2]),i=Math.PI;return!(n>=i&&r<=i||n<=i&&r>=i)}(e.map((function(e){return u[e]})),e.map((function(e){return B[e]})))})))return!1;var m=G(u[0],u[2],u[1],u[3],B[0],B[2],B[1],B[3]);if(!m.length)return!1;var b=Ft(n,R(a,m,4),!0),w=R(T(A,4),b,4);n.prevMatrix=b;var E=R(l,b,4),y=Qt(n,"matrix3d("+E.join(", ")+")","matrix3d("+b.join(", ")+")");return Dt(t,y),et(e,"onWarp",Ze(e,t,{delta:w,matrix:E,dist:b,multiply:R,transform:y})),!0},dragControlEnd:function(e,t){var n=t.datas,r=t.isDrag;return!!n.isWarp&&(n.isWarp=!1,et(e,"onWarpEnd",$e(e,t,{})),r)}},Ar=be("area-pieces"),sr=be("area-piece"),lr=be("avoid");function ur(e){var t=e.areaElement,n=e.state,r=n.width,i=n.height;!function(e,t){if(e.classList)e.classList.remove(t);else{var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}(t,lr),t.style.cssText+="left: 0px; top: 0px; width: "+r+"px; height: "+i+"px"}function cr(e){return e.createElement("div",{key:"area_pieces",className:Ar},e.createElement("div",{className:sr}),e.createElement("div",{className:sr}),e.createElement("div",{className:sr}),e.createElement("div",{className:sr}))}var fr={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(e,t){var n=e.props,r=n.target,o=n.dragArea,a=n.groupable,A=n.passDragArea,s=e.state,l=s.width,u=s.height,c=s.renderPoses,f=A?be("area","pass"):be("area");if(a)return[t.createElement("div",{key:"area",ref:Object(i.d)(e,"areaElement"),className:f}),cr(t)];if(!r||!o)return[];var d=G([0,0],[l,0],[0,u],[l,u],c[0],c[1],c[2],c[3]),p=d.length?He(d,!0):"none";return[t.createElement("div",{key:"area",ref:Object(i.d)(e,"areaElement"),className:f,style:{top:"0px",left:"0px",width:l+"px",height:u+"px",transformOrigin:"0 0",transform:p}}),cr(t)]},dragStart:function(e,t){var n=t.datas,r=t.clientX,i=t.clientY;if(!t.inputEvent)return!1;n.isDragArea=!1;var o,a,A=e.areaElement,s=e.state,l=s.moveableClientRect,u=s.renderPoses,c=s.rootMatrix,f=s.is3d,d=l.left,p=l.top,h=Me(u),g=h.left,v=h.top,B=h.width,m=h.height,b=At(c,[r-d,i-p],f?4:3),w=b[0],E=b[1],y=[{left:g,top:v,width:B,height:(E-=v)-10},{left:g,top:v,width:(w-=g)-10,height:m},{left:g,top:v+E+10,width:B,height:m-E-10},{left:g+w+10,top:v,width:B-w-10,height:m}],C=[].slice.call(A.nextElementSibling.children);y.forEach((function(e,t){C[t].style.cssText="left: "+e.left+"px;top: "+e.top+"px; width: "+e.width+"px; height: "+e.height+"px;"})),a=lr,(o=A).classList?o.classList.add(a):o.className+=" "+a},drag:function(e,t){var n=t.datas;if(!t.inputEvent)return!1;n.isDragArea||(n.isDragArea=!0,ur(e))},dragEnd:function(e,t){var n=t.inputEvent,r=t.datas;if(!n)return!1;r.isDragArea||ur(e)},dragGroupStart:function(e,t){return this.dragStart(e,t)},dragGroup:function(e,t){return this.drag(e,t)},dragGroupEnd:function(e,t){return this.dragEnd(e,t)},unset:function(e){ur(e)}},dr={name:"origin",props:{origin:Boolean},events:{},render:function(e,t){var n=e.props.zoom,r=e.state,i=r.beforeOrigin,o=r.rotation;return[t.createElement("div",{className:be("control","origin"),style:Ke(o,n,i),key:"beforeOrigin"})]}};function pr(e){var t=e.scrollContainer;return[t.scrollLeft,t.scrollTop]}var hr={name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragStart:function(e,t){var n=e.props.scrollContainer,r=void 0===n?e.getContainer():n,i=new $.a,o=pt(r,!0);t.datas.dragScroll=i;var a=t.isControl?"controlGesto":"targetGesto",A=t.targets;i.on("scroll",(function(n){var r=n.container,i=n.direction,o=Ze(e,t,{scrollContainer:r,direction:i}),a=A?"onScrollGroup":"onScroll";A&&(o.targets=A),et(e,a,o)})).on("move",(function(n){var r=n.offsetX,i=n.offsetY;e[a].scrollBy(r,i,t.inputEvent,!1)})),i.dragStart(t,{container:o})},checkScroll:function(e,t){var n=t.datas.dragScroll;if(n){var r=e.props,i=r.scrollContainer,o=void 0===i?e.getContainer():i,a=r.scrollThreshold,A=void 0===a?0:a,s=r.getScrollPosition,l=void 0===s?pr:s;return n.drag(t,{container:o,threshold:A,getScrollPosition:function(e){return l({scrollContainer:e.container,direction:e.direction})}}),!0}},drag:function(e,t){return this.checkScroll(e,t)},dragEnd:function(e,t){t.datas.dragScroll.dragEnd(),t.datas.dragScroll=null},dragControlStart:function(e,t){return this.dragStart(e,ae(ae({},t),{isControl:!0}))},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupStart:function(e,t){return this.dragStart(e,ae(ae({},t),{targets:e.props.targets}))},dragGroup:function(e,t){return this.drag(e,ae(ae({},t),{targets:e.props.targets}))},dragGroupEnd:function(e,t){return this.dragEnd(e,ae(ae({},t),{targets:e.props.targets}))},dragGroupControlStart:function(e,t){return this.dragStart(e,ae(ae({},t),{targets:e.props.targets,isControl:!0}))},dragGroupContro:function(e,t){return this.drag(e,ae(ae({},t),{targets:e.props.targets}))},dragGroupControEnd:function(e,t){return this.dragEnd(e,ae(ae({},t),{targets:e.props.targets}))}},gr={name:"",props:{target:Object,dragTarget:Object,container:Object,rootContainer:Object,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,props:Object},events:{}},vr={name:"padding",props:{padding:Object},events:{},render:function(e,t){var n=e.props;if(n.dragArea)return[];var r=n.padding||{},i=r.left,o=void 0===i?0:i,a=r.top,A=void 0===a?0:a,s=r.right,l=void 0===s?0:s,u=r.bottom,c=void 0===u?0:u,f=e.state,d=f.renderPoses,p=[f.pos1,f.pos2,f.pos3,f.pos4],h=[];return o>0&&h.push([0,2]),A>0&&h.push([0,1]),l>0&&h.push([1,3]),c>0&&h.push([2,3]),h.map((function(e,n){var r=e[0],i=e[1],o=G([0,0],[100,0],[0,100],[100,100],p[r],p[i],d[r],d[i]);if(o.length)return t.createElement("div",{key:"padding"+n,className:be("padding"),style:{transform:He(o,!0)}})}))}},Br=["nw","ne","se","sw"];function mr(e,t){var n=e[0]+e[1],r=n>t?t/n:1;return e[0]*=r,e[1]=t-e[1]*r,e}var br=[1,2,5,6],wr=[0,3,4,7],Er=[1,-1,-1,1],yr=[1,1,-1,-1];function Cr(e,t,n,r,i,o,a,A,s){void 0===o&&(o=0),void 0===a&&(a=0),void 0===A&&(A=r),void 0===s&&(s=i);var l=[],u=!1,c=e.map((function(e,c){var f=t[c],d=f.horizontal,p=f.vertical;if(p&&!u&&(u=!0,l.push("/")),u){var h=Math.max(0,1===p?e[1]-a:s-e[1]);return l.push(ut(h,i,n)),h}h=Math.max(0,1===d?e[0]-o:A-e[0]);return l.push(ut(h,r,n)),h}));return{styles:l,raws:c}}function Qr(e){for(var t=[0,0],n=[0,0],r=e.length,i=0;i-1?e.slice(0,u):e).length,f=e.slice(0,c),d=e.slice(c+1),p=f[0],h=void 0===p?"0px":p,g=f[1],v=void 0===g?h:g,B=f[2],m=void 0===B?h:B,w=f[3],E=void 0===w?v:w,y=d[0],C=void 0===y?h:y,Q=d[1],x=void 0===Q?C:Q,F=d[2],U=void 0===F?C:F,S=d[3],H=void 0===S?x:S,O=[h,v,m,E].map((function(e){return b(e,t)})),T=[C,x,U,H].map((function(e){return b(e,n)})),N=O.slice(),_=T.slice();a=mr([N[0],N[1]],t),N[0]=a[0],N[1]=a[1],A=mr([N[3],N[2]],t),N[3]=A[0],N[2]=A[1],s=mr([_[0],_[3]],n),_[0]=s[0],_[3]=s[1],l=mr([_[1],_[2]],n),_[1]=l[0],_[2]=l[1];var M=N.slice(0,Math.max(o[0],f.length)),R=_.slice(0,Math.max(o[1],d.length));return Ae(M.map((function(e,t){var o=Br[t];return{horizontal:Er[t],vertical:0,pos:[r+e,i+(-1===yr[t]?n:0)],sub:!0,raw:O[t],direction:o}})),R.map((function(e,n){var o=Br[n];return{horizontal:0,vertical:yr[n],pos:[r+(-1===Er[n]?t:0),i+e],sub:!0,raw:T[n],direction:o}})))}function Fr(e,t,n,r,i){void 0===i&&(i=t.length);var o=Qr(e.slice(r)),a=o.horizontalRange,A=o.verticalRange,s=n-r,l=0;if(0===s)l=i;else if(s>0&&s=A[0]))return;l=A[0]+A[1]-s}e.splice(n,l),t.splice(n,l)}function Ur(e,t,n,r,i,o,a,A,s,l,u){void 0===l&&(l=0),void 0===u&&(u=0);var c=Qr(e.slice(n)),f=c.horizontalRange,d=c.verticalRange;if(r>-1)for(var p=1===Er[r]?o-l:A-o,h=f[1];h<=r;++h){var g=1===yr[h]?u:s,v=0;if(r===h?v=o:0===h?v=l+p:-1===Er[h]&&(v=A-(t[n][0]-l)),e.splice(n+h,0,{horizontal:Er[h],vertical:0,pos:[v,g]}),t.splice(n+h,0,[v,g]),0===h)break}else if(i>-1){var B=1===yr[i]?a-u:s-a;if(0===f[1]&&0===d[1]){var m=[l+B,u];e.push({horizontal:Er[0],vertical:0,pos:m}),t.push(m)}var b=d[0];for(h=d[1];h<=i;++h){v=1===Er[h]?l:A,g=0;if(i===h?g=a:0===h?g=u+B:1===yr[h]?g=t[n+b][1]:-1===yr[h]&&(g=s-(t[n+b][1]-u)),e.push({horizontal:0,vertical:yr[h],pos:[v,g]}),t.push([v,g]),0===h)break}}}function Sr(e,t){return void 0===t&&(t=e.map((function(e){return e.raw}))),{horizontals:e.map((function(e,n){return e.horizontal?t[n]:null})).filter((function(e){return null!=e})),verticals:e.map((function(e,n){return e.vertical?t[n]:null})).filter((function(e){return null!=e}))}}var Hr=[[0,-1,"n"],[1,0,"e"]],Or=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function Tr(e,t,n){var r=e.props.clipRelative,i=e.state,o=i.width,a=i.height,A=t,s=A.type,l=A.poses,u="rect"===s,c="circle"===s;if("polygon"===s)return n.map((function(e){return ut(e[0],o,r)+" "+ut(e[1],a,r)}));if(u||"inset"===s){var f=n[1][1],d=n[3][0],p=n[7][0],h=n[5][1];if(u)return[f,d,h,p].map((function(e){return e+"px"}));var g=[f,o-d,a-h,p].map((function(e,t){return ut(e,t%2?o:a,r)}));if(n.length>8){var v=P(n[4],n[0]),B=v[0],m=v[1];g.push.apply(g,Ae(["round"],Cr(n.slice(8),l.slice(8),r,B,m,p,f,d,h).styles))}return g}if(c||"ellipse"===s){var b=n[0],w=ut(Math.abs(n[1][1]-b[1]),c?Math.sqrt((o*o+a*a)/2):a,r);return(g=c?[w]:[ut(Math.abs(n[2][0]-b[0]),o,r),w]).push("at",ut(b[0],o,r),ut(b[1],a,r)),g}}function Nr(e,t,n,r){var i=[r,(r+t)/2,t],o=[e,(e+n)/2,n];return Or.map((function(e){var t=e[0],n=e[1],r=e[2],a=i[t+1],A=o[n+1];return{vertical:Math.abs(n),horizontal:Math.abs(t),direction:r,pos:[a,A]}}))}function _r(e,t,n,r,i){var o,a,A,s,l,u,c,f=i;if(!f){var d=getComputedStyle(e),B=d.clipPath;f="none"!==B?B:d.clip}if(f&&"none"!==f&&"auto"!==f||(f=r)){var m=g(f),w=m.prefix,E=void 0===w?f:w,y=m.value,C=void 0===y?"":y,Q="circle"===E,x=" ";if("polygon"===E)return x=",",{type:E,clipText:f,poses:R=(O=h(C||"0% 0%, 100% 0%, 100% 100%, 0% 100%")).map((function(e){var r=e.split(" "),i=r[0],o=r[1];return{vertical:1,horizontal:1,pos:[b(i,t),b(o,n)]}})),splitter:x};if(Q||"ellipse"===E){var F="",U="",S=0,H=0,O=p(C);if(Q){var T;T=void 0===(o=O[0])?"50%":o,F=void 0===(a=O[2])?"50%":a,U=void 0===(A=O[3])?"50%":A,S=b(T,Math.sqrt((t*t+n*n)/2)),H=S}else{var N,_;N=void 0===(s=O[0])?"50%":s,_=void 0===(l=O[1])?"50%":l,F=void 0===(u=O[3])?"50%":u,U=void 0===(c=O[4])?"50%":c,S=b(N,t),H=b(_,n)}var M=[b(F,t),b(U,n)],R=Ae([{vertical:1,horizontal:1,pos:M,direction:"nesw"}],Hr.slice(0,Q?1:2).map((function(e){return{vertical:Math.abs(e[1]),horizontal:e[0],direction:e[2],sub:!0,pos:[M[0]+e[0]*S,M[1]+e[1]*H]}})));return{type:E,clipText:f,radiusX:S,radiusY:H,left:M[0]-S,top:M[1]-H,poses:R,splitter:x}}if("inset"===E){var D=(O=p(C||"0 0 0 0")).indexOf("round"),P=(D>-1?O.slice(0,D):O).length,k=O.slice(P+1),I=O.slice(0,P),K=I[0],L=I[1],z=void 0===L?K:L,j=I[2],X=void 0===j?K:j,G=I[3],V=void 0===G?z:G,Y=[K,X].map((function(e){return b(e,n)})),W=Y[0],J=Y[1],q=[V,z].map((function(e){return b(e,t)})),Z=q[0],$=q[1],ee=t-$,te=n-J,ne=xr(k,ee-Z,te-W,Z,W);return{type:"inset",clipText:f,poses:R=Ae(Nr(W,ee,te,Z),ne),top:W,left:Z,right:ee,bottom:te,radius:k,splitter:x}}if("rect"===E){x=",";var re=(O=h(C||"0px, "+t+"px, "+n+"px, 0px")).map((function(e){return v(e).value}));return{type:"rect",clipText:f,poses:R=Nr(W=re[0],$=re[1],J=re[2],Z=re[3]),top:W,right:$,bottom:J,left:Z,values:O,splitter:x}}}}var Mr={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}",":host {\n --bounds-color: #d66;\n}",".guideline {\n pointer-events: none;\n z-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(e,t){var n=e.props,r=n.customClipPath,i=n.defaultClipPath,o=n.clipArea,a=n.zoom,A=e.state,s=A.target,l=A.width,u=A.height,c=A.allMatrix,f=A.is3d,d=A.left,p=A.top,h=A.pos1,g=A.pos2,v=A.pos3,B=A.pos4,m=A.clipPathState,b=A.snapBoundInfos;if(!s)return[];var w=_r(s,l,u,i||"inset",m||r);if(!w)return[];var E=f?4:3,y=w.type,C=w.poses.map((function(e){var t=Ne(c,e.pos,E);return[t[0]-d,t[1]-p]})),x=[],F=[],U="rect"===y,S="inset"===y,H="polygon"===y;if(U||S||H){var O=S?C.slice(0,8):C;F=O.map((function(e,n){var r=0===n?O[O.length-1]:O[n-1],i=Q(r,e),o=ke(r,e);return t.createElement("div",{key:"clipLine"+n,className:be("line","clip-line","snap-control"),"data-clip-index":n,style:{width:o+"px",transform:"translate("+r[0]+"px, "+r[1]+"px) rotate("+i+"rad) scaleY("+a+")"}})}))}if(x=C.map((function(e,n){return t.createElement("div",{key:"clipControl"+n,className:be("control","clip-control","snap-control"),"data-clip-index":n,style:{transform:"translate("+e[0]+"px, "+e[1]+"px) scale("+a+")"}})})),S&&x.push.apply(x,C.slice(8).map((function(e,n){return t.createElement("div",{key:"clipRadiusControl"+n,className:be("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+n,style:{transform:"translate("+e[0]+"px, "+e[1]+"px) scale("+a+")"}})}))),"circle"===y||"ellipse"===y){var T=w.left,N=w.top,_=w.radiusX,M=w.radiusY,R=P(Ne(c,[T,N],E),Ne(c,[0,0],E)),D=R[0],k=R[1],I="none";if(!o){for(var K=Math.max(10,_/5,M/5),L=[],z=0;z<=K;++z){var j=2*Math.PI/K*z;L.push([_+(_-a)*Math.cos(j),M+(M-a)*Math.sin(j)])}L.push([_,-2]),L.push([-2,-2]),L.push([-2,2*M+2]),L.push([2*_+2,2*M+2]),L.push([2*_+2,-2]),L.push([_,-2]),I="polygon("+L.map((function(e){return e[0]+"px "+e[1]+"px"})).join(", ")+")"}x.push(t.createElement("div",{key:"clipEllipse",className:be("clip-ellipse","snap-control"),style:{width:2*_+"px",height:2*M+"px",clipPath:I,transform:"translate("+(-d+D)+"px, "+(-p+k)+"px) "+He(c)}}))}if(o){var X=Me(Ae([h,g,v,B],C)),G=X.width,V=X.height,Y=X.left,W=X.top;if(H||U||S){L=S?C.slice(0,8):C;x.push(t.createElement("div",{key:"clipArea",className:be("clip-area","snap-control"),style:{width:G+"px",height:V+"px",transform:"translate("+Y+"px, "+W+"px)",clipPath:"polygon("+L.map((function(e){return e[0]-Y+"px "+(e[1]-W)+"px"})).join(", ")+")"}}))}}return b&&["vertical","horizontal"].forEach((function(e){var n=b[e],r="horizontal"===e;n.isSnap&&F.push.apply(F,n.snap.posInfos.map((function(n,i){var o=n.pos,A=P(Ne(c,r?[0,o]:[o,0],E),[d,p]),s=P(Ne(c,r?[l,o]:[o,u],E),[d,p]);return $n(t,"",A,s,a,"clip"+e+"snap"+i,"guideline")}))),n.isBound&&F.push.apply(F,n.bounds.map((function(n,i){var o=n.pos,A=P(Ne(c,r?[0,o]:[o,0],E),[d,p]),s=P(Ne(c,r?[l,o]:[o,u],E),[d,p]);return $n(t,"",A,s,a,"clip"+e+"bounds"+i,"guideline","bounds","bold")})))})),Ae(x,F)},dragControlCondition:function(e){return e.inputEvent&&(e.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,t){var n=e.props.dragWithClip;return!(void 0===n||n)&&this.dragControlStart(e,t)},drag:function(e,t){return this.dragControl(e,t)},dragEnd:function(e,t){return this.dragControlEnd(e,t)},dragControlStart:function(e,t){var n=e.state,r=e.props,i=r.defaultClipPath,o=r.customClipPath,a=n.target,A=n.width,s=n.height,l=t.inputEvent?t.inputEvent.target:null,u=l?l.getAttribute("class"):"",c=t.datas,f=_r(a,A,s,i||"inset",o);if(!f)return!1;var d=f.clipText;return!1===et(e,"onClipStart",Ze(e,t,{clipType:f.type,clipStyle:d,poses:f.poses.map((function(e){return e.pos}))}))?(c.isClipStart=!1,!1):(c.isControl=u.indexOf("clip-control")>-1,c.isLine=u.indexOf("clip-line")>-1,c.isArea=u.indexOf("clip-area")>-1||u.indexOf("clip-ellipse")>-1,c.index=l?parseInt(l.getAttribute("data-clip-index"),10):-1,c.clipPath=f,c.isClipStart=!0,n.clipPathState=d,yt(e,t),!0)},dragControl:function(e,t){var n=t.datas,r=t.originalDatas;if(!n.isClipStart)return!1;var i=r&&r.draggable||{},o=n,a=o.isControl,A=o.isLine,s=o.isArea,l=o.index,u=o.clipPath;if(!u)return!1;var c=i.isDrag?i.prevDist:St(t),f=c[0],d=c[1],p=e.props,h=e.state,g=h.width,v=h.height,B=!s&&!a&&!A,m=u.type,w=u.poses,E=u.splitter,y=w.map((function(e){return e.pos}));B&&(f=-f,d=-d);var C=!a||"nesw"===w[l].direction,Q="inset"===m||"rect"===m,x=w.map((function(){return[0,0]}));if(a&&!C){var F=w[l],U=F.horizontal,S=F.vertical,H=[f*Math.abs(U),d*Math.abs(S)];x=function(e,t,n,r){var i=e[t],o=i.direction,a=i.sub,A=e.map((function(){return[0,0]})),s=o?o.split(""):[];if(r&&t<8){var l=s.filter((function(e){return"w"===e||"e"===e}))[0],u=s.filter((function(e){return"n"===e||"s"===e}))[0];A[t]=n,e.forEach((function(e,t){var r=e.direction;r&&(r.indexOf(l)>-1&&(A[t][0]=n[0]),r.indexOf(u)>-1&&(A[t][1]=n[1]))})),l&&(A[1][0]=n[0]/2,A[5][0]=n[0]/2),u&&(A[3][1]=n[1]/2,A[7][1]=n[1]/2)}else o&&!a?s.forEach((function(t){var r="n"===t||"s"===t;e.forEach((function(e,i){var o=e.direction,a=e.horizontal,s=e.vertical;o&&-1!==o.indexOf(t)&&(A[i]=[r||!a?0:n[0],r&&s?n[1]:0])}))})):A[t]=n;return A}(w,l,H,Q)}else C&&(x=y.map((function(){return[f,d]})));var O=y.map((function(e,t){return D(e,x[t])})),T=Ae(O);h.snapBoundInfos=null;var N="circle"===u.type,_="ellipse"===u.type;if(N||_){var M=Me(O),R=Math.abs(M.bottom-M.top),P=Math.abs(_?M.right-M.left:R),k=O[0][1]+R,I=O[0][0]-P,K=O[0][0]+P;N&&(T.push([K,M.bottom]),x.push([1,0])),T.push([M.left,k]),x.push([0,1]),T.push([I,M.bottom]),x.push([1,0])}var L=Gt([],g,v,(p.clipHorizontalGuidelines||[]).map((function(e){return b(""+e,v)})),(p.clipVerticalGuidelines||[]).map((function(e){return b(""+e,g)}))),z=[],j=[];if(N||_)z=[T[4][0],T[2][0]],j=[T[1][1],T[3][1]];else if(Q){var X=[T[0],T[2],T[4],T[6]],G=[x[0],x[2],x[4],x[6]];z=X.filter((function(e,t){return G[t][0]})).map((function(e){return e[0]})),j=X.filter((function(e,t){return G[t][1]})).map((function(e){return e[1]}))}else z=T.filter((function(e,t){return x[t][0]})).map((function(e){return e[0]})),j=T.filter((function(e,t){return x[t][1]})).map((function(e){return e[1]}));for(var V=function(e){var t=Fn(L,p.clipTargetBounds&&{left:0,top:0,right:g,bottom:v},z,j,{snapThreshold:5}),n=t.horizontal,r=t.vertical,i=n.offset,o=r.offset;if(!_&&!N||0!==x[0][0]||0!==x[0][1])return T.forEach((function(e,t){var n=x[t];n[0]&&(e[0]-=o),n[1]&&(e[1]-=i)})),"break";var a=Me(O),A=a.bottom-a.top,s=_?a.right-a.left:A;s-=r.isBound?Math.abs(o):0===r.snapIndex?-o:o,A-=n.isBound?Math.abs(i):0===n.snapIndex?-i:i,N&&(s=A=en(r,n)>0?A:s);var l=T[0];T[1][1]=l[1]-A,T[2][0]=l[0]+s,T[3][1]=l[1]+A,T[4][0]=l[0]-s},Y=0;Y<2;++Y){if("break"===V())break}var W=Tr(e,u,O),J=m+"("+W.join(E)+")";if(h.clipPathState=J,N||_)z=[T[4][0],T[2][0]],j=[T[1][1],T[3][1]];else if(Q){X=[T[0],T[2],T[4],T[6]];z=X.map((function(e){return e[0]})),j=X.map((function(e){return e[1]}))}else z=T.map((function(e){return e[0]})),j=T.map((function(e){return e[1]}));return h.snapBoundInfos=Fn(L,p.clipTargetBounds&&{left:0,top:0,right:g,bottom:v},z,j,{snapThreshold:1}),et(e,"onClip",Ze(e,t,{clipEventType:"changed",clipType:m,poses:O,clipStyle:J,clipStyles:W,distX:f,distY:d})),!0},dragControlEnd:function(e,t){this.unset(e);var n=t.isDrag,r=t.datas,i=t.isDouble,o=r.isLine,a=r.isClipStart,A=r.isControl;return!!a&&(et(e,"onClipEnd",$e(e,t,{})),i&&(A?function(e,t){var n=t.datas,r=n.clipPath,i=n.index,o=r,a=o.type,A=o.poses,s=o.splitter,l=A.map((function(e){return e.pos})),u=l.length;if("polygon"===a)A.splice(i,1),l.splice(i,1);else{if("inset"!==a)return;if(i<8)return;if(Fr(A,l,i,8,u),u===A.length)return}var c=Tr(e,r,l);et(e,"onClip",Ze(e,t,{clipEventType:"removed",clipType:a,poses:l,clipStyles:c,clipStyle:a+"("+c.join(s)+")",distX:0,distY:0}))}(e,t):o&&function(e,t){var n=Et(e,t),r=n[0],i=n[1],o=t.datas,a=o.clipPath,A=o.index,s=a,l=s.type,u=s.poses,c=s.splitter,f=u.map((function(e){return e.pos}));if("polygon"===l)f.splice(A,0,[r,i]);else{if("inset"!==l)return;var d=br.indexOf(A),p=wr.indexOf(A),h=u.length;if(Ur(u,f,8,d,p,r,i,f[4][0],f[4][1],f[0][0],f[0][1]),h===u.length)return}var g=Tr(e,a,f);et(e,"onClip",Ze(e,t,{clipEventType:"added",clipType:l,poses:f,clipStyles:g,clipStyle:l+"("+g.join(c)+")",distX:0,distY:0}))}(e,t)),i||n)},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}},Rr={name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[":host[data-able-origindraggable] .control.origin {\n pointer-events: auto;\n}"],dragControlCondition:function(e){return e.isRequest?"originDraggable"===e.requestAble:F(e.inputEvent.target,be("origin"))},dragControlStart:function(e,t){var n=t.datas;yt(e,t);var r=Ze(e,t,{dragStart:Xn.dragStart(e,(new Bt).dragStart([0,0],t))}),i=et(e,"onDragOriginStart",r);return n.startOrigin=e.state.transformOrigin,n.startTargetOrigin=e.state.targetOrigin,n.prevOrigin=[0,0],n.isDragOrigin=!0,!1===i?(n.isDragOrigin=!1,!1):r},dragControl:function(e,t){var n=t.datas,r=t.isPinch,i=t.isRequest;if(!n.isDragOrigin)return!1;var o=St(t),a=o[0],A=o[1],s=e.state,l=s.width,u=s.height,c=s.offsetMatrix,f=s.targetMatrix,d=s.is3d,p=e.props.originRelative,h=void 0===p||p,g=d?4:3,v=[a,A];if(i){var B=t.distOrigin;(B[0]||B[1])&&(v=B)}var m=D(n.startOrigin,v),b=D(n.startTargetOrigin,v),w=P(v,n.prevOrigin),E=Nt(c,f,m,g),y=e.getRect(),C=Me(_e(E,l,u,g)),Q=[y.left-C.left,y.top-C.top];n.prevOrigin=v;var x=Ze(e,t,{width:l,height:u,origin:m,dist:v,delta:w,transformOrigin:[ut(b[0],l,h),ut(b[1],u,h)].join(" "),drag:Xn.drag(e,vt(t,e.state,Q,!!r,!1))});return et(e,"onDragOrigin",x),x},dragControlEnd:function(e,t){return!!t.datas.isDragOrigin&&(et(e,"onDragOriginEnd",$e(e,t,{})),!0)},dragGroupControlCondition:function(e){return this.dragControlCondition(e)},dragGroupControlStart:function(e,t){return!!this.dragControlStart(e,t)},dragGroupControl:function(e,t){var n=this.dragControl(e,t);return!!n&&(e.transformOrigin=n.transformOrigin,!0)},request:function(e){var t={},n=e.getRect(),r=0,i=0,o=n.transformOrigin,a=[0,0];return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaOrigin"in e?(a[0]+=e.deltaOrigin[0],a[1]+=e.deltaOrigin[1]):"origin"in e?(a[0]=e.origin[0]-o[0],a[1]=e.origin[1]-o[1]):("x"in e?r=e.x-n.left:"deltaX"in e&&(r+=e.deltaX),"y"in e?i=e.y-n.top:"deltaY"in e&&(i+=e.deltaY)),{datas:t,distX:r,distY:i,distOrigin:a}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function Dr(e,t,n,r,i){var o;void 0===r&&(r=[0,0]);if(i)o=i;else{var a=window.getComputedStyle(e);o=a&&a.borderRadius||""}return xr(!o||!i&&"0px"===o?[]:p(o),t,n,0,0,r)}function Pr(e,t,n,r,i,o){var a=e.state,A=a.width,s=a.height,l=Cr(o,i,e.props.roundRelative,A,s),u=l.raws,c=l.styles,f=Sr(i,u),d=f.horizontals,p=f.verticals,h=c.join(" ");a.borderRadiusState=h,et(e,"onRound",Ze(e,t,{horizontals:d,verticals:p,borderRadius:h,width:A,height:s,delta:r,dist:n}))}var kr={name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[".control.border-radius {\n background: #d66;\n cursor: pointer;\n}",":host[data-able-roundable] .line.direction {\n cursor: pointer;\n}"],render:function(e,t){var n=e.state,r=n.target,i=n.width,o=n.height,a=n.allMatrix,A=n.is3d,s=n.left,l=n.top,u=n.borderRadiusState,c=e.props,f=c.minRoundControls,d=void 0===f?[0,0]:f,p=c.maxRoundControls,h=void 0===p?[4,4]:p,g=c.zoom;if(!r)return null;var v=A?4:3,B=Dr(r,i,o,d,u);if(!B)return null;var m=0,b=0;return B.map((function(e,n){b+=Math.abs(e.horizontal),m+=Math.abs(e.vertical);var r=P(Ne(a,e.pos,v),[s,l]),i=e.vertical?m<=h[1]:b<=h[0];return t.createElement("div",{key:"borderRadiusControl"+n,className:be("control","border-radius"),"data-radius-index":n,style:{display:i?"block":"none",transform:"translate("+r[0]+"px, "+r[1]+"px) scale("+g+")"}})}))},dragControlCondition:function(e){if(!e.inputEvent||e.isRequest)return!1;var t=e.inputEvent.target.getAttribute("class")||"";return t.indexOf("border-radius")>-1||t.indexOf("moveable-line")>-1&&t.indexOf("moveable-direction")>-1},dragControlStart:function(e,t){var n=t.inputEvent,r=t.datas,i=n.target,o=i.getAttribute("class")||"",a=o.indexOf("border-radius")>-1,A=o.indexOf("moveable-line")>-1&&o.indexOf("moveable-direction")>-1,s=a?parseInt(i.getAttribute("data-radius-index"),10):-1,l=A?parseInt(i.getAttribute("data-line-index"),10):-1;if(!a&&!A)return!1;if(!1===et(e,"onRoundStart",Ze(e,t,{})))return!1;r.lineIndex=l,r.controlIndex=s,r.isControl=a,r.isLine=A,yt(e,t);var u=e.props,c=u.roundRelative,f=u.minRoundControls,d=void 0===f?[0,0]:f,p=e.state,h=p.target,g=p.width,v=p.height;r.isRound=!0,r.prevDist=[0,0];var B=Dr(h,g,v,d)||[];return r.controlPoses=B,p.borderRadiusState=Cr(B.map((function(e){return e.pos})),B,c,g,v).styles.join(" "),!0},dragControl:function(e,t){var n=t.datas;if(!n.isRound||!n.isControl||!n.controlPoses.length)return!1;var r=n.controlIndex,i=n.controlPoses,o=St(t),a=o[0],A=o[1],s=[a,A],l=P(s,n.prevDist),u=e.props.maxRoundControls,c=void 0===u?[4,4]:u,f=e.state,d=f.width,p=f.height,h=i[r],g=h.vertical,v=h.horizontal,B=i.map((function(e,t){var n=e.horizontal,r=e.vertical,i=[n*v*s[0],r*g*s[1]];if(n){if(1===c[0])return i;if(c[0]<4&&n!==v)return i}else{if(0===c[1])return i[1]=r*v*s[0]/d*p,i;if(g){if(1===c[1])return i;if(c[1]<4&&r!==g)return i}}return[0,0]}));B[r]=s;var m=i.map((function(e,t){return D(e.pos,B[t])}));return n.prevDist=[a,A],Pr(e,t,s,l,i,m),!0},dragControlEnd:function(e,t){var n=e.state;n.borderRadiusState="";var r=t.datas,i=t.isDouble;if(!r.isRound)return!1;var o=n.width,a=n.height,A=r.isControl,s=r.controlIndex,l=r.isLine,u=r.lineIndex,c=r.controlPoses,f=c.map((function(e){return e.pos})),d=f.length,p=e.props.roundClickable;if(i&&(void 0===p||p)){if(A)Fr(c,f,s,0);else if(l){var h=Et(e,t);!function(e,t,n,r,i,o,a){var A=Sr(e),s=A.horizontals,l=A.verticals,u=s.length,c=l.length,f=-1,d=-1;0===n?0===u?f=0:1===u&&(f=1):3===n&&(u<=2?f=2:u<=3&&(f=3)),2===n?0===c?d=0:c<4&&(d=3):1===n&&(c<=1?d=1:c<=2&&(d=2)),Ur(e,t,0,f,d,r,i,o,a)}(c,f,u,h[0],h[1],o,a)}d!==c.length&&Pr(e,t,[0,0],[0,0],c,f),et(e,"onRoundEnd",$e(e,t,{}))}return n.borderRadiusState="",!0},unset:function(e){e.state.borderRadiusState=""}},Ir={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},setTransform:function(e,t){var n=e.state,r=n.is3d,i=n.targetMatrix,o=r?"matrix3d("+i.join(",")+")":"matrix("+k(i,!0)+")";t.datas.startTransforms=[o]},resetTransform:function(e,t){t.datas.nextTransforms=t.datas.startTransforms,t.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,t){return Ze(e,t,{setTransform:function(e){t.datas.startTransforms=l(e)?e:p(e)},isPinch:!!t.isPinch})},fillDragParams:function(e,t){return Ze(e,t,{isPinch:!!t.isPinch})},dragStart:function(e,t){this.setTransform(e,t),et(e,"onBeforeRenderStart",this.fillDragStartParams(e,t))},drag:function(e,t){this.resetTransform(e,t),et(e,"onBeforeRender",Ze(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){et(e,"onBeforeRenderEnd",Ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){var n=this;this.dragStart(e,t);var r=mt(e,"beforeRenderable",t),i=e.moveables,o=r.map((function(e,t){var r=i[t];return n.setTransform(r,e),n.fillDragStartParams(r,e)}));et(e,"onBeforeRenderGroupStart",Ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,setTransform:function(){},events:o}))},dragGroup:function(e,t){var n=this;this.drag(e,t);var r=mt(e,"beforeRenderable",t),i=e.moveables,o=r.map((function(e,t){var r=i[t];return n.resetTransform(r,e),n.fillDragParams(r,e)}));et(e,"onBeforeRenderGroup",Ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,events:o}))},dragGroupEnd:function(e,t){this.dragEnd(e,t),et(e,"onBeforeRenderGroupEnd",Ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}},Kr={name:"Renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragStart:function(e,t){et(e,"onRenderStart",Ze(e,t,{isPinch:!!t.isPinch}))},drag:function(e,t){et(e,"onRender",Ze(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){et(e,"onRenderEnd",Ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){et(e,"onRenderGroupStart",Ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroup:function(e,t){et(e,"onRenderGroup",Ze(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroupEnd:function(e,t){et(e,"onRenderGroupEnd",Ze(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}};function Lr(e,t,n,r,i,o,a){var A="Start"===i,s=e.state.target,l=o.isRequest;if(!s||A&&r.indexOf("Control")>-1&&!l&&e.areaElement===o.inputEvent.target)return!1;var u=""+n+r+i,c=""+n+r+"Condition",f="End"===i,d=i.indexOf("After")>-1,p=A&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());p&&e.updateRect(i,!0,!1),""!==i||d||st(e.state,o);var h=r.indexOf("Group")>-1,g=Ae([Ir],e[t].slice(),[Kr]);if(l){var v=o.requestAble;g.some((function(e){return e.name===v}))||g.push.apply(g,e.props.ables.filter((function(e){return e.name===v})))}if(!g.length)return!1;var B=g.filter((function(e){return e[u]})),m=o.datas;p&&B.forEach((function(t){t.unset&&t.unset(e)}));var b,w=o.inputEvent;f&&w&&(b=document.elementFromPoint(o.clientX,o.clientY)||w.target);var E=B.filter((function(t){var n=t.name,r=m[n]||(m[n]={});return A&&(r.isEventStart=!t[c]||t[c](o,e)),!!r.isEventStart&&t[u](e,ae(ae({},o),{datas:r,originalDatas:m,inputTarget:b}))})),y=E.length,C=A&&B.length&&!y;return(f||C)&&(e.state.gesto=null,e.moveables&&e.moveables.forEach((function(e){e.state.gesto=null}))),p&&C&&B.forEach((function(t){t.unset&&t.unset(e)})),!e.isUnmounted&&!C&&((!A&&y&&!a||f)&&(E.some((function(e){return e.updateRect}))&&!h?e.updateRect(i,!1,!1):e.updateRect(i,!0,!1),e.forceUpdate()),A||f||d||!y||a||Lr(e,t,n,r,i+"After",o),!0)}function zr(e,t,n){var r=e.controlBox.getElement(),i=[];i.push(r),e.props.dragArea&&!e.props.dragTarget||i.push(t);var o=function(t){var n=t.inputEvent.target;return n===e.areaElement||!e.isMoveableElement(n)||F(n,"moveable-area")||F(n,"moveable-padding")};return jr(e,i,"targetAbles",n,{dragStart:o,pinchStart:o})}function jr(e,t,n,r,i){void 0===i&&(i={});var o=e.props,a=o.pinchOutside,A=o.pinchThreshold,s={container:window,pinchThreshold:A,pinchOutside:a},l=new te.a(t,s);return["drag","pinch"].forEach((function(t){["Start","","End"].forEach((function(o){l.on(""+t+o,(function(a){var A=a.eventType;!i[A]||i[A](a)?Lr(e,n,t,r,o,a)||a.stop():a.stop()}))}))})),l}var Xr=function(){function e(e,t,n){var r=this;this.target=e,this.moveable=t,this.eventName=n,this.ables=[],this.onEvent=function(e){var t=r.eventName,n=r.moveable;r.ables.forEach((function(r){r[t]({inputEvent:e},n)}))},this.target.addEventListener(this.eventName.toLowerCase(),this.onEvent)}var t=e.prototype;return t.setAbles=function(e){this.ables=e},t.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this.onEvent),this.target=null,this.moveable=null},e}(),Gr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state=ae({container:null,target:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]]},je(null)),t.enabledAbles=[],t.targetAbles=[],t.controlAbles=[],t.rotation=0,t.scale=[1,1],t.isUnmounted=!1,t.events={mouseEnter:null,mouseLeave:null},t}oe(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=this.state,n=e.edge,r=e.parentPosition,o=e.className,a=e.target,A=e.zoom,s=e.cspNonce,l=e.translateZ,u=e.cssStyled;this.checkUpdate(),this.updateRenderPoses();var c=r||{left:0,top:0},f=c.left,d=c.top,p=t.left,h=t.top,g=t.target,v=t.direction,B=t.renderPoses,m=e.targets,b=(m&&m.length||a)&&g,w=this.isDragging(),E={},y={createElement:ee.createElement};return this.getEnabledAbles().forEach((function(e){E["data-able-"+e.name.toLowerCase()]=!0})),Object(ee.createElement)(u,ae({cspNonce:s,ref:Object(i.d)(this,"controlBox"),className:be("control-box",-1===v?"reverse":"",w?"dragging":"")+" "+o},E,{style:{position:"absolute",display:b?"block":"none",transform:"translate("+(p-f)+"px, "+(h-d)+"px) translateZ("+l+"px)","--zoom":A,"--zoompx":A+"px"}}),this.renderAbles(),$n(y,n?"n":"",B[0],B[1],A,0),$n(y,n?"e":"",B[1],B[3],A,1),$n(y,n?"w":"",B[0],B[2],A,2),$n(y,n?"s":"",B[2],B[3],A,3))},n.componentDidMount=function(){this.controlBox.getElement();var e=this.props,t=e.parentMoveable,n=e.container,r=e.wrapperMoveable;this.updateEvent(e),this.updateNativeEvents(e),n||t||r||this.updateRect("",!1,!0),this.updateCheckInput()},n.componentDidUpdate=function(e){this.updateNativeEvents(e),this.updateEvent(e),this.updateCheckInput()},n.componentWillUnmount=function(){this.isUnmounted=!0,qe(this,"targetGesto"),qe(this,"controlGesto");var e=this.events;for(var t in e){var n=e[t];n&&n.destroy()}},n.getContainer=function(){var e=this.props,t=e.parentMoveable,n=e.wrapperMoveable;return e.container||n&&n.getContainer()||t&&t.getContainer()||this.controlBox.getElement().parentElement},n.isMoveableElement=function(e){return e&&(e.getAttribute("class")||"").indexOf(ce)>-1},n.dragStart=function(e){return this.targetGesto&&this.targetGesto.triggerDragStart(e),this},n.hitTest=function(e){var t,n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,A=n.pos4,s=n.targetClientRect;if(!r)return 0;if(e instanceof Element){var l=e.getBoundingClientRect();t={left:l.left,top:l.top,width:l.width,height:l.height}}else t=ae({width:0,height:0},e);var u=t.left,c=t.top,f=t.width,d=t.height,p=Object(Z.a)([i,o,A,a],s),h=Object(Z.e)(p,[[u,c],[u+f,c],[u+f,c+d],[u,c+d]]),g=Object(Z.b)(p);return h&&g?Math.min(100,h/g*100):0},n.isInside=function(e,t){var n=this.state,r=n.target,i=n.pos1,o=n.pos2,a=n.pos3,A=n.pos4,s=n.targetClientRect;return!!r&&Object(Z.f)([e,t],Object(Z.a)([i,o,A,a],s))},n.updateRect=function(e,t,n){void 0===n&&(n=!0);var r=this.props,i=r.parentMoveable,o=this.state.target||this.props.target,a=this.getContainer(),A=i?i.props.rootContainer:r.rootContainer;this.updateState(je(this.controlBox&&this.controlBox.getElement(),o,a,a,A||a),!i&&n)},n.isTargetChanged=function(e,t){var n=this.props,r=n.dragTarget||n.target,i=e.dragTarget||e.target,o=n.dragArea,a=e.dragArea;return!o&&i!==r||(t||o)&&a!==o},n.updateNativeEvents=function(e){var t=this,n=this.props.dragArea?this.areaElement:this.state.target,r=this.events,i=m(r);if(this.isTargetChanged(e))for(var o in r){var a=r[o];a&&a.destroy(),r[o]=null}if(n){var A=this.enabledAbles;i.forEach((function(e){var i=nt(A,[e]),o=i.length>0,a=r[e];o?(a||(a=new Xr(n,t,e),r[e]=a),a.setAbles(i)):a&&(a.destroy(),r[e]=null)}))}},n.updateEvent=function(e){var t=this.controlBox.getElement(),n=this.targetAbles.length,r=this.controlAbles.length,i=this.props,o=i.dragTarget||i.target,a=this.isTargetChanged(e,!0),A=!n&&this.targetGesto||a;A&&(qe(this,"targetGesto"),this.updateState({gesto:null})),r||qe(this,"controlGesto"),o&&n&&!this.targetGesto&&(this.targetGesto=zr(this,o,"")),!this.controlGesto&&r&&(this.controlGesto=jr(this,t,"controlAbles","Control")),A&&this.unsetAbles()},n.isDragging=function(){return!!this.targetGesto&&this.targetGesto.isFlag()||!!this.controlGesto&&this.controlGesto.isFlag()},n.updateTarget=function(e){this.updateRect(e,!0)},n.getRect=function(){var e=this.state,t=Ye(this.state),n=t[0],r=t[1],i=t[2],o=t[3],a=Me(t),A=e.width,s=e.height,l=a.width,u=a.height,c=a.left,f=a.top,d=[e.left,e.top],p=D(d,e.origin);return{width:l,height:u,left:c,top:f,pos1:n,pos2:r,pos3:i,pos4:o,offsetWidth:A,offsetHeight:s,beforeOrigin:D(d,e.beforeOrigin),origin:p,transformOrigin:e.transformOrigin,rotation:this.getRotation()}},n.getManager=function(){return this},n.getRotation=function(){var e=this.state;return function(e,t,n){var r=Q(e,t)/Math.PI*180;return r=(r=n>=0?r:180-r)>=0?r:360+r}(e.pos1,e.pos2,e.direction)},n.request=function(e,t,n){void 0===t&&(t={});var r=this.props,i=r.ables,o=r.groupable,a=i.filter((function(t){return t.name===e}))[0];if(this.isDragging()||!a||!a.request)return{request:function(){return this},requestEnd:function(){return this}};var A=this,s=a.request(this),l=n||t.isInstant,u=s.isControl?"controlAbles":"targetAbles",c=(o?"Group":"")+(s.isControl?"Control":""),f={request:function(t){return Lr(A,u,"drag",c,"",ae(ae({},s.request(t)),{requestAble:e,isRequest:!0}),l),this},requestEnd:function(){return Lr(A,u,"drag",c,"End",ae(ae({},s.requestEnd()),{requestAble:e,isRequest:!0}),l),this}};return Lr(A,u,"drag",c,"Start",ae(ae({},s.requestStart(t)),{requestAble:e,isRequest:!0}),l),l?f.request(t).requestEnd():f},n.destroy=function(){this.componentWillUnmount()},n.updateRenderPoses=function(){var e=this.state,t=this.props,n=e.originalBeforeOrigin,r=e.transformOrigin,i=e.allMatrix,o=e.is3d,a=e.pos1,A=e.pos2,s=e.pos3,l=e.pos4,u=e.left,c=e.top,f=t.padding||{},d=f.left,p=void 0===d?0:d,h=f.top,g=void 0===h?0:h,v=f.bottom,B=void 0===v?0:v,m=f.right,b=void 0===m?0:m,w=o?4:3,E=t.groupable?n:D(n,[u,c]);e.renderPoses=[D(a,lt(i,[-p,-g],r,E,w)),D(A,lt(i,[b,-g],r,E,w)),D(s,lt(i,[-p,B],r,E,w)),D(l,lt(i,[b,B],r,E,w))]},n.checkUpdate=function(){var e=this.props,t=e.target,n=e.container,r=e.parentMoveable,i=this.state,o=i.target,a=i.container;(o||t)&&(this.updateAbles(),(!rt(o,t)||!rt(a,n))&&(this.updateState({target:t,container:n}),r||!n&&!this.controlBox||this.updateRect("End",!1,!1)))},n.triggerEvent=function(e,t){var n=this.props[e];return n&&n(t)},n.useCSS=function(e,t){var n=this.props.customStyledMap,r=e+t;return n[r]||(n[r]=Object(ne.a)(e,t)),n[r]},n.unsetAbles=function(){var e=this;this.targetAbles.filter((function(t){return!!t.unset&&(t.unset(e),!0)})).length&&this.forceUpdate()},n.updateAbles=function(e,t){void 0===e&&(e=this.props.ables),void 0===t&&(t="");var n=this.props,r=n.triggerAblesSimultaneously,i=e.filter((function(e){return e&&(e.always||n[e.name])})),o="drag"+t+"ControlStart",a=nt(i,["drag"+t+"Start","pinch"+t+"Start"],r),A=nt(i,[o],r);this.enabledAbles=i,this.targetAbles=a,this.controlAbles=A},n.updateState=function(e,t){if(t)this.setState(e);else{var n=this.state;for(var r in e)n[r]=e[r]}},n.getEnabledAbles=function(){var e=this.props;return e.ables.filter((function(t){return t&&e[t.name]}))},n.renderAbles=function(){var e=this,t=this.props.triggerAblesSimultaneously,n={createElement:ee.createElement};return function(e,t){var n=[],r={};return e.forEach((function(i,o){var a=t(i,o,e),A=r[a];A||(A=[],r[a]=A,n.push(A)),A.push(i)})),n}(ot(nt(this.getEnabledAbles(),["render"],t).map((function(t){return(0,t.render)(e,n)||[]}))).filter((function(e){return e})),(function(e){return e.key})).map((function(e){return e[0]}))},n.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},t.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,cspNonce:"",translateZ:50,cssStyled:null,customStyledMap:{},props:{}},t}(ee.PureComponent),Vr={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(e,t){var n=e.props.targets||[];e.moveables=[];var r=e.state,o={left:r.left,top:r.top};return n.map((function(n,r){return t.createElement(Gr,{key:"moveable"+r,ref:Object(i.e)(e,"moveables",r),target:n,origin:!1,cssStyled:e.props.cssStyled,customStyledMap:e.props.customStyledMap,parentMoveable:e,parentPosition:o})}))}};function Yr(e){var t=e.originalDatas.draggable;return t||(e.originalDatas.draggable={},t=e.originalDatas.draggable),ae(ae({},e),{datas:t})}var Wr={name:"edgeDraggable",props:{edgeDraggable:Boolean},events:{},dragControlCondition:function(e,t){if(!t.props.edgeDraggable||!e.inputEvent)return!1;var n=e.inputEvent.target;return F(n,be("direction"))&&F(n,be("line"))},dragControlStart:function(e,t){return Xn.dragStart(e,Yr(t))},dragControl:function(e,t){return Xn.drag(e,Yr(t))},dragControlEnd:function(e,t){return Xn.dragEnd(e,Yr(t))},dragGroupControlCondition:function(e,t){if(!t.props.edgeDraggable||!e.inputEvent)return!1;var n=e.inputEvent.target;return F(n,be("direction"))&&F(n,be("line"))},dragGroupControlStart:function(e,t){return Xn.dragGroupStart(e,Yr(t))},dragGroupControl:function(e,t){return Xn.dragGroup(e,Yr(t))},dragGroupControlEnd:function(e,t){return Xn.dragGroupEnd(e,Yr(t))},unset:function(e){e.state.dragInfo=null}},Jr={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},qr=[Ir,gr,jn,gt,Xn,Wr,qn,nr,rr,ar,hr,vr,dr,Rr,Mr,kr,Vr,Jr,{name:"clickable",props:{},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragStart:function(){},dragGroupStart:function(e,t){t.datas.inputTarget=t.inputEvent&&t.inputEvent.target},dragEnd:function(e,t){var n=e.state.target,r=t.inputEvent,i=t.inputTarget;if(r&&i&&!t.isDrag&&!e.isMoveableElement(i)){var o=n.contains(i);et(e,"onClick",Ze(e,t,{isDouble:t.isDouble,inputTarget:i,isTarget:n===i,containsTarget:o}))}},dragGroupEnd:function(e,t){var n=t.inputEvent,r=t.inputTarget;if(n&&r&&!t.isDrag&&!e.isMoveableElement(r)&&t.datas.inputTarget!==r){var i=e.props.targets,o=i.indexOf(r),a=o>-1,A=!1;-1===o&&(A=(o=B(i,(function(e){return e.contains(r)})))>-1),et(e,"onClickGroup",Ze(e,t,{isDouble:t.isDouble,targets:i,inputTarget:r,targetIndex:o,isTarget:a,containsTarget:A}))}}},fr,Kr],Zr=qr.reduce((function(e,t){return ae(ae({},e),t.events)}),{}),$r=qr.reduce((function(e,t){return ae(ae({},e),t.props)}),{}),ei=dt(Zr);Object.keys(ei),Object.keys($r);function ti(e,t){return Math.max.apply(Math,e.map((function(e){var n=e[0],r=e[1],i=e[2],o=e[3];return Math.max(n[t],r[t],i[t],o[t])})))}function ni(e,t){return Math.min.apply(Math,e.map((function(e){var n=e[0],r=e[1],i=e[2],o=e[3];return Math.min(n[t],r[t],i[t],o[t])})))}var ri=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.differ=new re.a,t.moveables=[],t.transformOrigin="50% 50%",t}oe(t,e);var n=t.prototype;return n.updateEvent=function(e){var t=this.state,n=this.props,r=e.dragTarget||t.target,i=n.dragTarget||this.areaElement;r!==i&&(qe(this,"targetGesto"),qe(this,"controlGesto"),t.target=null),t.target||(t.target=this.areaElement,this.controlBox.getElement().style.display="block",this.targetGesto=zr(this,i,"Group"),this.controlGesto=jr(this,this.controlBox.getElement(),"controlAbles","GroupControl"));var o=!rt(e.container,n.container);o&&(t.container=n.container);var a=this.differ.update(n.targets),A=a.added,s=a.changed,l=a.removed;(o||A.length||s.length||l.length)&&this.updateRect()},n.checkUpdate=function(){this.updateAbles()},n.updateRect=function(e,t,n){if(void 0===n&&(n=!0),this.controlBox){this.moveables.forEach((function(t){t.updateRect(e,!1,!1)}));var r=this.state,i=this.props,o=r.target||i.target;(!t||""!==e&&i.updateGroup)&&(this.rotation=i.defaultGroupRotate,this.transformOrigin=i.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var a=this.rotation,A=this.scale,s=function(e,t){if(!e.length)return[0,0,0,0];var n=e.map((function(e){return Ye(e.state)})),r=pe,i=pe,o=0,a=0,A=We(t,1e-7);if(A%90){var s=A/180*Math.PI,l=Math.tan(s),u=-1/l,c=[he,pe],f=[he,pe];n.forEach((function(e){e.forEach((function(e){var t=e[1]-l*e[0],n=e[1]-u*e[0];c[0]=Math.max(c[0],t),c[1]=Math.min(c[1],t),f[0]=Math.max(f[0],n),f[1]=Math.min(f[1],n)}))})),c.forEach((function(e){f.forEach((function(t){var n=(t-e)/(l-u),o=l*n+e;r=Math.min(r,n),i=Math.min(i,o)}))}));var d=n.map((function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return[K(t,-s),K(n,-s),K(r,-s),K(i,-s)]}));o=ti(d,0)-ni(d,0),a=ti(d,1)-ni(d,1)}else if(r=ni(n,0),i=ni(n,1),o=ti(n,0)-r,a=ti(n,1)-i,A%180){var p=o;o=a,a=p}return[r,i,o,a]}(this.moveables,a),l=s[0],u=s[1],c=s[2],f=s[3],d="rotate("+a+"deg) scale("+(A[0]>=0?1:-1)+", "+(A[1]>=0?1:-1)+")";o.style.cssText+="left:0px;top:0px; transform-origin: "+this.transformOrigin+"; width:"+c+"px; height:"+f+"px;transform:"+d,r.width=c,r.height=f;var p=this.getContainer(),h=je(this.controlBox.getElement(),o,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||p),g=[h.left,h.top],v=Ye(h),B=v[0],m=v[1],b=v[2],w=v[3],E=Object(Z.c)([B,m,b,w]),y=[E.minX,E.minY];h.pos1=P(B,y),h.pos2=P(m,y),h.pos3=P(b,y),h.pos4=P(w,y),h.left=l-h.left+y[0],h.top=u-h.top+y[1],h.origin=P(D(g,h.origin),y),h.beforeOrigin=P(D(g,h.beforeOrigin),y),h.originalBeforeOrigin=D(g,h.originalBeforeOrigin);var C=h.targetClientRect,Q=A[0]*A[1]>0?1:-1;C.top+=h.top-r.top,C.left+=h.left-r.left,o.style.transform="translate("+-y[0]+"px, "+-y[1]+"px) "+d,this.updateState(ae(ae({},h),{direction:Q,beforeDirection:Q}),n)}},n.getRect=function(){return ae(ae({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.triggerEvent=function(t,n,r){if(r||t.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,t,n)},n.updateAbles=function(){e.prototype.updateAbles.call(this,Ae(this.props.ables,[Vr]),"Group")},t.defaultProps=ae(ae({},Gr.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),t}(Gr),ii=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.moveables=[],t}oe(t,e);var n=t.prototype;return n.render=function(){var e=this,t=this.props,n=t.cspNonce,r=t.cssStyled,o=t.targets;return Object(ee.createElement)(r,{cspNonce:n,ref:Object(i.d)(this,"controlBox"),className:be("control-box")},o.map((function(t,n){return Object(ee.createElement)(Gr,ae({key:"moveable"+n,ref:Object(i.e)(e,"moveables",n)},e.props,{target:t,wrapperMoveable:e}))})))},n.componentDidUpdate=function(){},n.updateRect=function(e,t,n){void 0===n&&(n=!0),this.moveables.forEach((function(r){r.updateRect(e,t,n)}))},n.getRect=function(){return ae(ae({},e.prototype.getRect.call(this)),{children:this.moveables.map((function(e){return e.getRect()}))})},n.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},n.dragStart=function(){return this},n.hitTest=function(){return 0},n.isInside=function(){return!1},n.isDragging=function(){return!1},n.updateRenderPoses=function(){},n.updateEvent=function(){},n.checkUpdate=function(){},n.triggerEvent=function(){},n.updateAbles=function(){},t}(Gr),oi=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.refTargets=[],t.selectorMap={},t}oe(t,e);var n=t.prototype;return t.makeStyled=function(){var e={};this.getTotalAbles().forEach((function(t){var n=t.css;n&&n.forEach((function(t){e[t]=!0}))}));var t=m(e).join("\n");this.defaultStyled=Object(ne.a)("div",Object(i.b)(ce,fe+t))},t.getTotalAbles=function(){return Ae([gr,Vr,Jr,fr],this.defaultAbles)},n.render=function(){var e=this.constructor;e.defaultStyled||e.makeStyled();var t=this.props,n=t.ables,r=t.props,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1,l=Ae(e.getTotalAbles(),n||[]),c=ae(ae(ae({},o),r||{}),{ables:l,cssStyled:e.defaultStyled,customStyledMap:e.customStyledMap});return s?o.individualGroupable?Object(ee.createElement)(ii,ae({key:"individual-group",ref:Object(i.d)(this,"moveable")},c,{target:null,targets:A})):Object(ee.createElement)(ri,ae({key:"group",ref:Object(i.d)(this,"moveable")},c,{target:null,targets:A})):Object(ee.createElement)(Gr,ae({key:"single",ref:Object(i.d)(this,"moveable")},c,{target:A[0]}))},n.componentDidMount=function(){this.updateRefs()},n.componentDidUpdate=function(){this.updateRefs()},n.updateRefs=function(e){var t=ht(this.props.target||this.props.targets),n=this.refTargets.some((function(e,n){var r=t[n];return!(!e&&!r)&&e!==r})),r=e?{}:this.selectorMap,i={};this.refTargets.forEach((function(e){u(e)&&(r[e]?i[e]=r[e]:(n=!0,i[e]=[].slice.call(document.querySelectorAll(e))))})),this.selectorMap=i,n&&this.forceUpdate()},n.getManager=function(){return this.moveable},t.defaultAbles=[],t.customStyledMap={},t.defaultStyled=null,function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(i.f)(me)],t.prototype,"moveable",void 0),t}(ee.PureComponent),ai=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return oe(t,e),t.defaultAbles=qr,t}(oi);t.a=ai},function(e,t,n){"use strict";n.d(t,"b",(function(){return A}));var r=n(44),i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var o="function"===typeof Map?void 0:function(){var e=0;return function(t){return t.__DIFF_KEY__||(t.__DIFF_KEY__=++e)}}(),a=function(e){function t(t){return void 0===t&&(t=[]),e.call(this,t,o)||this}return function(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(r.a);function A(e,t){return Object(r.b)(e,t,o)}t.a=a},function(e,t,n){var r=n(68),i=n(64);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=e.length,r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);no-l?(h[1]>p.top||oh[1])&&(B[1]=1),p.left>r-l?(h[0]>p.left||rh[0])&&(B[0]=1),clearTimeout(this.timer),!B[0]&&!B[1])return!1;if(v>0)return this.timer=window.setTimeout((function(){n.drag(e,t)}),v),!1;this.prevTime=g;var m=d({container:A,direction:B});this.trigger("scroll",{container:A,direction:B,inputEvent:e});var b=d({container:A,direction:B}),w=b[0]-m[0],E=b[1]-m[1];return!(!w&&!E)&&(this.trigger("move",{offsetX:B[0]?w:0,offsetY:B[1]?E:0,inputEvent:e}),c&&(this.timer=window.setTimeout((function(){n.drag(e,t)}),c)),!0)},n.dragEnd=function(){clearTimeout(this.timer)},t}(r.a);t.a=A},function(e,t,n){"use strict";var r=n(15),i=n(1),o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var a=function(){return(a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function s(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||g===v)return!1;if(g&&b&&g.isContentEditable&&g.contains(v))return!1}else if((u||"touchstart"===e.type)&&g){var w=g.tagName;(g.isContentEditable||p.indexOf(w)>-1)&&g.blur()}if(r.clientStores=[new d(s(e))],r.flag=!0,r.isDrag=!1,r.datas={},l&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",a({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=Object(i.J)()-r.prevTime<200,r.flag&&u&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(h&&f&&A&&(E=setTimeout((function(){Object(i.p)(o,"touchstart",r.onDragStart,{passive:!1})}))),!h&&f&&A&&Object(i.L)(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),h&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=s(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",a({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&Object(i.L)(o,"touchstart",r.onDragStart),r.flag=!1;var A=r.getCurrentStore().getPosition(),s=Object(i.J)(),l=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||l?0:s,r.emit("dragEnd",a({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},A)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=a({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var A=r.options,l=A.container,u=A.events,c=A.checkWindowBlur;if(r.isTouch=u.indexOf("touch")>-1,r.isMouse=u.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){Object(i.p)(e,"mousedown",r.onDragStart)})),Object(i.p)(l,"mousemove",r.onDrag),Object(i.p)(l,"mouseup",r.onDragEnd),Object(i.p)(l,"contextmenu",r.onDragEnd)),c&&Object(i.p)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};o.forEach((function(e){Object(i.p)(e,"touchstart",r.onDragStart,f)})),Object(i.p)(l,"touchmove",r.onDrag,f),Object(i.p)(l,"touchend",r.onDragEnd,f),Object(i.p)(l,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(i.L)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(i.L)(t,"mousedown",e.onDragStart)})),Object(i.L)(n,"mousemove",this.onDrag),Object(i.L)(n,"mouseup",this.onDragEnd),Object(i.L)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(i.L)(t,"touchstart",e.onDragStart)})),Object(i.L)(n,"touchstart",this.onDragStart),Object(i.L)(n,"touchmove",this.onDrag),Object(i.L)(n,"touchend",this.onDragEnd),Object(i.L)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new d(s(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",a({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",a({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",a({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,a({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(r.a);t.a=h},function(e,t,n){var r=n(81),i=n(85);e.exports=function(e,t){return e&&r(e,i(t))}},function(e,t,n){var r=n(137),i=n(22),o=Object.prototype,a=o.hasOwnProperty,A=o.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!A.call(e,"callee")};e.exports=s},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(80),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,A=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(t){}}();e.exports=A}).call(this,n(61)(e))},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(27),i=n(20);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){var r=n(84)(Object.getPrototypeOf,Object);e.exports=r},function(e,t,n){var r=n(28)(n(21),"Map");e.exports=r},function(e,t,n){var r=n(159),i=n(166),o=n(168),a=n(169),A=n(170);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=-g&&b=h)){var F=0===Q?d?c:u:Q%2===0?10:7,U=d?[x,p?0:c-F]:[p?0:u-F,x],S=U[0],H=U[1],O=d?[S,H+F]:[S+F,H],T=O[0],N=O[1];f.moveTo(S,H),f.lineTo(T,N)}}}f.stroke(),f.restore()},t.defaultProps={type:"horizontal",zoom:1,width:0,height:0,unit:50,direction:"end",style:{width:"100%",height:"100%"},backgroundColor:"#333333",textColor:"#ffffff",lineColor:"#777777"},t}(r.PureComponent),A=n(15),s=("undefined"!==typeof document&&document,['"',"'",'\\"',"\\'"]);function l(e,t,n,r){for(var i=n;i-1&&(a=l(o,t,i+1,r)),-1===a)break;i=a}return-1}function u(e,t){for(var n=new RegExp("(\\s*"+(t||",")+"\\s*|\\(|\\)|\"|'|\\\\\"|\\\\'|\\s+)","g"),r=e.split(n).filter(Boolean),i=r.length,o=[],a=[],A=0;A-1)c=l(u,r,A+1,i);else if(u===t){a.length&&(o.push(a.join("")),a=[]);continue}}-1===c&&(c=i-1),a.push(r.slice(A,c+1).join("")),A=c}return a.length&&o.push(a.join("")),o}function c(e){return u(e,",")}function f(e){var t=/([^(]*)\(([\s\S]*)\)([\s\S]*)/g.exec(e);return!t||t.length<4?{}:{prefix:t[1],value:t[2],suffix:t[3]}}function d(e){var t=/^([^\d|e|\-|\+]*)((?:\d|\.|-|e-|e\+)+)(\S*)$/g.exec(e);if(!t)return{prefix:"",unit:"",value:NaN};var n=t[1],r=t[2];return{prefix:n,unit:t[3],value:parseFloat(r)}}function p(){return Date.now?Date.now():(new Date).getTime()}function h(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function g(e,t){if(e.classList)e.classList.remove(t);else{var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}function v(e,t,n,r){e.addEventListener(t,n,r)}function B(e,t,n){e.removeEventListener(t,n)}var m=function(e,t){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var b=function(){return(b=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function E(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,g=f.isContentEditable;if(h||g){if(s||c===f)return!1;if(c&&g&&c.isContentEditable&&c.contains(f))return!1}else if((A||"touchstart"===e.type)&&c){var m=c.tagName;(c.isContentEditable||U.indexOf(m)>-1)&&c.blur()}if(r.clientStores=[new F(E(e))],r.flag=!0,r.isDrag=!1,r.datas={},a&&(3===e.which||2===e.button))return r.initDrag(),!1;!1===r.emit("dragStart",b({datas:r.datas,inputEvent:e,isTrusted:t},r.getCurrentStore().getPosition()))&&r.initDrag(),r.isDouble=p()-r.prevTime<200,r.flag&&A&&e.preventDefault()}if(!r.flag)return!1;var w=0;if(u&&l&&o&&(w=setTimeout((function(){v(i,"touchstart",r.onDragStart,{passive:!1})}))),!u&&l&&o&&B(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(w),u&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=E(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",b({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&B(i,"touchstart",r.onDragStart),r.flag=!1;var o=r.getCurrentStore().getPosition(),a=p(),A=!r.isDrag&&r.isDouble;r.prevTime=r.isDrag||A?0:a,r.emit("dragEnd",b({datas:r.datas,isDouble:A,isDrag:r.isDrag,inputEvent:e},o)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=b({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var o=r.options,a=o.container,A=o.events,s=o.checkWindowBlur;if(r.isTouch=A.indexOf("touch")>-1,r.isMouse=A.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){v(e,"mousedown",r.onDragStart)})),v(a,"mousemove",r.onDrag),v(a,"mouseup",r.onDragEnd),v(a,"contextmenu",r.onDragEnd)),s&&v(window,"blur",r.onBlur),r.isTouch){var l={passive:!1};i.forEach((function(e){v(e,"touchstart",r.onDragStart,l)})),v(a,"touchmove",r.onDrag,l),v(a,"touchend",r.onDragEnd,l),v(a,"touchcancel",r.onDragEnd,l)}return r}!function(e,t){function n(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),B(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){B(t,"mousedown",e.onDragStart)})),B(n,"mousemove",this.onDrag),B(n,"mouseup",this.onDragEnd),B(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){B(t,"touchstart",e.onDragStart)})),B(n,"touchstart",this.onDragStart),B(n,"touchmove",this.onDrag),B(n,"touchend",this.onDragEnd),B(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new F(E(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",b({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",b({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",b({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,b({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(A.a),H=n(10),O=n(9);function T(e){return function(e){var t=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return e.forEach((function(e){var n=e.matrixFunction,r=e.functionValue;n&&(t=n(t,r))})),t}(function(e){return(n=e,Array.isArray(n)?e:(t=e,u(t,""))).map((function(e){var t=f(e),n=t.prefix,r=t.value,i=null,o=n,a="";if("translate"===n||"translateX"===n||"translate3d"===n){var A=c(r).map((function(e){return parseFloat(e)})),s=A[0],l=A[1],u=void 0===l?0:l,p=A[2],h=void 0===p?0:p;i=O.i,a=[s,u,h]}else if("translateY"===n){u=parseFloat(r);i=O.i,a=[0,u,0]}else if("translateZ"===n){h=parseFloat(r);i=O.i,a=[0,0,h]}else if("scale"===n||"scale3d"===n){var g=c(r).map((function(e){return parseFloat(e)})),v=g[0],B=g[1],m=void 0===B?v:B,b=g[2],w=void 0===b?1:b;i=O.h,a=[v,m,w]}else if("scaleX"===n){v=parseFloat(r);i=O.h,a=[v,1,1]}else if("scaleY"===n){m=parseFloat(r);i=O.h,a=[1,m,1]}else if("scaleZ"===n){w=parseFloat(r);i=O.h,a=[1,1,w]}else if("rotate"===n||"rotateZ"===n||"rotateX"===n||"rotateY"===n){var E=d(r),y=E.unit,C=E.value,Q="rad"===y?C:C*Math.PI/180;"rotate"===n||"rotateZ"===n?(o="rotateZ",i=O.g):"rotateX"===n?i=O.e:"rotateY"===n&&(i=O.f),a=Q}else if("matrix3d"===n)i=O.d,a=c(r).map((function(e){return parseFloat(e)}));else if("matrix"===n){var x=c(r).map((function(e){return parseFloat(e)}));i=O.d,a=[x[0],x[1],0,0,x[2],x[3],0,0,0,0,1,0,x[4],x[5],0,1]}else o="";return{name:n,functionName:o,value:r,matrixFunction:i,functionValue:a}}));var t;var n}(e))}function N(e,t){var n=Object(O.a)(e,[t[0],t[1]||0,t[2]||0,1],4),r=n[3]||1;return[n[0]/r,n[1]/r,n[2]/r]}var _=function(e,t){return(_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var M=function(){return(M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=t.scrollPos&&A.indexOf(d)<0&&t.setState({guides:A.concat([d])},(function(){u({guides:t.state.guides,distX:i,distY:o}),l(t.state.guides)}));else{var p=n.target.getAttribute("data-index");if(r||d-1)return;A[p]=d}t.setState({guides:A.slice()},(function(){var e=t.state.guides;l(e),u({distX:i,distY:o,guides:e})}))}},t}!function(e,t){function n(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.render=function(){var e=this.props,t=e.className,n=e.type,o=e.width,A=e.height,s=e.unit,l=e.zoom,u=e.style,c=e.rulerStyle,f=e.backgroundColor,d=e.lineColor,p=e.textColor,h=e.direction,g=e.textFormat,v=e.displayDragPos,B=e.cspNonce,m=this.getTranslateName();return Object(r.createElement)(z,{ref:Object(i.d)(this,"manager"),cspNonce:B,className:R("manager",n)+" "+t,style:u},Object(r.createElement)("div",{className:R("guide-origin"),ref:Object(i.d)(this,"originElement")}),Object(r.createElement)(a,{ref:Object(i.d)(this,"ruler"),type:n,width:o,height:A,unit:s,zoom:l,backgroundColor:f,lineColor:d,style:c,textColor:p,direction:h,textFormat:g}),Object(r.createElement)("div",{className:P,ref:Object(i.d)(this,"guidesElement"),style:{transform:m+"("+-this.scrollPos*l+"px)"}},v&&Object(r.createElement)("div",{className:K,ref:Object(i.d)(this,"displayElement")}),Object(r.createElement)("div",{className:D,ref:Object(i.d)(this,"adderElement")}),this.renderGuides()))},n.renderGuides=function(){var e=this,t=this.props,n=t.type,o=t.zoom,a=t.showGuides,A=this.getTranslateName(),s=this.state.guides;if(this.guideElements=[],a)return s.map((function(t,a){return Object(r.createElement)("div",{className:R("guide",n),ref:Object(i.e)(e,"guideElements",a),key:a,"data-index":a,"data-pos":t,style:{transform:A+"("+t*o+"px)"}})}))},n.componentDidMount=function(){var e=this;this.gesto=new S(this.manager.getElement(),{container:document.body}).on("dragStart",(function(t){var n,r,i=t.inputEvent.target,o=t.datas,a=e.ruler.canvasElement,A=e.guidesElement,s="horizontal"===e.props.type,l=e.originElement.getBoundingClientRect(),u=function(e,t){void 0===t&&(t=document.body);for(var n=e,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];n;){var i=getComputedStyle(n).transform;if(r=Object(O.d)(T(i),r),n===t)break;n=n.parentElement}return(r=Object(O.c)(r,4))[12]=0,r[13]=0,r[14]=0,r}(e.manager.getElement()),c=N(u,[t.clientX-l.left,t.clientY-l.top]);if(c[0]-=A.offsetLeft,c[1]-=A.offsetTop,c[s?1:0]+=e.scrollPos*e.props.zoom,o.offsetPos=c,o.matrix=u,i===a)o.fromRuler=!0,o.target=e.adderElement;else{if(r=k,!((n=i).classList?n.classList.contains(r):n.className.match(new RegExp("(\\s|^)"+r+"(\\s|$)"))))return t.stop(),!1;o.target=i}e.onDragStart(t)})).on("drag",this.onDrag).on("dragEnd",this.onDragEnd),this.setState({guides:this.props.defaultGuides||[]})},n.componentWillUnmount=function(){this.gesto.unset()},n.componentDidUpdate=function(e){e.defaultGuides!==this.props.defaultGuides&&this.setState({guides:this.props.defaultGuides||[]})},n.loadGuides=function(e){this.setState({guides:e})},n.getGuides=function(){return this.state.guides},n.scrollGuides=function(e){var t=this.props.zoom,n=this.guidesElement;this.scrollPos=e,n.style.transform=this.getTranslateName()+"("+-e*t+"px)";var r=this.state.guides;this.guideElements.forEach((function(t,n){t&&(t.style.display=-e+r[n]<0?"none":"block")}))},n.resize=function(){this.ruler.resize()},n.scroll=function(e){this.ruler.scroll(e)},n.movePos=function(e){var t=e.datas,n=e.distX,r=e.distY,i=this.props,o=i.type,a=i.zoom,A=i.snaps,s=i.snapThreshold,l=i.displayDragPos,u=i.dragPosFormat,c="horizontal"===o,f=N(t.matrix,[n,r]),d=t.offsetPos,p=f[0]+d[0],h=f[1]+d[1],g=Math.round(c?h:p),v=Math.round(g/a),B=A.slice().sort((function(e,t){return Math.abs(v-e)-Math.abs(v-t)}));if(B.length&&Math.abs(B[0]-v)u))return!1;var f=s.get(e),d=s.get(t);if(f&&d)return f==t&&d==e;var p=-1,h=!0,g=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++p=t||n<0||g&&e-p>=u}function w(){var e=i();if(b(e))return E(e);f=setTimeout(w,function(e){var n=t-(e-d);return g?A(n,u-(e-p)):n}(e))}function E(e){return f=void 0,v&&s?B(e):(s=l=void 0,c)}function y(){var e=i(),n=b(e);if(s=arguments,l=this,d=e,n){if(void 0===f)return m(d);if(g)return clearTimeout(f),f=setTimeout(w,t),B(d)}return void 0===f&&(f=setTimeout(w,t)),c}return t=o(t)||0,r(n)&&(h=!!n.leading,u=(g="maxWait"in n)?a(o(n.maxWait)||0,t):u,v="trailing"in n?!!n.trailing:v),y.cancel=function(){void 0!==f&&clearTimeout(f),p=0,s=d=l=f=void 0},y.flush=function(){return void 0===f?c:E(i())},y}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ColorWrap=void 0;var r=Object.assign||function(e){for(var t=1;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=55296&&i<=56319&&n>10),a%1024+56320)),(i+1===n||r.length>16384)&&(o+=String.fromCharCode.apply(String,r),r.length=0)}return o},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"===typeof Uint8Array?[]:new Uint8Array(256),c=0;c=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),h=10,g=13,v=15,B=17,m=18,b=19,w=20,E=21,y=22,C=24,Q=25,x=26,F=27,U=28,S=30,H=32,O=33,T=34,N=35,_=37,M=38,R=39,D=40,P=42,k=function(e){var t,n,r,i=function(e){var t,n,r,i,o,a=.75*e.length,A=e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var l="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint8Array.prototype.slice?new ArrayBuffer(a):new Array(a),c=Array.isArray(l)?l:new Uint8Array(l);for(t=0;t>4,c[s++]=(15&r)<<4|i>>2,c[s++]=(3&i)<<6|63&o;return l}(e),o=Array.isArray(i)?function(e){for(var t=e.length,n=[],r=0;r0;){var a=r[--o];if(Array.isArray(e)?-1!==e.indexOf(a):e===a)for(var A=n;A<=r.length;){var s;if((s=r[++A])===t)return!0;if(s!==h)break}if(a!==h)break}return!1},Y=function(e,t){for(var n=e;n>=0;){var r=t[n];if(r!==h)return r;n--}return 0},W=function(e,t,n,r,i){if(0===n[r])return"\xd7";var o=r-1;if(Array.isArray(i)&&!0===i[o])return"\xd7";var a=o-1,A=o+1,s=t[o],l=a>=0?t[a]:0,u=t[A];if(2===s&&3===u)return"\xd7";if(-1!==K.indexOf(s))return"!";if(-1!==K.indexOf(u))return"\xd7";if(-1!==L.indexOf(u))return"\xd7";if(8===Y(o,t))return"\xf7";if(11===k.get(e[o])&&(u===_||u===H||u===O))return"\xd7";if(7===s||7===u)return"\xd7";if(9===s)return"\xd7";if(-1===[h,g,v].indexOf(s)&&9===u)return"\xd7";if(-1!==[B,m,b,C,U].indexOf(u))return"\xd7";if(Y(o,t)===y)return"\xd7";if(V(23,y,o,t))return"\xd7";if(V([B,m],E,o,t))return"\xd7";if(V(12,12,o,t))return"\xd7";if(s===h)return"\xf7";if(23===s||23===u)return"\xd7";if(16===u||16===s)return"\xf7";if(-1!==[g,v,E].indexOf(u)||14===s)return"\xd7";if(36===l&&-1!==G.indexOf(s))return"\xd7";if(s===U&&36===u)return"\xd7";if(u===w&&-1!==I.concat(w,b,Q,_,H,O).indexOf(s))return"\xd7";if(-1!==I.indexOf(u)&&s===Q||-1!==I.indexOf(s)&&u===Q)return"\xd7";if(s===F&&-1!==[_,H,O].indexOf(u)||-1!==[_,H,O].indexOf(s)&&u===x)return"\xd7";if(-1!==I.indexOf(s)&&-1!==z.indexOf(u)||-1!==z.indexOf(s)&&-1!==I.indexOf(u))return"\xd7";if(-1!==[F,x].indexOf(s)&&(u===Q||-1!==[y,v].indexOf(u)&&t[A+1]===Q)||-1!==[y,v].indexOf(s)&&u===Q||s===Q&&-1!==[Q,U,C].indexOf(u))return"\xd7";if(-1!==[Q,U,C,B,m].indexOf(u))for(var c=o;c>=0;){if((f=t[c])===Q)return"\xd7";if(-1===[U,C].indexOf(f))break;c--}if(-1!==[F,x].indexOf(u))for(c=-1!==[B,m].indexOf(s)?a:o;c>=0;){var f;if((f=t[c])===Q)return"\xd7";if(-1===[U,C].indexOf(f))break;c--}if(M===s&&-1!==[M,R,T,N].indexOf(u)||-1!==[R,T].indexOf(s)&&-1!==[R,D].indexOf(u)||-1!==[D,N].indexOf(s)&&u===D)return"\xd7";if(-1!==X.indexOf(s)&&-1!==[w,x].indexOf(u)||-1!==X.indexOf(u)&&s===F)return"\xd7";if(-1!==I.indexOf(s)&&-1!==I.indexOf(u))return"\xd7";if(s===C&&-1!==I.indexOf(u))return"\xd7";if(-1!==I.concat(Q).indexOf(s)&&u===y||-1!==I.concat(Q).indexOf(u)&&s===m)return"\xd7";if(41===s&&41===u){for(var d=n[o],p=1;d>0&&41===t[--d];)p++;if(p%2!==0)return"\xd7"}return s===H&&u===O?"\xd7":"\xf7"},J=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var n=function(e,t){void 0===t&&(t="strict");var n=[],r=[],i=[];return e.forEach((function(e,o){var a=k.get(e);if(a>50?(i.push(!0),a-=50):i.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return r.push(o),n.push(16);if(4===a||11===a){if(0===o)return r.push(o),n.push(S);var A=n[o-1];return-1===j.indexOf(A)?(r.push(r[o-1]),n.push(A)):(r.push(o),n.push(S))}return r.push(o),31===a?n.push("strict"===t?E:_):a===P||29===a?n.push(S):43===a?e>=131072&&e<=196605||e>=196608&&e<=262141?n.push(_):n.push(S):void n.push(a)})),[r,n,i]}(e,t.lineBreak),r=n[0],i=n[1],o=n[2];return"break-all"!==t.wordBreak&&"break-word"!==t.wordBreak||(i=i.map((function(e){return-1!==[Q,S,P].indexOf(e)?_:e}))),[r,i,"keep-all"===t.wordBreak?o.map((function(t,n){return t&&e[n]>=19968&&e[n]<=40959})):void 0]},q=function(){function e(e,t,n,r){this.codePoints=e,this.required="!"===t,this.start=n,this.end=r}return e.prototype.slice=function(){return s.apply(void 0,this.codePoints.slice(this.start,this.end))},e}();!function(e){e[e.STRING_TOKEN=0]="STRING_TOKEN",e[e.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",e[e.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",e[e.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",e[e.COMMA_TOKEN=4]="COMMA_TOKEN",e[e.HASH_TOKEN=5]="HASH_TOKEN",e[e.DELIM_TOKEN=6]="DELIM_TOKEN",e[e.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",e[e.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",e[e.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",e[e.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",e[e.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",e[e.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",e[e.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",e[e.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",e[e.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",e[e.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",e[e.NUMBER_TOKEN=17]="NUMBER_TOKEN",e[e.FUNCTION=18]="FUNCTION",e[e.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",e[e.IDENT_TOKEN=20]="IDENT_TOKEN",e[e.COLUMN_TOKEN=21]="COLUMN_TOKEN",e[e.URL_TOKEN=22]="URL_TOKEN",e[e.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",e[e.CDC_TOKEN=24]="CDC_TOKEN",e[e.CDO_TOKEN=25]="CDO_TOKEN",e[e.COLON_TOKEN=26]="COLON_TOKEN",e[e.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",e[e.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",e[e.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",e[e.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",e[e.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",e[e.EOF_TOKEN=32]="EOF_TOKEN"}(f||(f={}));var Z=function(e){return e>=48&&e<=57},$=function(e){return Z(e)||e>=65&&e<=70||e>=97&&e<=102},ee=function(e){return 10===e||9===e||32===e},te=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},ne=function(e){return te(e)||Z(e)||45===e},re=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},ie=function(e,t){return 92===e&&10!==t},oe=function(e,t,n){return 45===e?te(t)||ie(t,n):!!te(e)||!(92!==e||!ie(e,t))},ae=function(e,t,n){return 43===e||45===e?!!Z(t)||46===t&&Z(n):Z(46===e?t:e)},Ae=function(e){var t=0,n=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(n=-1),t++);for(var r=[];Z(e[t]);)r.push(e[t++]);var i=r.length?parseInt(s.apply(void 0,r),10):0;46===e[t]&&t++;for(var o=[];Z(e[t]);)o.push(e[t++]);var a=o.length,A=a?parseInt(s.apply(void 0,o),10):0;69!==e[t]&&101!==e[t]||t++;var l=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(l=-1),t++);for(var u=[];Z(e[t]);)u.push(e[t++]);var c=u.length?parseInt(s.apply(void 0,u),10):0;return n*(i+A*Math.pow(10,-a))*Math.pow(10,l*c)},se={type:f.LEFT_PARENTHESIS_TOKEN},le={type:f.RIGHT_PARENTHESIS_TOKEN},ue={type:f.COMMA_TOKEN},ce={type:f.SUFFIX_MATCH_TOKEN},fe={type:f.PREFIX_MATCH_TOKEN},de={type:f.COLUMN_TOKEN},pe={type:f.DASH_MATCH_TOKEN},he={type:f.INCLUDE_MATCH_TOKEN},ge={type:f.LEFT_CURLY_BRACKET_TOKEN},ve={type:f.RIGHT_CURLY_BRACKET_TOKEN},Be={type:f.SUBSTRING_MATCH_TOKEN},me={type:f.BAD_URL_TOKEN},be={type:f.BAD_STRING_TOKEN},we={type:f.CDO_TOKEN},Ee={type:f.CDC_TOKEN},ye={type:f.COLON_TOKEN},Ce={type:f.SEMICOLON_TOKEN},Qe={type:f.LEFT_SQUARE_BRACKET_TOKEN},xe={type:f.RIGHT_SQUARE_BRACKET_TOKEN},Fe={type:f.WHITESPACE_TOKEN},Ue={type:f.EOF_TOKEN},Se=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(A(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Ue;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),r=this.peekCodePoint(2);if(ne(t)||ie(n,r)){var i=oe(t,n,r)?2:1,o=this.consumeName();return{type:f.HASH_TOKEN,value:o,flags:i}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),ce;break;case 39:return this.consumeStringToken(39);case 40:return se;case 41:return le;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Be;break;case 43:if(ae(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return ue;case 45:var a=e,A=this.peekCodePoint(0),l=this.peekCodePoint(1);if(ae(a,A,l))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(oe(a,A,l))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(45===A&&62===l)return this.consumeCodePoint(),this.consumeCodePoint(),Ee;break;case 46:if(ae(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(42===u&&47===(u=this.consumeCodePoint()))return this.consumeToken();if(-1===u)return this.consumeToken()}break;case 58:return ye;case 59:return Ce;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),we;break;case 64:var c=this.peekCodePoint(0),d=this.peekCodePoint(1),p=this.peekCodePoint(2);if(oe(c,d,p))return o=this.consumeName(),{type:f.AT_KEYWORD_TOKEN,value:o};break;case 91:return Qe;case 92:if(ie(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return xe;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),fe;break;case 123:return ge;case 125:return ve;case 117:case 85:var h=this.peekCodePoint(0),g=this.peekCodePoint(1);return 43!==h||!$(g)&&63!==g||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),pe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),de;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),he;break;case-1:return Ue}return ee(e)?(this.consumeWhiteSpace(),Fe):Z(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):te(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:f.DELIM_TOKEN,value:s(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return"undefined"===typeof e?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();$(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var r=parseInt(s.apply(void 0,e.map((function(e){return 63===e?48:e}))),16),i=parseInt(s.apply(void 0,e.map((function(e){return 63===e?70:e}))),16);return{type:f.UNICODE_RANGE_TOKEN,start:r,end:i}}var o=parseInt(s.apply(void 0,e),16);if(45===this.peekCodePoint(0)&&$(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var a=[];$(t)&&a.length<6;)a.push(t),t=this.consumeCodePoint();return i=parseInt(s.apply(void 0,a),16),{type:f.UNICODE_RANGE_TOKEN,start:o,end:i}}return{type:f.UNICODE_RANGE_TOKEN,start:o,end:o}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:f.FUNCTION_TOKEN,value:e}):{type:f.IDENT_TOKEN,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:f.URL_TOKEN,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===f.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:f.URL_TOKEN,value:n.value}):(this.consumeBadUrlRemnants(),me)}for(;;){var r=this.consumeCodePoint();if(-1===r||41===r)return{type:f.URL_TOKEN,value:s.apply(void 0,e)};if(ee(r))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:f.URL_TOKEN,value:s.apply(void 0,e)}):(this.consumeBadUrlRemnants(),me);if(34===r||39===r||40===r||re(r))return this.consumeBadUrlRemnants(),me;if(92===r){if(!ie(r,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),me;e.push(this.consumeEscapedCodePoint())}else e.push(r)}},e.prototype.consumeWhiteSpace=function(){for(;ee(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||-1===e)return;ie(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var n=Math.min(6e4,e);t+=s.apply(void 0,this._value.splice(0,n)),e-=n}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",n=0;;){var r=this._value[n];if(-1===r||void 0===r||r===e)return t+=this.consumeStringSlice(n),{type:f.STRING_TOKEN,value:t};if(10===r)return this._value.splice(0,n),be;if(92===r){var i=this._value[n+1];-1!==i&&void 0!==i&&(10===i?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):ie(r,i)&&(t+=this.consumeStringSlice(n),t+=s(this.consumeEscapedCodePoint()),n=-1))}n++}},e.prototype.consumeNumber=function(){var e=[],t=4,n=this.peekCodePoint(0);for(43!==n&&45!==n||e.push(this.consumeCodePoint());Z(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var r=this.peekCodePoint(1);if(46===n&&Z(r))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Z(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),r=this.peekCodePoint(1);var i=this.peekCodePoint(2);if((69===n||101===n)&&((43===r||45===r)&&Z(i)||Z(r)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;Z(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Ae(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],r=this.peekCodePoint(0),i=this.peekCodePoint(1),o=this.peekCodePoint(2);if(oe(r,i,o)){var a=this.consumeName();return{type:f.DIMENSION_TOKEN,number:t,flags:n,unit:a}}return 37===r?(this.consumeCodePoint(),{type:f.PERCENTAGE_TOKEN,number:t,flags:n}):{type:f.NUMBER_TOKEN,number:t,flags:n}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if($(e)){for(var t=s(e);$(this.peekCodePoint(0))&&t.length<6;)t+=s(this.consumeCodePoint());ee(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||function(e){return e>=55296&&e<=57343}(n)||n>1114111?65533:n}return-1===e?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(ne(t))e+=s(t);else{if(!ie(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=s(this.consumeEscapedCodePoint())}}},e}(),He=function(){function e(e){this._tokens=e}return e.create=function(t){var n=new Se;return n.write(t),new e(n.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===f.WHITESPACE_TOKEN;)e=this.consumeToken();if(e.type===f.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(e.type===f.WHITESPACE_TOKEN);if(e.type===f.EOF_TOKEN)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===f.EOF_TOKEN)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case f.LEFT_CURLY_BRACKET_TOKEN:case f.LEFT_SQUARE_BRACKET_TOKEN:case f.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(e.type);case f.FUNCTION_TOKEN:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===f.EOF_TOKEN||ke(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:f.FUNCTION};;){var n=this.consumeToken();if(n.type===f.EOF_TOKEN||n.type===f.RIGHT_PARENTHESIS_TOKEN)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return"undefined"===typeof e?Ue:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),Oe=function(e){return e.type===f.DIMENSION_TOKEN},Te=function(e){return e.type===f.NUMBER_TOKEN},Ne=function(e){return e.type===f.IDENT_TOKEN},_e=function(e){return e.type===f.STRING_TOKEN},Me=function(e,t){return Ne(e)&&e.value===t},Re=function(e){return e.type!==f.WHITESPACE_TOKEN},De=function(e){return e.type!==f.WHITESPACE_TOKEN&&e.type!==f.COMMA_TOKEN},Pe=function(e){var t=[],n=[];return e.forEach((function(e){if(e.type===f.COMMA_TOKEN){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}e.type!==f.WHITESPACE_TOKEN&&n.push(e)})),n.length&&t.push(n),t},ke=function(e,t){return t===f.LEFT_CURLY_BRACKET_TOKEN&&e.type===f.RIGHT_CURLY_BRACKET_TOKEN||t===f.LEFT_SQUARE_BRACKET_TOKEN&&e.type===f.RIGHT_SQUARE_BRACKET_TOKEN||t===f.LEFT_PARENTHESIS_TOKEN&&e.type===f.RIGHT_PARENTHESIS_TOKEN},Ie=function(e){return e.type===f.NUMBER_TOKEN||e.type===f.DIMENSION_TOKEN},Ke=function(e){return e.type===f.PERCENTAGE_TOKEN||Ie(e)},Le=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},ze={type:f.NUMBER_TOKEN,number:0,flags:4},je={type:f.PERCENTAGE_TOKEN,number:50,flags:4},Xe={type:f.PERCENTAGE_TOKEN,number:100,flags:4},Ge=function(e,t,n){var r=e[0],i=e[1];return[Ve(r,t),Ve("undefined"!==typeof i?i:r,n)]},Ve=function(e,t){if(e.type===f.PERCENTAGE_TOKEN)return e.number/100*t;if(Oe(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},Ye=function(e){if(e.type===f.DIMENSION_TOKEN)switch(e.unit){case"deg":return Math.PI*e.number/180;case"grad":return Math.PI/200*e.number;case"rad":return e.number;case"turn":return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},We=function(e){return e.type===f.DIMENSION_TOKEN&&("deg"===e.unit||"grad"===e.unit||"rad"===e.unit||"turn"===e.unit)},Je=function(e){switch(e.filter(Ne).map((function(e){return e.value})).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ze,ze];case"to top":case"bottom":return qe(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ze,Xe];case"to right":case"left":return qe(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Xe,Xe];case"to bottom":case"top":return qe(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Xe,ze];case"to left":case"right":return qe(270)}return 0},qe=function(e){return Math.PI*e/180},Ze=function(e){if(e.type===f.FUNCTION){var t=st[e.name];if("undefined"===typeof t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(e.values)}if(e.type===f.HASH_TOKEN){if(3===e.value.length){var n=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);return tt(parseInt(n+n,16),parseInt(r+r,16),parseInt(i+i,16),1)}if(4===e.value.length){n=e.value.substring(0,1),r=e.value.substring(1,2),i=e.value.substring(2,3);var o=e.value.substring(3,4);return tt(parseInt(n+n,16),parseInt(r+r,16),parseInt(i+i,16),parseInt(o+o,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),tt(parseInt(n,16),parseInt(r,16),parseInt(i,16),1);if(8===e.value.length)return n=e.value.substring(0,2),r=e.value.substring(2,4),i=e.value.substring(4,6),o=e.value.substring(6,8),tt(parseInt(n,16),parseInt(r,16),parseInt(i,16),parseInt(o,16)/255)}if(e.type===f.IDENT_TOKEN){var a=lt[e.value.toUpperCase()];if("undefined"!==typeof a)return a}return lt.TRANSPARENT},$e=function(e){return 0===(255&e)},et=function(e){var t=255&e,n=255&e>>8,r=255&e>>16,i=255&e>>24;return t<255?"rgba("+i+","+r+","+n+","+t/255+")":"rgb("+i+","+r+","+n+")"},tt=function(e,t,n,r){return(e<<24|t<<16|n<<8|Math.round(255*r)<<0)>>>0},nt=function(e,t){if(e.type===f.NUMBER_TOKEN)return e.number;if(e.type===f.PERCENTAGE_TOKEN){var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}return 0},rt=function(e){var t=e.filter(De);if(3===t.length){var n=t.map(nt),r=n[0],i=n[1],o=n[2];return tt(r,i,o,1)}if(4===t.length){var a=t.map(nt),A=(r=a[0],i=a[1],o=a[2],a[3]);return tt(r,i,o,A)}return 0};function it(e,t,n){return n<0&&(n+=1),n>=1&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}var ot,at,At=function(e){var t=e.filter(De),n=t[0],r=t[1],i=t[2],o=t[3],a=(n.type===f.NUMBER_TOKEN?qe(n.number):Ye(n))/(2*Math.PI),A=Ke(r)?r.number/100:0,s=Ke(i)?i.number/100:0,l="undefined"!==typeof o&&Ke(o)?Ve(o,1):1;if(0===A)return tt(255*s,255*s,255*s,1);var u=s<=.5?s*(A+1):s+A-s*A,c=2*s-u,d=it(c,u,a+1/3),p=it(c,u,a),h=it(c,u,a-1/3);return tt(255*d,255*p,255*h,l)},st={hsl:At,hsla:At,rgb:rt,rgba:rt},lt={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(function(e){e[e.VALUE=0]="VALUE",e[e.LIST=1]="LIST",e[e.IDENT_VALUE=2]="IDENT_VALUE",e[e.TYPE_VALUE=3]="TYPE_VALUE",e[e.TOKEN_VALUE=4]="TOKEN_VALUE"})(ot||(ot={})),function(e){e[e.BORDER_BOX=0]="BORDER_BOX",e[e.PADDING_BOX=1]="PADDING_BOX",e[e.CONTENT_BOX=2]="CONTENT_BOX"}(at||(at={}));var ut,ct,ft,dt={name:"background-clip",initialValue:"border-box",prefix:!1,type:ot.LIST,parse:function(e){return e.map((function(e){if(Ne(e))switch(e.value){case"padding-box":return at.PADDING_BOX;case"content-box":return at.CONTENT_BOX}return at.BORDER_BOX}))}},pt={name:"background-color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"},ht=function(e){var t=Ze(e[0]),n=e[1];return n&&Ke(n)?{color:t,stop:n}:{color:t,stop:null}},gt=function(e,t){var n=e[0],r=e[e.length-1];null===n.stop&&(n.stop=ze),null===r.stop&&(r.stop=Xe);for(var i=[],o=0,a=0;ao?i.push(s):i.push(o),o=s}else i.push(null)}var l=null;for(a=0;ae.optimumDistance)?{optimumCorner:t,optimumDistance:A}:e}),{optimumDistance:i?1/0:-1/0,optimumCorner:null}).optimumCorner},bt=function(e){var t=qe(180),n=[];return Pe(e).forEach((function(e,r){if(0===r){var i=e[0];if(i.type===f.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(t=Je(e));if(We(i))return void(t=(Ye(i)+qe(270))%qe(360))}var o=ht(e);n.push(o)})),{angle:t,stops:n,type:ut.LINEAR_GRADIENT}},wt=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Et=function(e,t,n,r,i){var o="http://www.w3.org/2000/svg",a=document.createElementNS(o,"svg"),A=document.createElementNS(o,"foreignObject");return a.setAttributeNS(null,"width",e.toString()),a.setAttributeNS(null,"height",t.toString()),A.setAttributeNS(null,"width","100%"),A.setAttributeNS(null,"height","100%"),A.setAttributeNS(null,"x",n.toString()),A.setAttributeNS(null,"y",r.toString()),A.setAttributeNS(null,"externalResourcesRequired","true"),a.appendChild(A),A.appendChild(i),a},yt=function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){return t(r)},r.onerror=n,r.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Ct={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n);var r=t.getBoundingClientRect(),i=Math.round(r.height);if(e.body.removeChild(n),123===i)return!0}}return!1}(document);return Object.defineProperty(Ct,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,n=e.createElement("canvas"),r=n.getContext("2d");if(!r)return!1;t.src="data:image/svg+xml,";try{r.drawImage(t,0,0),n.toDataURL()}catch(i){return!1}return!0}(document);return Object.defineProperty(Ct,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"===typeof Array.from&&"function"===typeof window.fetch?function(e){var t=e.createElement("canvas");t.width=100,t.height=100;var n=t.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,100,100);var r=new Image,i=t.toDataURL();r.src=i;var o=Et(100,100,0,0,r);return n.fillStyle="red",n.fillRect(0,0,100,100),yt(o).then((function(t){n.drawImage(t,0,0);var r=n.getImageData(0,0,100,100).data;n.fillStyle="red",n.fillRect(0,0,100,100);var o=e.createElement("div");return o.style.backgroundImage="url("+i+")",o.style.height="100px",wt(r)?yt(Et(100,100,0,0,o)):Promise.reject(!1)})).then((function(e){return n.drawImage(e,0,0),wt(n.getImageData(0,0,100,100).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(Ct,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e="undefined"!==typeof(new Image).crossOrigin;return Object.defineProperty(Ct,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"===typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Ct,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ct,"SUPPORT_CORS_XHR",{value:e}),e}},Qt=function(){function e(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t0&&setTimeout((function(){return t("Timed out ("+a._options.imageTimeout+"ms) loading image")}),a._options.imageTimeout)}))];case 3:return[2,i.sent()]}}))}))},e.prototype.has=function(e){return"undefined"!==typeof this._cache[e]},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,n=this._options.proxy;if(!n)throw new Error("No proxy defined");var r=e.substring(0,256);return new Promise((function(i,o){var a=Ct.SUPPORT_RESPONSE_TYPE?"blob":"text",A=new XMLHttpRequest;if(A.onload=function(){if(200===A.status)if("text"===a)i(A.response);else{var e=new FileReader;e.addEventListener("load",(function(){return i(e.result)}),!1),e.addEventListener("error",(function(e){return o(e)}),!1),e.readAsDataURL(A.response)}else o("Failed to proxy resource "+r+" with status code "+A.status)},A.onerror=o,A.open("GET",n+"?url="+encodeURIComponent(e)+"&responseType="+a),"text"!==a&&A instanceof XMLHttpRequest&&(A.responseType=a),t._options.imageTimeout){var s=t._options.imageTimeout;A.timeout=s,A.ontimeout=function(){return o("Timed out ("+s+"ms) proxying "+r)}}A.send()}))},e}(),Ut=/^data:image\/svg\+xml/i,St=/^data:image\/.*;base64,/i,Ht=/^data:image\/.*/i,Ot=function(e){return Ct.SUPPORT_SVG_DRAWING||!Mt(e)},Tt=function(e){return Ht.test(e)},Nt=function(e){return St.test(e)},_t=function(e){return"blob"===e.substr(0,4)},Mt=function(e){return"svg"===e.substr(-3).toLowerCase()||Ut.test(e)},Rt=function(e){var t=ct.CIRCLE,n=ft.FARTHEST_CORNER,r=[],i=[];return Pe(e).forEach((function(e,o){var a=!0;if(0===o?a=e.reduce((function(e,t){if(Ne(t))switch(t.value){case"center":return i.push(je),!1;case"top":case"left":return i.push(ze),!1;case"right":case"bottom":return i.push(Xe),!1}else if(Ke(t)||Ie(t))return i.push(t),!1;return e}),a):1===o&&(a=e.reduce((function(e,r){if(Ne(r))switch(r.value){case"circle":return t=ct.CIRCLE,!1;case"ellipse":return t=ct.ELLIPSE,!1;case"contain":case"closest-side":return n=ft.CLOSEST_SIDE,!1;case"farthest-side":return n=ft.FARTHEST_SIDE,!1;case"closest-corner":return n=ft.CLOSEST_CORNER,!1;case"cover":case"farthest-corner":return n=ft.FARTHEST_CORNER,!1}else if(Ie(r)||Ke(r))return Array.isArray(n)||(n=[]),n.push(r),!1;return e}),a)),a){var A=ht(e);r.push(A)}})),{size:n,shape:t,stops:r,position:i,type:ut.RADIAL_GRADIENT}};!function(e){e[e.URL=0]="URL",e[e.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",e[e.RADIAL_GRADIENT=2]="RADIAL_GRADIENT"}(ut||(ut={})),function(e){e[e.CIRCLE=0]="CIRCLE",e[e.ELLIPSE=1]="ELLIPSE"}(ct||(ct={})),function(e){e[e.CLOSEST_SIDE=0]="CLOSEST_SIDE",e[e.FARTHEST_SIDE=1]="FARTHEST_SIDE",e[e.CLOSEST_CORNER=2]="CLOSEST_CORNER",e[e.FARTHEST_CORNER=3]="FARTHEST_CORNER"}(ft||(ft={}));var Dt,Pt=function(e){if(e.type===f.URL_TOKEN){var t={url:e.value,type:ut.URL};return xt.getInstance().addImage(e.value),t}if(e.type===f.FUNCTION){var n=kt[e.name];if("undefined"===typeof n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(e.values)}throw new Error("Unsupported image type")},kt={"linear-gradient":function(e){var t=qe(180),n=[];return Pe(e).forEach((function(e,r){if(0===r){var i=e[0];if(i.type===f.IDENT_TOKEN&&"to"===i.value)return void(t=Je(e));if(We(i))return void(t=Ye(i))}var o=ht(e);n.push(o)})),{angle:t,stops:n,type:ut.LINEAR_GRADIENT}},"-moz-linear-gradient":bt,"-ms-linear-gradient":bt,"-o-linear-gradient":bt,"-webkit-linear-gradient":bt,"radial-gradient":function(e){var t=ct.CIRCLE,n=ft.FARTHEST_CORNER,r=[],i=[];return Pe(e).forEach((function(e,o){var a=!0;if(0===o){var A=!1;a=e.reduce((function(e,r){if(A)if(Ne(r))switch(r.value){case"center":return i.push(je),e;case"top":case"left":return i.push(ze),e;case"right":case"bottom":return i.push(Xe),e}else(Ke(r)||Ie(r))&&i.push(r);else if(Ne(r))switch(r.value){case"circle":return t=ct.CIRCLE,!1;case"ellipse":return t=ct.ELLIPSE,!1;case"at":return A=!0,!1;case"closest-side":return n=ft.CLOSEST_SIDE,!1;case"cover":case"farthest-side":return n=ft.FARTHEST_SIDE,!1;case"contain":case"closest-corner":return n=ft.CLOSEST_CORNER,!1;case"farthest-corner":return n=ft.FARTHEST_CORNER,!1}else if(Ie(r)||Ke(r))return Array.isArray(n)||(n=[]),n.push(r),!1;return e}),a)}if(a){var s=ht(e);r.push(s)}})),{size:n,shape:t,stops:r,position:i,type:ut.RADIAL_GRADIENT}},"-moz-radial-gradient":Rt,"-ms-radial-gradient":Rt,"-o-radial-gradient":Rt,"-webkit-radial-gradient":Rt,"-webkit-gradient":function(e){var t=qe(180),n=[],r=ut.LINEAR_GRADIENT,i=ct.CIRCLE,o=ft.FARTHEST_CORNER;return Pe(e).forEach((function(e,t){var i=e[0];if(0===t){if(Ne(i)&&"linear"===i.value)return void(r=ut.LINEAR_GRADIENT);if(Ne(i)&&"radial"===i.value)return void(r=ut.RADIAL_GRADIENT)}if(i.type===f.FUNCTION)if("from"===i.name){var o=Ze(i.values[0]);n.push({stop:ze,color:o})}else if("to"===i.name)o=Ze(i.values[0]),n.push({stop:Xe,color:o});else if("color-stop"===i.name){var a=i.values.filter(De);if(2===a.length){o=Ze(a[1]);var A=a[0];Te(A)&&n.push({stop:{type:f.PERCENTAGE_TOKEN,number:100*A.number,flags:A.flags},color:o})}}})),r===ut.LINEAR_GRADIENT?{angle:(t+qe(180))%qe(360),stops:n,type:r}:{size:o,shape:i,stops:n,position:[],type:r}}},It={name:"background-image",initialValue:"none",type:ot.LIST,prefix:!1,parse:function(e){if(0===e.length)return[];var t=e[0];return t.type===f.IDENT_TOKEN&&"none"===t.value?[]:e.filter((function(e){return De(e)&&function(e){return e.type!==f.FUNCTION||kt[e.name]}(e)})).map(Pt)}},Kt={name:"background-origin",initialValue:"border-box",prefix:!1,type:ot.LIST,parse:function(e){return e.map((function(e){if(Ne(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Lt={name:"background-position",initialValue:"0% 0%",type:ot.LIST,prefix:!1,parse:function(e){return Pe(e).map((function(e){return e.filter(Ke)})).map(Le)}};!function(e){e[e.REPEAT=0]="REPEAT",e[e.NO_REPEAT=1]="NO_REPEAT",e[e.REPEAT_X=2]="REPEAT_X",e[e.REPEAT_Y=3]="REPEAT_Y"}(Dt||(Dt={}));var zt,jt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:ot.LIST,parse:function(e){return Pe(e).map((function(e){return e.filter(Ne).map((function(e){return e.value})).join(" ")})).map(Xt)}},Xt=function(e){switch(e){case"no-repeat":return Dt.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return Dt.REPEAT_X;case"repeat-y":case"no-repeat repeat":return Dt.REPEAT_Y;case"repeat":default:return Dt.REPEAT}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(zt||(zt={}));var Gt,Vt={name:"background-size",initialValue:"0",prefix:!1,type:ot.LIST,parse:function(e){return Pe(e).map((function(e){return e.filter(Yt)}))}},Yt=function(e){return Ne(e)||Ke(e)},Wt=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"}},Jt=Wt("top"),qt=Wt("right"),Zt=Wt("bottom"),$t=Wt("left"),en=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:ot.LIST,parse:function(e){return Le(e.filter(Ke))}}},tn=en("top-left"),nn=en("top-right"),rn=en("bottom-right"),on=en("bottom-left");!function(e){e[e.NONE=0]="NONE",e[e.SOLID=1]="SOLID"}(Gt||(Gt={}));var an,An=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"none":return Gt.NONE}return Gt.SOLID}}},sn=An("top"),ln=An("right"),un=An("bottom"),cn=An("left"),fn=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:ot.VALUE,prefix:!1,parse:function(e){return Oe(e)?e.number:0}}},dn=fn("top"),pn=fn("right"),hn=fn("bottom"),gn=fn("left"),vn={name:"color",initialValue:"transparent",prefix:!1,type:ot.TYPE_VALUE,format:"color"},Bn={name:"display",initialValue:"inline-block",prefix:!1,type:ot.LIST,parse:function(e){return e.filter(Ne).reduce((function(e,t){return e|mn(t.value)}),0)}},mn=function(e){switch(e){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};!function(e){e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.INLINE_START=3]="INLINE_START",e[e.INLINE_END=4]="INLINE_END"}(an||(an={}));var bn,wn={name:"float",initialValue:"none",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"left":return an.LEFT;case"right":return an.RIGHT;case"inline-start":return an.INLINE_START;case"inline-end":return an.INLINE_END}return an.NONE}},En={name:"letter-spacing",initialValue:"0",prefix:!1,type:ot.VALUE,parse:function(e){return e.type===f.IDENT_TOKEN&&"normal"===e.value?0:e.type===f.NUMBER_TOKEN||e.type===f.DIMENSION_TOKEN?e.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(bn||(bn={}));var yn,Cn={name:"line-break",initialValue:"normal",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"strict":return bn.STRICT;case"normal":default:return bn.NORMAL}}},Qn={name:"line-height",initialValue:"normal",prefix:!1,type:ot.TOKEN_VALUE},xn={name:"list-style-image",initialValue:"none",type:ot.VALUE,prefix:!1,parse:function(e){return e.type===f.IDENT_TOKEN&&"none"===e.value?null:Pt(e)}};!function(e){e[e.INSIDE=0]="INSIDE",e[e.OUTSIDE=1]="OUTSIDE"}(yn||(yn={}));var Fn,Un={name:"list-style-position",initialValue:"outside",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"inside":return yn.INSIDE;case"outside":default:return yn.OUTSIDE}}};!function(e){e[e.NONE=-1]="NONE",e[e.DISC=0]="DISC",e[e.CIRCLE=1]="CIRCLE",e[e.SQUARE=2]="SQUARE",e[e.DECIMAL=3]="DECIMAL",e[e.CJK_DECIMAL=4]="CJK_DECIMAL",e[e.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",e[e.LOWER_ROMAN=6]="LOWER_ROMAN",e[e.UPPER_ROMAN=7]="UPPER_ROMAN",e[e.LOWER_GREEK=8]="LOWER_GREEK",e[e.LOWER_ALPHA=9]="LOWER_ALPHA",e[e.UPPER_ALPHA=10]="UPPER_ALPHA",e[e.ARABIC_INDIC=11]="ARABIC_INDIC",e[e.ARMENIAN=12]="ARMENIAN",e[e.BENGALI=13]="BENGALI",e[e.CAMBODIAN=14]="CAMBODIAN",e[e.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",e[e.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",e[e.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",e[e.DEVANAGARI=18]="DEVANAGARI",e[e.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",e[e.GEORGIAN=20]="GEORGIAN",e[e.GUJARATI=21]="GUJARATI",e[e.GURMUKHI=22]="GURMUKHI",e[e.HEBREW=22]="HEBREW",e[e.HIRAGANA=23]="HIRAGANA",e[e.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",e[e.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",e[e.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",e[e.KANNADA=27]="KANNADA",e[e.KATAKANA=28]="KATAKANA",e[e.KATAKANA_IROHA=29]="KATAKANA_IROHA",e[e.KHMER=30]="KHMER",e[e.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",e[e.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",e[e.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",e[e.LAO=34]="LAO",e[e.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",e[e.MALAYALAM=36]="MALAYALAM",e[e.MONGOLIAN=37]="MONGOLIAN",e[e.MYANMAR=38]="MYANMAR",e[e.ORIYA=39]="ORIYA",e[e.PERSIAN=40]="PERSIAN",e[e.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",e[e.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",e[e.TAMIL=43]="TAMIL",e[e.TELUGU=44]="TELUGU",e[e.THAI=45]="THAI",e[e.TIBETAN=46]="TIBETAN",e[e.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",e[e.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",e[e.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",e[e.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN",e[e.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"}(Fn||(Fn={}));var Sn,Hn={name:"list-style-type",initialValue:"none",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"disc":return Fn.DISC;case"circle":return Fn.CIRCLE;case"square":return Fn.SQUARE;case"decimal":return Fn.DECIMAL;case"cjk-decimal":return Fn.CJK_DECIMAL;case"decimal-leading-zero":return Fn.DECIMAL_LEADING_ZERO;case"lower-roman":return Fn.LOWER_ROMAN;case"upper-roman":return Fn.UPPER_ROMAN;case"lower-greek":return Fn.LOWER_GREEK;case"lower-alpha":return Fn.LOWER_ALPHA;case"upper-alpha":return Fn.UPPER_ALPHA;case"arabic-indic":return Fn.ARABIC_INDIC;case"armenian":return Fn.ARMENIAN;case"bengali":return Fn.BENGALI;case"cambodian":return Fn.CAMBODIAN;case"cjk-earthly-branch":return Fn.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return Fn.CJK_HEAVENLY_STEM;case"cjk-ideographic":return Fn.CJK_IDEOGRAPHIC;case"devanagari":return Fn.DEVANAGARI;case"ethiopic-numeric":return Fn.ETHIOPIC_NUMERIC;case"georgian":return Fn.GEORGIAN;case"gujarati":return Fn.GUJARATI;case"gurmukhi":return Fn.GURMUKHI;case"hebrew":return Fn.HEBREW;case"hiragana":return Fn.HIRAGANA;case"hiragana-iroha":return Fn.HIRAGANA_IROHA;case"japanese-formal":return Fn.JAPANESE_FORMAL;case"japanese-informal":return Fn.JAPANESE_INFORMAL;case"kannada":return Fn.KANNADA;case"katakana":return Fn.KATAKANA;case"katakana-iroha":return Fn.KATAKANA_IROHA;case"khmer":return Fn.KHMER;case"korean-hangul-formal":return Fn.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return Fn.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return Fn.KOREAN_HANJA_INFORMAL;case"lao":return Fn.LAO;case"lower-armenian":return Fn.LOWER_ARMENIAN;case"malayalam":return Fn.MALAYALAM;case"mongolian":return Fn.MONGOLIAN;case"myanmar":return Fn.MYANMAR;case"oriya":return Fn.ORIYA;case"persian":return Fn.PERSIAN;case"simp-chinese-formal":return Fn.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return Fn.SIMP_CHINESE_INFORMAL;case"tamil":return Fn.TAMIL;case"telugu":return Fn.TELUGU;case"thai":return Fn.THAI;case"tibetan":return Fn.TIBETAN;case"trad-chinese-formal":return Fn.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return Fn.TRAD_CHINESE_INFORMAL;case"upper-armenian":return Fn.UPPER_ARMENIAN;case"disclosure-open":return Fn.DISCLOSURE_OPEN;case"disclosure-closed":return Fn.DISCLOSURE_CLOSED;case"none":default:return Fn.NONE}}},On=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:ot.TOKEN_VALUE}},Tn=On("top"),Nn=On("right"),_n=On("bottom"),Mn=On("left");!function(e){e[e.VISIBLE=0]="VISIBLE",e[e.HIDDEN=1]="HIDDEN",e[e.SCROLL=2]="SCROLL",e[e.AUTO=3]="AUTO"}(Sn||(Sn={}));var Rn,Dn={name:"overflow",initialValue:"visible",prefix:!1,type:ot.LIST,parse:function(e){return e.filter(Ne).map((function(e){switch(e.value){case"hidden":return Sn.HIDDEN;case"scroll":return Sn.SCROLL;case"auto":return Sn.AUTO;case"visible":default:return Sn.VISIBLE}}))}};!function(e){e.NORMAL="normal",e.BREAK_WORD="break-word"}(Rn||(Rn={}));var Pn,kn={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"break-word":return Rn.BREAK_WORD;case"normal":default:return Rn.NORMAL}}},In=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:ot.TYPE_VALUE,format:"length-percentage"}},Kn=In("top"),Ln=In("right"),zn=In("bottom"),jn=In("left");!function(e){e[e.LEFT=0]="LEFT",e[e.CENTER=1]="CENTER",e[e.RIGHT=2]="RIGHT"}(Pn||(Pn={}));var Xn,Gn={name:"text-align",initialValue:"left",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"right":return Pn.RIGHT;case"center":case"justify":return Pn.CENTER;case"left":default:return Pn.LEFT}}};!function(e){e[e.STATIC=0]="STATIC",e[e.RELATIVE=1]="RELATIVE",e[e.ABSOLUTE=2]="ABSOLUTE",e[e.FIXED=3]="FIXED",e[e.STICKY=4]="STICKY"}(Xn||(Xn={}));var Vn,Yn={name:"position",initialValue:"static",prefix:!1,type:ot.IDENT_VALUE,parse:function(e){switch(e){case"relative":return Xn.RELATIVE;case"absolute":return Xn.ABSOLUTE;case"fixed":return Xn.FIXED;case"sticky":return Xn.STICKY}return Xn.STATIC}},Wn={name:"text-shadow",initialValue:"none",type:ot.LIST,prefix:!1,parse:function(e){return 1===e.length&&Me(e[0],"none")?[]:Pe(e).map((function(e){for(var t={color:lt.TRANSPARENT,offsetX:ze,offsetY:ze,blur:ze},n=0,r=0;r1?1:0],this.overflowWrap=Fr(kn,e.overflowWrap),this.paddingTop=Fr(Kn,e.paddingTop),this.paddingRight=Fr(Ln,e.paddingRight),this.paddingBottom=Fr(zn,e.paddingBottom),this.paddingLeft=Fr(jn,e.paddingLeft),this.position=Fr(Yn,e.position),this.textAlign=Fr(Gn,e.textAlign),this.textDecorationColor=Fr(lr,e.textDecorationColor||e.color),this.textDecorationLine=Fr(ur,e.textDecorationLine),this.textShadow=Fr(Wn,e.textShadow),this.textTransform=Fr(qn,e.textTransform),this.transform=Fr(Zn,e.transform),this.transformOrigin=Fr(nr,e.transformOrigin),this.visibility=Fr(ir,e.visibility),this.wordBreak=Fr(ar,e.wordBreak),this.zIndex=Fr(Ar,e.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===Jn.VISIBLE},e.prototype.isTransparent=function(){return $e(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return this.position!==Xn.STATIC},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return this.float!==an.NONE},e.prototype.isInlineLevel=function(){return vr(this.display,4)||vr(this.display,33554432)||vr(this.display,268435456)||vr(this.display,536870912)||vr(this.display,67108864)||vr(this.display,134217728)},e}(),Qr=function(e){this.content=Fr(Br,e.content),this.quotes=Fr(wr,e.quotes)},xr=function(e){this.counterIncrement=Fr(mr,e.counterIncrement),this.counterReset=Fr(br,e.counterReset)},Fr=function(e,t){var n=new Se,r=null!==t&&"undefined"!==typeof t?t.toString():e.initialValue;n.write(r);var i=new He(n.read());switch(e.type){case ot.IDENT_VALUE:var o=i.parseComponentValue();return e.parse(Ne(o)?o.value:e.initialValue);case ot.VALUE:return e.parse(i.parseComponentValue());case ot.LIST:return e.parse(i.parseComponentValues());case ot.TOKEN_VALUE:return i.parseComponentValue();case ot.TYPE_VALUE:switch(e.format){case"angle":return Ye(i.parseComponentValue());case"color":return Ze(i.parseComponentValue());case"image":return Pt(i.parseComponentValue());case"length":var a=i.parseComponentValue();return Ie(a)?a:ze;case"length-percentage":var A=i.parseComponentValue();return Ke(A)?A:ze}}throw new Error("Attempting to parse unsupported css format type "+e.format)},Ur=function(e){this.styles=new Cr(window.getComputedStyle(e,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&ii(e)&&(e.style.transform="none"),this.bounds=a(e),this.flags=0},Sr=function(e,t){this.text=e,this.bounds=t},Hr=function(e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var r=e.parentNode;if(r){r.replaceChild(n,e);var i=a(n);return n.firstChild&&r.replaceChild(n.firstChild,n),i}}return new o(0,0,0,0)},Or=function(e,t,n){var r=e.ownerDocument;if(!r)throw new Error("Node has no owner document");var i=r.createRange();return i.setStart(e,t),i.setEnd(e,t+n),o.fromClientRect(i.getBoundingClientRect())},Tr=function(e,t){return 0!==t.letterSpacing?A(e).map((function(e){return s(e)})):Nr(e,t)},Nr=function(e,t){for(var n,r=function(e,t){var n=A(e),r=J(n,t),i=r[0],o=r[1],a=r[2],s=n.length,l=0,u=0;return{next:function(){if(u>=s)return{done:!0,value:null};for(var e="\xd7";u0)if(Ct.SUPPORT_RANGE_BOUNDS)i.push(new Sr(e,Or(n,o,e.length)));else{var r=n.splitText(e.length);i.push(new Sr(e,Hr(n))),n=r}else Ct.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));o+=e.length})),i}(this.text,t,e)},Mr=function(e,t){switch(t){case Vn.LOWERCASE:return e.toLowerCase();case Vn.CAPITALIZE:return e.replace(Rr,Dr);case Vn.UPPERCASE:return e.toUpperCase();default:return e}},Rr=/(^|\s|:|-|\(|\))([a-z])/g,Dr=function(e,t,n){return e.length>0?t+n.toUpperCase():e},Pr=function(e){function n(t){var n=e.call(this,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,xt.getInstance().addImage(n.src),n}return t(n,e),n}(Ur),kr=function(e){function n(t){var n=e.call(this,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return t(n,e),n}(Ur),Ir=function(e){function n(t){var n=e.call(this,t)||this,r=new XMLSerializer;return n.svg="data:image/svg+xml,"+encodeURIComponent(r.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,xt.getInstance().addImage(n.svg),n}return t(n,e),n}(Ur),Kr=function(e){function n(t){var n=e.call(this,t)||this;return n.value=t.value,n}return t(n,e),n}(Ur),Lr=function(e){function n(t){var n=e.call(this,t)||this;return n.start=t.start,n.reversed="boolean"===typeof t.reversed&&!0===t.reversed,n}return t(n,e),n}(Ur),zr=[{type:f.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],jr=[{type:f.PERCENTAGE_TOKEN,flags:0,number:50}],Xr="password",Gr=function(e){function n(t){var n,r=e.call(this,t)||this;switch(r.type=t.type.toLowerCase(),r.checked=t.checked,r.value=function(e){var t=e.type===Xr?new Array(e.value.length+1).join("\u2022"):e.value;return 0===t.length?e.placeholder||"":t}(t),"checkbox"!==r.type&&"radio"!==r.type||(r.styles.backgroundColor=3739148031,r.styles.borderTopColor=r.styles.borderRightColor=r.styles.borderBottomColor=r.styles.borderLeftColor=2779096575,r.styles.borderTopWidth=r.styles.borderRightWidth=r.styles.borderBottomWidth=r.styles.borderLeftWidth=1,r.styles.borderTopStyle=r.styles.borderRightStyle=r.styles.borderBottomStyle=r.styles.borderLeftStyle=Gt.SOLID,r.styles.backgroundClip=[at.BORDER_BOX],r.styles.backgroundOrigin=[0],r.bounds=(n=r.bounds).width>n.height?new o(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width0)n.textNodes.push(new _r(i,n.styles));else if(ri(i)){var a=Zr(i);a.styles.isVisible()&&(ei(i,a,r)?a.flags|=4:ti(a.styles)&&(a.flags|=2),-1!==qr.indexOf(i.tagName)&&(a.flags|=8),n.elements.push(a),gi(i)||li(i)||vi(i)||e(i,a,r))}}(e,t,t),t},ei=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||ui(e)&&n.styles.isTransparent()},ti=function(e){return e.isPositioned()||e.isFloating()},ni=function(e){return e.nodeType===Node.TEXT_NODE},ri=function(e){return e.nodeType===Node.ELEMENT_NODE},ii=function(e){return ri(e)&&"undefined"!==typeof e.style&&!oi(e)},oi=function(e){return"object"===typeof e.className},ai=function(e){return"LI"===e.tagName},Ai=function(e){return"OL"===e.tagName},si=function(e){return"INPUT"===e.tagName},li=function(e){return"svg"===e.tagName},ui=function(e){return"BODY"===e.tagName},ci=function(e){return"CANVAS"===e.tagName},fi=function(e){return"IMG"===e.tagName},di=function(e){return"IFRAME"===e.tagName},pi=function(e){return"STYLE"===e.tagName},hi=function(e){return"SCRIPT"===e.tagName},gi=function(e){return"TEXTAREA"===e.tagName},vi=function(e){return"SELECT"===e.tagName},Bi=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){var t=this.counters[e];return t||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,n=e.counterIncrement,r=e.counterReset,i=!0;null!==n&&n.forEach((function(e){var n=t.counters[e.counter];n&&0!==e.increment&&(i=!1,n[Math.max(0,n.length-1)]+=e.increment)}));var o=[];return i&&r.forEach((function(e){var n=t.counters[e.counter];o.push(e.counter),n||(n=t.counters[e.counter]=[]),n.push(e.reset)})),o},e}(),mi={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},bi={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054f","\u054e","\u054d","\u054c","\u054b","\u054a","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053f","\u053e","\u053d","\u053c","\u053b","\u053a","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},wi={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05d9\u05f3","\u05d8\u05f3","\u05d7\u05f3","\u05d6\u05f3","\u05d5\u05f3","\u05d4\u05f3","\u05d3\u05f3","\u05d2\u05f3","\u05d1\u05f3","\u05d0\u05f3","\u05ea","\u05e9","\u05e8","\u05e7","\u05e6","\u05e4","\u05e2","\u05e1","\u05e0","\u05de","\u05dc","\u05db","\u05d9\u05d8","\u05d9\u05d7","\u05d9\u05d6","\u05d8\u05d6","\u05d8\u05d5","\u05d9","\u05d8","\u05d7","\u05d6","\u05d5","\u05d4","\u05d3","\u05d2","\u05d1","\u05d0"]},Ei={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10f5","\u10f0","\u10ef","\u10f4","\u10ee","\u10ed","\u10ec","\u10eb","\u10ea","\u10e9","\u10e8","\u10e7","\u10e6","\u10e5","\u10e4","\u10f3","\u10e2","\u10e1","\u10e0","\u10df","\u10de","\u10dd","\u10f2","\u10dc","\u10db","\u10da","\u10d9","\u10d8","\u10d7","\u10f1","\u10d6","\u10d5","\u10d4","\u10d3","\u10d2","\u10d1","\u10d0"]},yi=function(e,t,n,r,i,o){return en?Ui(e,i,o.length>0):r.integers.reduce((function(t,n,i){for(;e>=n;)e-=n,t+=r.values[i];return t}),"")+o},Ci=function(e,t,n,r){var i="";do{n||e--,i=r(e)+i,e/=t}while(e*t>=t);return i},Qi=function(e,t,n,r,i){var o=n-t+1;return(e<0?"-":"")+(Ci(Math.abs(e),o,r,(function(e){return s(Math.floor(e%o)+t)}))+i)},xi=function(e,t,n){void 0===n&&(n=". ");var r=t.length;return Ci(Math.abs(e),r,!1,(function(e){return t[Math.floor(e%r)]}))+n},Fi=function(e,t,n,r,i,o){if(e<-9999||e>9999)return Ui(e,Fn.CJK_DECIMAL,i.length>0);var a=Math.abs(e),A=i;if(0===a)return t[0]+A;for(var s=0;a>0&&s<=4;s++){var l=a%10;0===l&&vr(o,1)&&""!==A?A=t[l]+A:l>1||1===l&&0===s||1===l&&1===s&&vr(o,2)||1===l&&1===s&&vr(o,4)&&e>100||1===l&&s>1&&vr(o,8)?A=t[l]+(s>0?n[s-1]:"")+A:1===l&&s>0&&(A=n[s-1]+A),a=Math.floor(a/10)}return(e<0?r:"")+A},Ui=function(e,t,n){var r=n?". ":"",i=n?"\u3001":"",o=n?", ":"",a=n?" ":"";switch(t){case Fn.DISC:return"\u2022"+a;case Fn.CIRCLE:return"\u25e6"+a;case Fn.SQUARE:return"\u25fe"+a;case Fn.DECIMAL_LEADING_ZERO:var A=Qi(e,48,57,!0,r);return A.length<4?"0"+A:A;case Fn.CJK_DECIMAL:return xi(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",i);case Fn.LOWER_ROMAN:return yi(e,1,3999,mi,Fn.DECIMAL,r).toLowerCase();case Fn.UPPER_ROMAN:return yi(e,1,3999,mi,Fn.DECIMAL,r);case Fn.LOWER_GREEK:return Qi(e,945,969,!1,r);case Fn.LOWER_ALPHA:return Qi(e,97,122,!1,r);case Fn.UPPER_ALPHA:return Qi(e,65,90,!1,r);case Fn.ARABIC_INDIC:return Qi(e,1632,1641,!0,r);case Fn.ARMENIAN:case Fn.UPPER_ARMENIAN:return yi(e,1,9999,bi,Fn.DECIMAL,r);case Fn.LOWER_ARMENIAN:return yi(e,1,9999,bi,Fn.DECIMAL,r).toLowerCase();case Fn.BENGALI:return Qi(e,2534,2543,!0,r);case Fn.CAMBODIAN:case Fn.KHMER:return Qi(e,6112,6121,!0,r);case Fn.CJK_EARTHLY_BRANCH:return xi(e,"\u5b50\u4e11\u5bc5\u536f\u8fb0\u5df3\u5348\u672a\u7533\u9149\u620c\u4ea5",i);case Fn.CJK_HEAVENLY_STEM:return xi(e,"\u7532\u4e59\u4e19\u4e01\u620a\u5df1\u5e9a\u8f9b\u58ec\u7678",i);case Fn.CJK_IDEOGRAPHIC:case Fn.TRAD_CHINESE_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8ca0",i,14);case Fn.TRAD_CHINESE_FORMAL:return Fi(e,"\u96f6\u58f9\u8cb3\u53c3\u8086\u4f0d\u9678\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8ca0",i,15);case Fn.SIMP_CHINESE_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8d1f",i,14);case Fn.SIMP_CHINESE_FORMAL:return Fi(e,"\u96f6\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8d1f",i,15);case Fn.JAPANESE_INFORMAL:return Fi(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",i,0);case Fn.JAPANESE_FORMAL:return Fi(e,"\u96f6\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",i,7);case Fn.KOREAN_HANGUL_FORMAL:return Fi(e,"\uc601\uc77c\uc774\uc0bc\uc0ac\uc624\uc721\uce60\ud314\uad6c","\uc2ed\ubc31\ucc9c\ub9cc","\ub9c8\uc774\ub108\uc2a4",o,7);case Fn.KOREAN_HANJA_INFORMAL:return Fi(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\ub9c8\uc774\ub108\uc2a4",o,0);case Fn.KOREAN_HANJA_FORMAL:return Fi(e,"\u96f6\u58f9\u8cb3\u53c3\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343","\ub9c8\uc774\ub108\uc2a4",o,7);case Fn.DEVANAGARI:return Qi(e,2406,2415,!0,r);case Fn.GEORGIAN:return yi(e,1,19999,Ei,Fn.DECIMAL,r);case Fn.GUJARATI:return Qi(e,2790,2799,!0,r);case Fn.GURMUKHI:return Qi(e,2662,2671,!0,r);case Fn.HEBREW:return yi(e,1,10999,wi,Fn.DECIMAL,r);case Fn.HIRAGANA:return xi(e,"\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a\u308b\u308c\u308d\u308f\u3090\u3091\u3092\u3093");case Fn.HIRAGANA_IROHA:return xi(e,"\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092\u308f\u304b\u3088\u305f\u308c\u305d\u3064\u306d\u306a\u3089\u3080\u3046\u3090\u306e\u304a\u304f\u3084\u307e\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304d\u3086\u3081\u307f\u3057\u3091\u3072\u3082\u305b\u3059");case Fn.KANNADA:return Qi(e,3302,3311,!0,r);case Fn.KATAKANA:return xi(e,"\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f0\u30f1\u30f2\u30f3",i);case Fn.KATAKANA_IROHA:return xi(e,"\u30a4\u30ed\u30cf\u30cb\u30db\u30d8\u30c8\u30c1\u30ea\u30cc\u30eb\u30f2\u30ef\u30ab\u30e8\u30bf\u30ec\u30bd\u30c4\u30cd\u30ca\u30e9\u30e0\u30a6\u30f0\u30ce\u30aa\u30af\u30e4\u30de\u30b1\u30d5\u30b3\u30a8\u30c6\u30a2\u30b5\u30ad\u30e6\u30e1\u30df\u30b7\u30f1\u30d2\u30e2\u30bb\u30b9",i);case Fn.LAO:return Qi(e,3792,3801,!0,r);case Fn.MONGOLIAN:return Qi(e,6160,6169,!0,r);case Fn.MYANMAR:return Qi(e,4160,4169,!0,r);case Fn.ORIYA:return Qi(e,2918,2927,!0,r);case Fn.PERSIAN:return Qi(e,1776,1785,!0,r);case Fn.TAMIL:return Qi(e,3046,3055,!0,r);case Fn.TELUGU:return Qi(e,3174,3183,!0,r);case Fn.THAI:return Qi(e,3664,3673,!0,r);case Fn.TIBETAN:return Qi(e,3872,3881,!0,r);case Fn.DECIMAL:default:return Qi(e,48,57,!0,r)}},Si=function(){function e(e,t){if(this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Bi,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement)}return e.prototype.toIFrame=function(e,t){var n=this,o=Oi(e,t);if(!o.contentWindow)return Promise.reject("Unable to find iframe window");var a=e.defaultView.pageXOffset,A=e.defaultView.pageYOffset,s=o.contentWindow,l=s.document,u=Ti(o).then((function(){return r(n,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return this.scrolledElements.forEach(Ri),s&&(s.scrollTo(t.left,t.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===t.top&&s.scrollX===t.left||(l.documentElement.style.top=-t.top+"px",l.documentElement.style.left=-t.left+"px",l.documentElement.style.position="absolute")),e=this.options.onclone,"undefined"===typeof this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:l.fonts&&l.fonts.ready?[4,l.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return"function"===typeof e?[2,Promise.resolve().then((function(){return e(l)})).then((function(){return o}))]:[2,o]}}))}))}));return l.open(),l.write(_i(document.doctype)+""),Mi(this.referenceElement.ownerDocument,a,A),l.replaceChild(l.adoptNode(this.documentElement),l.documentElement),l.close(),u},e.prototype.createElementClone=function(e){if(ci(e))return this.createCanvasClone(e);if(pi(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return fi(t)&&"lazy"===t.loading&&(t.loading="eager"),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"===typeof t.cssText?e+t.cssText:e}),""),r=e.cloneNode(!1);return r.textContent=n,r}}catch(i){if(Qt.getInstance(this.options.id).error("Unable to access cssRules property",i),"SecurityError"!==i.name)throw i}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(o){Qt.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var r=e.getContext("2d"),i=n.getContext("2d");return i&&(r?i.putImageData(r.getImageData(0,0,e.width,e.height),0,0):i.drawImage(e,0,0)),n}catch(o){}return n},e.prototype.cloneNode=function(e){if(ni(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(t&&ri(e)&&(ii(e)||oi(e))){var n=this.createElementClone(e),r=t.getComputedStyle(e),i=t.getComputedStyle(e,":before"),o=t.getComputedStyle(e,":after");this.referenceElement===e&&ii(n)&&(this.clonedReferenceElement=n),ui(n)&&ki(n);for(var a=this.counters.parse(new xr(r)),A=this.resolvePseudoContent(e,n,i,hr.BEFORE),s=e.firstChild;s;s=s.nextSibling)ri(s)&&(hi(s)||s.hasAttribute("data-html2canvas-ignore")||"function"===typeof this.options.ignoreElements&&this.options.ignoreElements(s))||this.options.copyStyles&&ri(s)&&pi(s)||n.appendChild(this.cloneNode(s));A&&n.insertBefore(A,n.firstChild);var l=this.resolvePseudoContent(e,n,o,hr.AFTER);return l&&n.appendChild(l),this.counters.pop(a),r&&(this.options.copyStyles||oi(e))&&!di(e)&&Ni(r,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(gi(e)||vi(e))&&(gi(n)||vi(n))&&(n.value=e.value),n}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,n,r){var i=this;if(n){var o=n.content,a=t.ownerDocument;if(a&&o&&"none"!==o&&"-moz-alt-content"!==o&&"none"!==n.display){this.counters.parse(new xr(n));var A=new Qr(n),s=a.createElement("html2canvaspseudoelement");Ni(n,s),A.content.forEach((function(t){if(t.type===f.STRING_TOKEN)s.appendChild(a.createTextNode(t.value));else if(t.type===f.URL_TOKEN){var n=a.createElement("img");n.src=t.value,n.style.opacity="1",s.appendChild(n)}else if(t.type===f.FUNCTION){if("attr"===t.name){var r=t.values.filter(Ne);r.length&&s.appendChild(a.createTextNode(e.getAttribute(r[0].value)||""))}else if("counter"===t.name){var o=t.values.filter(De),l=o[0],u=o[1];if(l&&Ne(l)){var c=i.counters.getCounterValue(l.value),d=u&&Ne(u)?Hn.parse(u.value):Fn.DECIMAL;s.appendChild(a.createTextNode(Ui(c,d,!1)))}}else if("counters"===t.name){var p=t.values.filter(De),h=(l=p[0],p[1]);if(u=p[2],l&&Ne(l)){var g=i.counters.getCounterValues(l.value),v=u&&Ne(u)?Hn.parse(u.value):Fn.DECIMAL,B=h&&h.type===f.STRING_TOKEN?h.value:"",m=g.map((function(e){return Ui(e,v,!1)})).join(B);s.appendChild(a.createTextNode(m))}}}else if(t.type===f.IDENT_TOKEN)switch(t.value){case"open-quote":s.appendChild(a.createTextNode(Er(A.quotes,i.quoteDepth++,!0)));break;case"close-quote":s.appendChild(a.createTextNode(Er(A.quotes,--i.quoteDepth,!1)));break;default:s.appendChild(a.createTextNode(t.value))}})),s.className=Di+" "+Pi;var l=r===hr.BEFORE?" "+Di:" "+Pi;return oi(t)?t.className.baseValue+=l:t.className+=l,s}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(hr||(hr={}));var Hi,Oi=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute("data-html2canvas-ignore","true"),e.body.appendChild(n),n},Ti=function(e){return new Promise((function(t,n){var r=e.contentWindow;if(!r)return n("No window assigned for iframe");var i=r.document;r.onload=e.onload=i.onreadystatechange=function(){r.onload=e.onload=i.onreadystatechange=null;var n=setInterval((function(){i.body.childNodes.length>0&&"complete"===i.readyState&&(clearInterval(n),t(e))}),50)}}))},Ni=function(e,t){for(var n=e.length-1;n>=0;n--){var r=e.item(n);"content"!==r&&t.style.setProperty(r,e.getPropertyValue(r))}return t},_i=function(e){var t="";return e&&(t+=""),t},Mi=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},Ri=function(e){var t=e[0],n=e[1],r=e[2];t.scrollLeft=n,t.scrollTop=r},Di="___html2canvas___pseudoelement_before",Pi="___html2canvas___pseudoelement_after",ki=function(e){Ii(e,"."+Di+':before{\n content: "" !important;\n display: none !important;\n}\n .'+Pi+':after{\n content: "" !important;\n display: none !important;\n}')},Ii=function(e,t){var n=e.ownerDocument;if(n){var r=n.createElement("style");r.textContent=t,e.appendChild(r)}};!function(e){e[e.VECTOR=0]="VECTOR",e[e.BEZIER_CURVE=1]="BEZIER_CURVE"}(Hi||(Hi={}));var Ki,Li=function(e,t){return e.length===t.length&&e.some((function(e,n){return e===t[n]}))},zi=function(){function e(e,t){this.type=Hi.VECTOR,this.x=e,this.y=t}return e.prototype.add=function(t,n){return new e(this.x+t,this.y+n)},e}(),ji=function(e,t,n){return new zi(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)},Xi=function(){function e(e,t,n,r){this.type=Hi.BEZIER_CURVE,this.start=e,this.startControl=t,this.endControl=n,this.end=r}return e.prototype.subdivide=function(t,n){var r=ji(this.start,this.startControl,t),i=ji(this.startControl,this.endControl,t),o=ji(this.endControl,this.end,t),a=ji(r,i,t),A=ji(i,o,t),s=ji(a,A,t);return n?new e(this.start,r,a,s):new e(s,A,o,this.end)},e.prototype.add=function(t,n){return new e(this.start.add(t,n),this.startControl.add(t,n),this.endControl.add(t,n),this.end.add(t,n))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Gi=function(e){return e.type===Hi.BEZIER_CURVE},Vi=function(e){var t=e.styles,n=e.bounds,r=Ge(t.borderTopLeftRadius,n.width,n.height),i=r[0],o=r[1],a=Ge(t.borderTopRightRadius,n.width,n.height),A=a[0],s=a[1],l=Ge(t.borderBottomRightRadius,n.width,n.height),u=l[0],c=l[1],f=Ge(t.borderBottomLeftRadius,n.width,n.height),d=f[0],p=f[1],h=[];h.push((i+A)/n.width),h.push((d+u)/n.width),h.push((o+p)/n.height),h.push((s+c)/n.height);var g=Math.max.apply(Math,h);g>1&&(i/=g,o/=g,A/=g,s/=g,u/=g,c/=g,d/=g,p/=g);var v=n.width-A,B=n.height-c,m=n.width-u,b=n.height-p,w=t.borderTopWidth,E=t.borderRightWidth,y=t.borderBottomWidth,C=t.borderLeftWidth,Q=Ve(t.paddingTop,e.bounds.width),x=Ve(t.paddingRight,e.bounds.width),F=Ve(t.paddingBottom,e.bounds.width),U=Ve(t.paddingLeft,e.bounds.width);this.topLeftBorderBox=i>0||o>0?Yi(n.left,n.top,i,o,Ki.TOP_LEFT):new zi(n.left,n.top),this.topRightBorderBox=A>0||s>0?Yi(n.left+v,n.top,A,s,Ki.TOP_RIGHT):new zi(n.left+n.width,n.top),this.bottomRightBorderBox=u>0||c>0?Yi(n.left+m,n.top+B,u,c,Ki.BOTTOM_RIGHT):new zi(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=d>0||p>0?Yi(n.left,n.top+b,d,p,Ki.BOTTOM_LEFT):new zi(n.left,n.top+n.height),this.topLeftPaddingBox=i>0||o>0?Yi(n.left+C,n.top+w,Math.max(0,i-C),Math.max(0,o-w),Ki.TOP_LEFT):new zi(n.left+C,n.top+w),this.topRightPaddingBox=A>0||s>0?Yi(n.left+Math.min(v,n.width+C),n.top+w,v>n.width+C?0:A-C,s-w,Ki.TOP_RIGHT):new zi(n.left+n.width-E,n.top+w),this.bottomRightPaddingBox=u>0||c>0?Yi(n.left+Math.min(m,n.width-C),n.top+Math.min(B,n.height+w),Math.max(0,u-E),c-y,Ki.BOTTOM_RIGHT):new zi(n.left+n.width-E,n.top+n.height-y),this.bottomLeftPaddingBox=d>0||p>0?Yi(n.left+C,n.top+b,Math.max(0,d-C),p-y,Ki.BOTTOM_LEFT):new zi(n.left+C,n.top+n.height-y),this.topLeftContentBox=i>0||o>0?Yi(n.left+C+U,n.top+w+Q,Math.max(0,i-(C+U)),Math.max(0,o-(w+Q)),Ki.TOP_LEFT):new zi(n.left+C+U,n.top+w+Q),this.topRightContentBox=A>0||s>0?Yi(n.left+Math.min(v,n.width+C+U),n.top+w+Q,v>n.width+C+U?0:A-C+U,s-(w+Q),Ki.TOP_RIGHT):new zi(n.left+n.width-(E+x),n.top+w+Q),this.bottomRightContentBox=u>0||c>0?Yi(n.left+Math.min(m,n.width-(C+U)),n.top+Math.min(B,n.height+w+Q),Math.max(0,u-(E+x)),c-(y+F),Ki.BOTTOM_RIGHT):new zi(n.left+n.width-(E+x),n.top+n.height-(y+F)),this.bottomLeftContentBox=d>0||p>0?Yi(n.left+C+U,n.top+b,Math.max(0,d-(C+U)),p-(y+F),Ki.BOTTOM_LEFT):new zi(n.left+C+U,n.top+n.height-(y+F))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(Ki||(Ki={}));var Yi=function(e,t,n,r,i){var o=(Math.sqrt(2)-1)/3*4,a=n*o,A=r*o,s=e+n,l=t+r;switch(i){case Ki.TOP_LEFT:return new Xi(new zi(e,l),new zi(e,l-A),new zi(s-a,t),new zi(s,t));case Ki.TOP_RIGHT:return new Xi(new zi(e,t),new zi(e+a,t),new zi(s,l-A),new zi(s,l));case Ki.BOTTOM_RIGHT:return new Xi(new zi(s,t),new zi(s,t+A),new zi(e+a,l),new zi(e,l));case Ki.BOTTOM_LEFT:default:return new Xi(new zi(s,l),new zi(s-a,l),new zi(e,t+A),new zi(e,t))}},Wi=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Ji=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},qi=function(e,t,n){this.type=0,this.offsetX=e,this.offsetY=t,this.matrix=n,this.target=6},Zi=function(e,t){this.type=1,this.target=t,this.path=e},$i=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},eo=function(){function e(e,t){if(this.container=e,this.effects=t.slice(0),this.curves=new Vi(e),null!==e.styles.transform){var n=e.bounds.left+e.styles.transformOrigin[0].number,r=e.bounds.top+e.styles.transformOrigin[1].number,i=e.styles.transform;this.effects.push(new qi(n,r,i))}if(e.styles.overflowX!==Sn.VISIBLE){var o=Wi(this.curves),a=Ji(this.curves);Li(o,a)?this.effects.push(new Zi(o,6)):(this.effects.push(new Zi(o,2)),this.effects.push(new Zi(a,4)))}}return e.prototype.getParentEffects=function(){var e=this.effects.slice(0);if(this.container.styles.overflowX!==Sn.VISIBLE){var t=Wi(this.curves),n=Ji(this.curves);Li(t,n)||e.push(new Zi(n,6))}return e},e}(),to=function(e,t){for(var n=e instanceof Lr?e.start:1,r=e instanceof Lr&&e.reversed,i=0;ie.element.container.styles.zIndex.order?(d=t,!1):d>0})),u.negativeZIndex.splice(d,0,c)}else if(f>0){var p=0;u.positiveZIndex.some((function(e,t){return f>=e.element.container.styles.zIndex.order?(p=t+1,!1):p>0})),u.positiveZIndex.splice(p,0,c)}else u.zeroOrAutoZIndexOrTransformedOrOpacity.push(c)}else o.styles.isFloating()?u.nonPositionedFloats.push(c):u.nonPositionedInlineLevel.push(c);e(s,c,a?c:r,l)}else o.styles.isInlineLevel()?n.inlineLevel.push(s):n.nonInlineLevel.push(s),e(s,n,r,l);vr(o.flags,8)&&to(o,l)}))}(t,n,n,r),to(t.container,r),n},ro=function(e,t,n,r){var i=[];return Gi(e)?i.push(e.subdivide(.5,!1)):i.push(e),Gi(n)?i.push(n.subdivide(.5,!0)):i.push(n),Gi(r)?i.push(r.subdivide(.5,!0).reverse()):i.push(r),Gi(t)?i.push(t.subdivide(.5,!1).reverse()):i.push(t),i},io=function(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))},oo=function(e){var t=e.styles,n=e.bounds,r=Ve(t.paddingLeft,n.width),i=Ve(t.paddingRight,n.width),o=Ve(t.paddingTop,n.width),a=Ve(t.paddingBottom,n.width);return n.add(r+t.borderLeftWidth,o+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+r+i),-(t.borderTopWidth+t.borderBottomWidth+o+a))},ao=function(e,t,n){var r=function(e,t){return 0===e?t.bounds:2===e?oo(t):io(t)}(uo(e.styles.backgroundOrigin,t),e),i=function(e,t){return e===at.BORDER_BOX?t.bounds:e===at.CONTENT_BOX?oo(t):io(t)}(uo(e.styles.backgroundClip,t),e),o=lo(uo(e.styles.backgroundSize,t),n,r),a=o[0],A=o[1],s=Ge(uo(e.styles.backgroundPosition,t),r.width-a,r.height-A);return[co(uo(e.styles.backgroundRepeat,t),s,o,r,i),Math.round(r.left+s[0]),Math.round(r.top+s[1]),a,A]},Ao=function(e){return Ne(e)&&e.value===zt.AUTO},so=function(e){return"number"===typeof e},lo=function(e,t,n){var r=t[0],i=t[1],o=t[2],a=e[0],A=e[1];if(Ke(a)&&A&&Ke(A))return[Ve(a,n.width),Ve(A,n.height)];var s=so(o);if(Ne(a)&&(a.value===zt.CONTAIN||a.value===zt.COVER))return so(o)?n.width/n.height0&&e.intrinsicHeight>0){var r=oo(e),i=Ji(t);this.path(i),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,r.left,r.top,r.width,r.height),this.ctx.restore()}},e.prototype.renderNodeContent=function(t){return r(this,void 0,void 0,(function(){var n,r,a,A,s,l,u,c,d,p,h,g,v,B;return i(this,(function(i){switch(i.label){case 0:this.applyEffects(t.effects,4),n=t.container,r=t.curves,a=n.styles,A=0,s=n.textNodes,i.label=1;case 1:return A0&&C>0&&(B=r.ctx.createPattern(h,"repeat"),r.renderRepeat(b,B,x,F))):function(e){return e.type===ut.RADIAL_GRADIENT}(n)&&(m=ao(e,t,[null,null,null]),b=m[0],w=m[1],E=m[2],y=m[3],C=m[4],Q=0===n.position.length?[je]:n.position,x=Ve(Q[0],y),F=Ve(Q[Q.length-1],C),U=function(e,t,n,r,i){var o=0,a=0;switch(e.size){case ft.CLOSEST_SIDE:e.shape===ct.CIRCLE?o=a=Math.min(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===ct.ELLIPSE&&(o=Math.min(Math.abs(t),Math.abs(t-r)),a=Math.min(Math.abs(n),Math.abs(n-i)));break;case ft.CLOSEST_CORNER:if(e.shape===ct.CIRCLE)o=a=Math.min(Bt(t,n),Bt(t,n-i),Bt(t-r,n),Bt(t-r,n-i));else if(e.shape===ct.ELLIPSE){var A=Math.min(Math.abs(n),Math.abs(n-i))/Math.min(Math.abs(t),Math.abs(t-r)),s=mt(r,i,t,n,!0),l=s[0],u=s[1];a=A*(o=Bt(l-t,(u-n)/A))}break;case ft.FARTHEST_SIDE:e.shape===ct.CIRCLE?o=a=Math.max(Math.abs(t),Math.abs(t-r),Math.abs(n),Math.abs(n-i)):e.shape===ct.ELLIPSE&&(o=Math.max(Math.abs(t),Math.abs(t-r)),a=Math.max(Math.abs(n),Math.abs(n-i)));break;case ft.FARTHEST_CORNER:if(e.shape===ct.CIRCLE)o=a=Math.max(Bt(t,n),Bt(t,n-i),Bt(t-r,n),Bt(t-r,n-i));else if(e.shape===ct.ELLIPSE){A=Math.max(Math.abs(n),Math.abs(n-i))/Math.max(Math.abs(t),Math.abs(t-r));var c=mt(r,i,t,n,!1);l=c[0],u=c[1],a=A*(o=Bt(l-t,(u-n)/A))}}return Array.isArray(e.size)&&(o=Ve(e.size[0],r),a=2===e.size.length?Ve(e.size[1],i):o),[o,a]}(n,x,F,y,C),S=U[0],H=U[1],S>0&&S>0&&(O=r.ctx.createRadialGradient(w+x,E+F,0,w+x,E+F,S),gt(n.stops,2*S).forEach((function(e){return O.addColorStop(e.stop,et(e.color))})),r.path(b),r.ctx.fillStyle=O,S!==H?(T=e.bounds.left+.5*e.bounds.width,N=e.bounds.top+.5*e.bounds.height,M=1/(_=H/S),r.ctx.save(),r.ctx.translate(T,N),r.ctx.transform(1,0,0,_,0,0),r.ctx.translate(-T,-N),r.ctx.fillRect(w,M*(E-N)+N,y,C*M),r.ctx.restore()):r.ctx.fill())),i.label=6;case 6:return t--,[2]}}))},r=this,o=0,a=e.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return o-1&&r.splice(o,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var n=this;return t&&this._addEvent(e,t,{once:!0}),new Promise((function(t){n._addEvent(e,t,{once:!0})}))},t.emit=function(e,t){var n=this;void 0===t&&(t={});var r=this._events[e];if(!e||!r)return!0;var i=!1;return t.eventType=e,t.stop=function(){i=!0},t.currentTarget=this,function(){for(var e=0,t=0,n=arguments.length;t=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function u(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||p===v)return!1;if(p&&b&&p.isContentEditable&&p.contains(v))return!1}else if((l||"touchstart"===e.type)&&p){var w=p.tagName;(p.isContentEditable||g.indexOf(w)>-1)&&p.blur()}if(r.clientStores=[new h(u(e))],r.flag=!0,r.isDrag=!1,r.datas={},A&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=Object(i.J)()-r.prevTime<200,!1===r.emit("dragStart",s({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()))&&r.initDrag(),r.flag&&l&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(d&&f&&a&&(E=setTimeout((function(){Object(i.p)(o,"touchstart",r.onDragStart,{passive:!1})}))),!d&&f&&a&&Object(i.L)(o,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),d&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=u(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",s({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,o=t.container;r.isTouch&&n&&Object(i.L)(o,"touchstart",r.onDragStart),r.flag=!1;var a=r.getCurrentStore().getPosition(),A=Object(i.J)(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:A,r.emit("dragEnd",s({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},a)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var o=[].concat(t);r.options=s({checkInput:!1,container:o.length>1?window:o[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,A=a.container,l=a.events,c=a.checkWindowBlur;if(r.isTouch=l.indexOf("touch")>-1,r.isMouse=l.indexOf("mouse")>-1,r.targets=o,r.isMouse&&(o.forEach((function(e){Object(i.p)(e,"mousedown",r.onDragStart)})),Object(i.p)(A,"mousemove",r.onDrag),Object(i.p)(A,"mouseup",r.onDragEnd),Object(i.p)(A,"contextmenu",r.onDragEnd)),c&&Object(i.p)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};o.forEach((function(e){Object(i.p)(e,"touchstart",r.onDragStart,f)})),Object(i.p)(A,"touchmove",r.onDrag,f),Object(i.p)(A,"touchend",r.onDragEnd,f),Object(i.p)(A,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(i.L)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(i.L)(t,"mousedown",e.onDragStart)})),Object(i.L)(n,"mousemove",this.onDrag),Object(i.L)(n,"mouseup",this.onDragEnd),Object(i.L)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(i.L)(t,"touchstart",e.onDragStart)})),Object(i.L)(n,"touchstart",this.onDragStart),Object(i.L)(n,"touchmove",this.onDrag),Object(i.L)(n,"touchend",this.onDragEnd),Object(i.L)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new h(u(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",s({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",s({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",s({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,s({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(a),B=n(7),m=n(31),b=n(57),w=n(24),E=n(16),y=n(29),C=function(e,t){return(C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Q(e,t){function n(){this.constructor=e}C(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return(x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0){var f=Math.sqrt((a*a+s*s)/(1+t*t));a=(a>=0?1:-1)*(t*f),s=(s>=0?1:-1)*f}var d=Math.abs(a),p=Math.abs(s),h=a<0?u-n.left:n.right-u,g=s<0?c-n.top:n.bottom-c;a=(a>=0?1:-1)*(d=(r=Object(i.s)([d,p],[0,0],[h,g],!!t))[0]),s=(s>=0?1:-1)*(p=r[1]);var v=u+Math.min(0,a),B=c+Math.min(0,s);return{left:v,top:B,right:v+d,bottom:B+p,width:d,height:p}}function H(e){var t=e.getBoundingClientRect(),n=t.left,r=t.top,i=t.width,o=t.height;return{pos1:[n,r],pos2:[n+i,r],pos3:[n,r+o],pos4:[n+i,r+o]}}function O(e,t){var n=Object(m.b)(e,t),r=n.list,i=n.prevList,o=n.added,a=n.removed;return o.map((function(e){return r[e]})).concat(a.map((function(e){return i[e]})))}var T=Object(y.a)("\n:host {\n position: fixed;\n display: none;\n border: 1px solid #4af;\n background: rgba(68, 170, 255, 0.5);\n z-index: 100;\n}\n"),N="selecto-selection "+T.className,_=["boundContainer","selectableTargets","selectByClick","selectFromInside","continueSelect","toggleContinueSelect","keyContainer","hitRate","scrollOptions","checkInput","preventDefault","ratio","getElementRect","preventDragFromInside"],M=function(){for(var e=0,t=0,n=arguments.length;t-1);)m=m.parentElement;B=m?[m]:[]}var b=B.length>0,w=!u&&b;if(w&&!c)return e.stop(),!1;var E=A.type,y="mousedown"===E||"touchstart"===E;if(!(!(!e.isClick&&y)||n.trigger("dragStart",x({},e))))return e.stop(),!1;if(l?(B=O(n.selectedTargets,B),r.startPassedTargets=n.selectedTargets):r.startPassedTargets=[],n.select(n.selectedTargets,B,v,A,!0),r.startX=o,r.startY=a,r.selectFlag=!1,r.preventDragFromInside=!1,r.boundsArea=n.target.style.cssText+="left:0px;top:0px;transform: translate("+o+"px, "+a+"px)",w&&c)A.preventDefault(),p&&(n.selectEnd(r.startSelectedTargets,r.startPassedTargets,v,e),r.preventDragFromInside=!0);else{r.selectFlag=!0,"touchstart"===E&&A.preventDefault();var C=n.options.scrollOptions;C&&C.container&&n.dragScroll.dragStart(e,C)}return!0},n.onDrag=function(e){if(e.datas.selectFlag){var t=n.options.scrollOptions;if(t&&t.container&&n.dragScroll.drag(e,t))return}n.check(e)},n.onDragEnd=function(e){var t=e.datas,r=e.inputEvent,i=S(e,n.options.ratio),o=t.selectFlag;r&&!e.isClick&&n.trigger("dragEnd",x(x({isDouble:!!e.isDouble,isDrag:!1,isSelect:o},e),{rect:i})),n.target.style.cssText+="display: none;",o&&(t.selectFlag=!1,n.dragScroll.dragEnd()),t.preventDragFromInside||n.selectEnd(t.startSelectedTargets,t.startPassedTargets,i,e)},n.onKeyDown=function(e){n.sameCombiKey(e)&&(n.continueSelect=!0,n.trigger("keydown",{}))},n.onKeyUp=function(e){n.sameCombiKey(e,!0)&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onBlur=function(){n.toggleContinueSelect&&n.continueSelect&&(n.continueSelect=!1,n.trigger("keyup",{}))},n.onDocumentSelectStart=function(e){if(n.gesto.isFlag()){var t=n.dragContainer;t===window&&(t=document.documentElement);var r=t instanceof Element?[t]:[].slice.call(t),i=e.target;r.some((function(t){if(t===i||t.contains(i))return e.preventDefault(),!0}))}},n.target=t.target,n.container=t.container||document.body,n.options=x({target:null,container:null,dragContainer:null,selectableTargets:[],selectByClick:!0,selectFromInside:!0,hitRate:100,continueSelect:!1,toggleContinueSelect:null,keyContainer:null,scrollOptions:void 0,checkInput:!1,preventDefault:!1,boundContainer:!1,preventDragFromInside:!0,getElementRect:H,cspNonce:"",ratio:0},t),n.initElement(),n.initDragScroll(),n.setKeyController(),n}Q(t,e);var n=t.prototype;return n.setSelectedTargets=function(e){return this.selectedTargets=e,this},n.getSelectedTargets=function(){return this.selectedTargets},n.setKeyContainer=function(e){var t=this,n=this.options;U(n.keyContainer,e,(function(){n.keyContainer=e,t.setKeyController()}))},n.setToggleContinueSelect=function(e){var t=this,n=this.options;U(n.toggleContinueSelect,e,(function(){n.toggleContinueSelect=e,t.setKeyEvent()}))},n.setPreventDefault=function(e){this.gesto.options.preventDefault=e},n.setCheckInput=function(e){this.gesto.options.checkInput=e},n.triggerDragStart=function(e){return this.gesto.triggerDragStart(e),this},n.destroy=function(){this.off(),this.keycon&&this.keycon.destroy(),this.gesto.unset(),this.injectResult.destroy(),Object(i.L)(document,"selectstart",this.onDocumentSelectStart),this.keycon=null,this.gesto=null,this.injectResult=null,this.target=null,this.container=null,this.options=null},n.getElementPoints=function(e){var t=this.getElementRect,n=t(e),r=[n.pos1,n.pos2,n.pos4,n.pos3];if(t!==H){var i=e.getBoundingClientRect();return Object(E.a)(r,i)}return r},n.findSelectableTargets=function(e){var t=this;void 0===e&&(e=this.gesto.getEventDatas());var n=this.getSelectableTargets(),r=n.map((function(e){return t.getElementPoints(e)}));e.selectableTargets=n,e.selectablePoints=r},n.clickTarget=function(e,t){var n=function(e){if("touches"in e){var t=e.touches[0]||e.changedTouches[0];return{clientX:t.clientX,clientY:t.clientY}}return{clientX:e.clientX,clientY:e.clientY}}(e),r={datas:{selectFlag:!1},clientX:n.clientX,clientY:n.clientY,inputEvent:e,isClick:!0,stop:function(){return!1}};return this.onDragStart(r,t)&&this.onDragEnd(r),this},n.setKeyController=function(){var e=this.options,t=e.keyContainer,n=e.toggleContinueSelect;this.keycon&&(this.keycon.destroy(),this.keycon=null),n&&(this.keycon=new w.a(t||window),this.keycon.keydown(this.onKeyDown).keyup(this.onKeyUp).on("blur",this.onBlur))},n.setKeyEvent=function(){this.options.toggleContinueSelect&&!this.keycon&&this.setKeyController()},n.initElement=function(){this.target=function e(t,n,r){var o=t.tag,a=t.children,A=t.attributes,s=t.className,l=t.style,u=n||document.createElement(o);for(var c in A)u.setAttribute(c,A[c]);var f=u.children;if(a.forEach((function(t,n){e(t,f[n],u)})),s&&s.split(" ").forEach((function(e){Object(i.C)(u,e)||Object(i.o)(u,e)})),l){var d=u.style;for(var c in l)d[c]=l[c]}return!n&&r&&r.appendChild(u),u}(function(e,t){for(var n=[],r=2;r=Math.min(100,A)}))},n.initDragScroll=function(){var e=this;this.dragScroll.on("scroll",(function(t){var n=t.container,r=t.direction;e.trigger("scroll",{container:n,direction:r})})).on("move",(function(t){var n=t.offsetX,r=t.offsetY,i=t.inputEvent,o=i.datas;o.startX-=n,o.startY-=r,o.selectablePoints.forEach((function(e){e.forEach((function(e){e[0]-=n,e[1]-=r}))})),e.gesto.scrollBy(n,r,i.inputEvent,!1),i.distX+=n,i.distY+=r,e.check(i)}))},n.getSelectableTargets=function(){var e=[];return this.options.selectableTargets.forEach((function(t){Object(i.G)(t)?e.push(t):[].slice.call(document.querySelectorAll(t)).forEach((function(t){e.push(t)}))})),e},n.select=function(e,t,n,r,i){var o=Object(m.b)(e,t),a=o.added,A=o.removed,s=o.prevList,l=o.list;this.selectedTargets=t,i&&this.trigger("selectStart",{selected:t,added:a.map((function(e){return l[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r}),(a.length||A.length)&&this.trigger("select",{selected:t,added:a.map((function(e){return l[e]})),removed:A.map((function(e){return s[e]})),rect:n,inputEvent:r})},n.selectEnd=function(e,t,n,r){var i=r.inputEvent,o=r.isDouble,a=Object(m.b)(e,this.selectedTargets),A=a.added,s=a.removed,l=a.prevList,u=a.list,c=Object(m.b)(t,this.selectedTargets),f=c.added,d=c.removed,p=c.prevList,h=c.list,g=i&&i.type,v="mousedown"===g||"touchstart"===g;this.trigger("selectEnd",{selected:this.selectedTargets,added:A.map((function(e){return u[e]})),removed:s.map((function(e){return l[e]})),afterAdded:f.map((function(e){return h[e]})),afterRemoved:d.map((function(e){return p[e]})),isDragStart:v,isDouble:!!o,rect:n,inputEvent:i})},n.check=function(e,t){void 0===t&&(t=S(e,this.options.ratio));var n=e.datas,r=e.inputEvent,i=t.top,o=t.left,a=t.width,A=t.height,s=n.selectFlag,l=[],u=[];if(s){this.target.style.cssText+="display: block;left:0px;top:0px;transform: translate("+o+"px, "+i+"px);width:"+a+"px;height:"+A+"px;";var c=this.hitTest(t,n.startX,n.startY,n.selectableTargets,n.selectablePoints);l=this.selectedTargets,u=O(n.startPassedTargets,c),this.selectedTargets=u}this.trigger("drag",x(x({},e),{isSelect:s,rect:t})),s&&this.select(l,u,t,r)},n.sameCombiKey=function(e,t){var n=[].concat(this.options.toggleContinueSelect),r=Object(w.b)(e.inputEvent,e.key),o=Object(i.D)(n[0])?n:[n];if(t){var a=e.key;return o.some((function(e){return e.some((function(e){return e===a}))}))}return o.some((function(e){return e.every((function(e){return r.indexOf(e)>-1}))}))},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([Object(B.a)(_,(function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=Object(i.t)("set "+t);e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)}))],t)}(a)),k=function(e,t){return(k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var I=function(){return(I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(B.f)(D)],t.prototype,"selecto",void 0),t}(r.PureComponent);t.a=L},function(e,t,n){"use strict";var r=n(0),i=n(15),o=n(1),a=function(e,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var A=function(){return(A=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0?i:i+2*Math.PI}([e[0].clientX,e[0].clientY],[e[1].clientX,e[1].clientY])/Math.PI*180}function l(e){return e.touches?function(e){for(var t=Math.min(e.length,2),n=[],r=0;r-1,b=v.isContentEditable;if(m||b){if(c||g===v)return!1;if(g&&b&&g.isContentEditable&&g.contains(v))return!1}else if((u||"touchstart"===e.type)&&g){var w=g.tagName;(g.isContentEditable||h.indexOf(w)>-1)&&g.blur()}if(r.clientStores=[new p(l(e))],r.flag=!0,r.isDrag=!1,r.datas={},s&&(3===e.which||2===e.button))return r.initDrag(),!1;r.doubleFlag=Object(o.J)()-r.prevTime<200,!1===r.emit("dragStart",A({datas:r.datas,inputEvent:e,isTrusted:t,isDouble:r.doubleFlag},r.getCurrentStore().getPosition()))&&r.initDrag(),r.flag&&u&&e.preventDefault()}if(!r.flag)return!1;var E=0;if(d&&f&&a&&(E=setTimeout((function(){Object(o.p)(i,"touchstart",r.onDragStart,{passive:!1})}))),!d&&f&&a&&Object(o.L)(i,"touchstart",r.onDragStart),r.flag&&function(e){return e.touches&&e.touches.length>=2}(e)){if(clearTimeout(E),d&&e.touches.length!==e.changedTouches.length)return;r.pinchFlag||r.onPinchStart(e)}}},r.onDrag=function(e,t){if(r.flag){var n=l(e),i=r.moveClients(n,e,!1);(r.pinchFlag||i.deltaX||i.deltaY)&&r.emit("drag",A({},i,{isScroll:!!t,inputEvent:e})),r.pinchFlag&&r.onPinch(e,n),r.getCurrentStore().addClients(n)}},r.onDragEnd=function(e){if(r.flag){var t=r.options,n=t.pinchOutside,i=t.container;r.isTouch&&n&&Object(o.L)(i,"touchstart",r.onDragStart),r.flag=!1;var a=r.getCurrentStore().getPosition(),s=Object(o.J)(),l=!r.isDrag&&r.doubleFlag;r.prevTime=r.isDrag||l?0:s,r.emit("dragEnd",A({datas:r.datas,isDouble:l,isDrag:r.isDrag,inputEvent:e},a)),r.pinchFlag&&r.onPinchEnd(e),r.clientStores=[]}},r.onBlur=function(){r.onDragEnd()};var i=[].concat(t);r.options=A({checkInput:!1,container:i.length>1?window:i[0],preventRightClick:!0,preventDefault:!0,checkWindowBlur:!1,pinchThreshold:0,events:["touch","mouse"]},n);var a=r.options,s=a.container,u=a.events,c=a.checkWindowBlur;if(r.isTouch=u.indexOf("touch")>-1,r.isMouse=u.indexOf("mouse")>-1,r.targets=i,r.isMouse&&(i.forEach((function(e){Object(o.p)(e,"mousedown",r.onDragStart)})),Object(o.p)(s,"mousemove",r.onDrag),Object(o.p)(s,"mouseup",r.onDragEnd),Object(o.p)(s,"contextmenu",r.onDragEnd)),c&&Object(o.p)(window,"blur",r.onBlur),r.isTouch){var f={passive:!1};i.forEach((function(e){Object(o.p)(e,"touchstart",r.onDragStart,f)})),Object(o.p)(s,"touchmove",r.onDrag,f),Object(o.p)(s,"touchend",r.onDragEnd,f),Object(o.p)(s,"touchcancel",r.onDragEnd,f)}return r}!function(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e);var n=t.prototype;return n.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce((function(e,t){return e+t.movement}),0)},n.isDragging=function(){return this.isDrag},n.isFlag=function(){return this.flag},n.isPinchFlag=function(){return this.pinchFlag},n.isDoubleFlag=function(){return this.doubleFlag},n.isPinching=function(){return this.isPinch},n.scrollBy=function(e,t,n,r){void 0===r&&(r=!0),this.flag&&(this.clientStores[0].move(e,t),r&&this.onDrag(n,!0))},n.move=function(e,t){var n=e[0],r=e[1],i=this.getCurrentStore().prevClients;return this.moveClients(i.map((function(e){var t=e.clientX,i=e.clientY;return{clientX:t+n,clientY:i+r,originalClientX:t,originalClientY:i}})),t,!0)},n.triggerDragStart=function(e){this.onDragStart(e,!1)},n.setEventDatas=function(e){var t=this.datas;for(var n in e)t[n]=e[n];return this},n.getEventDatas=function(){return this.datas},n.unset=function(){var e=this,t=this.targets,n=this.options.container;this.off(),Object(o.L)(window,"blur",this.onBlur),this.isMouse&&(t.forEach((function(t){Object(o.L)(t,"mousedown",e.onDragStart)})),Object(o.L)(n,"mousemove",this.onDrag),Object(o.L)(n,"mouseup",this.onDragEnd),Object(o.L)(n,"contextmenu",this.onDragEnd)),this.isTouch&&(t.forEach((function(t){Object(o.L)(t,"touchstart",e.onDragStart)})),Object(o.L)(n,"touchstart",this.onDragStart),Object(o.L)(n,"touchmove",this.onDrag),Object(o.L)(n,"touchend",this.onDragEnd),Object(o.L)(n,"touchcancel",this.onDragEnd))},n.onPinchStart=function(e){var t=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>t)){var n=new p(l(e));this.pinchFlag=!0,this.clientStores.splice(0,0,n),!1===this.emit("pinchStart",A({datas:this.datas,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition(),{inputEvent:e}))&&(this.pinchFlag=!1)}},n.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var n=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",A({datas:this.datas,movement:this.getMovement(t),angle:n.getAngle(t),rotation:n.getRotation(t),touches:n.getPositions(t),scale:n.getScale(t),distance:n.getDistance(t)},n.getPosition(t),{inputEvent:e}))}},n.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var n=this.getCurrentStore();this.emit("pinchEnd",A({datas:this.datas,isPinch:t,touches:n.getPositions()},n.getPosition(),{inputEvent:e})),this.isPinch=!1,this.pinchFlag=!1}},n.initDrag=function(){this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1},n.getCurrentStore=function(){return this.clientStores[0]},n.moveClients=function(e,t,n){var r=this.getCurrentStore()[n?"addClients":"getPosition"](e);return this.isDrag=!0,A({datas:this.datas},r,{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:t})},t}(i.a),v=n(7),B=n(29),m=n(34),b=function(e,t){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function w(e,t){function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var E=function(){return(E=Object.assign||function(e){for(var t,n=1,r=arguments.length;nn?"block":"none",o=this.isHorizontal?["X","width"]:["Y","height"],a=o[0],A=o[1];this.barElement.style.cssText="display: "+i+";",this.thumbElement.style.cssText+=A+": "+n*n/r+"px;transform: translate"+a+"("+t/r*n+"px)"},n.destroy=function(){Object(o.L)(this.barElement,"wheel",this.onWheel),this.gesto.off(),this.off()},t}(i.a),R=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return w(t,e),t}(function(e){function t(t,n,r){void 0===r&&(r={});var i=e.call(this)||this;return i.containerElement=t,i.viewportElement=n,i.offsetX=0,i.offsetY=0,i.containerWidth=0,i.containerHeight=0,i.viewportWidth=0,i.viewportHeight=0,i.scrollLeft=0,i.scrollTop=0,i.timer=0,i.tempScale=1,i.dragFlag=!1,i.isLoop=!1,i.resize=function(){var e=i.containerElement,t=e.offsetWidth,n=e.offsetHeight,r=i.viewportElement,o=r.offsetWidth,a=r.offsetHeight;i.containerWidth=t,i.containerHeight=n,i.viewportWidth=o,i.viewportHeight=a},i.onScroll=function(){var e=i.wrapperElement,t=e.scrollLeft,n=e.scrollTop,r=i.zoom,o=void 0===r?x.zoom:r,a=t-i.scrollLeft,A=n-i.scrollTop,s=i.getScrollLeft(),l=i.getScrollTop();i.isLoop&&(i.isLoop=!1),i.scrollLeft=t,i.scrollTop=n,i.scrollTo(s+a/o,l+A/o)},i.onWheel=function(e){var t=i.options;if(e.ctrlKey){var n=-e.deltaY,r=Math.max(1+n*(t.wheelScale||.01),1e-6);i.trigger("pinch",{distance:n,scale:r,rotation:0,zoom:i.zoom*r,inputEvent:e})}else{if(!y&&!t.useForceWheel)return;var o=i.zoom,a=e.deltaX,A=e.deltaY;e.shiftKey&&!a&&(a=A,A=0),i.scrollBy(a/o,A/o)}e.preventDefault()},i.onGestureStart=function(e){i.tempScale=i.zoom,e.preventDefault()},i.onGestureChange=function(e){if(e.preventDefault(),!i.gesto.isFlag()&&i.tempScale){var t=e.scale;i.trigger("pinch",{distance:0,scale:t,rotation:e.rotation,zoom:i.tempScale*t,inputEvent:e})}else i.tempScale=0},i.options=E(E({},x),r),i.init(),i}w(t,e);var n=t.prototype;return n.getContainer=function(){return this.containerElement},n.getViewport=function(){return this.viewportElement},n.getWrapper=function(){return this.wrapperElement},n.destroy=function(){this.off(),this.gesto.unset(),this.verticalScrollbar.destroy(),this.horizontalScrollbar.destroy(),this.injectResult.destroy();var e=this.containerElement;Object(o.L)(window,"resize",this.resize),Object(o.L)(this.wrapperElement,"scroll",this.onScroll),Object(o.L)(e,"wheel",this.onWheel),Object(o.L)(e,"tgesturestart",this.onGestureStart),Object(o.L)(e,"gesturechange",this.onGestureChange),this.gesto=null,this.injectResult=null,this.containerElement=null,this.viewportElement=null,this.options=null},n.getScrollTop=function(e){return this.scrollTop/this.zoom+this.offsetY+(e?N(this.getRangeY()[0]):0)},n.getScrollLeft=function(e){return this.scrollLeft/this.zoom+this.offsetX+(e?N(this.getRangeX()[0]):0)},n.getScrollWidth=function(e){var t=this.getRangeX(e);return this.containerWidth+N(t[0])+N(t[1])},n.getScrollHeight=function(e){var t=this.getRangeY(e);return this.containerHeight+N(t[0])+N(t[1])},n.scrollCenter=function(){this.resize();var e=this.zoom,t=-(this.containerWidth/e-this.viewportWidth)/2,n=-(this.containerHeight/e-this.viewportHeight)/2;return this.scrollTo(t,n)},n.scrollBy=function(e,t){return this.scrollTo(this.getScrollLeft()+e,this.getScrollTop()+t)},n.scrollTo=function(e,t){var n=this,r=this,i=r.zoom,o=void 0===i?x.zoom:i,a=r.margin,A=void 0===a?x.margin:a,s=r.threshold,l=void 0===s?x.threshold:s,u=r.scrollLeft,c=r.scrollTop,f=this.getRangeX(!0,!0),d=f[0],p=f[1],h=this.getRangeY(!0,!0),g=h[0],v=h[1],B=u,m=c,b=this.getScrollAreaWidth(),w=this.getScrollAreaHeight(),E=e*o,y=t*o;if(E-l<=d){var C=Math.max(0,E-d);B=C,e=(d+C)/o}else if(E+l>=p){var Q=Math.max(0,p-E);B=b-Q,e=(p-Q)/o}else Bb-l&&(B-=A);if(y-l<=g){C=Math.max(0,y-g);m=C,t=(g+C)/o}else if(y+l>=v){Q=Math.max(0,v-y);m=w-Q,t=(v-Q)/o}else mw-l&&(m-=A);B=Math.round(B),m=Math.round(m),this.scrollLeft=B,this.scrollTop=m,this.offsetX=e-B/o,this.offsetY=t-m/o,this.render();var F=this.getScrollLeft(),U=this.getScrollTop();return this.trigger("scroll",{scrollLeft:F,scrollTop:U}),u===B&&c===m||(this.isLoop=!0,this.move(B,m),requestAnimationFrame((function(){if(n.isLoop){n.isLoop=!1;var e=n.wrapperElement,t=e.scrollLeft,r=e.scrollTop;n.scrollLeft=t,n.scrollTop=r,B===t&&m===r||n.scrollTo(F,U)}})),!1)},n.setZoom=function(e){var t=this,n=t.containerWidth,r=t.containerHeight,i=t.zoomOffsetX,a=void 0===i?x.zoomOffsetX:i,A=t.zoomOffsetY,s=void 0===A?x.zoomOffsetY:A,l=t.zoom,u=this.getScrollLeft(),c=this.getScrollTop();this.options.zoom=e;var f=this.getScrollLeft(),d=this.getScrollTop(),p=Object(o.v)(""+a,n),h=Object(o.v)(""+s,r),g=u+p/l,v=c+h/l,B=f+p/e,m=d+h/e;this.scrollBy(g-B,v-m),this.render()},n.getRangeX=function(e,t){var n=this.rangeX,r=void 0===n?x.rangeX:n,i=this.margin,o=void 0===i?x.margin:i,a=this.zoom,A=void 0===a?x.zoom:a,s=this.threshold,l=_(this.getScrollLeft(),o,r,s,t);return e?[l[0]*A,Math.max(this.viewportWidth*A-this.containerWidth,l[1]*A)]:l},n.getRangeY=function(e,t){var n=this.rangeY,r=void 0===n?x.rangeY:n,i=this.margin,o=void 0===i?x.margin:i,a=this.zoom,A=void 0===a?x.zoom:a,s=this.threshold,l=_(this.getScrollTop(),o,r,s,t);return e?[l[0]*A,Math.max(this.viewportHeight*A-this.containerHeight,l[1]*A)]:l},n.init=function(){var e=this,t=this.containerElement,n=this.options;Object(o.o)(t,F);var r=n.wrapperElement||t.querySelector(".infinite-viewer-wrapper"),i=n.scrollAreaElement||t.querySelector(".infinite-viewer-scroll-area"),a=n.horizontalScrollElement||t.querySelector(".infinite-viewer-horizontal-scroll-bar"),A=n.verticalScrollElement||t.querySelector(".infinite-viewer-vertical-scroll-bar");r||(r=document.createElement("div"),Object(o.o)(r,"infinite-viewer-wrapper"),r.insertBefore(this.viewportElement,null),t.insertBefore(r,null)),this.wrapperElement=r,i||(i=document.createElement("div"),Object(o.o)(i,"infinite-viewer-scroll-area"),r.insertBefore(i,r.firstChild)),this.scrollAreaElement=i,this.horizontalScrollbar=new M("horizontal",a),this.verticalScrollbar=new M("vertical",A),this.horizontalScrollbar.on("scroll",(function(t){e.scrollBy(t.delta/e.zoom,0)})),this.verticalScrollbar.on("scroll",(function(t){e.scrollBy(0,t.delta/e.zoom)})),this.horizontalScrollbar.isAppend&&t.insertBefore(this.horizontalScrollbar.barElement,null),this.verticalScrollbar.isAppend&&t.insertBefore(this.verticalScrollbar.barElement,null),Object(o.o)(t,F),this.injectResult=Q.inject(t,{nonce:this.options.cspNonce}),this.gesto=new g(t,{container:document.body,events:["touch"]}).on("dragStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;e.pauseAnimation(),e.dragFlag=!1,!1!==e.trigger("dragStart",{inputEvent:n})?(n.preventDefault(),r.startEvent=n):i()})).on("drag",(function(t){if(!e.options.usePinch||t.isPinch){e.trigger("drag",{inputEvent:t.inputEvent}),function(e){var t=e.deltaX,n=e.deltaY,r=e.datas,i=Date.now(),o=r.speed;if(!o)return r.speed=[0,0],void(r.time=i);var a=i-r.time;r.speed=[o[0]/2+t/a,o[1]/2+n/a]}(t);var r=e.zoom;e.scrollBy(-t.deltaX/r,-t.deltaY/r)}else!e.dragFlag&&t.movement>n.pinchThreshold&&(e.dragFlag=!0,e.trigger("abortPinch",{inputEvent:t.datas.startEvent||t.inputEvent}))})).on("dragEnd",(function(t){e.trigger("dragEnd",{isDrag:t.isDrag,isDouble:t.isDouble,inputEvent:t.inputEvent}),e.startAnimation(t.datas.speed)})).on("pinchStart",(function(t){var n=t.inputEvent,r=t.datas,i=t.stop;n.preventDefault(),e.pauseAnimation(),r.startZoom=e.zoom,!1===e.trigger("pinchStart",{inputEvent:n})&&i()})).on("pinch",(function(t){e.trigger("pinch",{rotation:t.rotation,distance:t.distance,scale:t.scale,zoom:t.datas.startZoom*t.scale,inputEvent:t.inputEvent})})),Object(o.p)(r,"scroll",this.onScroll),Object(o.p)(window,"resize",this.resize),Object(o.p)(t,"wheel",this.onWheel,{passive:!1}),Object(o.p)(t,"gesturestart",this.onGestureStart,{passive:!1}),Object(o.p)(t,"gesturechange",this.onGestureChange,{passive:!1}),this.resize(),this.render(),this.scrollTo(0,0)},n.render=function(){var e=this.offsetX,t=this.offsetY,n=this.zoom,r=void 0===n?x.zoom:n,i=this.translateZ,o=void 0===i?0:i,a=-e*r,A=-t*r;this.scrollAreaElement.style.cssText="width:calc(100% + "+this.getScrollAreaWidth()+"px);height:calc(100% + "+this.getScrollAreaHeight()+"px);",this.viewportElement.style.cssText+="transform-origin: 0 0;transform:translate3d("+a+"px, "+A+"px, "+o+"px) scale("+r+");",this.renderScroll()},n.renderScroll=function(){var e=this.containerWidth,t=this.containerHeight,n=this.zoom,r=this.getScrollLeft(!0)*n,i=this.getScrollTop(!0)*n,o=this.getScrollWidth(!0),a=this.getScrollHeight(!0);this.horizontalScrollbar.render(this.displayHorizontalScroll,r,e,o),this.verticalScrollbar.render(this.displayVerticalScroll,i,t,a)},n.move=function(e,t){var n=this.wrapperElement;n.scrollLeft=e,n.scrollTop=t},n.startAnimation=function(e){var t=this;if(e&&(e[0]||e[1])){var n=-6e-4,r=function(e){return 1-Math.pow(1-e,3)},i=T(e,n),o=function(e,t){var n=T(e,t);return[e[0]/2*n,e[1]/2*n]}(e,n),a=Date.now(),A=a;this.timer=requestAnimationFrame((function e(){var n=Date.now(),s=n-a;i=i||(t.timer=requestAnimationFrame(e))}))}},n.pauseAnimation=function(){cancelAnimationFrame(this.timer)},n.getScrollAreaWidth=function(){var e=this.getRangeX(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},n.getScrollAreaHeight=function(){var e=this.getRangeY(!0),t=e[0],n=e[1];return t||n?2*this.margin:0},t=function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var A=e.length-1;A>=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}([Object(v.a)(U,(function(e,t){var n={enumerable:!0,configurable:!0,get:function(){return this.options[t]}},r=Object(o.t)("set "+t);e[r]?n.set=function(e){this[r](e)}:n.set=function(e){this.options[t]=e},Object.defineProperty(e,t,n)}))],t)}(i.a)),D=function(e,t){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var P=function(){return(P=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;A--)(i=e[A])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([Object(v.f)(O)],t.prototype,"infiniteViewer",void 0),t}(r.PureComponent);t.a=I},function(e,t,n){"use strict";var r=n(1),i=n(15),o=function(){function e(e){this.separator=e,this.orderMap={}}var t=e.prototype;return t.getFullName=function(e){return e.join(this.separator)},t.get=function(e){return this.orderMap[this.getFullName(e)]},t.gets=function(e,t){void 0===t&&(t=!0);var n=[],r=this;return function e(t,i){var o=r.get(t);if(o)return o.forEach((function(r){var o=i.concat([r]),a=e(t.concat([r]),o);a&&a.length||n.push(i.concat([r]))})),o}(e,t?e:[]),n},t.set=function(e,t){var n=this;return e.forEach((function(t,r){n.addName(e.slice(0,r),t)})),this.orderMap[this.getFullName(e)]=t,t},t.add=function(e){var t=e.length;return t?this.addName(e.slice(0,-1),e[t-1]):[]},t.addName=function(e,t){var n=this.get(e)||this.set(e,[]);return-1===n.indexOf(t)&&n.push(t),n},t.findIndex=function(e,t){var n=this.orderMap[this.getFullName(e)];return n?n.indexOf(t):-1},t.remove=function(e){var t=this.getFullName(e),n=this.orderMap;for(var r in n)0===r.indexOf(t)&&delete n[r];var i=e.length;if(i){var o=e.slice(0,-1),a=e[i-1];this.splice(o,this.findIndex(o,a),1)}return this},t.filter=function(t,n,r){void 0===r&&(r=!0);var i=this.gets(t,r).filter(n),o=new e(this.separator),a=r?[]:t;return i.forEach((function(e){o.add(a.concat(e))})),o},t.splice=function(e,t,n){for(var r=[],i=3;i.001;){if(i=l(e,t,r)-n,Math.abs(i)<.001)return r;r-=i/2}return r}(e,n,Object(r.r)(o,0,1));return l(t,i,a)};return o.easingName="cubic-bezier("+e+","+t+","+n+","+i+")",o}function c(e,t){var n=function(n){var r=1/e;return n>=1?1:("start"===t?r:0)+Math.floor(n/r)*r};return n.easingName="steps("+e+", "+t+")",n}var f,d=c(1,"start"),p=c(1,"end"),h=u(0,0,1,1),g=u(.25,.1,.25,1),v=u(.42,0,1,1),B=u(0,0,.58,1),m=u(.42,0,.58,1),b="animation-timing-function",w={transform:{},filter:{},attribute:{},html:!0},E={easing:[b]},y=((f={})[b]=!0,f.contents=!0,f.html=!0,f),C="delay",Q={linear:h,ease:g,"ease-in":v,"ease-out":B,"ease-in-out":m,"step-start":d,"step-end":p},x=["duration","fillMode","direction","iterationCount",C,"easing","playSpeed"],F=function(){function e(e,t){this.prefix="",this.suffix="",this.model="",this.type="",this.separator=",",t&&this.setOptions(t),this.value=Object(r.H)(e)?e.split(this.separator):e}var t=e.prototype;return t.setOptions=function(e){for(var t in e)this[t]=e[t];return this},t.size=function(){return this.value.length},t.get=function(e){return this.value[e]},t.set=function(e,t){return this.value[e]=t,this},t.clone=function(){var t=this,n=t.separator,r=t.prefix,i=t.suffix,o=t.model,a=t.type;return new e(this.value.map((function(t){return t instanceof e?t.clone():t})),{separator:n,prefix:r,suffix:i,model:o,type:a})},t.toValue=function(){return this.prefix+this.join()+this.suffix},t.join=function(){return this.value.map((function(t){return t instanceof e?t.toValue():t})).join(this.separator)},t.forEach=function(e){return this.value.forEach(e),this},e}();function U(e){for(var t=Object(r.R)(e,";"),n={},i=t.length,o=i,a=0;a1?H(n.map((function(e){return O(e)})),","):(n=Object(r.Q)(e)).length>1?H(n.map((function(e){return O(e)}))," "):(n=/^(['"])([^'"]*)(['"])$/g.exec(e))&&n[1]===n[3]?new F([O(n[2])],{prefix:n[1],suffix:n[1]}):-1!==e.indexOf("(")?function(e){var t=Object(r.O)(e),n=t.prefix,i=t.value,o=t.suffix;if("undefined"===typeof i)return e;if(r.d.indexOf(n)>-1)return S(Object(r.T)(e));var a=O(i,n),A=[i],s=",",l=n+"(",u=")"+o;return a instanceof F&&(s=a.separator,A=a.value,l+=a.prefix,u=a.suffix+u),new F(A,{separator:s,model:n,prefix:l,suffix:u})}(e):"#"===e.charAt(0)&&"url"!==t?function(e){var t=Object(r.T)(e);return t?S(t):e}(e):e}function T(e,t){void 0===t&&(t={});var n=e.model;if(n){e.setOptions({model:"",suffix:"",prefix:""});var r=e.size()>1?e:e.get(0);t[n]=r}else e.forEach((function(e){T(e,t)}));return t}function N(e){return e instanceof F}function _(e){var t=typeof e;if(t===r.j){if(Object(r.D)(e))return r.c;if(N(e))return r.k}else if(t===r.m||t===r.i)return"value";return t}function M(e){return Object(r.G)(e)&&e.constructor===Object}function R(e,t){var n=[];if(M(e))for(var r in e)t.push(r),n=n.concat(R(e[r],t)),t.pop();else n.push(t.slice());return n}function D(e){return Math.round(1e6*e)/1e6}function P(e,t,n){void 0===n&&(n=e.length);for(var i=t,o=0;o=1?"alternate-reverse":"alternate"):n===(e%2>=1?"alternate":"alternate-reverse"))}var j=["id","iterationCount",C,"fillMode","direction","playSpeed","duration","playSpeed","iterationTime","playState"],X=s(j,["easing","easingName"]);i.a;function G(e,t){if(void 0===t&&(t=[]),!e)return"";var n=[],i=Object(r.B)(e);return Object(r.N)(i,t),i.forEach((function(t){n.push(t.replace(/\d$/g,"")+"("+e[t]+")")})),n.join(" ")}function V(e,t){return void 0===t&&(t=!1),Y({},e,t)}function Y(e,t,n){for(var i in void 0===n&&(n=!1),t){var o=t[i],a=_(o);a===r.k?e[i]=n?o.toValue():o.clone():a===r.f?e[i]=n?J([i],o):o:a===r.c?e[i]=o.slice():a===r.j?Object(r.G)(e[i])&&!N(e[i])?Y(e[i],o,n):e[i]=V(o,n):e[i]=t[i]}return e}function W(e){return e[0]in E?E[e[0]]:e}function J(e,t){var n=_(t);if(n===r.k)return t.toValue();if(n===r.f){if(e[0]!==b)return J(e,t())}else if(n===r.j)return V(t,!0);return t}var q=function(){function e(e){void 0===e&&(e={}),this.properties={},this.orderMap=new o("_///_"),this.properties={},this.set(e)}var t=e.prototype;return t.get=function(){for(var e=[],t=0;tH.length&&H.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,i){var A=typeof t;"undefined"!==A&&"boolean"!==A||(t=null);var s=!1;if(null===t)s=!0;else switch(A){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case a:s=!0}}if(s)return r(i,t,""===n?"."+_(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var l=0;l