diff --git a/asset-manifest.json b/asset-manifest.json index 15edd38..5c5899b 100644 --- a/asset-manifest.json +++ b/asset-manifest.json @@ -1,25 +1,25 @@ { "files": { "main.css": "./static/css/main.435d5fe5.chunk.css", - "main.js": "./static/js/main.5aa10c51.chunk.js", - "main.js.map": "./static/js/main.5aa10c51.chunk.js.map", + "main.js": "./static/js/main.905b5fdb.chunk.js", + "main.js.map": "./static/js/main.905b5fdb.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.2f85583a.js", "runtime-main.js.map": "./static/js/runtime-main.2f85583a.js.map", "static/css/2.5c9bb0f6.chunk.css": "./static/css/2.5c9bb0f6.chunk.css", - "static/js/2.a81926a3.chunk.js": "./static/js/2.a81926a3.chunk.js", - "static/js/2.a81926a3.chunk.js.map": "./static/js/2.a81926a3.chunk.js.map", + "static/js/2.063a3519.chunk.js": "./static/js/2.063a3519.chunk.js", + "static/js/2.063a3519.chunk.js.map": "./static/js/2.063a3519.chunk.js.map", "index.html": "./index.html", - "precache-manifest.fe5c1013cb70c779fd2b2388bfd0dbb5.js": "./precache-manifest.fe5c1013cb70c779fd2b2388bfd0dbb5.js", + "precache-manifest.a754095d274aa1c1f75d7f8110f82a04.js": "./precache-manifest.a754095d274aa1c1f75d7f8110f82a04.js", "service-worker.js": "./service-worker.js", "static/css/2.5c9bb0f6.chunk.css.map": "./static/css/2.5c9bb0f6.chunk.css.map", "static/css/main.435d5fe5.chunk.css.map": "./static/css/main.435d5fe5.chunk.css.map", - "static/js/2.a81926a3.chunk.js.LICENSE.txt": "./static/js/2.a81926a3.chunk.js.LICENSE.txt" + "static/js/2.063a3519.chunk.js.LICENSE.txt": "./static/js/2.063a3519.chunk.js.LICENSE.txt" }, "entrypoints": [ "static/js/runtime-main.2f85583a.js", "static/css/2.5c9bb0f6.chunk.css", - "static/js/2.a81926a3.chunk.js", + "static/js/2.063a3519.chunk.js", "static/css/main.435d5fe5.chunk.css", - "static/js/main.5aa10c51.chunk.js" + "static/js/main.905b5fdb.chunk.js" ] } \ No newline at end of file diff --git a/index.html b/index.html index eb8f39a..772a7aa 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -AVAT - ALPHA
\ No newline at end of file +AVAT - ALPHA
\ No newline at end of file diff --git a/precache-manifest.fe5c1013cb70c779fd2b2388bfd0dbb5.js b/precache-manifest.a754095d274aa1c1f75d7f8110f82a04.js similarity index 52% rename from precache-manifest.fe5c1013cb70c779fd2b2388bfd0dbb5.js rename to precache-manifest.a754095d274aa1c1f75d7f8110f82a04.js index ca52238..ffe66af 100644 --- a/precache-manifest.fe5c1013cb70c779fd2b2388bfd0dbb5.js +++ b/precache-manifest.a754095d274aa1c1f75d7f8110f82a04.js @@ -1,27 +1,27 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([ { - "revision": "47ecb40134f6687596572ed8bf6bc94e", + "revision": "d3219646a4e94acbcb0effe1208ac567", "url": "./index.html" }, { - "revision": "533bb6806e97de941229", + "revision": "064ed22c39fc36e443f2", "url": "./static/css/2.5c9bb0f6.chunk.css" }, { - "revision": "bcbf371007d0b5cb65aa", + "revision": "cc132bf59d2a4d415bce", "url": "./static/css/main.435d5fe5.chunk.css" }, { - "revision": "533bb6806e97de941229", - "url": "./static/js/2.a81926a3.chunk.js" + "revision": "064ed22c39fc36e443f2", + "url": "./static/js/2.063a3519.chunk.js" }, { "revision": "62c5437c0199da4e67916b9b0a3c7974", - "url": "./static/js/2.a81926a3.chunk.js.LICENSE.txt" + "url": "./static/js/2.063a3519.chunk.js.LICENSE.txt" }, { - "revision": "bcbf371007d0b5cb65aa", - "url": "./static/js/main.5aa10c51.chunk.js" + "revision": "cc132bf59d2a4d415bce", + "url": "./static/js/main.905b5fdb.chunk.js" }, { "revision": "981fb04b7452c6560ad9", diff --git a/service-worker.js b/service-worker.js index fadf47b..b3166aa 100644 --- a/service-worker.js +++ b/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); importScripts( - "./precache-manifest.fe5c1013cb70c779fd2b2388bfd0dbb5.js" + "./precache-manifest.a754095d274aa1c1f75d7f8110f82a04.js" ); self.addEventListener('message', (event) => { diff --git a/static/js/2.a81926a3.chunk.js b/static/js/2.063a3519.chunk.js similarity index 50% rename from static/js/2.a81926a3.chunk.js rename to static/js/2.063a3519.chunk.js index e602907..0933251 100644 --- a/static/js/2.a81926a3.chunk.js +++ b/static/js/2.063a3519.chunk.js @@ -1,3 +1,3 @@ -/*! For license information please see 2.a81926a3.chunk.js.LICENSE.txt */ -(this.webpackJsonpavat=this.webpackJsonpavat||[]).push([[2],[function(e,t,n){"use strict";e.exports=n(113)},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}n.d(t,"a",(function(){return r}))},function(e,t,n){var r;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t3&&void 0!==arguments[3]&&arguments[3],i=a(t),o=0;i.reduce((function(e,t){if(o+=1,"undefined"===typeof e[t]){if(!r)throw new Error(e+"."+t+" is undefined");return e[t]={},e[t]}return o===i.length?(e[t]=n,n):e[t]}),e)},isDefined:function(e){return"undefined"!==typeof e&&null!==e},isEmptyObject:function(e){if(!o.default.isObject(e))return!1;for(var t=Object.prototype.hasOwnProperty,n=Object.keys(e),r=0;r-1}})},function(e,t,n){"use strict";var r,i=n(3),o=n(1),a=n(4),s=n.n(a),l=n(39),u=n(30),c=n(23),f=n(56);function d(e){if((!r&&0!==r||e)&&u.a){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),r=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return r}var h=n(62),p=n(6),g=n(44),v=n(77),y=n(0),m=n.n(y);function b(e){void 0===e&&(e=Object(c.a)());try{var t=e.activeElement;return t&&t.nodeName?t:null}catch(n){return e.body}}var w=n(57),x=n(26),_=n(2),O=n.n(_),C=n(14),S=n.n(C),E=n(42),P=n(66),T=n(64),k=n(65),j=n(21);function R(e){return"window"in e&&e.window===e?e:"nodeType"in(t=e)&&t.nodeType===document.DOCUMENT_NODE&&e.defaultView||!1;var t}function A(e){var t;return R(e)||(t=e)&&"body"===t.tagName.toLowerCase()?function(e){var t=R(e)?Object(c.a)():Object(c.a)(e),n=R(e)||t.defaultView;return t.body.clientWidthe.clientHeight}var D=["template","script","style"],I=function(e,t,n){[].forEach.call(e.children,(function(e){-1===t.indexOf(e)&&function(e){var t=e.nodeType,n=e.tagName;return 1===t&&-1===D.indexOf(n.toLowerCase())}(e)&&n(e)}))};function M(e,t){t&&(e?t.setAttribute("aria-hidden","true"):t.removeAttribute("aria-hidden"))}var L,N=function(){function e(e){var t=void 0===e?{}:e,n=t.hideSiblingNodes,r=void 0===n||n,i=t.handleContainerOverflow,o=void 0===i||i;this.hideSiblingNodes=void 0,this.handleContainerOverflow=void 0,this.modals=void 0,this.containers=void 0,this.data=void 0,this.scrollbarSize=void 0,this.hideSiblingNodes=r,this.handleContainerOverflow=o,this.modals=[],this.containers=[],this.data=[],this.scrollbarSize=d()}var t=e.prototype;return t.isContainerOverflowing=function(e){var t=this.data[this.containerIndexFromModal(e)];return t&&t.overflowing},t.containerIndexFromModal=function(e){return function(e,t){var n=-1;return e.some((function(e,r){return!!t(e,r)&&(n=r,!0)})),n}(this.data,(function(t){return-1!==t.modals.indexOf(e)}))},t.setContainerStyle=function(e,t){var n={overflow:"hidden"};e.style={overflow:t.style.overflow,paddingRight:t.style.paddingRight},e.overflowing&&(n.paddingRight=parseInt(Object(j.a)(t,"paddingRight")||"0",10)+this.scrollbarSize+"px"),Object(j.a)(t,n)},t.removeContainerStyle=function(e,t){Object.assign(t.style,e.style)},t.add=function(e,t,n){var r=this.modals.indexOf(e),i=this.containers.indexOf(t);if(-1!==r)return r;if(r=this.modals.length,this.modals.push(e),this.hideSiblingNodes&&function(e,t){var n=t.dialog,r=t.backdrop;I(e,[n,r],(function(e){return M(!0,e)}))}(t,e),-1!==i)return this.data[i].modals.push(e),r;var o={modals:[e],classes:n?n.split(/\s+/):[],overflowing:A(t)};return this.handleContainerOverflow&&this.setContainerStyle(o,t),o.classes.forEach(T.a.bind(null,t)),this.containers.push(t),this.data.push(o),r},t.remove=function(e){var t=this.modals.indexOf(e);if(-1!==t){var n=this.containerIndexFromModal(e),r=this.data[n],i=this.containers[n];if(r.modals.splice(r.modals.indexOf(e),1),this.modals.splice(t,1),0===r.modals.length)r.classes.forEach(k.a.bind(null,i)),this.handleContainerOverflow&&this.removeContainerStyle(r,i),this.hideSiblingNodes&&function(e,t){var n=t.dialog,r=t.backdrop;I(e,[n,r],(function(e){return M(!1,e)}))}(i,e),this.containers.splice(n,1),this.data.splice(n,1);else if(this.hideSiblingNodes){var o=r.modals[r.modals.length-1],a=o.backdrop;M(!1,o.dialog),M(!1,a)}}},t.isTopModal=function(e){return!!this.modals.length&&this.modals[this.modals.length-1]===e},e}(),F=function(e){var t;return"undefined"===typeof document?null:null==e?Object(c.a)().body:("function"===typeof e&&(e=e()),e&&"current"in e&&(e=e.current),null!=(t=e)&&t.nodeType&&e||null)};function B(e){var t=e||(L||(L=new N),L),n=Object(y.useRef)({dialog:null,backdrop:null});return Object.assign(n.current,{add:function(e,r){return t.add(n.current,e,r)},remove:function(){return t.remove(n.current)},isTopModal:function(){return t.isTopModal(n.current)},setDialogRef:Object(y.useCallback)((function(e){n.current.dialog=e}),[]),setBackdropRef:Object(y.useCallback)((function(e){n.current.backdrop=e}),[])})}var z=Object(y.forwardRef)((function(e,t){var n=e.show,r=void 0!==n&&n,a=e.role,s=void 0===a?"dialog":a,l=e.className,c=e.style,f=e.children,d=e.backdrop,h=void 0===d||d,v=e.keyboard,_=void 0===v||v,O=e.onBackdropClick,C=e.onEscapeKeyDown,T=e.transition,k=e.backdropTransition,j=e.autoFocus,R=void 0===j||j,A=e.enforceFocus,D=void 0===A||A,I=e.restoreFocus,M=void 0===I||I,L=e.restoreFocusOptions,N=e.renderDialog,z=e.renderBackdrop,H=void 0===z?function(e){return m.a.createElement("div",e)}:z,U=e.manager,W=e.container,V=e.containerClassName,G=e.onShow,X=e.onHide,Y=void 0===X?function(){}:X,q=e.onExit,K=e.onExited,$=e.onExiting,Q=e.onEnter,J=e.onEntering,Z=e.onEntered,ee=Object(i.a)(e,["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","backdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","containerClassName","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"]),te=function(e,t){var n=Object(y.useState)((function(){return F(e)})),r=n[0],i=n[1];if(!r){var o=F(e);o&&i(o)}return Object(y.useEffect)((function(){t&&r&&t(r)}),[t,r]),Object(y.useEffect)((function(){var t=F(e);t!==r&&i(t)}),[e,r]),r}(W),ne=B(U),re=Object(E.a)(),ie=Object(P.a)(r),oe=Object(y.useState)(!r),ae=oe[0],se=oe[1],le=Object(y.useRef)(null);Object(y.useImperativeHandle)(t,(function(){return ne}),[ne]),u.a&&!ie&&r&&(le.current=b()),T||r||ae?r&&ae&&se(!1):se(!0);var ue=Object(p.a)((function(){if(ne.add(te,V),ge.current=Object(x.a)(document,"keydown",he),pe.current=Object(x.a)(document,"focus",(function(){return setTimeout(fe)}),!0),G&&G(),R){var e=b(document);ne.dialog&&e&&!Object(w.a)(ne.dialog,e)&&(le.current=e,ne.dialog.focus())}})),ce=Object(p.a)((function(){var e;(ne.remove(),null==ge.current||ge.current(),null==pe.current||pe.current(),M)&&(null==(e=le.current)||null==e.focus||e.focus(L),le.current=null)}));Object(y.useEffect)((function(){r&&te&&ue()}),[r,te,ue]),Object(y.useEffect)((function(){ae&&ce()}),[ae,ce]),Object(g.a)((function(){ce()}));var fe=Object(p.a)((function(){if(D&&re()&&ne.isTopModal()){var e=b();ne.dialog&&e&&!Object(w.a)(ne.dialog,e)&&ne.dialog.focus()}})),de=Object(p.a)((function(e){e.target===e.currentTarget&&(null==O||O(e),!0===h&&Y())})),he=Object(p.a)((function(e){_&&27===e.keyCode&&ne.isTopModal()&&(null==C||C(e),e.defaultPrevented||Y())})),pe=Object(y.useRef)(),ge=Object(y.useRef)(),ve=T;if(!te||!(r||ve&&!ae))return null;var ye=Object(o.a)({role:s,ref:ne.setDialogRef,"aria-modal":"dialog"===s||void 0},ee,{style:c,className:l,tabIndex:-1}),me=N?N(ye):m.a.createElement("div",ye,m.a.cloneElement(f,{role:"document"}));ve&&(me=m.a.createElement(ve,{appear:!0,unmountOnExit:!0,in:!!r,onExit:q,onExiting:$,onExited:function(){se(!0);for(var e=arguments.length,t=new Array(e),n=0;nObject(c.a)(e).documentElement.clientHeight;K({paddingRight:t&&!n?d():void 0,paddingLeft:!t&&n?d():void 0})}}var he=Object(p.a)((function(){oe&&fe(oe.dialog)}));Object(g.a)((function(){Object(f.a)(window,"resize",he),re.current&&re.current()}));var ve=function(){te.current=!0},ye=function(e){te.current&&oe&&e.target===oe.dialog&&(ne.current=!0),te.current=!1},me=function(){ee(!0),re.current=Object(v.a)(oe.dialog,(function(){ee(!1)}))},be=function(e){"static"!==E?ne.current||e.target!==e.currentTarget?ne.current=!1:null==j||j():function(e){e.target===e.currentTarget&&me()}(e)},we=Object(y.useCallback)((function(e){return m.a.createElement("div",Object(o.a)({},e,{className:s()(n+"-backdrop",W,!S&&"show")}))}),[S,W,n]),xe=Object(o.a)({},a,Y);S||(xe.display="block");return m.a.createElement(J.Provider,{value:ue},m.a.createElement(U,{show:C,ref:ae,backdrop:E,container:R,keyboard:!0,autoFocus:A,enforceFocus:D,restoreFocus:I,restoreFocusOptions:M,onEscapeKeyDown:function(e){P||"static"!==E?P&&T&&T(e):(e.preventDefault(),me())},onShow:k,onHide:j,onEnter:function(e,t){e&&(e.style.display="block",fe(e)),null==B||B(e,t)},onEntering:function(e,t){null==z||z(e,t),Object(l.a)(window,"resize",he)},onEntered:L,onExit:function(e){null==re.current||re.current(),null==N||N(e)},onExiting:F,onExited:function(e){e&&(e.style.display=""),null==H||H(e),Object(f.a)(window,"resize",he)},manager:ce(),containerClassName:n+"-open",transition:S?pe:void 0,backdropTransition:S?ge:void 0,renderBackdrop:we,renderDialog:function(e){return m.a.createElement("div",Object(o.a)({role:"dialog"},e,{style:xe,className:s()(r,n,Q&&n+"-static"),onClick:E?be:void 0,onMouseUp:ye,"aria-labelledby":O}),m.a.createElement(_,Object(o.a)({},G,{onMouseDown:ve,className:b,contentClassName:w}),x))}}))}));ve.displayName="Modal",ve.defaultProps=he,ve.Body=Q,ve.Header=le,ve.Title=fe,ve.Footer=re,ve.Dialog=ne,ve.TRANSITION_DURATION=300,ve.BACKDROP_TRANSITION_DURATION=150;t.a=ve},function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(0),i=n.n(r).a.createContext(null),o=function(e,t){return void 0===t&&(t=null),null!=e?String(e):t||null};t.a=i},function(e,t,n){"use strict";var r=n(1),i=n(3),o=n(4),a=n.n(o),s=n(0),l=n.n(s),u=n(5),c=n(28),f=["bsPrefix","variant","size","active","className","block","type","as"],d=l.a.forwardRef((function(e,t){var n=e.bsPrefix,o=e.variant,s=e.size,d=e.active,h=e.className,p=e.block,g=e.type,v=e.as,y=Object(i.a)(e,f),m=Object(u.a)(n,"btn"),b=a()(h,m,d&&"active",o&&m+"-"+o,p&&m+"-block",s&&m+"-"+s);if(y.href)return l.a.createElement(c.a,Object(r.a)({},y,{as:v,ref:t,className:a()(b,y.disabled&&"disabled")}));t&&(y.ref=t),g?y.type=g:v||(y.type="button");var w=v||"button";return l.a.createElement(w,Object(r.a)({},y,{className:b}))}));d.displayName="Button",d.defaultProps={variant:"primary",active:!1,disabled:!1},t.a=d},function(e,t,n){"use strict";var r,i=n(1),o=n(3),a=n(4),s=n.n(a),l=n(0),u=n.n(l);var c=n(24),f=n(39),d=n(2),h=n.n(d),p=n(20),g=n(66),v=n(70),y=n(6);function m(e,t,n){return void 0===n&&(n=!1),function(e,t,n,r){void 0===r&&(r=!1);var i=Object(y.a)(n);Object(l.useEffect)((function(){var n="function"===typeof e?e():e;return n.addEventListener(t,i,r),function(){return n.removeEventListener(t,i,r)}}),[e])}(Object(l.useCallback)((function(){return document}),[]),e,t,n)}var b=u.a.createContext(null),w=n(62),x=n(42);var _=function(e){var t=Object(x.a)();return[e[0],Object(l.useCallback)((function(n){if(t())return e[1](n)}),[t,e[1]])]};function O(e){return e.split("-")[0]}function C(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function S(e){return e instanceof C(e).Element||e instanceof Element}function E(e){return e instanceof C(e).HTMLElement||e instanceof HTMLElement}function P(e){return"undefined"!==typeof ShadowRoot&&(e instanceof C(e).ShadowRoot||e instanceof ShadowRoot)}var T=Math.max,k=Math.min,j=Math.round;function R(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(E(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=j(n.width)/a||1),o>0&&(i=j(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function A(e){var t=R(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function D(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function I(e){return e?(e.nodeName||"").toLowerCase():null}function M(e){return C(e).getComputedStyle(e)}function L(e){return["table","td","th"].indexOf(I(e))>=0}function N(e){return((S(e)?e.ownerDocument:e.document)||window.document).documentElement}function F(e){return"html"===I(e)?e:e.assignedSlot||e.parentNode||(P(e)?e.host:null)||N(e)}function B(e){return E(e)&&"fixed"!==M(e).position?e.offsetParent:null}function z(e){for(var t=C(e),n=B(e);n&&L(n)&&"static"===M(n).position;)n=B(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===M(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&E(e)&&"fixed"===M(e).position)return null;var n=F(e);for(P(n)&&(n=n.host);E(n)&&["html","body"].indexOf(I(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function H(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function U(e,t,n){return T(e,k(t,n))}function W(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function V(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var G="top",X="bottom",Y="right",q="left",K=[G,X,Y,q],$=K.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),Q=[].concat(K,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),J=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];var Z={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=O(n.placement),l=H(s),u=[q,Y].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return W("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:V(e,K))}(i.padding,n),f=A(o),d="y"===l?G:q,h="y"===l?X:Y,p=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],g=a[l]-n.rects.reference[l],v=z(o),y=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,m=p/2-g/2,b=c[d],w=y-f[u]-c[h],x=y/2-f[u]/2+m,_=U(b,x,w),C=l;n.modifiersData[r]=((t={})[C]=_,t.centerOffset=_-x,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!==typeof r||(r=t.elements.popper.querySelector(r)))&&D(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ee(e){return e.split("-")[1]}var te={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ne(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,d=a.x,h=void 0===d?0:d,p=a.y,g=void 0===p?0:p,v="function"===typeof c?c({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var y=a.hasOwnProperty("x"),m=a.hasOwnProperty("y"),b=q,w=G,x=window;if(u){var _=z(n),O="clientHeight",S="clientWidth";if(_===C(n)&&"static"!==M(_=N(n)).position&&"absolute"===s&&(O="scrollHeight",S="scrollWidth"),_=_,i===G||(i===q||i===Y)&&"end"===o)w=X,g-=(f&&_===x&&x.visualViewport?x.visualViewport.height:_[O])-r.height,g*=l?1:-1;if(i===q||(i===G||i===X)&&"end"===o)b=Y,h-=(f&&_===x&&x.visualViewport?x.visualViewport.width:_[S])-r.width,h*=l?1:-1}var E,P=Object.assign({position:s},u&&te),T=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:j(t*r)/r||0,y:j(n*r)/r||0}}({x:h,y:g}):{x:h,y:g};return h=T.x,g=T.y,l?Object.assign({},P,((E={})[w]=m?"0":"",E[b]=y?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",E)):Object.assign({},P,((t={})[w]=m?g+"px":"",t[b]=y?h+"px":"",t.transform="",t))}var re={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,u={placement:O(t.placement),variation:ee(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,ne(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,ne(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},ie={passive:!0};var oe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,l=C(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach((function(e){e.addEventListener("scroll",n.update,ie)})),s&&l.addEventListener("resize",n.update,ie),function(){o&&u.forEach((function(e){e.removeEventListener("scroll",n.update,ie)})),s&&l.removeEventListener("resize",n.update,ie)}},data:{}},ae={left:"right",right:"left",bottom:"top",top:"bottom"};function se(e){return e.replace(/left|right|bottom|top/g,(function(e){return ae[e]}))}var le={start:"end",end:"start"};function ue(e){return e.replace(/start|end/g,(function(e){return le[e]}))}function ce(e){var t=C(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function fe(e){return R(N(e)).left+ce(e).scrollLeft}function de(e){var t=M(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function he(e,t){var n;void 0===t&&(t=[]);var r=function e(t){return["html","body","#document"].indexOf(I(t))>=0?t.ownerDocument.body:E(t)&&de(t)?t:e(F(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=C(r),a=i?[o].concat(o.visualViewport||[],de(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(he(F(a)))}function pe(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ge(e,t){return"viewport"===t?pe(function(e){var t=C(e),n=N(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+fe(e),y:s}}(e)):S(t)?function(e){var t=R(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):pe(function(e){var t,n=N(e),r=ce(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=T(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=T(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+fe(e),l=-r.scrollTop;return"rtl"===M(i||n).direction&&(s+=T(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(N(e)))}function ve(e,t,n){var r="clippingParents"===t?function(e){var t=he(F(e)),n=["absolute","fixed"].indexOf(M(e).position)>=0&&E(e)?z(e):e;return S(n)?t.filter((function(e){return S(e)&&D(e,n)&&"body"!==I(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ge(e,n);return t.top=T(r.top,t.top),t.right=k(r.right,t.right),t.bottom=k(r.bottom,t.bottom),t.left=T(r.left,t.left),t}),ge(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function ye(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?O(i):null,a=i?ee(i):null,s=n.x+n.width/2-r.width/2,l=n.y+n.height/2-r.height/2;switch(o){case G:t={x:s,y:n.y-r.height};break;case X:t={x:s,y:n.y+n.height};break;case Y:t={x:n.x+n.width,y:l};break;case q:t={x:n.x-r.width,y:l};break;default:t={x:n.x,y:n.y}}var u=o?H(o):null;if(null!=u){var c="y"===u?"height":"width";switch(a){case"start":t[u]=t[u]-(n[c]/2-r[c]/2);break;case"end":t[u]=t[u]+(n[c]/2-r[c]/2)}}return t}function me(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,l=void 0===s?"viewport":s,u=n.elementContext,c=void 0===u?"popper":u,f=n.altBoundary,d=void 0!==f&&f,h=n.padding,p=void 0===h?0:h,g=W("number"!==typeof p?p:V(p,K)),v="popper"===c?"reference":"popper",y=e.rects.popper,m=e.elements[d?v:c],b=ve(S(m)?m:m.contextElement||N(e.elements.popper),a,l),w=R(e.elements.reference),x=ye({reference:w,element:y,strategy:"absolute",placement:i}),_=pe(Object.assign({},y,x)),O="popper"===c?_:w,C={top:b.top-O.top+g.top,bottom:O.bottom-b.bottom+g.bottom,left:b.left-O.left+g.left,right:O.right-b.right+g.right},E=e.modifiersData.offset;if("popper"===c&&E){var P=E[i];Object.keys(C).forEach((function(e){var t=[Y,X].indexOf(e)>=0?1:-1,n=[G,X].indexOf(e)>=0?"y":"x";C[e]+=P[n]*t}))}return C}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,g=n.allowedAutoPlacements,v=t.options.placement,y=O(v),m=l||(y===v||!p?[se(v)]:function(e){if("auto"===O(e))return[];var t=se(e);return[ue(e),t,ue(t)]}(v)),b=[v].concat(m).reduce((function(e,n){return e.concat("auto"===O(n)?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?Q:l,c=ee(r),f=c?s?$:$.filter((function(e){return ee(e)===c})):K,d=f.filter((function(e){return u.indexOf(e)>=0}));0===d.length&&(d=f);var h=d.reduce((function(t,n){return t[n]=me(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[O(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}(t,{placement:n,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:g}):n)}),[]),w=t.rects.reference,x=t.rects.popper,_=new Map,C=!0,S=b[0],E=0;E=0,R=j?"width":"height",A=me(t,{placement:P,boundary:c,rootBoundary:f,altBoundary:d,padding:u}),D=j?k?Y:q:k?X:G;w[R]>x[R]&&(D=se(D));var I=se(D),M=[];if(o&&M.push(A[T]<=0),s&&M.push(A[D]<=0,A[I]<=0),M.every((function(e){return e}))){S=P,C=!1;break}_.set(P,M)}if(C)for(var L=function(e){var t=b.find((function(t){var n=_.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return S=t,"break"},N=p?3:1;N>0;N--){if("break"===L(N))break}t.placement!==S&&(t.modifiersData[r]._skip=!0,t.placement=S,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function xe(e){return[G,Y,X,q].some((function(t){return e[t]>=0}))}var _e={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=me(t,{elementContext:"reference"}),s=me(t,{altBoundary:!0}),l=we(a,r),u=we(s,i,o),c=xe(l),f=xe(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}};var Oe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=Q.reduce((function(e,n){return e[n]=function(e,t,n){var r=O(e),i=[q,G].indexOf(r)>=0?-1:1,o="function"===typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[q,Y].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],l=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}};var Ce={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ye({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var Se={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,d=n.tether,h=void 0===d||d,p=n.tetherOffset,g=void 0===p?0:p,v=me(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),y=O(t.placement),m=ee(t.placement),b=!m,w=H(y),x="x"===w?"y":"x",_=t.modifiersData.popperOffsets,C=t.rects.reference,S=t.rects.popper,E="function"===typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,P="number"===typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(_){if(o){var D,I="y"===w?G:q,M="y"===w?X:Y,L="y"===w?"height":"width",N=_[w],F=N+v[I],B=N-v[M],W=h?-S[L]/2:0,V="start"===m?C[L]:S[L],K="start"===m?-S[L]:-C[L],$=t.elements.arrow,Q=h&&$?A($):{width:0,height:0},J=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=J[I],te=J[M],ne=U(0,C[L],Q[L]),re=b?C[L]/2-W-ne-Z-P.mainAxis:V-ne-Z-P.mainAxis,ie=b?-C[L]/2+W+ne+te+P.mainAxis:K+ne+te+P.mainAxis,oe=t.elements.arrow&&z(t.elements.arrow),ae=oe?"y"===w?oe.clientTop||0:oe.clientLeft||0:0,se=null!=(D=null==j?void 0:j[w])?D:0,le=N+ie-se,ue=U(h?k(F,N+re-se-ae):F,N,h?T(B,le):B);_[w]=ue,R[w]=ue-N}if(s){var ce,fe="x"===w?G:q,de="x"===w?X:Y,he=_[x],pe="y"===x?"height":"width",ge=he+v[fe],ve=he-v[de],ye=-1!==[G,q].indexOf(y),be=null!=(ce=null==j?void 0:j[x])?ce:0,we=ye?ge:he-C[pe]-S[pe]-be+P.altAxis,xe=ye?he+C[pe]+S[pe]-be-P.altAxis:ve,_e=h&&ye?function(e,t,n){var r=U(e,t,n);return r>n?n:r}(we,he,xe):U(h?we:ge,he,h?xe:ve);_[x]=_e,R[x]=_e-he}t.modifiersData[r]=R}},requiresIfExists:["offset"]};function Ee(e,t,n){void 0===n&&(n=!1);var r=E(t),i=E(t)&&function(e){var t=e.getBoundingClientRect(),n=j(t.width)/e.offsetWidth||1,r=j(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),o=N(t),a=R(e,i),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(("body"!==I(t)||de(o))&&(s=function(e){return e!==C(e)&&E(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:ce(e);var t}(t)),E(t)?((l=R(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=fe(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Pe(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=t.get(r);i&&e(i)}})),r.push(i)}(e)})),r}function Te(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}var ke={placement:"bottom",modifiers:[],strategy:"absolute"};function je(){for(var e=arguments.length,t=new Array(e),n=0;n *":s,h=e.focusFirstItemOnShow,v=e.children,w=Object(p.b)(o,i,a),x=w[0],_=w[1],O=st(),C=O[0],S=O[1],E=C.current,P=st(),T=P[0],k=P[1],j=T.current,R=Object(g.a)(x),A=Object(l.useRef)(null),D=Object(l.useRef)(!1),I=Object(l.useCallback)((function(e,t){_(e,t)}),[_]),M=Object(l.useMemo)((function(){return{toggle:I,drop:t,show:x,alignEnd:n,menuElement:E,toggleElement:j,setMenu:S,setToggle:k}}),[I,t,x,n,E,j,S,k]);E&&R&&!x&&(D.current=E.contains(document.activeElement));var L=Object(y.a)((function(){j&&j.focus&&j.focus()})),N=Object(y.a)((function(){var e=A.current,t=h;if(null==t&&(t=!(!C.current||!function(e,t){if(!r){var n=document.body,i=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;r=function(e,t){return i.call(e,t)}}return r(e,t)}(C.current,"[role=menu]"))&&"keyboard"),!1!==t&&("keyboard"!==t||/^key.+$/.test(e))){var n=Object(c.a)(C.current,d)[0];n&&n.focus&&n.focus()}}));Object(l.useEffect)((function(){x?N():D.current&&(D.current=!1,L())}),[x,D,L,N]),Object(l.useEffect)((function(){A.current=null}));var F=function(e,t){if(!C.current)return null;var n=Object(c.a)(C.current,d),r=n.indexOf(e)+t;return n[r=Math.max(0,Math.min(r,n.length))]};return m("keydown",(function(e){var t,n,r=e.key,i=e.target,o=null==(t=C.current)?void 0:t.contains(i),a=null==(n=T.current)?void 0:n.contains(i);if((!/input|textarea/i.test(i.tagName)||!(" "===r||"Escape"!==r&&o))&&(o||a)&&(C.current||"Tab"!==r))switch(A.current=e.type,r){case"ArrowUp":var s=F(i,-1);return s&&s.focus&&s.focus(),void e.preventDefault();case"ArrowDown":if(e.preventDefault(),x){var l=F(i,1);l&&l.focus&&l.focus()}else _(!0,e);return;case"Tab":Object(f.a)(document,"keyup",(function(t){var n;("Tab"!==t.key||t.target)&&null!=(n=C.current)&&n.contains(t.target)||_(!1,e)}),{once:!0});break;case"Escape":e.preventDefault(),e.stopPropagation(),_(!1,e)}})),u.a.createElement(b.Provider,{value:M},v)}lt.displayName="ReactOverlaysDropdown",lt.propTypes=at,lt.Menu=et,lt.Toggle=ot;var ut=lt,ct=n(11),ft=n(5),dt=n(43),ht=n(28),pt=["bsPrefix","className","children","eventKey","disabled","href","onClick","onSelect","active","as"],gt={as:ht.a,disabled:!1},vt=u.a.forwardRef((function(e,t){var n=e.bsPrefix,r=e.className,a=e.children,c=e.eventKey,f=e.disabled,d=e.href,h=e.onClick,p=e.onSelect,g=e.active,v=e.as,m=Object(o.a)(e,pt),b=Object(ft.a)(n,"dropdown-item"),w=Object(l.useContext)(ct.a),x=(Object(l.useContext)(dt.a)||{}).activeKey,_=Object(ct.b)(c,d),O=null==g&&null!=_?Object(ct.b)(x)===_:g,C=Object(y.a)((function(e){f||(h&&h(e),w&&w(_,e),p&&p(_,e))}));return u.a.createElement(v,Object(i.a)({},m,{ref:t,href:d,disabled:f,className:s()(r,b,O&&"active",f&&"disabled"),onClick:C}),a)}));vt.displayName="DropdownItem",vt.defaultProps=gt;var yt=vt,mt=n(29),bt=n(27);n(53);function wt(e,t){return e}var xt=n(46);function _t(e){var t=window.getComputedStyle(e);return{top:parseFloat(t.marginTop)||0,right:parseFloat(t.marginRight)||0,bottom:parseFloat(t.marginBottom)||0,left:parseFloat(t.marginLeft)||0}}var Ot=["bsPrefix","className","align","alignRight","rootCloseEvent","flip","show","renderOnMount","as","popperConfig"],Ct=h.a.oneOf(["left","right"]),St=(h.a.oneOfType([Ct,h.a.shape({sm:Ct}),h.a.shape({md:Ct}),h.a.shape({lg:Ct}),h.a.shape({xl:Ct})]),u.a.forwardRef((function(e,t){var n=e.bsPrefix,r=e.className,a=e.align,c=e.alignRight,f=e.rootCloseEvent,d=e.flip,h=e.show,p=e.renderOnMount,g=e.as,v=void 0===g?"div":g,y=e.popperConfig,m=Object(o.a)(e,Ot),b=Object(l.useContext)(bt.a),w=Object(ft.a)(n,"dropdown-menu"),x=function(){var e=Object(l.useRef)(null),t=Object(l.useRef)(null),n=Object(l.useRef)(null),r=Object(ft.a)(void 0,"popover"),i=Object(ft.a)(void 0,"dropdown-menu");return[Object(l.useCallback)((function(n){n&&(Object(xt.a)(n,r)||Object(xt.a)(n,i))&&(t.current=_t(n),n.style.margin="0",e.current=n)}),[r,i]),[Object(l.useMemo)((function(){return{name:"offset",options:{offset:function(e){var n=e.placement;if(!t.current)return[0,0];var r=t.current,i=r.top,o=r.left,a=r.bottom,s=r.right;switch(n.split("-")[0]){case"top":return[0,a];case"left":return[0,s];case"bottom":return[0,i];case"right":return[0,o];default:return[0,0]}}}}}),[t]),Object(l.useMemo)((function(){return{name:"arrow",options:{padding:function(){if(!n.current)return 0;var e=n.current,t=e.top,r=e.right,i=t||r;return{top:i,left:i,right:i,bottom:i}}}}}),[n]),Object(l.useMemo)((function(){return{name:"popoverArrowMargins",enabled:!0,phase:"main",fn:function(){},requiresIfExists:["arrow"],effect:function(t){var i=t.state;if(e.current&&i.elements.arrow&&Object(xt.a)(e.current,r)){if(i.modifiersData["arrow#persistent"]){var o=_t(i.elements.arrow),a=o.top,s=o.right,l=a||s;i.modifiersData["arrow#persistent"].padding={top:l,left:l,right:l,bottom:l}}else n.current=_t(i.elements.arrow);return i.elements.arrow.style.margin="0",function(){i.elements.arrow&&(i.elements.arrow.style.margin="")}}}}}),[r])]]}(),_=x[0],O=x[1],C=[];if(a)if("object"===typeof a){var S=Object.keys(a);if(S.length){var E=S[0],P=a[E];c="left"===P,C.push(w+"-"+E+"-"+P)}}else"right"===a&&(c=!0);var T=Qe({flip:d,rootCloseEvent:f,show:h,alignEnd:c,usePopper:!b&&0===C.length,popperConfig:Object(i.a)({},y,{modifiers:O.concat((null==y?void 0:y.modifiers)||[])})}),k=T[0],j=T[1],R=j.hasShown,A=j.popper,D=j.show,I=j.alignEnd,M=j.toggle;if(k.ref=Object(mt.a)(_,Object(mt.a)(wt(t),k.ref)),!R&&!p)return null;"string"!==typeof v&&(k.show=D,k.close=function(){return null==M?void 0:M(!1)},k.alignRight=I);var L=m.style;return null!=A&&A.placement&&(L=Object(i.a)({},m.style,k.style),m["x-placement"]=A.placement),u.a.createElement(v,Object(i.a)({},m,k,{style:L,className:s.a.apply(void 0,[r,w,D&&"show",I&&w+"-right"].concat(C))}))})));St.displayName="DropdownMenu",St.defaultProps={align:"left",alignRight:!1,flip:!0};var Et=St,Pt=(n(93),n(12)),Tt=["bsPrefix","split","className","childBsPrefix","as"],kt=u.a.forwardRef((function(e,t){var n=e.bsPrefix,r=e.split,a=e.className,l=e.childBsPrefix,c=e.as,f=void 0===c?Pt.a:c,d=Object(o.a)(e,Tt),h=Object(ft.a)(n,"dropdown-toggle");void 0!==l&&(d.bsPrefix=l);var p=nt()[0];return p.ref=Object(mt.a)(p.ref,wt(t)),u.a.createElement(f,Object(i.a)({className:s()(a,h,r&&h+"-split")},p,d))}));kt.displayName="DropdownToggle";var jt=kt,Rt=n(8),At=["bsPrefix","drop","show","className","alignRight","onSelect","onToggle","focusFirstItemOnShow","as","navbar"],Dt=Object(Rt.a)("dropdown-header",{defaultProps:{role:"heading"}}),It=Object(Rt.a)("dropdown-divider",{defaultProps:{role:"separator"}}),Mt=Object(Rt.a)("dropdown-item-text",{Component:"span"}),Lt=u.a.forwardRef((function(e,t){var n=Object(p.a)(e,{show:"onToggle"}),r=n.bsPrefix,a=n.drop,c=n.show,f=n.className,d=n.alignRight,h=n.onSelect,g=n.onToggle,v=n.focusFirstItemOnShow,m=n.as,b=void 0===m?"div":m,w=(n.navbar,Object(o.a)(n,At)),x=Object(l.useContext)(ct.a),_=Object(ft.a)(r,"dropdown"),O=Object(y.a)((function(e,t,n){void 0===n&&(n=t.type),t.currentTarget!==document||"keydown"===n&&"Escape"!==t.key||(n="rootClose"),g&&g(e,t,{source:n})})),C=Object(y.a)((function(e,t){x&&x(e,t),h&&h(e,t),O(!1,t,"select")}));return u.a.createElement(ct.a.Provider,{value:C},u.a.createElement(ut,{drop:a,show:c,alignEnd:d,onToggle:O,focusFirstItemOnShow:v,itemSelector:"."+_+"-item:not(.disabled):not(:disabled)"},u.a.createElement(b,Object(i.a)({},w,{ref:t,className:s()(f,c&&"show",(!a||"down"===a)&&_,"up"===a&&"dropup","right"===a&&"dropright","left"===a&&"dropleft")}))))}));Lt.displayName="Dropdown",Lt.defaultProps={navbar:!1},Lt.Divider=It,Lt.Header=Dt,Lt.Item=yt,Lt.ItemText=Mt,Lt.Menu=Et,Lt.Toggle=jt;t.a=Lt},function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}}(),e.exports=n(114)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseStartTime=function(e){return d(e,l)},t.parseEndTime=function(e){return d(e,u)},t.randomString=function(){return Math.random().toString(36).substr(2,5)},t.queryString=function(e){return Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&")},t.getSDK=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){return!0},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:r.default,a=h(t);if(a&&i(a))return Promise.resolve(a);return new Promise((function(r,i){if(p[e])p[e].push({resolve:r,reject:i});else{p[e]=[{resolve:r,reject:i}];var a=function(t){p[e].forEach((function(e){return e.resolve(t)}))};if(n){var s=window[n];window[n]=function(){s&&s(),a(h(t))}}o(e,(function(r){r?(p[e].forEach((function(e){return e.reject(r)})),p[e]=null):n||a(h(t))}))}}))},t.getConfig=function(e,t){return(0,i.default)(t.config,e.config)},t.omit=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?r-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:document.createElement("video"),t=!1===/iPhone|iPod/.test(navigator.userAgent);return e.webkitSupportsPresentationMode&&"function"===typeof e.webkitSetPresentationMode&&t};var r=o(n(121)),i=o(n(90));function o(e){return e&&e.__esModule?e:{default:e}}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(l){i=!0,o=l}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||function(e,t){if(!e)return;if("string"===typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:d(e)?2:h(e)?3:0}function l(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return 2===s(e)?e.get(t):e[t]}function c(e,t,n){var r=s(e);2===r?e.set(t,n):3===r?(e.delete(t),e.add(n)):e[t]=n}function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function d(e){return U&&e instanceof Map}function h(e){return W&&e instanceof Set}function p(e){return e.o||e.t}function g(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=$(e);delete t[Y];for(var n=K(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=y),Object.freeze(e),t&&a(e,(function(e,t){return v(t,!0)}),!0)),e}function y(){r(2)}function m(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function b(e){var t=Q[e];return t||r(18,e),t}function w(e,t){Q[e]||(Q[e]=t)}function x(){return z}function _(e,t){t&&(b("Patches"),e.u=[],e.s=[],e.v=t)}function O(e){C(e),e.p.forEach(E),e.p=null}function C(e){e===z&&(z=e.l)}function S(e){return z={p:[],l:z,h:e,m:!0,_:0}}function E(e){var t=e[Y];0===t.i||1===t.i?t.j():t.O=!0}function P(e,t){t._=t.p.length;var n=t.p[0],i=void 0!==e&&e!==n;return t.h.g||b("ES5").S(t,e,i),i?(n[Y].P&&(O(t),r(4)),o(e)&&(e=T(t,e),t.l||j(t,e)),t.u&&b("Patches").M(n[Y].t,e,t.u,t.s)):e=T(t,n,[]),O(t),t.u&&t.v(t.u,t.s),e!==G?e:void 0}function T(e,t,n){if(m(t))return t;var r=t[Y];if(!r)return a(t,(function(i,o){return k(e,r,t,i,o,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return j(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=4===r.i||5===r.i?r.o=g(r.k):r.o;a(3===r.i?new Set(i):i,(function(t,o){return k(e,r,i,t,o,n)})),j(e,i,!1),n&&e.u&&b("Patches").R(r,n,e.u,e.s)}return r.o}function k(e,t,n,r,a,s){if(i(a)){var u=T(e,a,s&&t&&3!==t.i&&!l(t.D,r)?s.concat(r):void 0);if(c(n,r,u),!i(u))return;e.m=!1}if(o(a)&&!m(a)){if(!e.h.F&&e._<1)return;T(e,a),t&&t.A.l||j(e,a)}}function j(e,t,n){void 0===n&&(n=!1),e.h.F&&e.m&&v(t,n)}function R(e,t){var n=e[Y];return(n?p(n):e)[t]}function A(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function D(e){e.P||(e.P=!0,e.l&&D(e.l))}function I(e){e.o||(e.o=g(e.t))}function M(e,t,n){var r=d(t)?b("MapSet").N(t,n):h(t)?b("MapSet").T(t,n):e.g?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:x(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,o=J;n&&(i=[r],o=Z);var a=Proxy.revocable(i,o),s=a.revoke,l=a.proxy;return r.k=l,r.j=s,l}(t,n):b("ES5").J(t,n);return(n?n.A:x()).p.push(r),r}function L(e){return i(e)||r(22,e),function e(t){if(!o(t))return t;var n,r=t[Y],i=s(t);if(r){if(!r.P&&(r.i<4||!b("ES5").K(r)))return r.t;r.I=!0,n=N(t,i),r.I=!1}else n=N(t,i);return a(n,(function(t,i){r&&u(r.t,t)===i||c(n,t,e(i))})),3===i?new Set(n):n}(e)}function N(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return g(e)}function F(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Y];return J.get(t,e)},set:function(t){var n=this[Y];J.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][Y];if(!i.P)switch(i.i){case 5:r(i)&&D(i);break;case 4:n(i)&&D(i)}}}function n(e){for(var t=e.t,n=e.k,r=K(n),i=r.length-1;i>=0;i--){var o=r[i];if(o!==Y){var a=t[o];if(void 0===a&&!l(t,o))return!0;var s=n[o],u=s&&s[Y];if(u?u.t!==a:!f(s,a))return!0}}var c=!!t[Y];return r.length!==K(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r1?r-1:0),o=1;o1?r-1:0),o=1;o=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=b("Patches").$;return i(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}()),te=ee.produce,ne=(ee.produceWithPatches.bind(ee),ee.setAutoFreeze.bind(ee),ee.setUseProxies.bind(ee),ee.applyPatches.bind(ee),ee.createDraft.bind(ee),ee.finishDraft.bind(ee),te);function re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oe(e){for(var t=1;t1?t-1:0),i=1;i=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nse?"next":"prev"),y&&oe(!0),le(_||0)),Object(a.useEffect)((function(){$.current&&($.current=null)}));var ue,ce=0;Object(O.a)(Y,(function(e,t){++ce,t===_&&(ue=e.props.interval)}));var fe=Object(u.a)(ue),de=Object(a.useCallback)((function(e){if(!ie){var t=se-1;if(t<0){if(!N)return;t=ce-1}$.current="prev",T&&T(t,e)}}),[ie,se,T,N,ce]),he=Object(o.a)((function(e){if(!ie){var t=se+1;if(t>=ce){if(!N)return;t=0}$.current="next",T&&T(t,e)}})),pe=Object(a.useRef)();Object(a.useImperativeHandle)(t,(function(){return{element:pe.current,prev:de,next:he}}));var ge=Object(o.a)((function(){!document.hidden&&function(e){if(!e||!e.style||!e.parentNode||!e.parentNode.style)return!1;var t=getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"none"!==getComputedStyle(e.parentNode).display}(pe.current)&&he()})),ve="next"===J?"left":"right";l((function(){y||(k&&k(se,ve),j&&j(se,ve))}),[se]);var ye=K+"-item-"+J,me=K+"-item-"+ve,be=Object(a.useCallback)((function(e){Object(E.a)(e),k&&k(se,ve)}),[k,se,ve]),we=Object(a.useCallback)((function(){oe(!1),j&&j(se,ve)}),[j,se,ve]),xe=Object(a.useCallback)((function(e){if(A&&!/input|textarea/i.test(e.target.tagName))switch(e.key){case"ArrowLeft":return e.preventDefault(),void de(e);case"ArrowRight":return e.preventDefault(),void he(e)}D&&D(e)}),[A,D,de,he]),_e=Object(a.useCallback)((function(e){"hover"===I&&ne(!0),M&&M(e)}),[I,M]),Oe=Object(a.useCallback)((function(e){ne(!1),L&&L(e)}),[L]),Ce=Object(a.useRef)(0),Se=Object(a.useRef)(0),Ee=Object(c.a)(),Pe=Object(a.useCallback)((function(e){Ce.current=e.touches[0].clientX,Se.current=0,"hover"===I&&ne(!0),B&&B(e)}),[I,B]),Te=Object(a.useCallback)((function(e){e.touches&&e.touches.length>1?Se.current=0:Se.current=e.touches[0].clientX-Ce.current,z&&z(e)}),[z]),ke=Object(a.useCallback)((function(e){if(F){var t=Se.current;Math.abs(t)>40&&(t>0?de(e):he(e))}"hover"===I&&Ee.set((function(){ne(!1)}),R||void 0),H&&H(e)}),[F,I,de,he,Ee,R,H]),je=null!=R&&!te&&!ie,Re=Object(a.useRef)();Object(a.useEffect)((function(){var e,t;if(je)return Re.current=window.setInterval(document.visibilityState?ge:he,null!=(e=null!=(t=fe.current)?t:R)?e:void 0),function(){null!==Re.current&&clearInterval(Re.current)}}),[je,he,fe,R,ge]);var Ae=Object(a.useMemo)((function(){return x&&Array.from({length:ce},(function(e,t){return function(e){T&&T(t,e)}}))}),[x,ce,T]);return s.a.createElement(p,Object(r.a)({ref:pe},q,{onKeyDown:xe,onMouseOver:_e,onMouseOut:Oe,onTouchStart:Pe,onTouchMove:Te,onTouchEnd:ke,className:d()(X,K,y&&"slide",m&&K+"-fade")}),x&&s.a.createElement("ol",{className:K+"-indicators"},Object(O.b)(Y,(function(e,t){return s.a.createElement("li",{key:t,className:t===se?"active":void 0,onClick:Ae?Ae[t]:void 0})}))),s.a.createElement("div",{className:K+"-inner"},Object(O.b)(Y,(function(e,t){var n=t===se;return y?s.a.createElement(h.e,{in:n,onEnter:n?be:void 0,onEntered:n?we:void 0,addEndListener:S.a},(function(t){return s.a.cloneElement(e,{className:d()(e.props.className,n&&"entered"!==t&&ye,("entered"===t||"exiting"===t)&&"active",("entering"===t||"exiting"===t)&&me)})})):s.a.cloneElement(e,{className:d()(e.props.className,n&&"active")})}))),w&&s.a.createElement(s.a.Fragment,null,(N||0!==_)&&s.a.createElement(C.a,{className:K+"-control-prev",onClick:de},U,W&&s.a.createElement("span",{className:"sr-only"},W)),(N||_!==ce-1)&&s.a.createElement(C.a,{className:K+"-control-next",onClick:he},V,G&&s.a.createElement("span",{className:"sr-only"},G))))}var R=s.a.forwardRef(j);R.displayName="Carousel",R.propTypes=T,R.defaultProps=k,R.Caption=m,R.Item=_;t.a=R},function(e,t,n){(function(e){var r,i=i||{version:"4.6.0"};if(t.fabric=i,"undefined"!==typeof document&&"undefined"!==typeof window)document instanceof("undefined"!==typeof HTMLDocument?HTMLDocument:Document)?i.document=document:i.document=document.implementation.createHTMLDocument(""),i.window=window;else{var o=new(n(144).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window;i.document=o.document,i.jsdomImplForWrapper=n(145).implForWrapper,i.nodeCanvas=n(146).Canvas,i.window=o,DOMParser=i.window.DOMParser}function a(e,t){var n=e.canvas,r=t.targetCanvas,i=r.getContext("2d");i.translate(0,r.height),i.scale(1,-1);var o=n.height-r.height;i.drawImage(n,0,o,r.width,r.height,0,0,r.width,r.height)}function s(e,t){var n=t.targetCanvas.getContext("2d"),r=t.destinationWidth,i=t.destinationHeight,o=r*i*4,a=new Uint8Array(this.imageBuffer,0,o),s=new Uint8ClampedArray(this.imageBuffer,0,o);e.readPixels(0,0,r,i,e.RGBA,e.UNSIGNED_BYTE,a);var l=new ImageData(s,r,i);n.putImageData(l,0,0)}i.isTouchSupported="ontouchstart"in i.window||"ontouchstart"in i.document||i.window&&i.window.navigator&&i.window.navigator.maxTouchPoints>0,i.isLikelyNode="undefined"!==typeof e&&"undefined"===typeof window,i.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],i.DPI=96,i.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",i.commaWsp="(?:\\s+,?\\s*|,\\s*)",i.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,i.reNonWord=/[ \n\.,;!\?\-]/,i.fontPaths={},i.iMatrix=[1,0,0,1,0,0],i.svgNS="http://www.w3.org/2000/svg",i.perfLimitSizeTotal=2097152,i.maxCacheSideLimit=4096,i.minCacheSideLimit=256,i.charWidthsCache={},i.textureSize=2048,i.disableStyleCopyPaste=!1,i.enableGLFiltering=!0,i.devicePixelRatio=i.window.devicePixelRatio||i.window.webkitDevicePixelRatio||i.window.mozDevicePixelRatio||1,i.browserShadowBlurConstant=1,i.arcToSegmentsCache={},i.boundsOfCurveCache={},i.cachesBoundsOfCurve=!0,i.forceGLPutImageData=!1,i.initFilterBackend=function(){return i.enableGLFiltering&&i.isWebglSupported&&i.isWebglSupported(i.textureSize)?(console.log("max texture size: "+i.maxTextureSize),new i.WebglFilterBackend({tileSize:i.textureSize})):i.Canvas2dFilterBackend?new i.Canvas2dFilterBackend:void 0},"undefined"!==typeof document&&"undefined"!==typeof window&&(window.fabric=i),function(){function e(e,t){if(this.__eventListeners[e]){var n=this.__eventListeners[e];t?n[n.indexOf(t)]=!1:i.util.array.fill(n,!1)}}function t(e,t){var n=function(){t.apply(this,arguments),this.off(e,n)}.bind(this);this.on(e,n)}i.Observable={fire:function(e,t){if(!this.__eventListeners)return this;var n=this.__eventListeners[e];if(!n)return this;for(var r=0,i=n.length;r-1||!!t&&this._objects.some((function(t){return"function"===typeof t.contains&&t.contains(e,!0)}))},complexity:function(){return this._objects.reduce((function(e,t){return e+=t.complexity?t.complexity():0}),0)}},i.CommonMethods={_setOptions:function(e){for(var t in e)this.set(t,e[t])},_initGradient:function(e,t){!e||!e.colorStops||e instanceof i.Gradient||this.set(t,new i.Gradient(e))},_initPattern:function(e,t,n){!e||!e.source||e instanceof i.Pattern?n&&n():this.set(t,new i.Pattern(e,n))},_setObject:function(e){for(var t in e)this._set(t,e[t])},set:function(e,t){return"object"===typeof e?this._setObject(e):this._set(e,t),this},_set:function(e,t){this[e]=t},toggle:function(e){var t=this.get(e);return"boolean"===typeof t&&this.set(e,!t),this},get:function(e){return this[e]}},function(e){var t=Math.sqrt,n=Math.atan2,r=Math.pow,o=Math.PI/180,a=Math.PI/2;i.util={cos:function(e){if(0===e)return 1;switch(e<0&&(e=-e),e/a){case 1:case 3:return 0;case 2:return-1}return Math.cos(e)},sin:function(e){if(0===e)return 0;var t=1;switch(e<0&&(t=-1),e/a){case 1:return t;case 2:return 0;case 3:return-t}return Math.sin(e)},removeFromArray:function(e,t){var n=e.indexOf(t);return-1!==n&&e.splice(n,1),e},getRandomInt:function(e,t){return Math.floor(Math.random()*(t-e+1))+e},degreesToRadians:function(e){return e*o},radiansToDegrees:function(e){return e/o},rotatePoint:function(e,t,n){var r=new i.Point(e.x-t.x,e.y-t.y),o=i.util.rotateVector(r,n);return new i.Point(o.x,o.y).addEquals(t)},rotateVector:function(e,t){var n=i.util.sin(t),r=i.util.cos(t);return{x:e.x*r-e.y*n,y:e.x*n+e.y*r}},transformPoint:function(e,t,n){return n?new i.Point(t[0]*e.x+t[2]*e.y,t[1]*e.x+t[3]*e.y):new i.Point(t[0]*e.x+t[2]*e.y+t[4],t[1]*e.x+t[3]*e.y+t[5])},makeBoundingBoxFromPoints:function(e,t){if(t)for(var n=0;nr;)(r+=s[h++%d])>c&&(r=c),e[p?"lineTo":"moveTo"](r,0),p=!p;e.restore()},createCanvasElement:function(){return i.document.createElement("canvas")},copyCanvasElement:function(e){var t=i.util.createCanvasElement();return t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t},toDataURL:function(e,t,n){return e.toDataURL("image/"+t,n)},createImage:function(){return i.document.createElement("img")},multiplyTransformMatrices:function(e,t,n){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],n?0:e[0]*t[4]+e[2]*t[5]+e[4],n?0:e[1]*t[4]+e[3]*t[5]+e[5]]},qrDecompose:function(e){var i=n(e[1],e[0]),a=r(e[0],2)+r(e[1],2),s=t(a),l=(e[0]*e[3]-e[2]*e[1])/s,u=n(e[0]*e[2]+e[1]*e[3],a);return{angle:i/o,scaleX:s,scaleY:l,skewX:u/o,skewY:0,translateX:e[4],translateY:e[5]}},calcRotateMatrix:function(e){if(!e.angle)return i.iMatrix.concat();var t=i.util.degreesToRadians(e.angle),n=i.util.cos(t),r=i.util.sin(t);return[n,r,-r,n,0,0]},calcDimensionsMatrix:function(e){var t="undefined"===typeof e.scaleX?1:e.scaleX,n="undefined"===typeof e.scaleY?1:e.scaleY,r=[e.flipX?-t:t,0,0,e.flipY?-n:n,0,0],o=i.util.multiplyTransformMatrices,a=i.util.degreesToRadians;return e.skewX&&(r=o(r,[1,0,Math.tan(a(e.skewX)),1],!0)),e.skewY&&(r=o(r,[1,Math.tan(a(e.skewY)),0,1],!0)),r},composeMatrix:function(e){var t=[1,0,0,1,e.translateX||0,e.translateY||0],n=i.util.multiplyTransformMatrices;return e.angle&&(t=n(t,i.util.calcRotateMatrix(e))),(1!==e.scaleX||1!==e.scaleY||e.skewX||e.skewY||e.flipX||e.flipY)&&(t=n(t,i.util.calcDimensionsMatrix(e))),t},resetObjectTransform:function(e){e.scaleX=1,e.scaleY=1,e.skewX=0,e.skewY=0,e.flipX=!1,e.flipY=!1,e.rotate(0)},saveObjectTransform:function(e){return{scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,angle:e.angle,left:e.left,flipX:e.flipX,flipY:e.flipY,top:e.top}},isTransparent:function(e,t,n,r){r>0&&(t>r?t-=r:t=0,n>r?n-=r:n=0);var i,o=!0,a=e.getImageData(t,n,2*r||1,2*r||1),s=a.data.length;for(i=3;i0?j-=2*c:1===l&&j<0&&(j+=2*c);for(var R=Math.ceil(Math.abs(j/c*2)),A=[],D=j/R,I=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),M=k+D,L=0;L=i?o-i:2*Math.PI-(i-o)}function s(t,n,r,o,a,s,l,u){var c;if(i.cachesBoundsOfCurve&&(c=e.call(arguments),i.boundsOfCurveCache[c]))return i.boundsOfCurveCache[c];var f,d,h,p,g,v,y,m,b=Math.sqrt,w=Math.min,x=Math.max,_=Math.abs,O=[],C=[[],[]];d=6*t-12*r+6*a,f=-3*t+9*r-9*a+3*l,h=3*r-3*t;for(var S=0;S<2;++S)if(S>0&&(d=6*n-12*o+6*s,f=-3*n+9*o-9*s+3*u,h=3*o-3*n),_(f)<1e-12){if(_(d)<1e-12)continue;0<(p=-h/d)&&p<1&&O.push(p)}else(y=d*d-4*h*f)<0||(0<(g=(-d+(m=b(y)))/(2*f))&&g<1&&O.push(g),0<(v=(-d-m)/(2*f))&&v<1&&O.push(v));for(var E,P,T,k=O.length,j=k;k--;)E=(T=1-(p=O[k]))*T*T*t+3*T*T*p*r+3*T*p*p*a+p*p*p*l,C[0][k]=E,P=T*T*T*n+3*T*T*p*o+3*T*p*p*s+p*p*p*u,C[1][k]=P;C[0][j]=t,C[1][j]=n,C[0][j+1]=l,C[1][j+1]=u;var R=[{x:w.apply(null,C[0]),y:w.apply(null,C[1])},{x:x.apply(null,C[0]),y:x.apply(null,C[1])}];return i.cachesBoundsOfCurve&&(i.boundsOfCurveCache[c]=R),R}function l(e,t,n){for(var r=n[1],i=n[2],a=n[3],s=n[4],l=n[5],u=o(n[6]-e,n[7]-t,r,i,s,l,a),c=0,f=u.length;c1e-4;)n=s(o),i=o,(r=u(l.x,l.y,n.x,n.y))+a>t?o-=c/=2:(l=n,o+=c,a+=r);return n.angle=f(i),n}function v(e){for(var t,n,r,i,o=0,a=e.length,s=0,l=0,g=0,v=0,y=[],m=0;mO)for(var S=1,E=v.length;S2;for(t=t||0,c&&(l=e[2].xe[n-2].x?1:o.x===e[n-2].x?0:-1,u=o.y>e[n-2].y?1:o.y===e[n-2].y?0:-1),r.push(["L",o.x+l*t,o.y+u*t]),r},i.util.getPathSegmentsInfo=v,i.util.getBoundsOfCurve=s,i.util.getPointOnPath=function(e,t,n){n||(n=v(e));for(var r=0;t-n[r].length>0&&r=t}))}}}(),function(){function e(t,n,r){if(r)if(!i.isLikelyNode&&n instanceof Element)t=n;else if(n instanceof Array){t=[];for(var o=0,a=n.length;o57343)return e.charAt(t);if(55296<=n&&n<=56319){if(e.length<=t+1)throw"High surrogate without following low surrogate";var r=e.charCodeAt(t+1);if(56320>r||r>57343)throw"High surrogate without following low surrogate";return e.charAt(t)+e.charAt(t+1)}if(0===t)throw"Low surrogate without preceding high surrogate";var i=e.charCodeAt(t-1);if(55296>i||i>56319)throw"Low surrogate without preceding high surrogate";return!1}i.util.string={camelize:function(e){return e.replace(/-+(.)?/g,(function(e,t){return t?t.toUpperCase():""}))},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},escapeXml:function(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")},graphemeSplit:function(t){var n,r=0,i=[];for(r=0;r-1?e.prototype[i]=function(e){return function(){var n=this.constructor.superclass;this.constructor.superclass=r;var i=t[e].apply(this,arguments);if(this.constructor.superclass=n,"initialize"!==e)return i}}(i):e.prototype[i]=t[i],n&&(t.toString!==Object.prototype.toString&&(e.prototype.toString=t.toString),t.valueOf!==Object.prototype.valueOf&&(e.prototype.valueOf=t.valueOf))};function o(){}function a(t){for(var n=null,r=this;r.constructor.superclass;){var i=r.constructor.superclass.prototype[t];if(r[t]!==i){n=i;break}r=r.constructor.superclass.prototype}return n?arguments.length>1?n.apply(this,e.call(arguments,1)):n.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}i.util.createClass=function(){var n=null,i=e.call(arguments,0);function s(){this.initialize.apply(this,arguments)}"function"===typeof i[0]&&(n=i.shift()),s.superclass=n,s.subclasses=[],n&&(o.prototype=n.prototype,s.prototype=new o,n.subclasses.push(s));for(var l=0,u=i.length;l-1||"touch"===e.pointerType}}(),function(){var e=i.document.createElement("div"),t="string"===typeof e.style.opacity,n="string"===typeof e.style.filter,r=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(e){return e};t?o=function(e,t){return e.style.opacity=t,e}:n&&(o=function(e,t){var n=e.style;return e.currentStyle&&!e.currentStyle.hasLayout&&(n.zoom=1),r.test(n.filter)?(t=t>=.9999?"":"alpha(opacity="+100*t+")",n.filter=n.filter.replace(r,t)):n.filter+=" alpha(opacity="+100*t+")",e}),i.util.setStyle=function(e,t){var n=e.style;if(!n)return e;if("string"===typeof t)return e.style.cssText+=";"+t,t.indexOf("opacity")>-1?o(e,t.match(/opacity:\s*(\d?\.?\d*)/)[1]):e;for(var r in t){if("opacity"===r)o(e,t[r]);else n["float"===r||"cssFloat"===r?"undefined"===typeof n.styleFloat?"cssFloat":"styleFloat":r]=t[r]}return e}}(),function(){var e=Array.prototype.slice;var t,n,r=function(t){return e.call(t,0)};try{t=r(i.document.childNodes)instanceof Array}catch(s){}function o(e,t){var n=i.document.createElement(e);for(var r in t)"class"===r?n.className=t[r]:"for"===r?n.htmlFor=t[r]:n.setAttribute(r,t[r]);return n}function a(e){for(var t=0,n=0,r=i.document.documentElement,o=i.document.body||{scrollLeft:0,scrollTop:0};e&&(e.parentNode||e.host)&&((e=e.parentNode||e.host)===i.document?(t=o.scrollLeft||r.scrollLeft||0,n=o.scrollTop||r.scrollTop||0):(t+=e.scrollLeft||0,n+=e.scrollTop||0),1!==e.nodeType||"fixed"!==e.style.position););return{left:t,top:n}}t||(r=function(e){for(var t=new Array(e.length),n=e.length;n--;)t[n]=e[n];return t}),n=i.document.defaultView&&i.document.defaultView.getComputedStyle?function(e,t){var n=i.document.defaultView.getComputedStyle(e,null);return n?n[t]:void 0}:function(e,t){var n=e.style[t];return!n&&e.currentStyle&&(n=e.currentStyle[t]),n},function(){var e=i.document.documentElement.style,t="userSelect"in e?"userSelect":"MozUserSelect"in e?"MozUserSelect":"WebkitUserSelect"in e?"WebkitUserSelect":"KhtmlUserSelect"in e?"KhtmlUserSelect":"";i.util.makeElementUnselectable=function(e){return"undefined"!==typeof e.onselectstart&&(e.onselectstart=i.util.falseFunction),t?e.style[t]="none":"string"===typeof e.unselectable&&(e.unselectable="on"),e},i.util.makeElementSelectable=function(e){return"undefined"!==typeof e.onselectstart&&(e.onselectstart=null),t?e.style[t]="":"string"===typeof e.unselectable&&(e.unselectable=""),e}}(),i.util.setImageSmoothing=function(e,t){e.imageSmoothingEnabled=e.imageSmoothingEnabled||e.webkitImageSmoothingEnabled||e.mozImageSmoothingEnabled||e.msImageSmoothingEnabled||e.oImageSmoothingEnabled,e.imageSmoothingEnabled=t},i.util.getById=function(e){return"string"===typeof e?i.document.getElementById(e):e},i.util.toArray=r,i.util.addClass=function(e,t){e&&-1===(" "+e.className+" ").indexOf(" "+t+" ")&&(e.className+=(e.className?" ":"")+t)},i.util.makeElement=o,i.util.wrapElement=function(e,t,n){return"string"===typeof t&&(t=o(t,n)),e.parentNode&&e.parentNode.replaceChild(t,e),t.appendChild(e),t},i.util.getScrollLeftTop=a,i.util.getElementOffset=function(e){var t,r,i=e&&e.ownerDocument,o={left:0,top:0},s={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!i)return s;for(var u in l)s[l[u]]+=parseInt(n(e,u),10)||0;return t=i.documentElement,"undefined"!==typeof e.getBoundingClientRect&&(o=e.getBoundingClientRect()),r=a(e),{left:o.left+r.left-(t.clientLeft||0)+s.left,top:o.top+r.top-(t.clientTop||0)+s.top}},i.util.getNodeCanvas=function(e){var t=i.jsdomImplForWrapper(e);return t._canvas||t._image},i.util.cleanUpJsdomNode=function(e){if(i.isLikelyNode){var t=i.jsdomImplForWrapper(e);t&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)}}}(),function(){function e(){}i.util.request=function(t,n){n||(n={});var r=n.method?n.method.toUpperCase():"GET",o=n.onComplete||function(){},a=new i.window.XMLHttpRequest,s=n.body||n.parameters;return a.onreadystatechange=function(){4===a.readyState&&(o(a),a.onreadystatechange=e)},"GET"===r&&(s=null,"string"===typeof n.parameters&&(t=function(e,t){return e+(/\?/.test(e)?"&":"?")+t}(t,n.parameters))),a.open(r,t,!0),"POST"!==r&&"PUT"!==r||a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.send(s),a}}(),i.log=console.log,i.warn=console.warn,function(){function e(){return!1}function t(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}var n=i.window.requestAnimationFrame||i.window.webkitRequestAnimationFrame||i.window.mozRequestAnimationFrame||i.window.oRequestAnimationFrame||i.window.msRequestAnimationFrame||function(e){return i.window.setTimeout(e,1e3/60)},r=i.window.cancelAnimationFrame||i.window.clearTimeout;function o(){return n.apply(i.window,arguments)}i.util.animate=function(n){var r=!1;return o((function(i){n||(n={});var a,s=i||+new Date,l=n.duration||500,u=s+l,c=n.onChange||e,f=n.abort||e,d=n.onComplete||e,h=n.easing||t,p="startValue"in n?n.startValue:0,g="endValue"in n?n.endValue:100,v=n.byValue||g-p;n.onStart&&n.onStart(),function e(t){var n=(a=t||+new Date)>u?l:a-s,i=n/l,y=h(n,p,v,l),m=Math.abs((y-p)/v);if(!r){if(!f(y,m,i))return a>u?(c(g,1,1),void d(g,1,1)):(c(y,m,i),void o(e));d(g,1,1)}}(s)})),function(){r=!0}},i.util.requestAnimFrame=o,i.util.cancelAnimFrame=function(){return r.apply(i.window,arguments)}}(),function(){function e(e,t,n){var r="rgba("+parseInt(e[0]+n*(t[0]-e[0]),10)+","+parseInt(e[1]+n*(t[1]-e[1]),10)+","+parseInt(e[2]+n*(t[2]-e[2]),10);return r+=","+(e&&t?parseFloat(e[3]+n*(t[3]-e[3])):1),r+=")"}i.util.animateColor=function(t,n,r,o){var a=new i.Color(t).getSource(),s=new i.Color(n).getSource(),l=o.onComplete,u=o.onChange;return o=o||{},i.util.animate(i.util.object.extend(o,{duration:r||500,startValue:a,endValue:s,byValue:s,easing:function(t,n,r,i){return e(n,r,o.colorEasing?o.colorEasing(t,i):1-Math.cos(t/i*(Math.PI/2)))},onComplete:function(t,n,r){if(l)return l(e(s,s,0),n,r)},onChange:function(t,n,r){if(u){if(Array.isArray(t))return u(e(t,t,0),n,r);u(t,n,r)}}}))}}(),function(){function e(e,t,n,r){return e-1&&c>-1&&c-1)&&(n="stroke")}else{if("href"===e||"xlink:href"===e||"font"===e)return n;if("imageSmoothing"===e)return"optimizeQuality"===n;s=l?n.map(o):o(n,i)}}else n="";return!l&&isNaN(s)?n:s}function f(e){return new RegExp("^("+e.join("|")+")\\b","i")}function d(e,t){var n,r,i,o,a=[];for(i=0,o=t.length;i1;)l.shift(),u=t.util.multiplyTransformMatrices(u,l[0]);return u}}();var v=new RegExp("^\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*,?\\s*("+t.reNum+"+)\\s*$");function y(e){if(!t.svgViewBoxElementsRegEx.test(e.nodeName))return{};var n,r,i,a,s,l,u=e.getAttribute("viewBox"),c=1,f=1,d=e.getAttribute("width"),h=e.getAttribute("height"),p=e.getAttribute("x")||0,g=e.getAttribute("y")||0,y=e.getAttribute("preserveAspectRatio")||"",m=!u||!(u=u.match(v)),b=!d||!h||"100%"===d||"100%"===h,w=m&&b,x={},_="",O=0,C=0;if(x.width=0,x.height=0,x.toBeParsed=w,m&&(p||g)&&e.parentNode&&"#document"!==e.parentNode.nodeName&&(_=" translate("+o(p)+" "+o(g)+") ",s=(e.getAttribute("transform")||"")+_,e.setAttribute("transform",s),e.removeAttribute("x"),e.removeAttribute("y")),w)return x;if(m)return x.width=o(d),x.height=o(h),x;if(n=-parseFloat(u[1]),r=-parseFloat(u[2]),i=parseFloat(u[3]),a=parseFloat(u[4]),x.minX=n,x.minY=r,x.viewBoxWidth=i,x.viewBoxHeight=a,b?(x.width=i,x.height=a):(x.width=o(d),x.height=o(h),c=x.width/i,f=x.height/a),"none"!==(y=t.util.parsePreserveAspectRatioAttribute(y)).alignX&&("meet"===y.meetOrSlice&&(f=c=c>f?f:c),"slice"===y.meetOrSlice&&(f=c=c>f?c:f),O=x.width-i*c,C=x.height-a*c,"Mid"===y.alignX&&(O/=2),"Mid"===y.alignY&&(C/=2),"Min"===y.alignX&&(O=0),"Min"===y.alignY&&(C=0)),1===c&&1===f&&0===n&&0===r&&0===p&&0===g)return x;if((p||g)&&"#document"!==e.parentNode.nodeName&&(_=" translate("+o(p)+" "+o(g)+") "),s=_+" matrix("+c+" 0 0 "+f+" "+(n*c+O)+" "+(r*f+C)+") ","svg"===e.nodeName){for(l=e.ownerDocument.createElementNS(t.svgNS,"g");e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}else(l=e).removeAttribute("x"),l.removeAttribute("y"),s=l.getAttribute("transform")+s;return l.setAttribute("transform",s),x}function m(e,t){var n=g(e,t.getAttribute("xlink:href").substr(1));if(n&&n.getAttribute("xlink:href")&&m(e,n),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach((function(e){n&&!t.hasAttribute(e)&&n.hasAttribute(e)&&t.setAttribute(e,n.getAttribute(e))})),!t.children.length)for(var r=n.cloneNode(!0);r.firstChild;)t.appendChild(r.firstChild);t.removeAttribute("xlink:href")}t.parseSVGDocument=function(e,n,i,o){if(e){!function(e){for(var n=d(e,["use","svg:use"]),r=0;n.length&&re.x&&this.y>e.y},gte:function(e){return this.x>=e.x&&this.y>=e.y},lerp:function(e,t){return"undefined"===typeof t&&(t=.5),t=Math.max(Math.min(1,t),0),new n(this.x+(e.x-this.x)*t,this.y+(e.y-this.y)*t)},distanceFrom:function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},midPointFrom:function(e){return this.lerp(e)},min:function(e){return new n(Math.min(this.x,e.x),Math.min(this.y,e.y))},max:function(e){return new n(Math.max(this.x,e.x),Math.max(this.y,e.y))},toString:function(){return this.x+","+this.y},setXY:function(e,t){return this.x=e,this.y=t,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setFromPoint:function(e){return this.x=e.x,this.y=e.y,this},swap:function(e){var t=this.x,n=this.y;this.x=e.x,this.y=e.y,e.x=t,e.y=n},clone:function(){return new n(this.x,this.y)}})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function n(e){this.status=e,this.points=[]}t.Intersection?t.warn("fabric.Intersection is already defined"):(t.Intersection=n,t.Intersection.prototype={constructor:n,appendPoint:function(e){return this.points.push(e),this},appendPoints:function(e){return this.points=this.points.concat(e),this}},t.Intersection.intersectLineLine=function(e,r,i,o){var a,s=(o.x-i.x)*(e.y-i.y)-(o.y-i.y)*(e.x-i.x),l=(r.x-e.x)*(e.y-i.y)-(r.y-e.y)*(e.x-i.x),u=(o.y-i.y)*(r.x-e.x)-(o.x-i.x)*(r.y-e.y);if(0!==u){var c=s/u,f=l/u;0<=c&&c<=1&&0<=f&&f<=1?(a=new n("Intersection")).appendPoint(new t.Point(e.x+c*(r.x-e.x),e.y+c*(r.y-e.y))):a=new n}else a=new n(0===s||0===l?"Coincident":"Parallel");return a},t.Intersection.intersectLinePolygon=function(e,t,r){var i,o,a,s,l=new n,u=r.length;for(s=0;s0&&(l.status="Intersection"),l},t.Intersection.intersectPolygonPolygon=function(e,t){var r,i=new n,o=e.length;for(r=0;r0&&(i.status="Intersection"),i},t.Intersection.intersectPolygonRectangle=function(e,r,i){var o=r.min(i),a=r.max(i),s=new t.Point(a.x,o.y),l=new t.Point(o.x,a.y),u=n.intersectLinePolygon(o,s,e),c=n.intersectLinePolygon(s,a,e),f=n.intersectLinePolygon(a,l,e),d=n.intersectLinePolygon(l,o,e),h=new n;return h.appendPoints(u.points),h.appendPoints(c.points),h.appendPoints(f.points),h.appendPoints(d.points),h.points.length>0&&(h.status="Intersection"),h})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});function n(e){e?this._tryParsingColor(e):this.setSource([0,0,0,1])}function r(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}t.Color?t.warn("fabric.Color is already defined."):(t.Color=n,t.Color.prototype={_tryParsingColor:function(e){var t;e in n.colorNameMap&&(e=n.colorNameMap[e]),"transparent"===e&&(t=[255,255,255,0]),t||(t=n.sourceFromHex(e)),t||(t=n.sourceFromRgb(e)),t||(t=n.sourceFromHsl(e)),t||(t=[0,0,0,1]),t&&this.setSource(t)},_rgbToHsl:function(e,n,r){e/=255,n/=255,r/=255;var i,o,a,s=t.util.array.max([e,n,r]),l=t.util.array.min([e,n,r]);if(a=(s+l)/2,s===l)i=o=0;else{var u=s-l;switch(o=a>.5?u/(2-s-l):u/(s+l),s){case e:i=(n-r)/u+(n0)-(e<0)||+e};function c(e,t){var n=e.angle+l(Math.atan2(t.y,t.x))+360;return Math.round(n%360/45)}function f(e,n){var r=n.transform.target,i=r.canvas,o=t.util.object.clone(n);o.target=r,i&&i.fire("object:"+e,o),r.fire(e,n)}function d(e,t){var n=t.canvas,r=e[n.uniScaleKey];return n.uniformScaling&&!r||!n.uniformScaling&&r}function h(e){return"center"===e.originX&&"center"===e.originY}function p(e,t,n){var r=e.lockScalingX,i=e.lockScalingY;return!(!r||!i)||(!(t||!r&&!i||!n)||(!(!r||"x"!==t)||!(!i||"y"!==t)))}function g(e,t,n,r){return{e:e,transform:t,pointer:{x:n,y:r}}}function v(e){return function(t,n,r,i){var o=n.target,a=o.getCenterPoint(),s=o.translateToOriginPoint(a,n.originX,n.originY),l=e(t,n,r,i);return o.setPositionByOrigin(s,n.originX,n.originY),l}}function y(e,t){return function(n,r,i,o){var a=t(n,r,i,o);return a&&f(e,g(n,r,i,o)),a}}function m(e,n,r,i,o){var a=e.target,s=a.controls[e.corner],l=a.canvas.getZoom(),u=a.padding/l,c=a.toLocalPoint(new t.Point(i,o),n,r);return c.x>=u&&(c.x-=u),c.x<=-u&&(c.x+=u),c.y>=u&&(c.y-=u),c.y<=u&&(c.y+=u),c.x-=s.offsetX,c.y-=s.offsetY,c}function b(e){return e.flipX!==e.flipY}function w(e,t,n,r,i){if(0!==e[t]){var o=i/e._getTransformedDimensions()[r]*e[n];e.set(n,o)}}function x(e,t,n,r){var i,s=t.target,u=s._getTransformedDimensions(0,s.skewY),c=m(t,t.originX,t.originY,n,r),f=Math.abs(2*c.x)-u.x,d=s.skewX;f<2?i=0:(i=l(Math.atan2(f/s.scaleX,u.y/s.scaleY)),t.originX===o&&"bottom"===t.originY&&(i=-i),"right"===t.originX&&t.originY===a&&(i=-i),b(s)&&(i=-i));var h=d!==i;if(h){var p=s._getTransformedDimensions().y;s.set("skewX",i),w(s,"skewY","scaleY","y",p)}return h}function _(e,t,n,r){var i,s=t.target,u=s._getTransformedDimensions(s.skewX,0),c=m(t,t.originX,t.originY,n,r),f=Math.abs(2*c.y)-u.y,d=s.skewY;f<2?i=0:(i=l(Math.atan2(f/s.scaleY,u.x/s.scaleX)),t.originX===o&&"bottom"===t.originY&&(i=-i),"right"===t.originX&&t.originY===a&&(i=-i),b(s)&&(i=-i));var h=d!==i;if(h){var p=s._getTransformedDimensions().x;s.set("skewY",i),w(s,"skewX","scaleX","x",p)}return h}function O(e,t,n,r,i){i=i||{};var o,a,l,c,f,g,v=t.target,y=v.lockScalingX,b=v.lockScalingY,w=i.by,x=d(e,v),_=p(v,w,x),O=t.gestureScale;if(_)return!1;if(O)a=t.scaleX*O,l=t.scaleY*O;else{if(o=m(t,t.originX,t.originY,n,r),f="y"!==w?u(o.x):1,g="x"!==w?u(o.y):1,t.signX||(t.signX=f),t.signY||(t.signY=g),v.lockScalingFlip&&(t.signX!==f||t.signY!==g))return!1;if(c=v._getTransformedDimensions(),x&&!w){var C=Math.abs(o.x)+Math.abs(o.y),S=t.original,E=C/(Math.abs(c.x*S.scaleX/v.scaleX)+Math.abs(c.y*S.scaleY/v.scaleY));a=S.scaleX*E,l=S.scaleY*E}else a=Math.abs(o.x*v.scaleX/c.x),l=Math.abs(o.y*v.scaleY/c.y);h(t)&&(a*=2,l*=2),t.signX!==f&&"y"!==w&&(t.originX=s[t.originX],a*=-1,t.signX=f),t.signY!==g&&"x"!==w&&(t.originY=s[t.originY],l*=-1,t.signY=g)}var P=v.scaleX,T=v.scaleY;return w?("x"===w&&v.set("scaleX",a),"y"===w&&v.set("scaleY",l)):(!y&&v.set("scaleX",a),!b&&v.set("scaleY",l)),P!==v.scaleX||T!==v.scaleY}i.scaleCursorStyleHandler=function(e,t,r){var i=d(e,r),o="";if(0!==t.x&&0===t.y?o="x":0===t.x&&0!==t.y&&(o="y"),p(r,o,i))return"not-allowed";var a=c(r,t);return n[a]+"-resize"},i.skewCursorStyleHandler=function(e,t,n){if(0!==t.x&&n.lockSkewingY)return"not-allowed";if(0!==t.y&&n.lockSkewingX)return"not-allowed";var i=c(n,t)%4;return r[i]+"-resize"},i.scaleSkewCursorStyleHandler=function(e,t,n){return e[n.canvas.altActionKey]?i.skewCursorStyleHandler(e,t,n):i.scaleCursorStyleHandler(e,t,n)},i.rotationWithSnapping=y("rotating",v((function(e,t,n,r){var i=t,o=i.target,a=o.translateToOriginPoint(o.getCenterPoint(),i.originX,i.originY);if(o.lockRotation)return!1;var s,u=Math.atan2(i.ey-a.y,i.ex-a.x),c=Math.atan2(r-a.y,n-a.x),f=l(c-u+i.theta);if(o.snapAngle>0){var d=o.snapAngle,h=o.snapThreshold||d,p=Math.ceil(f/d)*d,g=Math.floor(f/d)*d;Math.abs(f-g)0?o:"right":(l>0&&(i=u===a?o:"right"),l<0&&(i=u===a?"right":o),b(s)&&(i=i===o?"right":o)),t.originX=i,y("skewing",v(x))(e,t,n,r))},i.skewHandlerY=function(e,t,n,r){var i,s=t.target,l=s.skewY,u=t.originX;return!s.lockSkewingY&&(0===l?i=m(t,"center","center",n,r).y>0?a:"bottom":(l>0&&(i=u===o?a:"bottom"),l<0&&(i=u===o?"bottom":a),b(s)&&(i=i===a?"bottom":a)),t.originY=i,y("skewing",v(_))(e,t,n,r))},i.dragHandler=function(e,t,n,r){var i=t.target,o=n-t.offsetX,a=r-t.offsetY,s=!i.get("lockMovementX")&&i.left!==o,l=!i.get("lockMovementY")&&i.top!==a;return s&&i.set("left",o),l&&i.set("top",a),(s||l)&&f("moving",g(e,t,n,r)),s||l},i.scaleOrSkewActionName=function(e,t,n){var r=e[n.canvas.altActionKey];return 0===t.x?r?"skewX":"scaleY":0===t.y?r?"skewY":"scaleX":void 0},i.rotationStyleHandler=function(e,t,n){return n.lockRotation?"not-allowed":t.cursorStyle},i.fireEvent=f,i.wrapWithFixedAnchor=v,i.wrapWithFireEvent=y,i.getLocalPoint=m,t.controlsUtils=i}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.degreesToRadians,r=t.controlsUtils;r.renderCircleControl=function(e,t,n,r,i){r=r||{};var o,a=this.sizeX||r.cornerSize||i.cornerSize,s=this.sizeY||r.cornerSize||i.cornerSize,l="undefined"!==typeof r.transparentCorners?r.transparentCorners:i.transparentCorners,u=l?"stroke":"fill",c=!l&&(r.cornerStrokeColor||i.cornerStrokeColor),f=t,d=n;e.save(),e.fillStyle=r.cornerColor||i.cornerColor,e.strokeStyle=r.cornerStrokeColor||i.cornerStrokeColor,a>s?(o=a,e.scale(1,s/a),d=n*a/s):s>a?(o=s,e.scale(a/s,1),f=t*s/a):o=a,e.lineWidth=1,e.beginPath(),e.arc(f,d,o/2,0,2*Math.PI,!1),e[u](),c&&e.stroke(),e.restore()},r.renderSquareControl=function(e,t,r,i,o){i=i||{};var a=this.sizeX||i.cornerSize||o.cornerSize,s=this.sizeY||i.cornerSize||o.cornerSize,l="undefined"!==typeof i.transparentCorners?i.transparentCorners:o.transparentCorners,u=l?"stroke":"fill",c=!l&&(i.cornerStrokeColor||o.cornerStrokeColor),f=a/2,d=s/2;e.save(),e.fillStyle=i.cornerColor||o.cornerColor,e.strokeStyle=i.cornerStrokeColor||o.cornerStrokeColor,e.lineWidth=1,e.translate(t,r),e.rotate(n(o.angle)),e[u+"Rect"](-f,-d,a,s),c&&e.strokeRect(-f,-d,a,s),e.restore()}}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Control=function(e){for(var t in e)this[t]=e[t]},t.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(e,t){return t.cursorStyle},getActionName:function(e,t){return t.actionName},getVisibility:function(e,t){var n=e._controlsVisibility;return n&&"undefined"!==typeof n[t]?n[t]:this.visible},setVisibility:function(e){this.visible=e},positionHandler:function(e,n){return t.util.transformPoint({x:this.x*e.x+this.offsetX,y:this.y*e.y+this.offsetY},n)},calcCornerCoords:function(e,n,r,i,o){var a,s,l,u,c=o?this.touchSizeX:this.sizeX,f=o?this.touchSizeY:this.sizeY;if(c&&f&&c!==f){var d=Math.atan2(f,c),h=Math.sqrt(c*c+f*f)/2,p=d-t.util.degreesToRadians(e),g=Math.PI/2-d-t.util.degreesToRadians(e);a=h*t.util.cos(p),s=h*t.util.sin(p),l=h*t.util.cos(g),u=h*t.util.sin(g)}else{h=.7071067812*(c&&f?c:n);p=t.util.degreesToRadians(45-e);a=l=h*t.util.cos(p),s=u=h*t.util.sin(p)}return{tl:{x:r-u,y:i-l},tr:{x:r+a,y:i-s},bl:{x:r-a,y:i+s},br:{x:r+u,y:i+l}}},render:function(e,n,r,i,o){switch((i=i||{}).cornerStyle||o.cornerStyle){case"circle":t.controlsUtils.renderCircleControl.call(this,e,n,r,i,o);break;default:t.controlsUtils.renderSquareControl.call(this,e,n,r,i,o)}}}}(t),function(){function e(e,t){var n,r,o,a,s=e.getAttribute("style"),l=e.getAttribute("offset")||0;if(l=(l=parseFloat(l)/(/%$/.test(l)?100:1))<0?0:l>1?1:l,s){var u=s.split(/\s*;\s*/);for(""===u[u.length-1]&&u.pop(),a=u.length;a--;){var c=u[a].split(/\s*:\s*/),f=c[0].trim(),d=c[1].trim();"stop-color"===f?n=d:"stop-opacity"===f&&(o=d)}}return n||(n=e.getAttribute("stop-color")||"rgb(0,0,0)"),o||(o=e.getAttribute("stop-opacity")),r=(n=new i.Color(n)).getAlpha(),o=isNaN(parseFloat(o))?1:parseFloat(o),o*=r*t,{offset:l,color:n.toRgb(),opacity:o}}var t=i.util.object.clone;i.Gradient=i.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){e||(e={}),e.coords||(e.coords={});var t,n=this;Object.keys(e).forEach((function(t){n[t]=e[t]})),this.id?this.id+="_"+i.Object.__uid++:this.id=i.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(e){for(var t in e){var n=new i.Color(e[t]);this.colorStops.push({offset:parseFloat(t),color:n.toRgb(),opacity:n.getAlpha()})}return this},toObject:function(e){var t={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return i.util.populateWithProperties(this,t,e),t},toSVG:function(e,n){var r,o,a,s,l=t(this.coords,!0),u=(n=n||{},t(this.colorStops,!0)),c=l.r1>l.r2,f=this.gradientTransform?this.gradientTransform.concat():i.iMatrix.concat(),d=-this.offsetX,h=-this.offsetY,p=!!n.additionalTransform,g="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(u.sort((function(e,t){return e.offset-t.offset})),"objectBoundingBox"===g?(d/=e.width,h/=e.height):(d+=e.width/2,h+=e.height/2),"path"===e.type&&"percentage"!==this.gradientUnits&&(d-=e.pathOffset.x,h-=e.pathOffset.y),f[4]-=d,f[5]-=h,s='id="SVGID_'+this.id+'" gradientUnits="'+g+'"',s+=' gradientTransform="'+(p?n.additionalTransform+" ":"")+i.util.matrixToSVG(f)+'" ',"linear"===this.type?a=["\n']:"radial"===this.type&&(a=["\n']),"radial"===this.type){if(c)for((u=u.concat()).reverse(),r=0,o=u.length;r0){var y=v/Math.max(l.r1,l.r2);for(r=0,o=u.length;r\n')}return a.push("linear"===this.type?"\n":"\n"),a.join("")},toLive:function(e){var t,n,r,o=i.util.object.clone(this.coords);if(this.type){for("linear"===this.type?t=e.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(t=e.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),n=0,r=this.colorStops.length;n1?1:a,isNaN(a)&&(a=1);var s,l,u,c,f=t.getElementsByTagName("stop"),d="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",h=t.getAttribute("gradientTransform")||"",p=[],g=0,v=0;for("linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(s="linear",l=function(e){return{x1:e.getAttribute("x1")||0,y1:e.getAttribute("y1")||0,x2:e.getAttribute("x2")||"100%",y2:e.getAttribute("y2")||0}}(t)):(s="radial",l=function(e){return{x1:e.getAttribute("fx")||e.getAttribute("cx")||"50%",y1:e.getAttribute("fy")||e.getAttribute("cy")||"50%",r1:0,x2:e.getAttribute("cx")||"50%",y2:e.getAttribute("cy")||"50%",r2:e.getAttribute("r")||"50%"}}(t)),u=f.length;u--;)p.push(e(f[u],a));return c=i.parseTransformAttribute(h),function(e,t,n,r){var i,o;Object.keys(t).forEach((function(e){"Infinity"===(i=t[e])?o=1:"-Infinity"===i?o=0:(o=parseFloat(t[e],10),"string"===typeof i&&/^(\d+\.\d+)%|(\d+)%$/.test(i)&&(o*=.01,"pixels"===r&&("x1"!==e&&"x2"!==e&&"r2"!==e||(o*=n.viewBoxWidth||n.width),"y1"!==e&&"y2"!==e||(o*=n.viewBoxHeight||n.height)))),t[e]=o}))}(0,l,o,d),"pixels"===d&&(g=-n.left,v=-n.top),new i.Gradient({id:t.getAttribute("id"),type:s,coords:l,colorStops:p,gradientUnits:d,gradientTransform:c,offsetX:g,offsetY:v})}})}(),function(){"use strict";var e=i.util.toFixed;i.Pattern=i.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(e,t){if(e||(e={}),this.id=i.Object.__uid++,this.setOptions(e),!e.source||e.source&&"string"!==typeof e.source)t&&t(this);else{var n=this;this.source=i.util.createImage(),i.util.loadImage(e.source,(function(e,r){n.source=e,t&&t(n,r)}),null,this.crossOrigin)}},toObject:function(t){var n,r,o=i.Object.NUM_FRACTION_DIGITS;return"string"===typeof this.source.src?n=this.source.src:"object"===typeof this.source&&this.source.toDataURL&&(n=this.source.toDataURL()),r={type:"pattern",source:n,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:e(this.offsetX,o),offsetY:e(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},i.util.populateWithProperties(this,r,t),r},toSVG:function(e){var t="function"===typeof this.source?this.source():this.source,n=t.width/e.width,r=t.height/e.height,i=this.offsetX/e.width,o=this.offsetY/e.height,a="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(r=1,o&&(r+=Math.abs(o))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,i&&(n+=Math.abs(i))),t.src?a=t.src:t.toDataURL&&(a=t.toDataURL()),'\n\n\n'},setOptions:function(e){for(var t in e)this[t]=e[t]},toLive:function(e){var t=this.source;if(!t)return"";if("undefined"!==typeof t.src){if(!t.complete)return"";if(0===t.naturalWidth||0===t.naturalHeight)return""}return e.createPattern(t,this.repeat)}})}(),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.toFixed;t.Shadow?t.warn("fabric.Shadow is already defined."):(t.Shadow=t.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(e){for(var n in"string"===typeof e&&(e=this._parseShadow(e)),e)this[n]=e[n];this.id=t.Object.__uid++},_parseShadow:function(e){var n=e.trim(),r=t.Shadow.reOffsetsAndBlur.exec(n)||[];return{color:(n.replace(t.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(r[1],10)||0,offsetY:parseFloat(r[2],10)||0,blur:parseFloat(r[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(e){var r=40,i=40,o=t.Object.NUM_FRACTION_DIGITS,a=t.util.rotateVector({x:this.offsetX,y:this.offsetY},t.util.degreesToRadians(-e.angle)),s=new t.Color(this.color);return e.width&&e.height&&(r=100*n((Math.abs(a.x)+this.blur)/e.width,o)+20,i=100*n((Math.abs(a.y)+this.blur)/e.height,o)+20),e.flipX&&(a.x*=-1),e.flipY&&(a.y*=-1),'\n\t\n\t\n\t\n\t\n\t\n\t\t\n\t\t\n\t\n\n'},toObject:function(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling};var e={},n=t.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach((function(t){this[t]!==n[t]&&(e[t]=this[t])}),this),e}}),t.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(t),function(){"use strict";if(i.StaticCanvas)i.warn("fabric.StaticCanvas is already defined.");else{var e=i.util.object.extend,t=i.util.getElementOffset,n=i.util.removeFromArray,r=i.util.toFixed,o=i.util.transformPoint,a=i.util.invertTransform,s=i.util.getNodeCanvas,l=i.util.createCanvasElement,u=new Error("Could not initialize `canvas` element");i.StaticCanvas=i.util.createClass(i.CommonMethods,{initialize:function(e,t){t||(t={}),this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(e,t)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:i.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(e,t){var n=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(e),this._initOptions(t),this.interactive||this._initRetinaScaling(),t.overlayImage&&this.setOverlayImage(t.overlayImage,n),t.backgroundImage&&this.setBackgroundImage(t.backgroundImage,n),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor,n),t.overlayColor&&this.setOverlayColor(t.overlayColor,n),this.calcOffset()},_isRetinaScaling:function(){return 1!==i.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?i.devicePixelRatio:1},_initRetinaScaling:function(){if(this._isRetinaScaling()){var e=i.devicePixelRatio;this.__initRetinaScaling(e,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl&&this.__initRetinaScaling(e,this.upperCanvasEl,this.contextTop)}},__initRetinaScaling:function(e,t,n){t.setAttribute("width",this.width*e),t.setAttribute("height",this.height*e),n.scale(e,e)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(e,t,n){return this.__setBgOverlayImage("overlayImage",e,t,n)},setBackgroundImage:function(e,t,n){return this.__setBgOverlayImage("backgroundImage",e,t,n)},setOverlayColor:function(e,t){return this.__setBgOverlayColor("overlayColor",e,t)},setBackgroundColor:function(e,t){return this.__setBgOverlayColor("backgroundColor",e,t)},__setBgOverlayImage:function(e,t,n,r){return"string"===typeof t?i.util.loadImage(t,(function(t,o){if(t){var a=new i.Image(t,r);this[e]=a,a.canvas=this}n&&n(t,o)}),this,r&&r.crossOrigin):(r&&t.setOptions(r),this[e]=t,t&&(t.canvas=this),n&&n(t,!1)),this},__setBgOverlayColor:function(e,t,n){return this[e]=t,this._initGradient(t,e),this._initPattern(t,e,n),this},_createCanvasElement:function(){var e=l();if(!e)throw u;if(e.style||(e.style={}),"undefined"===typeof e.getContext)throw u;return e},_initOptions:function(e){var t=this.lowerCanvasEl;this._setOptions(e),this.width=this.width||parseInt(t.width,10)||0,this.height=this.height||parseInt(t.height,10)||0,this.lowerCanvasEl.style&&(t.width=this.width,t.height=this.height,t.style.width=this.width+"px",t.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(e){e&&e.getContext?this.lowerCanvasEl=e:this.lowerCanvasEl=i.util.getById(e)||this._createCanvasElement(),i.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(e,t){return this.setDimensions({width:e},t)},setHeight:function(e,t){return this.setDimensions({height:e},t)},setDimensions:function(e,t){var n;for(var r in t=t||{},e)n=e[r],t.cssOnly||(this._setBackstoreDimension(r,e[r]),n+="px",this.hasLostContext=!0),t.backstoreOnly||this._setCssDimension(r,n);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(),this._initRetinaScaling(),this.calcOffset(),t.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(e,t){return this.lowerCanvasEl[e]=t,this.upperCanvasEl&&(this.upperCanvasEl[e]=t),this.cacheCanvasEl&&(this.cacheCanvasEl[e]=t),this[e]=t,this},_setCssDimension:function(e,t){return this.lowerCanvasEl.style[e]=t,this.upperCanvasEl&&(this.upperCanvasEl.style[e]=t),this.wrapperEl&&(this.wrapperEl.style[e]=t),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(e){var t,n,r,i=this._activeObject,o=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=e,n=0,r=this._objects.length;n\n'),this._setSVGBgOverlayColor(n,"background"),this._setSVGBgOverlayImage(n,"backgroundImage",t),this._setSVGObjects(n,t),this.clipPath&&n.push("\n"),this._setSVGBgOverlayColor(n,"overlay"),this._setSVGBgOverlayImage(n,"overlayImage",t),n.push(""),n.join("")},_setSVGPreamble:function(e,t){t.suppressPreamble||e.push('\n','\n')},_setSVGHeader:function(e,t){var n,o=t.width||this.width,a=t.height||this.height,s='viewBox="0 0 '+this.width+" "+this.height+'" ',l=i.Object.NUM_FRACTION_DIGITS;t.viewBox?s='viewBox="'+t.viewBox.x+" "+t.viewBox.y+" "+t.viewBox.width+" "+t.viewBox.height+'" ':this.svgViewportTransformation&&(n=this.viewportTransform,s='viewBox="'+r(-n[4]/n[0],l)+" "+r(-n[5]/n[3],l)+" "+r(this.width/n[0],l)+" "+r(this.height/n[3],l)+'" '),e.push("\n',"Created with Fabric.js ",i.version,"\n","\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(t),"\n")},createSVGClipPathMarkup:function(e){var t=this.clipPath;return t?(t.clipPathId="CLIPPATH_"+i.Object.__uid++,'\n'+this.clipPath.toClipPathSVG(e.reviver)+"\n"):""},createSVGRefElementsMarkup:function(){var e=this;return["background","overlay"].map((function(t){var n=e[t+"Color"];if(n&&n.toLive){var r=e[t+"Vpt"],o=e.viewportTransform,a={width:e.width/(r?o[0]:1),height:e.height/(r?o[3]:1)};return n.toSVG(a,{additionalTransform:r?i.util.matrixToSVG(o):""})}})).join("")},createSVGFontFacesMarkup:function(){var e,t,n,r,o,a,s,l,u="",c={},f=i.fontPaths,d=[];for(this._objects.forEach((function e(t){d.push(t),t._objects&&t._objects.forEach(e)})),s=0,l=d.length;s',"\n",u,"","\n"].join("")),u},_setSVGObjects:function(e,t){var n,r,i,o=this._objects;for(r=0,i=o.length;r\n")}else e.push('\n")},sendToBack:function(e){if(!e)return this;var t,r,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(t=(i=o._objects).length;t--;)r=i[t],n(this._objects,r),this._objects.unshift(r);else n(this._objects,e),this._objects.unshift(e);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(e){if(!e)return this;var t,r,i,o=this._activeObject;if(e===o&&"activeSelection"===e.type)for(i=o._objects,t=0;t0+u&&(a=o-1,n(this._objects,i),this._objects.splice(a,0,i)),u++;else 0!==(o=this._objects.indexOf(e))&&(a=this._findNewLowerIndex(e,o,t),n(this._objects,e),this._objects.splice(a,0,e));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(e,t,n){var r,i;if(n)for(r=t,i=t-1;i>=0;--i){if(e.intersectsWithObject(this._objects[i])||e.isContainedWithinObject(this._objects[i])||this._objects[i].isContainedWithinObject(e)){r=i;break}}else r=t-1;return r},bringForward:function(e,t){if(!e)return this;var r,i,o,a,s,l=this._activeObject,u=0;if(e===l&&"activeSelection"===e.type)for(r=(s=l._objects).length;r--;)i=s[r],(o=this._objects.indexOf(i))"}}),e(i.StaticCanvas.prototype,i.Observable),e(i.StaticCanvas.prototype,i.Collection),e(i.StaticCanvas.prototype,i.DataURLExporter),e(i.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(e){var t=l();if(!t||!t.getContext)return null;var n=t.getContext("2d");if(!n)return null;switch(e){case"setLineDash":return"undefined"!==typeof n.setLineDash;default:return null}}}),i.StaticCanvas.prototype.toJSON=i.StaticCanvas.prototype.toObject,i.isLikelyNode&&(i.StaticCanvas.prototype.createPNGStream=function(){var e=s(this.lowerCanvasEl);return e&&e.createPNGStream()},i.StaticCanvas.prototype.createJPEGStream=function(e){var t=s(this.lowerCanvasEl);return t&&t.createJPEGStream(e)})}}(),i.BaseBrush=i.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(){var e=this.canvas.contextTop;e.strokeStyle=this.color,e.lineWidth=this.width,e.lineCap=this.strokeLineCap,e.miterLimit=this.strokeMiterLimit,e.lineJoin=this.strokeLineJoin,e.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(e){var t=this.canvas.viewportTransform;e.save(),e.transform(t[0],t[1],t[2],t[3],t[4],t[5])},_setShadow:function(){if(this.shadow){var e=this.canvas,t=this.shadow,n=e.contextTop,r=e.getZoom();e&&e._isRetinaScaling()&&(r*=i.devicePixelRatio),n.shadowColor=t.color,n.shadowBlur=t.blur*r,n.shadowOffsetX=t.offsetX*r,n.shadowOffsetY=t.offsetY*r}},needsFullRender:function(){return new i.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var e=this.canvas.contextTop;e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0},_isOutSideCanvas:function(e){return e.x<0||e.x>this.canvas.getWidth()||e.y<0||e.y>this.canvas.getHeight()}}),i.PencilBrush=i.util.createClass(i.BaseBrush,{decimate:.4,initialize:function(e){this.canvas=e,this._points=[]},_drawSegment:function(e,t,n){var r=t.midPointFrom(n);return e.quadraticCurveTo(t.x,t.y,r.x,r.y),r},onMouseDown:function(e,t){this.canvas._isMainEvent(t.e)&&(this._prepareForDrawing(e),this._captureDrawingPath(e),this._render())},onMouseMove:function(e,t){if(this.canvas._isMainEvent(t.e)&&(!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(e))&&this._captureDrawingPath(e)&&this._points.length>1)if(this.needsFullRender())this.canvas.clearContext(this.canvas.contextTop),this._render();else{var n=this._points,r=n.length,i=this.canvas.contextTop;this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,n[r-2],n[r-1],!0),i.stroke(),i.restore()}},onMouseUp:function(e){return!this.canvas._isMainEvent(e.e)||(this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(e){var t=new i.Point(e.x,e.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(e){return!(this._points.length>1&&e.eq(this._points[this._points.length-1]))&&(this._points.push(e),!0)},_reset:function(){this._points=[],this._setBrushStyles(),this._setShadow()},_captureDrawingPath:function(e){var t=new i.Point(e.x,e.y);return this._addPoint(t)},_render:function(){var e,t,n=this.canvas.contextTop,r=this._points[0],o=this._points[1];if(this._saveAndTransform(n),n.beginPath(),2===this._points.length&&r.x===o.x&&r.y===o.y){var a=this.width/1e3;r=new i.Point(r.x,r.y),o=new i.Point(o.x,o.y),r.x-=a,o.x+=a}for(n.moveTo(r.x,r.y),e=1,t=this._points.length;e=i&&(a=e[n],s.push(a));return s.push(e[o]),s},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var e=this.convertPointsToSVGPath(this._points);if(this._isEmptySVGPath(e))this.canvas.requestRenderAll();else{var t=this.createPath(e);this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t})}}}),i.CircleBrush=i.util.createClass(i.BaseBrush,{width:10,initialize:function(e){this.canvas=e,this.points=[]},drawDot:function(e){var t=this.addPoint(e),n=this.canvas.contextTop;this._saveAndTransform(n),this.dot(n,t),n.restore()},dot:function(e,t){e.fillStyle=t.fill,e.beginPath(),e.arc(t.x,t.y,t.radius,0,2*Math.PI,!1),e.closePath(),e.fill()},onMouseDown:function(e){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(e)},_render:function(){var e,t,n=this.canvas.contextTop,r=this.points;for(this._saveAndTransform(n),e=0,t=r.length;e0&&!this.preserveObjectStacking){t=[],n=[];for(var i=0,o=this._objects.length;i1&&(this._activeObject._objects=n),t.push.apply(t,n)}else t=this._objects;return t},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var e=this.contextContainer;return this.renderCanvas(e,this._chooseObjectsToRender()),this},renderTopLayer:function(e){e.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(e),this.contextTopDirty=!0),e.restore()},renderTop:function(){var e=this.contextTop;return this.clearContext(e),this.renderTopLayer(e),this.fire("after:render"),this},_normalizePointer:function(e,t){var n=e.calcTransformMatrix(),r=i.util.invertTransform(n),o=this.restorePointerVpt(t);return i.util.transformPoint(o,r)},isTargetTransparent:function(e,t,n){if(e.shouldCache()&&e._cacheCanvas&&e!==this._activeObject){var r=this._normalizePointer(e,{x:t,y:n}),o=Math.max(e.cacheTranslationX+r.x*e.zoomX,0),a=Math.max(e.cacheTranslationY+r.y*e.zoomY,0);return i.util.isTransparent(e._cacheContext,Math.round(o),Math.round(a),this.targetFindTolerance)}var s=this.contextCache,l=e.selectionBackgroundColor,u=this.viewportTransform;return e.selectionBackgroundColor="",this.clearContext(s),s.save(),s.transform(u[0],u[1],u[2],u[3],u[4],u[5]),e.render(s),s.restore(),e.selectionBackgroundColor=l,i.util.isTransparent(s,t,n,this.targetFindTolerance)},_isSelectionKeyPressed:function(e){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find((function(t){return!0===e[t]})):e[this.selectionKey]},_shouldClearSelection:function(e,t){var n=this.getActiveObjects(),r=this._activeObject;return!t||t&&r&&n.length>1&&-1===n.indexOf(t)&&r!==t&&!this._isSelectionKeyPressed(e)||t&&!t.evented||t&&!t.selectable&&r&&r!==t},_shouldCenterTransform:function(e,t,n){var r;if(e)return"scale"===t||"scaleX"===t||"scaleY"===t||"resizing"===t?r=this.centeredScaling||e.centeredScaling:"rotate"===t&&(r=this.centeredRotation||e.centeredRotation),r?!n:n},_getOriginFromCorner:function(e,t){var n={x:e.originX,y:e.originY};return"ml"===t||"tl"===t||"bl"===t?n.x="right":"mr"!==t&&"tr"!==t&&"br"!==t||(n.x="left"),"tl"===t||"mt"===t||"tr"===t?n.y="bottom":"bl"!==t&&"mb"!==t&&"br"!==t||(n.y="top"),n},_getActionFromCorner:function(e,t,n,r){if(!t||!e)return"drag";var i=r.controls[t];return i.getActionName(n,i,r)},_setupCurrentTransform:function(e,n,r){if(n){var o=this.getPointer(e),a=n.__corner,s=n.controls[a],l=r&&a?s.getActionHandler(e,n,s):i.controlsUtils.dragHandler,u=this._getActionFromCorner(r,a,e,n),c=this._getOriginFromCorner(n,a),f=e[this.centeredKey],d={target:n,action:u,actionHandler:l,corner:a,scaleX:n.scaleX,scaleY:n.scaleY,skewX:n.skewX,skewY:n.skewY,offsetX:o.x-n.left,offsetY:o.y-n.top,originX:c.x,originY:c.y,ex:o.x,ey:o.y,lastX:o.x,lastY:o.y,theta:t(n.angle),width:n.width*n.scaleX,shiftKey:e.shiftKey,altKey:f,original:i.util.saveObjectTransform(n)};this._shouldCenterTransform(n,u,f)&&(d.originX="center",d.originY="center"),d.original.originX=c.x,d.original.originY=c.y,this._currentTransform=d,this._beforeTransform(e)}},setCursor:function(e){this.upperCanvasEl.style.cursor=e},_drawSelection:function(e){var t=this._groupSelector,n=new i.Point(t.ex,t.ey),r=i.util.transformPoint(n,this.viewportTransform),o=new i.Point(t.ex+t.left,t.ey+t.top),a=i.util.transformPoint(o,this.viewportTransform),s=Math.min(r.x,a.x),l=Math.min(r.y,a.y),u=Math.max(r.x,a.x),c=Math.max(r.y,a.y),f=this.selectionLineWidth/2;this.selectionColor&&(e.fillStyle=this.selectionColor,e.fillRect(s,l,u-s,c-l)),this.selectionLineWidth&&this.selectionBorderColor&&(e.lineWidth=this.selectionLineWidth,e.strokeStyle=this.selectionBorderColor,s+=f,l+=f,u-=f,c-=f,i.Object.prototype._setLineDash.call(this,e,this.selectionDashArray),e.strokeRect(s,l,u-s,c-l))},findTarget:function(e,t){if(!this.skipTargetFind){var r,i,o=this.getPointer(e,!0),a=this._activeObject,s=this.getActiveObjects(),l=n(e),u=s.length>1&&!t||1===s.length;if(this.targets=[],u&&a._findTargetCorner(o,l))return a;if(s.length>1&&!t&&a===this._searchPossibleTargets([a],o))return a;if(1===s.length&&a===this._searchPossibleTargets([a],o)){if(!this.preserveObjectStacking)return a;r=a,i=this.targets,this.targets=[]}var c=this._searchPossibleTargets(this._objects,o);return e[this.altSelectionKey]&&c&&r&&c!==r&&(c=r,this.targets=i),c}},_checkTarget:function(e,t,n){if(t&&t.visible&&t.evented&&t.containsPoint(e)){if(!this.perPixelTargetFind&&!t.perPixelTargetFind||t.isEditing)return!0;if(!this.isTargetTransparent(t,n.x,n.y))return!0}},_searchPossibleTargets:function(e,t){for(var n,r,o=e.length;o--;){var a=e[o],s=a.group?this._normalizePointer(a.group,t):t;if(this._checkTarget(s,a,t)){(n=e[o]).subTargetCheck&&n instanceof i.Group&&(r=this._searchPossibleTargets(n._objects,t))&&this.targets.push(r);break}}return n},restorePointerVpt:function(e){return i.util.transformPoint(e,i.util.invertTransform(this.viewportTransform))},getPointer:function(t,n){if(this._absolutePointer&&!n)return this._absolutePointer;if(this._pointer&&n)return this._pointer;var r,i=e(t),o=this.upperCanvasEl,a=o.getBoundingClientRect(),s=a.width||0,l=a.height||0;s&&l||("top"in a&&"bottom"in a&&(l=Math.abs(a.top-a.bottom)),"right"in a&&"left"in a&&(s=Math.abs(a.right-a.left))),this.calcOffset(),i.x=i.x-this._offset.left,i.y=i.y-this._offset.top,n||(i=this.restorePointerVpt(i));var u=this.getRetinaScaling();return 1!==u&&(i.x/=u,i.y/=u),r=0===s||0===l?{width:1,height:1}:{width:o.width/s,height:o.height/l},{x:i.x*r.width,y:i.y*r.height}},_createUpperCanvas:function(){var e=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),t=this.lowerCanvasEl,n=this.upperCanvasEl;n?n.className="":(n=this._createCanvasElement(),this.upperCanvasEl=n),i.util.addClass(n,"upper-canvas "+e),this.wrapperEl.appendChild(n),this._copyCanvasStyle(t,n),this._applyCanvasStyle(n),this.contextTop=n.getContext("2d")},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=i.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),i.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),i.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(e){var t=this.width||e.width,n=this.height||e.height;i.util.setStyle(e,{position:"absolute",width:t+"px",height:n+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),e.width=t,e.height=n,i.util.makeElementUnselectable(e)},_copyCanvasStyle:function(e,t){t.style.cssText=e.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var e=this._activeObject;return e?"activeSelection"===e.type&&e._objects?e._objects.slice(0):[e]:[]},_onObjectRemoved:function(e){e===this._activeObject&&(this.fire("before:selection:cleared",{target:e}),this._discardActiveObject(),this.fire("selection:cleared",{target:e}),e.fire("deselected")),e===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",e)},_fireSelectionEvents:function(e,t){var n=!1,r=this.getActiveObjects(),i=[],o=[];e.forEach((function(e){-1===r.indexOf(e)&&(n=!0,e.fire("deselected",{e:t,target:e}),o.push(e))})),r.forEach((function(r){-1===e.indexOf(r)&&(n=!0,r.fire("selected",{e:t,target:r}),i.push(r))})),e.length>0&&r.length>0?n&&this.fire("selection:updated",{e:t,selected:i,deselected:o,updated:i[0]||o[0],target:this._activeObject}):r.length>0?this.fire("selection:created",{e:t,selected:i,target:this._activeObject}):e.length>0&&this.fire("selection:cleared",{e:t,deselected:o})},setActiveObject:function(e,t){var n=this.getActiveObjects();return this._setActiveObject(e,t),this._fireSelectionEvents(n,t),this},_setActiveObject:function(e,t){return this._activeObject!==e&&(!!this._discardActiveObject(t,e)&&(!e.onSelect({e:t})&&(this._activeObject=e,!0)))},_discardActiveObject:function(e,t){var n=this._activeObject;if(n){if(n.onDeselect({e:e,object:t}))return!1;this._activeObject=null}return!0},discardActiveObject:function(e){var t=this.getActiveObjects(),n=this.getActiveObject();return t.length&&this.fire("before:selection:cleared",{target:n,e:e}),this._discardActiveObject(e),this._fireSelectionEvents(t,e),this},dispose:function(){var e=this.wrapperEl;return this.removeListeners(),e.removeChild(this.upperCanvasEl),e.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(e){i.util.cleanUpJsdomNode(this[e]),this[e]=void 0}.bind(this)),e.parentNode&&e.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,i.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(e){var t=this._activeObject;t&&t._renderControls(e)},_toObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(e),i=this.callSuper("_toObject",e,t,n);return this._unwindGroupTransformOnObject(e,r),i},_realizeGroupTransformOnObject:function(e){if(e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group){var t={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach((function(n){t[n]=e[n]})),i.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),t}return null},_unwindGroupTransformOnObject:function(e,t){t&&e.set(t)},_setSVGObject:function(e,t,n){var r=this._realizeGroupTransformOnObject(t);this.callSuper("_setSVGObject",e,t,n),this._unwindGroupTransformOnObject(t,r)},setViewportTransform:function(e){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),i.StaticCanvas.prototype.setViewportTransform.call(this,e)}}),i.StaticCanvas)"prototype"!==r&&(i.Canvas[r]=i.StaticCanvas[r])}(),function(){var e=i.util.addListener,t=i.util.removeListener,n={passive:!1};function r(e,t){return e.button&&e.button===t-1}i.util.object.extend(i.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(e,t){var r=this.upperCanvasEl,o=this._getEventPrefix();e(i.window,"resize",this._onResize),e(r,o+"down",this._onMouseDown),e(r,o+"move",this._onMouseMove,n),e(r,o+"out",this._onMouseOut),e(r,o+"enter",this._onMouseEnter),e(r,"wheel",this._onMouseWheel),e(r,"contextmenu",this._onContextMenu),e(r,"dblclick",this._onDoubleClick),e(r,"dragover",this._onDragOver),e(r,"dragenter",this._onDragEnter),e(r,"dragleave",this._onDragLeave),e(r,"drop",this._onDrop),this.enablePointerEvents||e(r,"touchstart",this._onTouchStart,n),"undefined"!==typeof eventjs&&t in eventjs&&(eventjs[t](r,"gesture",this._onGesture),eventjs[t](r,"drag",this._onDrag),eventjs[t](r,"orientation",this._onOrientationChange),eventjs[t](r,"shake",this._onShake),eventjs[t](r,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(t,"remove");var e=this._getEventPrefix();t(i.document,e+"up",this._onMouseUp),t(i.document,"touchend",this._onTouchEnd,n),t(i.document,e+"move",this._onMouseMove,n),t(i.document,"touchmove",this._onMouseMove,n)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._simpleEventHandler.bind(this,"drop"),this.eventsBound=!0)},_onGesture:function(e,t){this.__onTransformGesture&&this.__onTransformGesture(e,t)},_onDrag:function(e,t){this.__onDrag&&this.__onDrag(e,t)},_onMouseWheel:function(e){this.__onMouseWheel(e)},_onMouseOut:function(e){var t=this._hoveredTarget;this.fire("mouse:out",{target:t,e:e}),this._hoveredTarget=null,t&&t.fire("mouseout",{e:e});var n=this;this._hoveredTargets.forEach((function(r){n.fire("mouse:out",{target:t,e:e}),r&&t.fire("mouseout",{e:e})})),this._hoveredTargets=[],this._iTextInstances&&this._iTextInstances.forEach((function(e){e.isEditing&&e.hiddenTextarea.focus()}))},_onMouseEnter:function(e){this._currentTransform||this.findTarget(e)||(this.fire("mouse:over",{target:null,e:e}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(e,t){this.__onOrientationChange&&this.__onOrientationChange(e,t)},_onShake:function(e,t){this.__onShake&&this.__onShake(e,t)},_onLongPress:function(e,t){this.__onLongPress&&this.__onLongPress(e,t)},_onDragOver:function(e){e.preventDefault();var t=this._simpleEventHandler("dragover",e);this._fireEnterLeaveEvents(t,e)},_onContextMenu:function(e){return this.stopContextMenu&&(e.stopPropagation(),e.preventDefault()),!1},_onDoubleClick:function(e){this._cacheTransformEventData(e),this._handleEvent(e,"dblclick"),this._resetTransformEventData(e)},getPointerId:function(e){var t=e.changedTouches;return t?t[0]&&t[0].identifier:this.enablePointerEvents?e.pointerId:-1},_isMainEvent:function(e){return!0===e.isPrimary||!1!==e.isPrimary&&("touchend"===e.type&&0===e.touches.length||(!e.changedTouches||e.changedTouches[0].identifier===this.mainTouchId))},_onTouchStart:function(r){r.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(r)),this.__onMouseDown(r),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();e(i.document,"touchend",this._onTouchEnd,n),e(i.document,"touchmove",this._onMouseMove,n),t(o,a+"down",this._onMouseDown)},_onMouseDown:function(r){this.__onMouseDown(r),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();t(o,a+"move",this._onMouseMove,n),e(i.document,a+"up",this._onMouseUp),e(i.document,a+"move",this._onMouseMove,n)},_onTouchEnd:function(r){if(!(r.touches.length>0)){this.__onMouseUp(r),this._resetTransformEventData(),this.mainTouchId=null;var o=this._getEventPrefix();t(i.document,"touchend",this._onTouchEnd,n),t(i.document,"touchmove",this._onMouseMove,n);var a=this;this._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout((function(){e(a.upperCanvasEl,o+"down",a._onMouseDown),a._willAddMouseDown=0}),400)}},_onMouseUp:function(r){this.__onMouseUp(r),this._resetTransformEventData();var o=this.upperCanvasEl,a=this._getEventPrefix();this._isMainEvent(r)&&(t(i.document,a+"up",this._onMouseUp),t(i.document,a+"move",this._onMouseMove,n),e(o,a+"move",this._onMouseMove,n))},_onMouseMove:function(e){!this.allowTouchScrolling&&e.preventDefault&&e.preventDefault(),this.__onMouseMove(e)},_onResize:function(){this.calcOffset()},_shouldRender:function(e){var t=this._activeObject;return!!(!!t!==!!e||t&&e&&t!==e)||(t&&t.isEditing,!1)},__onMouseUp:function(e){var t,n=this._currentTransform,o=this._groupSelector,a=!1,s=!o||0===o.left&&0===o.top;if(this._cacheTransformEventData(e),t=this._target,this._handleEvent(e,"up:before"),r(e,3))this.fireRightClick&&this._handleEvent(e,"up",3,s);else{if(r(e,2))return this.fireMiddleClick&&this._handleEvent(e,"up",2,s),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(e);else if(this._isMainEvent(e)){if(n&&(this._finalizeCurrentTransform(e),a=n.actionPerformed),!s){var l=t===this._activeObject;this._maybeGroupObjects(e),a||(a=this._shouldRender(t)||!l&&t===this._activeObject)}if(t){if(t.selectable&&t!==this._activeObject&&"up"===t.activeOn)this.setActiveObject(t,e),a=!0;else{var u=t._findTargetCorner(this.getPointer(e,!0),i.util.isTouchEvent(e)),c=t.controls[u],f=c&&c.getMouseUpHandler(e,t,c);if(f){var d=this.getPointer(e);f(e,n,d.x,d.y)}}t.isMoving=!1}this._setCursorFromEvent(e,t),this._handleEvent(e,"up",1,s),this._groupSelector=null,this._currentTransform=null,t&&(t.__corner=0),a?this.requestRenderAll():s||this.renderTop()}}},_simpleEventHandler:function(e,t){var n=this.findTarget(t),r=this.targets,i={e:t,target:n,subTargets:r};if(this.fire(e,i),n&&n.fire(e,i),!r)return n;for(var o=0;o1&&(t=new i.ActiveSelection(n.reverse(),{canvas:this}),this.setActiveObject(t,e))},_collectObjects:function(n){for(var r,o=[],a=this._groupSelector.ex,s=this._groupSelector.ey,l=a+this._groupSelector.left,u=s+this._groupSelector.top,c=new i.Point(e(a,l),e(s,u)),f=new i.Point(t(a,l),t(s,u)),d=!this.selectionFullyContained,h=a===l&&s===u,p=this._objects.length;p--&&!((r=this._objects[p])&&r.selectable&&r.visible&&(d&&r.intersectsWithRect(c,f,!0)||r.isContainedWithinRect(c,f,!0)||d&&r.containsPoint(c,null,!0)||d&&r.containsPoint(f,null,!0))&&(o.push(r),h)););return o.length>1&&(o=o.filter((function(e){return!e.onSelect({e:n})}))),o},_maybeGroupObjects:function(e){this.selection&&this._groupSelector&&this._groupSelectedObjects(e),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),i.util.object.extend(i.StaticCanvas.prototype,{toDataURL:function(e){e||(e={});var t=e.format||"png",n=e.quality||1,r=(e.multiplier||1)*(e.enableRetinaScaling?this.getRetinaScaling():1),o=this.toCanvasElement(r,e);return i.util.toDataURL(o,t,n)},toCanvasElement:function(e,t){e=e||1;var n=((t=t||{}).width||this.width)*e,r=(t.height||this.height)*e,o=this.getZoom(),a=this.width,s=this.height,l=o*e,u=this.viewportTransform,c=(u[4]-(t.left||0))*e,f=(u[5]-(t.top||0))*e,d=this.interactive,h=[l,0,0,l,c,f],p=this.enableRetinaScaling,g=i.util.createCanvasElement(),v=this.contextTop;return g.width=n,g.height=r,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=h,this.width=n,this.height=r,this.calcViewportBoundaries(),this.renderCanvas(g.getContext("2d"),this._objects),this.viewportTransform=u,this.width=a,this.height=s,this.calcViewportBoundaries(),this.interactive=d,this.enableRetinaScaling=p,this.contextTop=v,g}}),i.util.object.extend(i.StaticCanvas.prototype,{loadFromJSON:function(e,t,n){if(e){var r="string"===typeof e?JSON.parse(e):i.util.object.clone(e),o=this,a=r.clipPath,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,delete r.clipPath,this._enlivenObjects(r.objects,(function(e){o.clear(),o._setBgOverlay(r,(function(){a?o._enlivenObjects([a],(function(n){o.clipPath=n[0],o.__setupCanvas.call(o,r,e,s,t)})):o.__setupCanvas.call(o,r,e,s,t)}))}),n),this}},__setupCanvas:function(e,t,n,r){var i=this;t.forEach((function(e,t){i.insertAt(e,t)})),this.renderOnAddRemove=n,delete e.objects,delete e.backgroundImage,delete e.overlayImage,delete e.background,delete e.overlay,this._setOptions(e),this.renderAll(),r&&r()},_setBgOverlay:function(e,t){var n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(e.backgroundImage||e.overlayImage||e.background||e.overlay){var r=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&t&&t()};this.__setBgOverlay("backgroundImage",e.backgroundImage,n,r),this.__setBgOverlay("overlayImage",e.overlayImage,n,r),this.__setBgOverlay("backgroundColor",e.background,n,r),this.__setBgOverlay("overlayColor",e.overlay,n,r)}else t&&t()},__setBgOverlay:function(e,t,n,r){var o=this;if(!t)return n[e]=!0,void(r&&r());"backgroundImage"===e||"overlayImage"===e?i.util.enlivenObjects([t],(function(t){o[e]=t[0],n[e]=!0,r&&r()})):this["set"+i.util.string.capitalize(e,!0)](t,(function(){n[e]=!0,r&&r()}))},_enlivenObjects:function(e,t,n){e&&0!==e.length?i.util.enlivenObjects(e,(function(e){t&&t(e)}),null,n):t&&t([])},_toDataURL:function(e,t){this.clone((function(n){t(n.toDataURL(e))}))},_toDataURLWithMultiplier:function(e,t,n){this.clone((function(r){n(r.toDataURLWithMultiplier(e,t))}))},clone:function(e,t){var n=JSON.stringify(this.toJSON(t));this.cloneWithoutData((function(t){t.loadFromJSON(n,(function(){e&&e(t)}))}))},cloneWithoutData:function(e){var t=i.util.createCanvasElement();t.width=this.width,t.height=this.height;var n=new i.Canvas(t);this.backgroundImage?(n.setBackgroundImage(this.backgroundImage.src,(function(){n.renderAll(),e&&e(n)})),n.backgroundImageOpacity=this.backgroundImageOpacity,n.backgroundImageStretch=this.backgroundImageStretch):e&&e(n)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i=t.util.toFixed,o=t.util.string.capitalize,a=t.util.degreesToRadians,s=!t.isLikelyNode;t.Object||(t.Object=t.util.createClass(t.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:s,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(e){e&&this.setOptions(e)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=t.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(e){var n=t.perfLimitSizeTotal,r=e.width,i=e.height,o=t.maxCacheSideLimit,a=t.minCacheSideLimit;if(r<=o&&i<=o&&r*i<=n)return rc&&(e.zoomX/=r/c,e.width=c,e.capped=!0),i>f&&(e.zoomY/=i/f,e.height=f,e.capped=!0),e},_getCacheCanvasDimensions:function(){var e=this.getTotalObjectScaling(),t=this._getTransformedDimensions(0,0),n=t.x*e.scaleX/this.scaleX,r=t.y*e.scaleY/this.scaleY;return{width:n+2,height:r+2,zoomX:e.scaleX,zoomY:e.scaleY,x:n,y:r}},_updateCacheCanvas:function(){var e=this.canvas;if(this.noScaleCache&&e&&e._currentTransform){var n=e._currentTransform.target,r=e._currentTransform.action;if(this===n&&r.slice&&"scale"===r.slice(0,5))return!1}var i,o,a=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),l=t.minCacheSideLimit,u=s.width,c=s.height,f=s.zoomX,d=s.zoomY,h=u!==this.cacheWidth||c!==this.cacheHeight,p=this.zoomX!==f||this.zoomY!==d,g=h||p,v=0,y=0,m=!1;if(h){var b=this._cacheCanvas.width,w=this._cacheCanvas.height,x=u>b||c>w;m=x||(u<.9*b||c<.9*w)&&b>l&&w>l,x&&!s.capped&&(u>l||c>l)&&(v=.1*u,y=.1*c)}return this instanceof t.Text&&this.path&&(g=!0,m=!0,v+=this.getHeightOfLine(0)*this.zoomX,y+=this.getHeightOfLine(0)*this.zoomY),!!g&&(m?(a.width=Math.ceil(u+v),a.height=Math.ceil(c+y)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,a.width,a.height)),i=s.x/2,o=s.y/2,this.cacheTranslationX=Math.round(a.width/2-i)+i,this.cacheTranslationY=Math.round(a.height/2-o)+o,this.cacheWidth=u,this.cacheHeight=c,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(f,d),this.zoomX=f,this.zoomY=d,!0)},setOptions:function(e){this._setOptions(e),this._initGradient(e.fill,"fill"),this._initGradient(e.stroke,"stroke"),this._initPattern(e.fill,"fill"),this._initPattern(e.stroke,"stroke")},transform:function(e){var t=this.group&&!this.group._transformDone||this.group&&this.canvas&&e===this.canvas.contextTop,n=this.calcTransformMatrix(!t);e.transform(n[0],n[1],n[2],n[3],n[4],n[5])},toObject:function(e){var n=t.Object.NUM_FRACTION_DIGITS,r={type:this.type,version:t.version,originX:this.originX,originY:this.originY,left:i(this.left,n),top:i(this.top,n),width:i(this.width,n),height:i(this.height,n),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,n),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,n),scaleX:i(this.scaleX,n),scaleY:i(this.scaleY,n),angle:i(this.angle,n),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,n),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,n),skewY:i(this.skewY,n)};return this.clipPath&&!this.clipPath.excludeFromExport&&(r.clipPath=this.clipPath.toObject(e),r.clipPath.inverted=this.clipPath.inverted,r.clipPath.absolutePositioned=this.clipPath.absolutePositioned),t.util.populateWithProperties(this,r,e),this.includeDefaultValues||(r=this._removeDefaultValues(r)),r},toDatalessObject:function(e){return this.toObject(e)},_removeDefaultValues:function(e){var n=t.util.getKlass(e.type).prototype;return n.stateProperties.forEach((function(t){"left"!==t&&"top"!==t&&(e[t]===n[t]&&delete e[t],"[object Array]"===Object.prototype.toString.call(e[t])&&"[object Array]"===Object.prototype.toString.call(n[t])&&0===e[t].length&&0===n[t].length&&delete e[t])})),e},toString:function(){return"#"},getObjectScaling:function(){if(!this.group)return{scaleX:this.scaleX,scaleY:this.scaleY};var e=t.util.qrDecompose(this.calcTransformMatrix());return{scaleX:Math.abs(e.scaleX),scaleY:Math.abs(e.scaleY)}},getTotalObjectScaling:function(){var e=this.getObjectScaling(),t=e.scaleX,n=e.scaleY;if(this.canvas){var r=this.canvas.getZoom(),i=this.canvas.getRetinaScaling();t*=r*i,n*=r*i}return{scaleX:t,scaleY:n}},getObjectOpacity:function(){var e=this.opacity;return this.group&&(e*=this.group.getObjectOpacity()),e},_set:function(e,n){var r="scaleX"===e||"scaleY"===e,i=this[e]!==n,o=!1;return r&&(n=this._constrainScale(n)),"scaleX"===e&&n<0?(this.flipX=!this.flipX,n*=-1):"scaleY"===e&&n<0?(this.flipY=!this.flipY,n*=-1):"shadow"!==e||!n||n instanceof t.Shadow?"dirty"===e&&this.group&&this.group.set("dirty",n):n=new t.Shadow(n),this[e]=n,i&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(e)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(e)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:t.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(e){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(e.save(),this._setupCompositeOperation(e),this.drawSelectionBackground(e),this.transform(e),this._setOpacity(e),this._setShadow(e,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(e)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(e),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),e.restore())},renderCache:function(e){e=e||{},this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,e.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!==typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(e){var n=this.clipPath;if(e.save(),n.inverted?e.globalCompositeOperation="destination-out":e.globalCompositeOperation="destination-in",n.absolutePositioned){var r=t.util.invertTransform(this.calcTransformMatrix());e.transform(r[0],r[1],r[2],r[3],r[4],r[5])}n.transform(e),e.scale(1/n.zoomX,1/n.zoomY),e.drawImage(n._cacheCanvas,-n.cacheTranslationX,-n.cacheTranslationY),e.restore()},drawObject:function(e,t){var n=this.fill,r=this.stroke;t?(this.fill="black",this.stroke="",this._setClippingProperties(e)):this._renderBackground(e),this._render(e),this._drawClipPath(e),this.fill=n,this.stroke=r},_drawClipPath:function(e){var t=this.clipPath;t&&(t.canvas=this.canvas,t.shouldCache(),t._transformDone=!0,t.renderCache({forClipping:!0}),this.drawClipPathOnCache(e))},drawCacheOnCanvas:function(e){e.scale(1/this.zoomX,1/this.zoomY),e.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(e){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!e&&this._updateCacheCanvas())return!0;if(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!e){var t=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-t/2,-n/2,t,n)}return!0}return!1},_renderBackground:function(e){if(this.backgroundColor){var t=this._getNonTransformedDimensions();e.fillStyle=this.backgroundColor,e.fillRect(-t.x/2,-t.y/2,t.x,t.y),this._removeShadow(e)}},_setOpacity:function(e){this.group&&!this.group._transformDone?e.globalAlpha=this.getObjectOpacity():e.globalAlpha*=this.opacity},_setStrokeStyles:function(e,t){var n=t.stroke;n&&(e.lineWidth=t.strokeWidth,e.lineCap=t.strokeLineCap,e.lineDashOffset=t.strokeDashOffset,e.lineJoin=t.strokeLineJoin,e.miterLimit=t.strokeMiterLimit,n.toLive?"percentage"===n.gradientUnits||n.gradientTransform||n.patternTransform?this._applyPatternForTransformedGradient(e,n):(e.strokeStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,n)):e.strokeStyle=t.stroke)},_setFillStyles:function(e,t){var n=t.fill;n&&(n.toLive?(e.fillStyle=n.toLive(e,this),this._applyPatternGradientTransform(e,t.fill)):e.fillStyle=n)},_setClippingProperties:function(e){e.globalAlpha=1,e.strokeStyle="transparent",e.fillStyle="#000000"},_setLineDash:function(e,t){t&&0!==t.length&&(1&t.length&&t.push.apply(t,t),e.setLineDash(t))},_renderControls:function(e,n){var r,i,o,s=this.getViewportTransform(),l=this.calcTransformMatrix();i="undefined"!==typeof(n=n||{}).hasBorders?n.hasBorders:this.hasBorders,o="undefined"!==typeof n.hasControls?n.hasControls:this.hasControls,l=t.util.multiplyTransformMatrices(s,l),r=t.util.qrDecompose(l),e.save(),e.translate(r.translateX,r.translateY),e.lineWidth=1*this.borderScaleFactor,this.group||(e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),e.rotate(a(r.angle)),n.forActiveSelection||this.group?i&&this.drawBordersInGroup(e,r,n):i&&this.drawBorders(e,n),o&&this.drawControls(e,n),e.restore()},_setShadow:function(e){if(this.shadow){var n,r=this.shadow,i=this.canvas,o=i&&i.viewportTransform[0]||1,a=i&&i.viewportTransform[3]||1;n=r.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(o*=t.devicePixelRatio,a*=t.devicePixelRatio),e.shadowColor=r.color,e.shadowBlur=r.blur*t.browserShadowBlurConstant*(o+a)*(n.scaleX+n.scaleY)/4,e.shadowOffsetX=r.offsetX*o*n.scaleX,e.shadowOffsetY=r.offsetY*a*n.scaleY}},_removeShadow:function(e){this.shadow&&(e.shadowColor="",e.shadowBlur=e.shadowOffsetX=e.shadowOffsetY=0)},_applyPatternGradientTransform:function(e,t){if(!t||!t.toLive)return{offsetX:0,offsetY:0};var n=t.gradientTransform||t.patternTransform,r=-this.width/2+t.offsetX||0,i=-this.height/2+t.offsetY||0;return"percentage"===t.gradientUnits?e.transform(this.width,0,0,this.height,r,i):e.transform(1,0,0,1,r,i),n&&e.transform(n[0],n[1],n[2],n[3],n[4],n[5]),{offsetX:r,offsetY:i}},_renderPaintInOrder:function(e){"stroke"===this.paintFirst?(this._renderStroke(e),this._renderFill(e)):(this._renderFill(e),this._renderStroke(e))},_render:function(){},_renderFill:function(e){this.fill&&(e.save(),this._setFillStyles(e,this),"evenodd"===this.fillRule?e.fill("evenodd"):e.fill(),e.restore())},_renderStroke:function(e){if(this.stroke&&0!==this.strokeWidth){if(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(e),e.save(),this.strokeUniform&&this.group){var t=this.getObjectScaling();e.scale(1/t.scaleX,1/t.scaleY)}else this.strokeUniform&&e.scale(1/this.scaleX,1/this.scaleY);this._setLineDash(e,this.strokeDashArray),this._setStrokeStyles(e,this),e.stroke(),e.restore()}},_applyPatternForTransformedGradient:function(e,n){var r,i=this._limitCacheSize(this._getCacheCanvasDimensions()),o=t.util.createCanvasElement(),a=this.canvas.getRetinaScaling(),s=i.x/this.scaleX/a,l=i.y/this.scaleY/a;o.width=s,o.height=l,(r=o.getContext("2d")).beginPath(),r.moveTo(0,0),r.lineTo(s,0),r.lineTo(s,l),r.lineTo(0,l),r.closePath(),r.translate(s/2,l/2),r.scale(i.zoomX/this.scaleX/a,i.zoomY/this.scaleY/a),this._applyPatternGradientTransform(r,n),r.fillStyle=n.toLive(e),r.fill(),e.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),e.scale(a*this.scaleX/i.zoomX,a*this.scaleY/i.zoomY),e.strokeStyle=r.createPattern(o,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var e=t.util.qrDecompose(this.transformMatrix);this.flipX=!1,this.flipY=!1,this.set("scaleX",e.scaleX),this.set("scaleY",e.scaleY),this.angle=e.angle,this.skewX=e.skewX,this.skewY=0}},_removeTransformMatrix:function(e){var n=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),n=t.util.transformPoint(n,this.transformMatrix)),this.transformMatrix=null,e&&(this.scaleX*=e.scaleX,this.scaleY*=e.scaleY,this.cropX=e.cropX,this.cropY=e.cropY,n.x+=e.offsetLeft,n.y+=e.offsetTop,this.width=e.width,this.height=e.height),this.setPositionByOrigin(n,"center","center")},clone:function(e,n){var r=this.toObject(n);this.constructor.fromObject?this.constructor.fromObject(r,e):t.Object._fromObject("Object",r,e)},cloneAsImage:function(e,n){var r=this.toCanvasElement(n);return e&&e(new t.Image(r)),this},toCanvasElement:function(e){e||(e={});var n=t.util,r=n.saveObjectTransform(this),i=this.group,o=this.shadow,a=Math.abs,s=(e.multiplier||1)*(e.enableRetinaScaling?t.devicePixelRatio:1);delete this.group,e.withoutTransform&&n.resetObjectTransform(this),e.withoutShadow&&(this.shadow=null);var l,u,c,f,d=t.util.createCanvasElement(),h=this.getBoundingRect(!0,!0),p=this.shadow,g={x:0,y:0};p&&(u=p.blur,l=p.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),g.x=2*Math.round(a(p.offsetX)+u)*a(l.scaleX),g.y=2*Math.round(a(p.offsetY)+u)*a(l.scaleY)),c=h.width+g.x,f=h.height+g.y,d.width=Math.ceil(c),d.height=Math.ceil(f);var v=new t.StaticCanvas(d,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1});"jpeg"===e.format&&(v.backgroundColor="#fff"),this.setPositionByOrigin(new t.Point(v.width/2,v.height/2),"center","center");var y=this.canvas;v.add(this);var m=v.toCanvasElement(s||1,e);return this.shadow=o,this.set("canvas",y),i&&(this.group=i),this.set(r).setCoords(),v._objects=[],v.dispose(),v=null,m},toDataURL:function(e){return e||(e={}),t.util.toDataURL(this.toCanvasElement(e),e.format||"png",e.quality||1)},isType:function(e){return this.type===e},complexity:function(){return 1},toJSON:function(e){return this.toObject(e)},rotate:function(e){var t=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return t&&this._setOriginToCenter(),this.set("angle",e),t&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(e,n){n=n||this.canvas.getPointer(e);var r=new t.Point(n.x,n.y),i=this._getLeftTopCoords();return this.angle&&(r=t.util.rotatePoint(r,i,a(-this.angle))),{x:r.x-i.x,y:r.y-i.y}},_setupCompositeOperation:function(e){this.globalCompositeOperation&&(e.globalCompositeOperation=this.globalCompositeOperation)}}),t.util.createAccessors&&t.util.createAccessors(t.Object),n(t.Object.prototype,t.Observable),t.Object.NUM_FRACTION_DIGITS=2,t.Object._fromObject=function(e,n,i,o){var a=t[e];n=r(n,!0),t.util.enlivenPatterns([n.fill,n.stroke],(function(e){"undefined"!==typeof e[0]&&(n.fill=e[0]),"undefined"!==typeof e[1]&&(n.stroke=e[1]),t.util.enlivenObjects([n.clipPath],(function(e){n.clipPath=e[0];var t=o?new a(n[o],n):new a(n);i&&i(t)}))}))},t.Object.__uid=0)}(t),function(){var e=i.util.degreesToRadians,t={left:-.5,center:0,right:.5},n={top:-.5,center:0,bottom:.5};i.util.object.extend(i.Object.prototype,{translateToGivenOrigin:function(e,r,o,a,s){var l,u,c,f=e.x,d=e.y;return"string"===typeof r?r=t[r]:r-=.5,"string"===typeof a?a=t[a]:a-=.5,"string"===typeof o?o=n[o]:o-=.5,"string"===typeof s?s=n[s]:s-=.5,u=s-o,((l=a-r)||u)&&(c=this._getTransformedDimensions(),f=e.x+l*c.x,d=e.y+u*c.y),new i.Point(f,d)},translateToCenterPoint:function(t,n,r){var o=this.translateToGivenOrigin(t,n,r,"center","center");return this.angle?i.util.rotatePoint(o,t,e(this.angle)):o},translateToOriginPoint:function(t,n,r){var o=this.translateToGivenOrigin(t,"center","center",n,r);return this.angle?i.util.rotatePoint(o,t,e(this.angle)):o},getCenterPoint:function(){var e=new i.Point(this.left,this.top);return this.translateToCenterPoint(e,this.originX,this.originY)},getPointByOrigin:function(e,t){var n=this.getCenterPoint();return this.translateToOriginPoint(n,e,t)},toLocalPoint:function(t,n,r){var o,a,s=this.getCenterPoint();return o="undefined"!==typeof n&&"undefined"!==typeof r?this.translateToGivenOrigin(s,"center","center",n,r):new i.Point(this.left,this.top),a=new i.Point(t.x,t.y),this.angle&&(a=i.util.rotatePoint(a,s,-e(this.angle))),a.subtractEquals(o)},setPositionByOrigin:function(e,t,n){var r=this.translateToCenterPoint(e,t,n),i=this.translateToOriginPoint(r,this.originX,this.originY);this.set("left",i.x),this.set("top",i.y)},adjustPosition:function(n){var r,o,a=e(this.angle),s=this.getScaledWidth(),l=i.util.cos(a)*s,u=i.util.sin(a)*s;r="string"===typeof this.originX?t[this.originX]:this.originX-.5,o="string"===typeof n?t[n]:n-.5,this.left+=l*(o-r),this.top+=u*(o-r),this.setCoords(),this.originX=n},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var e=this.getCenterPoint();this.originX="center",this.originY="center",this.left=e.x,this.top=e.y},_resetOrigin:function(){var e=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=e.x,this.top=e.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}})}(),function(){var e=i.util,t=e.degreesToRadians,n=e.multiplyTransformMatrices,r=e.transformPoint;e.object.extend(i.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(e,t){return t?e?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),e?this.aCoords:this.lineCoords)},getCoords:function(e,t){return n=this._getCoords(e,t),[new i.Point(n.tl.x,n.tl.y),new i.Point(n.tr.x,n.tr.y),new i.Point(n.br.x,n.br.y),new i.Point(n.bl.x,n.bl.y)];var n},intersectsWithRect:function(e,t,n,r){var o=this.getCoords(n,r);return"Intersection"===i.Intersection.intersectPolygonRectangle(o,e,t).status},intersectsWithObject:function(e,t,n){return"Intersection"===i.Intersection.intersectPolygonPolygon(this.getCoords(t,n),e.getCoords(t,n)).status||e.isContainedWithinObject(this,t,n)||this.isContainedWithinObject(e,t,n)},isContainedWithinObject:function(e,t,n){for(var r=this.getCoords(t,n),i=t?e.aCoords:e.lineCoords,o=0,a=e._getImageLines(i);o<4;o++)if(!e.containsPoint(r[o],a))return!1;return!0},isContainedWithinRect:function(e,t,n,r){var i=this.getBoundingRect(n,r);return i.left>=e.x&&i.left+i.width<=t.x&&i.top>=e.y&&i.top+i.height<=t.y},containsPoint:function(e,t,n,r){var i=this._getCoords(n,r),o=(t=t||this._getImageLines(i),this._findCrossPoints(e,t));return 0!==o&&o%2===1},isOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.getCoords(!0,e).some((function(e){return e.x<=n.x&&e.x>=t.x&&e.y<=n.y&&e.y>=t.y}))||(!!this.intersectsWithRect(t,n,!0,e)||this._containsCenterOfCanvas(t,n,e))},_containsCenterOfCanvas:function(e,t,n){var r={x:(e.x+t.x)/2,y:(e.y+t.y)/2};return!!this.containsPoint(r,null,!0,n)},isPartiallyOnScreen:function(e){if(!this.canvas)return!1;var t=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br;return!!this.intersectsWithRect(t,n,!0,e)||this.getCoords(!0,e).every((function(e){return(e.x>=n.x||e.x<=t.x)&&(e.y>=n.y||e.y<=t.y)}))&&this._containsCenterOfCanvas(t,n,e)},_getImageLines:function(e){return{topline:{o:e.tl,d:e.tr},rightline:{o:e.tr,d:e.br},bottomline:{o:e.br,d:e.bl},leftline:{o:e.bl,d:e.tl}}},_findCrossPoints:function(e,t){var n,r,i,o=0;for(var a in t)if(!((i=t[a]).o.y=e.y&&i.d.y>=e.y)&&(i.o.x===i.d.x&&i.o.x>=e.x?r=i.o.x:(0,n=(i.d.y-i.o.y)/(i.d.x-i.o.x),r=-(e.y-0*e.x-(i.o.y-n*i.o.x))/(0-n)),r>=e.x&&(o+=1),2===o))break;return o},getBoundingRect:function(t,n){var r=this.getCoords(t,n);return e.makeBoundingBoxFromPoints(r)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(e){return Math.abs(e)\n')}},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(e),{reviver:e})},toClipPathSVG:function(e){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(e),{reviver:e})},_createBaseClipPathSVGMarkup:function(e,t){var n=(t=t||{}).reviver,r=t.additionalTransform||"",i=[this.getSvgTransform(!0,r),this.getSvgCommons()].join(""),o=e.indexOf("COMMON_PARTS");return e[o]=i,n?n(e.join("")):e.join("")},_createBaseSVGMarkup:function(e,t){var n,r,o=(t=t||{}).noStyle,a=t.reviver,s=o?"":'style="'+this.getSvgStyles()+'" ',l=t.withShadow?'style="'+this.getSvgFilter()+'" ':"",u=this.clipPath,c=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",f=u&&u.absolutePositioned,d=this.stroke,h=this.fill,p=this.shadow,g=[],v=e.indexOf("COMMON_PARTS"),y=t.additionalTransform;return u&&(u.clipPathId="CLIPPATH_"+i.Object.__uid++,r='\n'+u.toClipPathSVG(a)+"\n"),f&&g.push("\n"),g.push("\n"),n=[s,c,o?"":this.addPaintOrder()," ",y?'transform="'+y+'" ':""].join(""),e[v]=n,h&&h.toLive&&g.push(h.toSVG(this)),d&&d.toLive&&g.push(d.toSVG(this)),p&&g.push(p.toSVG(this)),u&&g.push(r),g.push(e.join("")),g.push("\n"),f&&g.push("\n"),a?a(g.join("")):g.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var e=i.util.object.extend;function t(t,n,r){var i={};r.forEach((function(e){i[e]=t[e]})),e(t[n],i,!0)}i.util.object.extend(i.Object.prototype,{hasStateChanged:function(e){var t="_"+(e=e||"stateProperties");return Object.keys(this[t]).length=0;l--)if(i=s[l],this.isControlVisible(i)&&(r=this._getImageLines(t?this.oCoords[i].touchCorner:this.oCoords[i].corner),0!==(n=this._findCrossPoints({x:o,y:a},r))&&n%2===1))return this.__corner=i,i;return!1},forEachControl:function(e){for(var t in this.controls)e(this.controls[t],t,this)},_setCornerCoords:function(){var e=this.oCoords;for(var t in e){var n=this.controls[t];e[t].corner=n.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=n.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;t.save();var n=this.getCenterPoint(),r=this._calculateCurrentDimensions(),i=this.canvas.viewportTransform;return t.translate(n.x,n.y),t.scale(1/i[0],1/i[3]),t.rotate(e(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-r.x/2,-r.y/2,r.x,r.y),t.restore(),this},drawBorders:function(e,t){t=t||{};var n=this._calculateCurrentDimensions(),r=this.borderScaleFactor,i=n.x+r,o=n.y+r,a="undefined"!==typeof t.hasControls?t.hasControls:this.hasControls,s=!1;return e.save(),e.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(e,t.borderDashArray||this.borderDashArray),e.strokeRect(-i/2,-o/2,i,o),a&&(e.beginPath(),this.forEachControl((function(t,n,r){t.withConnection&&t.getVisibility(r,n)&&(s=!0,e.moveTo(t.x*i,t.y*o),e.lineTo(t.x*i+t.offsetX,t.y*o+t.offsetY))})),s&&e.stroke()),e.restore(),this},drawBordersInGroup:function(e,t,n){n=n||{};var r=i.util.sizeAfterTransform(this.width,this.height,t),o=this.strokeWidth,a=this.strokeUniform,s=this.borderScaleFactor,l=r.x+o*(a?this.canvas.getZoom():t.scaleX)+s,u=r.y+o*(a?this.canvas.getZoom():t.scaleY)+s;return e.save(),this._setLineDash(e,n.borderDashArray||this.borderDashArray),e.strokeStyle=n.borderColor||this.borderColor,e.strokeRect(-l/2,-u/2,l,u),e.restore(),this},drawControls:function(e,t){t=t||{},e.save();var n,r,o=this.canvas.getRetinaScaling();return e.setTransform(o,0,0,o,0,0),e.strokeStyle=e.fillStyle=t.cornerColor||this.cornerColor,this.transparentCorners||(e.strokeStyle=t.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(e,t.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(n=this.group.calcTransformMatrix()),this.forEachControl((function(o,a,s){r=s.oCoords[a],o.getVisibility(s,a)&&(n&&(r=i.util.transformPoint(r,n)),o.render(e,r.x,r.y,t,s))})),e.restore(),this},isControlVisible:function(e){return this.controls[e]&&this.controls[e].getVisibility(this,e)},setControlVisible:function(e,t){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[e]=t,this},setControlsVisibility:function(e){for(var t in e||(e={}),e)this.setControlVisible(t,e[t]);return this},onDeselect:function(){},onSelect:function(){}})}(),i.util.object.extend(i.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){var n=function(){},r=(t=t||{}).onComplete||n,o=t.onChange||n,a=this;return i.util.animate({startValue:e.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),r()}}),this},fxCenterObjectV:function(e,t){var n=function(){},r=(t=t||{}).onComplete||n,o=t.onChange||n,a=this;return i.util.animate({startValue:e.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),a.requestRenderAll(),o()},onComplete:function(){e.setCoords(),r()}}),this},fxRemove:function(e,t){var n=function(){},r=(t=t||{}).onComplete||n,o=t.onChange||n,a=this;return i.util.animate({startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),a.requestRenderAll(),o()},onComplete:function(){a.remove(e),r()}}),this}}),i.util.object.extend(i.Object.prototype,{animate:function(){if(arguments[0]&&"object"===typeof arguments[0]){var e,t,n=[];for(e in arguments[0])n.push(e);for(var r=0,i=n.length;r-1||o&&a.colorProperties.indexOf(o[1])>-1,l=o?this.get(o[0])[o[1]]:this.get(e);"from"in n||(n.from=l),s||(t=~t.indexOf("=")?l+parseFloat(t.replace("=","")):parseFloat(t));var u={startValue:n.from,endValue:t,byValue:n.by,easing:n.easing,duration:n.duration,abort:n.abort&&function(e,t,r){return n.abort.call(a,e,t,r)},onChange:function(t,i,s){o?a[o[0]][o[1]]=t:a.set(e,t),r||n.onChange&&n.onChange(t,i,s)},onComplete:function(e,t,i){r||(a.setCoords(),n.onComplete&&n.onComplete(e,t,i))}};return s?i.util.animateColor(u.startValue,u.endValue,u.duration,u):i.util.animate(u)}}),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function o(e,t){var n=e.origin,r=e.axis1,i=e.axis2,o=e.dimension,a=t.nearest,s=t.center,l=t.farthest;return function(){switch(this.get(n)){case a:return Math.min(this.get(r),this.get(i));case s:return Math.min(this.get(r),this.get(i))+.5*this.get(o);case l:return Math.max(this.get(r),this.get(i))}}}t.Line?t.warn("fabric.Line is already defined"):(t.Line=t.util.createClass(t.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:t.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(e,t){e||(e=[0,0,0,0]),this.callSuper("initialize",t),this.set("x1",e[0]),this.set("y1",e[1]),this.set("x2",e[2]),this.set("y2",e[3]),this._setWidthHeight(t)},_setWidthHeight:function(e){e||(e={}),this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in e?e.left:this._getLeftToOriginX(),this.top="top"in e?e.top:this._getTopToOriginY()},_set:function(e,t){return this.callSuper("_set",e,t),"undefined"!==typeof i[e]&&this._setWidthHeight(),this},_getLeftToOriginX:o({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:o({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(e){e.beginPath();var t=this.calcLinePoints();e.moveTo(t.x1,t.y1),e.lineTo(t.x2,t.y2),e.lineWidth=this.strokeWidth;var n=e.strokeStyle;e.strokeStyle=this.stroke||e.fillStyle,this.stroke&&this._renderStroke(e),e.strokeStyle=n},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(e){return n(this.callSuper("toObject",e),this.calcLinePoints())},_getNonTransformedDimensions:function(){var e=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(e.y-=this.strokeWidth),0===this.height&&(e.x-=this.strokeWidth)),e},calcLinePoints:function(){var e=this.x1<=this.x2?-1:1,t=this.y1<=this.y2?-1:1,n=e*this.width*.5,r=t*this.height*.5;return{x1:n,x2:e*this.width*-.5,y1:r,y2:t*this.height*-.5}},_toSVG:function(){var e=this.calcLinePoints();return["\n']}}),t.Line.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),t.Line.fromElement=function(e,r,i){i=i||{};var o=t.parseAttributes(e,t.Line.ATTRIBUTE_NAMES),a=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];r(new t.Line(a,n(o,i)))},t.Line.fromObject=function(e,n){var i=r(e,!0);i.points=[e.x1,e.y1,e.x2,e.y2],t.Object._fromObject("Line",i,(function(e){delete e.points,n&&n(e)}),"points")})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=Math.PI;t.Circle?t.warn("fabric.Circle is already defined."):(t.Circle=t.util.createClass(t.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*n,cacheProperties:t.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(e,t){return this.callSuper("_set",e,t),"radius"===e&&this.setRadius(t),this},toObject:function(e){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(e))},_toSVG:function(){var e,r=(this.endAngle-this.startAngle)%(2*n);if(0===r)e=["\n'];else{var i=t.util.cos(this.startAngle)*this.radius,o=t.util.sin(this.startAngle)*this.radius,a=t.util.cos(this.endAngle)*this.radius,s=t.util.sin(this.endAngle)*this.radius,l=r>n?"1":"0";e=['\n"]}return e},_render:function(e){e.beginPath(),e.arc(0,0,this.radius,this.startAngle,this.endAngle,!1),this._renderPaintInOrder(e)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(e){return this.radius=e,this.set("width",2*e).set("height",2*e)}}),t.Circle.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),t.Circle.fromElement=function(e,n){var r,i=t.parseAttributes(e,t.Circle.ATTRIBUTE_NAMES);if(!("radius"in(r=i)&&r.radius>=0))throw new Error("value of `r` attribute is required and can not be negative");i.left=(i.left||0)-i.radius,i.top=(i.top||0)-i.radius,n(new t.Circle(i))},t.Circle.fromObject=function(e,n){t.Object._fromObject("Circle",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={});t.Triangle?t.warn("fabric.Triangle is already defined"):(t.Triangle=t.util.createClass(t.Object,{type:"triangle",width:100,height:100,_render:function(e){var t=this.width/2,n=this.height/2;e.beginPath(),e.moveTo(-t,n),e.lineTo(0,-n),e.lineTo(t,n),e.closePath(),this._renderPaintInOrder(e)},_toSVG:function(){var e=this.width/2,t=this.height/2;return["']}}),t.Triangle.fromObject=function(e,n){return t.Object._fromObject("Triangle",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=2*Math.PI;t.Ellipse?t.warn("fabric.Ellipse is already defined."):(t.Ellipse=t.util.createClass(t.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this.set("rx",e&&e.rx||0),this.set("ry",e&&e.ry||0)},_set:function(e,t){switch(this.callSuper("_set",e,t),e){case"rx":this.rx=t,this.set("width",2*t);break;case"ry":this.ry=t,this.set("height",2*t)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["\n']},_render:function(e){e.beginPath(),e.save(),e.transform(1,0,0,this.ry/this.rx,0,0),e.arc(0,0,this.rx,0,n,!1),e.restore(),this._renderPaintInOrder(e)}}),t.Ellipse.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),t.Ellipse.fromElement=function(e,n){var r=t.parseAttributes(e,t.Ellipse.ATTRIBUTE_NAMES);r.left=(r.left||0)-r.rx,r.top=(r.top||0)-r.ry,n(new t.Ellipse(r))},t.Ellipse.fromObject=function(e,n){t.Object._fromObject("Ellipse",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend;t.Rect?t.warn("fabric.Rect is already defined"):(t.Rect=t.util.createClass(t.Object,{stateProperties:t.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:t.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(e){this.callSuper("initialize",e),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(e){var t=this.rx?Math.min(this.rx,this.width/2):0,n=this.ry?Math.min(this.ry,this.height/2):0,r=this.width,i=this.height,o=-this.width/2,a=-this.height/2,s=0!==t||0!==n,l=.4477152502;e.beginPath(),e.moveTo(o+t,a),e.lineTo(o+r-t,a),s&&e.bezierCurveTo(o+r-l*t,a,o+r,a+l*n,o+r,a+n),e.lineTo(o+r,a+i-n),s&&e.bezierCurveTo(o+r,a+i-l*n,o+r-l*t,a+i,o+r-t,a+i),e.lineTo(o+t,a+i),s&&e.bezierCurveTo(o+l*t,a+i,o,a+i-l*n,o,a+i-n),e.lineTo(o,a+n),s&&e.bezierCurveTo(o,a+l*n,o+l*t,a,o+t,a),e.closePath(),this._renderPaintInOrder(e)},toObject:function(e){return this.callSuper("toObject",["rx","ry"].concat(e))},_toSVG:function(){return["\n']}}),t.Rect.ATTRIBUTE_NAMES=t.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),t.Rect.fromElement=function(e,r,i){if(!e)return r(null);i=i||{};var o=t.parseAttributes(e,t.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0,o.height=o.height||0,o.width=o.width||0;var a=new t.Rect(n(i?t.util.object.clone(i):{},o));a.visible=a.visible&&a.width>0&&a.height>0,r(a)},t.Rect.fromObject=function(e,n){return t.Object._fromObject("Rect",e,n)})}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.util.object.extend,r=t.util.array.min,i=t.util.array.max,o=t.util.toFixed;t.Polyline?t.warn("fabric.Polyline is already defined"):(t.Polyline=t.util.createClass(t.Object,{type:"polyline",points:null,cacheProperties:t.Object.prototype.cacheProperties.concat("points"),initialize:function(e,t){t=t||{},this.points=e||[],this.callSuper("initialize",t),this._setPositionDimensions(t)},_setPositionDimensions:function(e){var t,n=this._calcDimensions(e);this.width=n.width,this.height=n.height,e.fromSVG||(t=this.translateToGivenOrigin({x:n.left-this.strokeWidth/2,y:n.top-this.strokeWidth/2},"left","top",this.originX,this.originY)),"undefined"===typeof e.left&&(this.left=e.fromSVG?n.left:t.x),"undefined"===typeof e.top&&(this.top=e.fromSVG?n.top:t.y),this.pathOffset={x:n.left+this.width/2,y:n.top+this.height/2}},_calcDimensions:function(){var e=this.points,t=r(e,"x")||0,n=r(e,"y")||0;return{left:t,top:n,width:(i(e,"x")||0)-t,height:(i(e,"y")||0)-n}},toObject:function(e){return n(this.callSuper("toObject",e),{points:this.points.concat()})},_toSVG:function(){for(var e=[],n=this.pathOffset.x,r=this.pathOffset.y,i=t.Object.NUM_FRACTION_DIGITS,a=0,s=this.points.length;a\n']},commonRender:function(e){var t,n=this.points.length,r=this.pathOffset.x,i=this.pathOffset.y;if(!n||isNaN(this.points[n-1].y))return!1;e.beginPath(),e.moveTo(this.points[0].x-r,this.points[0].y-i);for(var o=0;o"},toObject:function(e){return i(this.callSuper("toObject",e),{path:this.path.map((function(e){return e.slice()}))})},toDatalessObject:function(e){var t=this.toObject(["sourcePath"].concat(e));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["\n"]},_getOffsetTransform:function(){var e=t.Object.NUM_FRACTION_DIGITS;return" translate("+a(-this.pathOffset.x,e)+", "+a(-this.pathOffset.y,e)+")"},toClipPathSVG:function(e){var t=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},toSVG:function(e){var t=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,additionalTransform:t})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var e,i,o=[],a=[],s=0,l=0,u=0,c=0,f=0,d=this.path.length;f"},addWithUpdate:function(e){var n=!!this.group;return this._restoreObjectsState(),t.util.resetObjectTransform(this),e&&(n&&t.util.removeTransformFromObject(e,this.group.calcTransformMatrix()),this._objects.push(e),e.group=this,e._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,n?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(e){return this._restoreObjectsState(),t.util.resetObjectTransform(this),this.remove(e),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(e){this.dirty=!0,e.group=this,e._set("canvas",this.canvas)},_onObjectRemoved:function(e){this.dirty=!0,delete e.group},_set:function(e,n){var r=this._objects.length;if(this.useSetOnGroup)for(;r--;)this._objects[r].setOnGroup(e,n);if("canvas"===e)for(;r--;)this._objects[r]._set(e,n);t.Object.prototype._set.call(this,e,n)},toObject:function(e){var n=this.includeDefaultValues,r=this._objects.filter((function(e){return!e.excludeFromExport})).map((function(t){var r=t.includeDefaultValues;t.includeDefaultValues=n;var i=t.toObject(e);return t.includeDefaultValues=r,i})),i=t.Object.prototype.toObject.call(this,e);return i.objects=r,i},toDatalessObject:function(e){var n,r=this.sourcePath;if(r)n=r;else{var i=this.includeDefaultValues;n=this._objects.map((function(t){var n=t.includeDefaultValues;t.includeDefaultValues=i;var r=t.toDatalessObject(e);return t.includeDefaultValues=n,r}))}var o=t.Object.prototype.toDatalessObject.call(this,e);return o.objects=n,o},render:function(e){this._transformDone=!0,this.callSuper("render",e),this._transformDone=!1},shouldCache:function(){var e=t.Object.prototype.shouldCache.call(this);if(e)for(var n=0,r=this._objects.length;n\n"],n=0,r=this._objects.length;n\n"),t},getSvgStyles:function(){var e="undefined"!==typeof this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",t=this.visible?"":" visibility: hidden;";return[e,this.getSvgFilter(),t].join("")},toClipPathSVG:function(e){for(var t=[],n=0,r=this._objects.length;n"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(e,t,n){e.save(),e.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",e,t),"undefined"===typeof(n=n||{}).hasControls&&(n.hasControls=!1),n.forActiveSelection=!0;for(var r=0,i=this._objects.length;r\n','\t\n',"\n"),s=' clip-path="url(#imageCrop_'+u+')" '}if(this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),n.push("\t\n"),this.stroke||this.strokeDashArray){var c=this.fill;this.fill=null,e=["\t\n'],this.fill=c}return t="fill"!==this.paintFirst?t.concat(e,n):t.concat(n,e)},getSrc:function(e){var t=e?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(e,t,n){return i.util.loadImage(e,(function(e,r){this.setElement(e,n),this._setWidthHeight(),t&&t(this,r)}),this,n&&n.crossOrigin),this},toString:function(){return'#'},applyResizeFilters:function(){var e=this.resizeFilter,t=this.minimumScaleTrigger,n=this.getTotalObjectScaling(),r=n.scaleX,o=n.scaleY,a=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!e||r>t&&o>t)return this._element=a,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=r,void(this._lastScaleY=o);i.filterBackend||(i.filterBackend=i.initFilterBackend());var s=i.util.createCanvasElement(),l=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,u=a.width,c=a.height;s.width=u,s.height=c,this._element=s,this._lastScaleX=e.scaleX=r,this._lastScaleY=e.scaleY=o,i.filterBackend.applyFilters([e],a,u,c,this._element,l),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height},applyFilters:function(e){if(e=(e=e||this.filters||[]).filter((function(e){return e&&!e.isNeutralState()})),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===e.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;var t=this._originalElement,n=t.naturalWidth||t.width,r=t.naturalHeight||t.height;if(this._element===this._originalElement){var o=i.util.createCanvasElement();o.width=n,o.height=r,this._element=o,this._filteredEl=o}else this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,n,r),this._lastScaleX=1,this._lastScaleY=1;return i.filterBackend||(i.filterBackend=i.initFilterBackend()),i.filterBackend.applyFilters(e,this._originalElement,n,r,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height),this},_render:function(e){i.util.setImageSmoothing(e,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(e),this._renderPaintInOrder(e)},drawCacheOnCanvas:function(e){i.util.setImageSmoothing(e,this.imageSmoothing),i.Object.prototype.drawCacheOnCanvas.call(this,e)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(e){var t=this._element;if(t){var n=this._filterScalingX,r=this._filterScalingY,i=this.width,o=this.height,a=Math.min,s=Math.max,l=s(this.cropX,0),u=s(this.cropY,0),c=t.naturalWidth||t.width,f=t.naturalHeight||t.height,d=l*n,h=u*r,p=a(i*n,c-d),g=a(o*r,f-h),v=-i/2,y=-o/2,m=a(i,c/n-l),b=a(o,f/r-u);t&&e.drawImage(t,d,h,p,g,v,y,m,b)}},_needsResize:function(){var e=this.getTotalObjectScaling();return e.scaleX!==this._lastScaleX||e.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(e,t){this.setElement(i.util.getById(e),t),i.util.addClass(this.getElement(),i.Image.CSS_CANVAS)},_initConfig:function(e){e||(e={}),this.setOptions(e),this._setWidthHeight(e)},_initFilters:function(e,t){e&&e.length?i.util.enlivenObjects(e,(function(e){t&&t(e)}),"fabric.Image.filters"):t&&t()},_setWidthHeight:function(e){e||(e={});var t=this.getElement();this.width=e.width||t.naturalWidth||t.width||0,this.height=e.height||t.naturalHeight||t.height||0},parsePreserveAspectRatioAttribute:function(){var e,t=i.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),n=this._element.width,r=this._element.height,o=1,a=1,s=0,l=0,u=0,c=0,f=this.width,d=this.height,h={width:f,height:d};return!t||"none"===t.alignX&&"none"===t.alignY?(o=f/n,a=d/r):("meet"===t.meetOrSlice&&(e=(f-n*(o=a=i.util.findScaleToFit(this._element,h)))/2,"Min"===t.alignX&&(s=-e),"Max"===t.alignX&&(s=e),e=(d-r*a)/2,"Min"===t.alignY&&(l=-e),"Max"===t.alignY&&(l=e)),"slice"===t.meetOrSlice&&(e=n-f/(o=a=i.util.findScaleToCover(this._element,h)),"Mid"===t.alignX&&(u=e/2),"Max"===t.alignX&&(u=e),e=r-d/a,"Mid"===t.alignY&&(c=e/2),"Max"===t.alignY&&(c=e),n=f/o,r=d/a)),{width:n,height:r,scaleX:o,scaleY:a,offsetLeft:s,offsetTop:l,cropX:u,cropY:c}}}),i.Image.CSS_CANVAS="canvas-img",i.Image.prototype.getSvgSrc=i.Image.prototype.getSrc,i.Image.fromObject=function(e,t){var n=i.util.object.clone(e);i.util.loadImage(n.src,(function(e,r){r?t&&t(null,!0):i.Image.prototype._initFilters.call(n,n.filters,(function(r){n.filters=r||[],i.Image.prototype._initFilters.call(n,[n.resizeFilter],(function(r){n.resizeFilter=r[0],i.util.enlivenObjects([n.clipPath],(function(r){n.clipPath=r[0];var o=new i.Image(e,n);t(o,!1)}))}))}))}),null,n.crossOrigin)},i.Image.fromURL=function(e,t,n){i.util.loadImage(e,(function(e,r){t&&t(new i.Image(e,n),r)}),null,n&&n.crossOrigin)},i.Image.ATTRIBUTE_NAMES=i.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),i.Image.fromElement=function(e,n,r){var o=i.parseAttributes(e,i.Image.ATTRIBUTE_NAMES);i.Image.fromURL(o["xlink:href"],n,t(r?i.util.object.clone(r):{},o))})}(t),i.util.object.extend(i.Object.prototype,{_getAngleValueForStraighten:function(){var e=this.angle%360;return e>0?90*Math.round((e-1)/90):90*Math.round(e/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(e){var t=function(){},n=(e=e||{}).onComplete||t,r=e.onChange||t,o=this;return i.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(e){o.rotate(e),r()},onComplete:function(){o.setCoords(),n()}}),this}}),i.util.object.extend(i.StaticCanvas.prototype,{straightenObject:function(e){return e.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(e){return e.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function e(e,t){var n="precision "+t+" float;\nvoid main(){}",r=e.createShader(e.FRAGMENT_SHADER);return e.shaderSource(r,n),e.compileShader(r),!!e.getShaderParameter(r,e.COMPILE_STATUS)}function t(e){e&&e.tileSize&&(this.tileSize=e.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}i.isWebglSupported=function(t){if(i.isLikelyNode)return!1;t=t||i.WebglFilterBackend.prototype.tileSize;var n=document.createElement("canvas"),r=n.getContext("webgl")||n.getContext("experimental-webgl"),o=!1;if(r){i.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),o=i.maxTextureSize>=t;for(var a=["highp","mediump","lowp"],s=0;s<3;s++)if(e(r,a[s])){i.webGlPrecision=a[s];break}}return this.isSupported=o,o},i.WebglFilterBackend=t,t.prototype={tileSize:2048,resources:{},setupGLContext:function(e,t){this.dispose(),this.createWebGLCanvas(e,t),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(e,t)},chooseFastestCopyGLTo2DMethod:function(e,t){var n,r="undefined"!==typeof window.performance;try{new ImageData(1,1),n=!0}catch(p){n=!1}var o="undefined"!==typeof ArrayBuffer,l="undefined"!==typeof Uint8ClampedArray;if(r&&n&&o&&l){var u=i.util.createCanvasElement(),c=new ArrayBuffer(e*t*4);if(i.forceGLPutImageData)return this.imageBuffer=c,void(this.copyGLTo2D=s);var f,d,h={imageBuffer:c,destinationWidth:e,destinationHeight:t,targetCanvas:u};u.width=e,u.height=t,f=window.performance.now(),a.call(h,this.gl,h),d=window.performance.now()-f,f=window.performance.now(),s.call(h,this.gl,h),d>window.performance.now()-f?(this.imageBuffer=c,this.copyGLTo2D=s):this.copyGLTo2D=a}},createWebGLCanvas:function(e,t){var n=i.util.createCanvasElement();n.width=e,n.height=t;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=n.getContext("webgl",r);o||(o=n.getContext("experimental-webgl",r)),o&&(o.clearColor(0,0,0,0),this.canvas=n,this.gl=o)},applyFilters:function(e,t,n,r,i,o){var a,s=this.gl;o&&(a=this.getCachedTexture(o,t));var l={originalWidth:t.width||t.originalWidth,originalHeight:t.height||t.originalHeight,sourceWidth:n,sourceHeight:r,destinationWidth:n,destinationHeight:r,context:s,sourceTexture:this.createTexture(s,n,r,!a&&t),targetTexture:this.createTexture(s,n,r),originalTexture:a||this.createTexture(s,n,r,!a&&t),passes:e.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:i},u=s.createFramebuffer();return s.bindFramebuffer(s.FRAMEBUFFER,u),e.forEach((function(e){e&&e.applyTo(l)})),function(e){var t=e.targetCanvas,n=t.width,r=t.height,i=e.destinationWidth,o=e.destinationHeight;n===i&&r===o||(t.width=i,t.height=o)}(l),this.copyGLTo2D(s,l),s.bindTexture(s.TEXTURE_2D,null),s.deleteTexture(l.sourceTexture),s.deleteTexture(l.targetTexture),s.deleteFramebuffer(u),i.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(e,t,n,r){var i=e.createTexture();return e.bindTexture(e.TEXTURE_2D,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),r?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,t,n,0,e.RGBA,e.UNSIGNED_BYTE,null),i},getCachedTexture:function(e,t){if(this.textureCache[e])return this.textureCache[e];var n=this.createTexture(this.gl,t.width,t.height,t);return this.textureCache[e]=n,n},evictCachesForKey:function(e){this.textureCache[e]&&(this.gl.deleteTexture(this.textureCache[e]),delete this.textureCache[e])},copyGLTo2D:a,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var e=this.gl,t={renderer:"",vendor:""};if(!e)return t;var n=e.getExtension("WEBGL_debug_renderer_info");if(n){var r=e.getParameter(n.UNMASKED_RENDERER_WEBGL),i=e.getParameter(n.UNMASKED_VENDOR_WEBGL);r&&(t.renderer=r.toLowerCase()),i&&(t.vendor=i.toLowerCase())}return this.gpuInfo=t,t}}}(),function(){"use strict";var e=function(){};function t(){}i.Canvas2dFilterBackend=t,t.prototype={evictCachesForKey:e,dispose:e,clearWebGLCaches:e,resources:{},applyFilters:function(e,t,n,r,i){var o=i.getContext("2d");o.drawImage(t,0,0,n,r);var a={sourceWidth:n,sourceHeight:r,imageData:o.getImageData(0,0,n,r),originalEl:t,originalImageData:o.getImageData(0,0,n,r),canvasEl:i,ctx:o,filterBackend:this};return e.forEach((function(e){e.applyTo(a)})),a.imageData.width===n&&a.imageData.height===r||(i.width=a.imageData.width,i.height=a.imageData.height),o.putImageData(a.imageData,0,0),a}}}(),i.Image=i.Image||{},i.Image.filters=i.Image.filters||{},i.Image.filters.BaseFilter=i.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main() {\nvTexCoord = aPosition;\ngl_Position = vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main() {\ngl_FragColor = texture2D(uTexture, vTexCoord);\n}",initialize:function(e){e&&this.setOptions(e)},setOptions:function(e){for(var t in e)this[t]=e[t]},createProgram:function(e,t,n){t=t||this.fragmentSource,n=n||this.vertexSource,"highp"!==i.webGlPrecision&&(t=t.replace(/precision highp float/g,"precision "+i.webGlPrecision+" float"));var r=e.createShader(e.VERTEX_SHADER);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+e.getShaderInfoLog(r));var o=e.createShader(e.FRAGMENT_SHADER);if(e.shaderSource(o,t),e.compileShader(o),!e.getShaderParameter(o,e.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+e.getShaderInfoLog(o));var a=e.createProgram();if(e.attachShader(a,r),e.attachShader(a,o),e.linkProgram(a),!e.getProgramParameter(a,e.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+e.getProgramInfoLog(a));var s=this.getAttributeLocations(e,a),l=this.getUniformLocations(e,a)||{};return l.uStepW=e.getUniformLocation(a,"uStepW"),l.uStepH=e.getUniformLocation(a,"uStepH"),{program:a,attributeLocations:s,uniformLocations:l}},getAttributeLocations:function(e,t){return{aPosition:e.getAttribLocation(t,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(e,t,n){var r=t.aPosition,i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r),e.vertexAttribPointer(r,2,e.FLOAT,!1,0,0),e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW)},_setupFrameBuffer:function(e){var t,n,r=e.context;e.passes>1?(t=e.destinationWidth,n=e.destinationHeight,e.sourceWidth===t&&e.sourceHeight===n||(r.deleteTexture(e.targetTexture),e.targetTexture=e.filterBackend.createTexture(r,t,n)),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.targetTexture,0)):(r.bindFramebuffer(r.FRAMEBUFFER,null),r.finish())},_swapTextures:function(e){e.passes--,e.pass++;var t=e.targetTexture;e.targetTexture=e.sourceTexture,e.sourceTexture=t},isNeutralState:function(){var e=this.mainParameter,t=i.Image.filters[this.type].prototype;if(e){if(Array.isArray(t[e])){for(var n=t[e].length;n--;)if(this[e][n]!==t[e][n])return!1;return!0}return t[e]===this[e]}return!1},applyTo:function(e){e.webgl?(this._setupFrameBuffer(e),this.applyToWebGL(e),this._swapTextures(e)):this.applyTo2d(e)},retrieveShader:function(e){return e.programCache.hasOwnProperty(this.type)||(e.programCache[this.type]=this.createProgram(e.context)),e.programCache[this.type]},applyToWebGL:function(e){var t=e.context,n=this.retrieveShader(e);0===e.pass&&e.originalTexture?t.bindTexture(t.TEXTURE_2D,e.originalTexture):t.bindTexture(t.TEXTURE_2D,e.sourceTexture),t.useProgram(n.program),this.sendAttributeData(t,n.attributeLocations,e.aPosition),t.uniform1f(n.uniformLocations.uStepW,1/e.sourceWidth),t.uniform1f(n.uniformLocations.uStepH,1/e.sourceHeight),this.sendUniformData(t,n.uniformLocations),t.viewport(0,0,e.destinationWidth,e.destinationHeight),t.drawArrays(t.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(e,t,n){e.activeTexture(n),e.bindTexture(e.TEXTURE_2D,t),e.activeTexture(e.TEXTURE0)},unbindAdditionalTexture:function(e,t){e.activeTexture(t),e.bindTexture(e.TEXTURE_2D,null),e.activeTexture(e.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(e){this[this.mainParameter]=e},sendUniformData:function(){},createHelpLayer:function(e){if(!e.helpLayer){var t=document.createElement("canvas");t.width=e.sourceWidth,t.height=e.sourceHeight,e.helpLayer=t}},toObject:function(){var e={type:this.type},t=this.mainParameter;return t&&(e[t]=this[t]),e},toJSON:function(){return this.toObject()}}),i.Image.filters.BaseFilter.fromObject=function(e,t){var n=new i.Image.filters[e.type](e);return t&&t(n),n},function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.ColorMatrix=r(n.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\ncolor *= uColorMatrix;\ncolor += uConstants;\ngl_FragColor = color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(e){this.callSuper("initialize",e),this.matrix=this.matrix.slice(0)},applyTo2d:function(e){var t,n,r,i,o,a=e.imageData.data,s=a.length,l=this.matrix,u=this.colorsOnly;for(o=0;o=w||a<0||a>=b||(l=4*(s*b+a),u=v[h*y+d],t+=g[l]*u,n+=g[l+1]*u,r+=g[l+2]*u,O||(i+=g[l+3]*u));_[o]=t,_[o+1]=n,_[o+2]=r,_[o+3]=O?g[o+3]:i}e.imageData=x},getUniformLocations:function(e,t){return{uMatrix:e.getUniformLocation(t,"uMatrix"),uOpaque:e.getUniformLocation(t,"uOpaque"),uHalfSize:e.getUniformLocation(t,"uHalfSize"),uSize:e.getUniformLocation(t,"uSize")}},sendUniformData:function(e,t){e.uniform1fv(t.uMatrix,this.matrix)},toObject:function(){return n(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Grayscale=r(n.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat average = (color.r + color.b + color.g) / 3.0;\ngl_FragColor = vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = (max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor = vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 col = texture2D(uTexture, vTexCoord);\nfloat average = 0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor = vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(e){var t,n,r=e.imageData.data,i=r.length,o=this.mode;for(t=0;tu[0]&&i>u[1]&&o>u[2]&&r 0.0) {\n"+this.fragmentSource[e]+"}\n}"},retrieveShader:function(e){var t,n=this.type+"_"+this.mode;return e.programCache.hasOwnProperty(n)||(t=this.buildSource(this.mode),e.programCache[n]=this.createProgram(e.context,t)),e.programCache[n]},applyTo2d:function(e){var n,r,i,o,a,s,l,u=e.imageData.data,c=u.length,f=1-this.alpha;n=(l=new t.Color(this.color).getSource())[0]*this.alpha,r=l[1]*this.alpha,i=l[2]*this.alpha;for(var d=0;d=e||t<=-e)return 0;if(t<1.1920929e-7&&t>-1.1920929e-7)return 1;var n=(t*=Math.PI)/e;return s(t)/t*s(n)/n}},applyTo2d:function(e){var t=e.imageData,n=this.scaleX,r=this.scaleY;this.rcpScaleX=1/n,this.rcpScaleY=1/r;var i,o=t.width,s=t.height,l=a(o*n),u=a(s*r);"sliceHack"===this.resizeType?i=this.sliceByTwo(e,o,s,l,u):"hermite"===this.resizeType?i=this.hermiteFastResize(e,o,s,l,u):"bilinear"===this.resizeType?i=this.bilinearFiltering(e,o,s,l,u):"lanczos"===this.resizeType&&(i=this.lanczosResize(e,o,s,l,u)),e.imageData=i},sliceByTwo:function(e,n,i,o,a){var s,l,u=e.imageData,c=!1,f=!1,d=.5*n,h=.5*i,p=t.filterBackend.resources,g=0,v=0,y=n,m=0;for(p.sliceByTwo||(p.sliceByTwo=document.createElement("canvas")),((s=p.sliceByTwo).width<1.5*n||s.height=t)){A=r(1e3*o(C-x.x)),w[A]||(w[A]={});for(var I=_.y-b;I<=_.y+b;I++)I<0||I>=a||(D=r(1e3*o(I-x.y)),w[A][D]||(w[A][D]=h(i(n(A*v,2)+n(D*y,2))/1e3)),(S=w[A][D])>0&&(P+=S,T+=S*c[E=4*(I*t+C)],k+=S*c[E+1],j+=S*c[E+2],R+=S*c[E+3]))}d[E=4*(O*s+l)]=T/P,d[E+1]=k/P,d[E+2]=j/P,d[E+3]=R/P}return++l1&&D<-1||(b=2*D*D*D-3*D*D+1)>0&&(S+=b*h[(A=4*(R+P*t))+3],x+=b,h[A+3]<255&&(b=b*h[A+3]/250),_+=b*h[A],O+=b*h[A+1],C+=b*h[A+2],w+=b)}g[m]=_/w,g[m+1]=O/w,g[m+2]=C/w,g[m+3]=S/x}return p},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),t.Image.filters.Resize.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Contrast=r(n.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nfloat contrastF = 1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb = contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor = color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(e){if(0!==this.contrast){var t,n=e.imageData.data,r=n.length,i=Math.floor(255*this.contrast),o=259*(i+255)/(255*(259-i));for(t=0;t1&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),e=t*this.blur*.12,this.horizontal?n[0]=e:n[1]=e,n}}),n.Blur.fromObject=t.Image.filters.BaseFilter.fromObject}(t),function(e){"use strict";var t=e.fabric||(e.fabric={}),n=t.Image.filters,r=t.util.createClass;n.Gamma=r(n.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main() {\nvec4 color = texture2D(uTexture, vTexCoord);\nvec3 correction = (1.0 / uGamma);\ncolor.r = pow(color.r, correction.r);\ncolor.g = pow(color.g, correction.g);\ncolor.b = pow(color.b, correction.b);\ngl_FragColor = color;\ngl_FragColor.rgb *= color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(e){this.gamma=[1,1,1],n.BaseFilter.prototype.initialize.call(this,e)},applyTo2d:function(e){var t,n=e.imageData.data,r=this.gamma,i=n.length,o=1/r[0],a=1/r[1],s=1/r[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),t=0,i=256;t'},_getCacheCanvasDimensions:function(){var e=this.callSuper("_getCacheCanvasDimensions"),t=this.fontSize;return e.width+=t*e.zoomX,e.height+=t*e.zoomY,e},_render:function(e){var t=this.path;t&&!t.isNotVisible()&&t._render(e),this._setTextStyles(e),this._renderTextLinesBackground(e),this._renderTextDecoration(e,"underline"),this._renderText(e),this._renderTextDecoration(e,"overline"),this._renderTextDecoration(e,"linethrough")},_renderText:function(e){"stroke"===this.paintFirst?(this._renderTextStroke(e),this._renderTextFill(e)):(this._renderTextFill(e),this._renderTextStroke(e))},_setTextStyles:function(e,t,n){e.textBaseline="alphabetic",e.font=this._getFontDeclaration(t,n)},calcTextWidth:function(){for(var e=this.getLineWidth(0),t=1,n=this._textLines.length;te&&(e=r)}return e},_renderTextLine:function(e,t,n,r,i,o){this._renderChars(e,t,n,r,i,o)},_renderTextLinesBackground:function(e){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var t,n,r,i,o,a,s,l=e.fillStyle,u=this._getLeftOffset(),c=this._getTopOffset(),f=0,d=0,h=this.path,p=0,g=this._textLines.length;p=0:ns?f%=s:f<0&&(f+=s),this._setGraphemeOnPath(f,o,a),f+=o.kernedWidth}return{width:l,numOfSpaces:0}},_setGraphemeOnPath:function(e,n,r){var i=e+n.kernedWidth/2,o=this.path,a=t.util.getPointOnPath(o.path,i,o.segmentsInfo);n.renderLeft=a.x-r.x,n.renderTop=a.y-r.y,n.angle=a.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(e,t,n,r,i){var o,a=this.getCompleteStyleDeclaration(t,n),s=r?this.getCompleteStyleDeclaration(t,n-1):{},l=this._measureChar(e,a,r,s),u=l.kernedWidth,c=l.width;0!==this.charSpacing&&(c+=o=this._getWidthOfCharSpacing(),u+=o);var f={width:c,left:0,height:a.fontSize,kernedWidth:u,deltaY:a.deltaY};if(n>0&&!i){var d=this.__charBounds[t][n-1];f.left=d.left+d.width+l.kernedWidth-l.width}return f},getHeightOfLine:function(e){if(this.__lineHeights[e])return this.__lineHeights[e];for(var t=this._textLines[e],n=this.getHeightOfChar(e,0),r=1,i=t.length;r0){var P=m+o+f;"rtl"===this.direction&&(P=this.width-P-d),u&&y&&(e.fillStyle=y,e.fillRect(P,c+_*r+a,d,this.fontSize/15)),f=h.left,d=h.width,u=p,y=v,r=i,a=s}else d+=h.kernedWidth;P=m+o+f;"rtl"===this.direction&&(P=this.width-P-d),e.fillStyle=v,p&&v&&e.fillRect(P,c+_*r+a,d-x,this.fontSize/15),b+=n}else b+=n;this._removeShadow(e)}},_getFontDeclaration:function(e,n){var r=e||this,i=this.fontFamily,o=t.Text.genericFonts.indexOf(i.toLowerCase())>-1,a=void 0===i||i.indexOf("'")>-1||i.indexOf(",")>-1||i.indexOf('"')>-1||o?r.fontFamily:'"'+r.fontFamily+'"';return[t.isLikelyNode?r.fontWeight:r.fontStyle,t.isLikelyNode?r.fontStyle:r.fontWeight,n?this.CACHE_FONT_SIZE+"px":r.fontSize+"px",a].join(" ")},render:function(e){this.visible&&(this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",e)))},_splitTextIntoLines:function(e){for(var n=e.split(this._reNewline),r=new Array(n.length),i=["\n"],o=[],a=0;a-1&&(e.underline=!0),e.textDecoration.indexOf("line-through")>-1&&(e.linethrough=!0),e.textDecoration.indexOf("overline")>-1&&(e.overline=!0),delete e.textDecoration)}i.IText=i.util.createClass(i.Text,i.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(e,t){this.callSuper("initialize",e,t),this.initBehavior()},setSelectionStart:function(e){e=Math.max(e,0),this._updateAndFire("selectionStart",e)},setSelectionEnd:function(e){e=Math.min(e,this.text.length),this._updateAndFire("selectionEnd",e)},_updateAndFire:function(e,t){this[e]!==t&&(this._fireSelectionChanged(),this[e]=t),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(e){this.clearContextTop(),this.callSuper("render",e),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(e){this.callSuper("_render",e)},clearContextTop:function(e){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var t=this.canvas.contextTop,n=this.canvas.viewportTransform;t.save(),t.transform(n[0],n[1],n[2],n[3],n[4],n[5]),this.transform(t),this._clearTextArea(t),e||t.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var e=this._getCursorBoundaries(),t=this.canvas.contextTop;this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.restore()}},_clearTextArea:function(e){var t=this.width+4,n=this.height+4;e.clearRect(-t/2,-n/2,t,n)},_getCursorBoundaries:function(e){"undefined"===typeof e&&(e=this.selectionStart);var t=this._getLeftOffset(),n=this._getTopOffset(),r=this._getCursorBoundariesOffsets(e);return{left:t,top:n,leftOffset:r.left,topOffset:r.top}},_getCursorBoundariesOffsets:function(e){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var t,n,r,i,o=0,a=0,s=this.get2DCursorLocation(e);r=s.charIndex,n=s.lineIndex;for(var l=0;l0?a:0)},"rtl"===this.direction&&(i.left*=-1),this.cursorOffsetCache=i,this.cursorOffsetCache},renderCursor:function(e,t){var n=this.get2DCursorLocation(),r=n.lineIndex,i=n.charIndex>0?n.charIndex-1:0,o=this.getValueOfPropertyAt(r,i,"fontSize"),a=this.scaleX*this.canvas.getZoom(),s=this.cursorWidth/a,l=e.topOffset,u=this.getValueOfPropertyAt(r,i,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(r)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(e,t),t.fillStyle=this.cursorColor||this.getValueOfPropertyAt(r,i,"fill"),t.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,t.fillRect(e.left+e.leftOffset-s/2,l+e.top+u,s,o)},renderSelection:function(e,t){for(var n=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,r=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,i=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(n),a=this.get2DCursorLocation(r),s=o.lineIndex,l=a.lineIndex,u=o.charIndex<0?0:o.charIndex,c=a.charIndex<0?0:a.charIndex,f=s;f<=l;f++){var d,h=this._getLineLeftOffset(f)||0,p=this.getHeightOfLine(f),g=0,v=0;if(f===s&&(g=this.__charBounds[s][u].left),f>=s&&f1)&&(p/=this.lineHeight);var m=e.left+h+g,b=v-g,w=p,x=0;this.inCompositionMode?(t.fillStyle=this.compositionColor||"black",w=1,x=p):t.fillStyle=this.selectionColor,"rtl"===this.direction&&(m=this.width-m-b),t.fillRect(m,e.top+e.topOffset+x,b,w),e.topOffset+=d}},getCurrentCharFontSize:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fontSize")},getCurrentCharColor:function(){var e=this._getCurrentCharIndex();return this.getValueOfPropertyAt(e.l,e.c,"fill")},_getCurrentCharIndex:function(){var e=this.get2DCursorLocation(this.selectionStart,!0),t=e.charIndex>0?e.charIndex-1:0;return{l:e.lineIndex,c:t}}}),i.IText.fromObject=function(t,n){if(e(t),t.styles)for(var r in t.styles)for(var o in t.styles[r])e(t.styles[r][o]);i.Object._fromObject("IText",t,n,"text")}}(),function(){var e=i.util.object.clone;i.util.object.extend(i.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",(function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))}))},initRemovedHandler:function(){var e=this;this.on("removed",(function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],i.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t)))}))},_initCanvasHandlers:function(e){e._mouseUpITextHandler=function(){e._iTextInstances&&e._iTextInstances.forEach((function(e){e.__isMousedown=!1}))},e.on("mouse:up",e._mouseUpITextHandler)},_removeCanvasHandlers:function(e){e.off("mouse:up",e._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(e,t,n,r){var i;return i={isAborted:!1,abort:function(){this.isAborted=!0}},e.animate("_currentCursorOpacity",t,{duration:n,onComplete:function(){i.isAborted||e[r]()},onChange:function(){e.canvas&&e.selectionStart===e.selectionEnd&&e.renderCursorOrSelection()},abort:function(){return i.isAborted}}),i},_onTickComplete:function(){var e=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout((function(){e._currentTickCompleteState=e._animateCursor(e,0,this.cursorDuration/2,"_tick")}),100)},initDelayedCursor:function(e){var t=this,n=e?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout((function(){t._tick()}),n)},abortCursorAnimation:function(){var e=this._currentTickState||this._currentTickCompleteState,t=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,e&&t&&t.clearContext(t.contextTop||t.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(e){var t=0,n=e-1;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n--;for(;/\S/.test(this._text[n])&&n>-1;)t++,n--;return e-t},findWordBoundaryRight:function(e){var t=0,n=e;if(this._reSpace.test(this._text[n]))for(;this._reSpace.test(this._text[n]);)t++,n++;for(;/\S/.test(this._text[n])&&n-1;)t++,n--;return e-t},findLineBoundaryRight:function(e){for(var t=0,n=e;!/\n/.test(this._text[n])&&n0&&rthis.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===n&&this.selectionEnd===r||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))}},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(e,t,n){var r=n.slice(0,e),o=i.util.string.graphemeSplit(r).length;if(e===t)return{selectionStart:o,selectionEnd:o};var a=n.slice(e,t);return{selectionStart:o,selectionEnd:o+i.util.string.graphemeSplit(a).length}},fromGraphemeToStringSelection:function(e,t,n){var r=n.slice(0,e).join("").length;return e===t?{selectionStart:r,selectionEnd:r}:{selectionStart:r,selectionEnd:r+n.slice(e,t).join("").length}},_updateTextarea:function(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var e=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=e.selectionStart,this.hiddenTextarea.selectionEnd=e.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var e=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value);this.selectionEnd=this.selectionStart=e.selectionEnd,this.inCompositionMode||(this.selectionStart=e.selectionStart),this.updateTextareaPosition()}},updateTextareaPosition:function(){if(this.selectionStart===this.selectionEnd){var e=this._calcTextareaPosition();this.hiddenTextarea.style.left=e.left,this.hiddenTextarea.style.top=e.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var e=this.inCompositionMode?this.compositionStart:this.selectionStart,t=this._getCursorBoundaries(e),n=this.get2DCursorLocation(e),r=n.lineIndex,o=n.charIndex,a=this.getValueOfPropertyAt(r,o,"fontSize")*this.lineHeight,s=t.leftOffset,l=this.calcTransformMatrix(),u={x:t.left+s,y:t.top+t.topOffset+a},c=this.canvas.getRetinaScaling(),f=this.canvas.upperCanvasEl,d=f.width/c,h=f.height/c,p=d-a,g=h-a,v=f.clientWidth/d,y=f.clientHeight/h;return u=i.util.transformPoint(u,l),(u=i.util.transformPoint(u,this.canvas.viewportTransform)).x*=v,u.y*=y,u.x<0&&(u.x=0),u.x>p&&(u.x=p),u.y<0&&(u.y=0),u.y>g&&(u.y=g),u.x+=this.canvas._offset.left,u.y+=this.canvas._offset.top,{left:u.x+"px",top:u.y+"px",fontSize:a+"px",charHeight:a}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor))},exitEditing:function(){var e=this._textBeforeEdit!==this.text,t=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,t&&(t.blur&&t.blur(),t.parentNode&&t.parentNode.removeChild(t)),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),e&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),e&&this.canvas.fire("object:modified",{target:this})),this},_removeExtraneousStyles:function(){for(var e in this.styles)this._textLines[e]||delete this.styles[e]},removeStyleFromTo:function(e,t){var n,r,i=this.get2DCursorLocation(e,!0),o=this.get2DCursorLocation(t,!0),a=i.lineIndex,s=i.charIndex,l=o.lineIndex,u=o.charIndex;if(a!==l){if(this.styles[a])for(n=s;n=u&&(r[c-d]=r[f],delete r[f])}},shiftLineStyles:function(t,n){var r=e(this.styles);for(var i in this.styles){var o=parseInt(i,10);o>t&&(this.styles[o+n]=r[o],r[o-n]||delete this.styles[o])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(t,n,r,i){var o,a={},s=!1,l=this._unwrappedTextLines[t].length===n;for(var u in r||(r=1),this.shiftLineStyles(t,r),this.styles[t]&&(o=this.styles[t][0===n?n:n-1]),this.styles[t]){var c=parseInt(u,10);c>=n&&(s=!0,a[c-n]=this.styles[t][u],l&&0===n||delete this.styles[t][u])}var f=!1;for(s&&!l&&(this.styles[t+r]=a,f=!0),f&&r--;r>0;)i&&i[r-1]?this.styles[t+r]={0:e(i[r-1])}:o?this.styles[t+r]={0:e(o)}:delete this.styles[t+r],r--;this._forceClearCache=!0},insertCharStyleObject:function(t,n,r,i){this.styles||(this.styles={});var o=this.styles[t],a=o?e(o):{};for(var s in r||(r=1),a){var l=parseInt(s,10);l>=n&&(o[l+r]=a[l],a[l-r]||delete o[l])}if(this._forceClearCache=!0,i)for(;r--;)Object.keys(i[r]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][n+r]=e(i[r]));else if(o)for(var u=o[n?n-1:1];u&&r--;)this.styles[t][n+r]=e(u)},insertNewStyleBlock:function(e,t,n){for(var r=this.get2DCursorLocation(t,!0),i=[0],o=0,a=0;a0&&(this.insertCharStyleObject(r.lineIndex,r.charIndex,i[0],n),n=n&&n.slice(i[0]+1)),o&&this.insertNewlineStyleObject(r.lineIndex,r.charIndex+i[0],o);for(a=1;a0?this.insertCharStyleObject(r.lineIndex+a,0,i[a],n):n&&(this.styles[r.lineIndex+a][0]=n[0]),n=n&&n.slice(i[a]+1);i[a]>0&&this.insertCharStyleObject(r.lineIndex+a,0,i[a],n)},setSelectionStartEndWithShift:function(e,t,n){n<=e?(t===e?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=e),this.selectionStart=n):n>e&&ne?this.selectionStart=e:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>e?this.selectionEnd=e:this.selectionEnd<0&&(this.selectionEnd=0)}})}(),i.util.object.extend(i.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(e){if(this.canvas){this.__newClickTime=+new Date;var t=e.pointer;this.isTripleClick(t)&&(this.fire("tripleclick",e),this._stopEvent(e.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=t,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected}},isTripleClick:function(e){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===e.x&&this.__lastPointer.y===e.y},_stopEvent:function(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(e){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(e.e))},tripleClickHandler:function(e){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(e.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(e.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(e){!this.canvas||!this.editable||e.e.button&&1!==e.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(e){if(this.__isMousedown=!1,!(!this.editable||this.group||e.transform&&e.transform.actionPerformed||e.e.button&&1!==e.e.button)){if(this.canvas){var t=this.canvas._activeObject;if(t&&t!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(e.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(e){var t=this.getSelectionStartFromPointer(e),n=this.selectionStart,r=this.selectionEnd;e.shiftKey?this.setSelectionStartEndWithShift(n,r,t):(this.selectionStart=t,this.selectionEnd=t),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(e){for(var t,n=this.getLocalPointer(e),r=0,i=0,o=0,a=0,s=0,l=0,u=this._textLines.length;l0&&(a+=this._textLines[l-1].length+this.missingNewlineOffset(l-1));i=this._getLineLeftOffset(s)*this.scaleX,t=this._textLines[s],"rtl"===this.direction&&(n.x=this.width*this.scaleX-n.x+i);for(var c=0,f=t.length;co||a<0?0:1);return this.flipX&&(s=i-s),s>this._text.length&&(s=this._text.length),s}}),i.util.object.extend(i.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=i.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var e=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+e.top+"; left: "+e.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding\uff70top: "+e.fontSize+";",this.hiddenTextareaContainer?this.hiddenTextareaContainer.appendChild(this.hiddenTextarea):i.document.body.appendChild(this.hiddenTextarea),i.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),i.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),i.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),i.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),i.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),i.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),i.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),i.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),i.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(i.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(e){if(this.isEditing){var t="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(e.keyCode in t)this[t[e.keyCode]](e);else{if(!(e.keyCode in this.ctrlKeysMapDown)||!e.ctrlKey&&!e.metaKey)return;this[this.ctrlKeysMapDown[e.keyCode]](e)}e.stopImmediatePropagation(),e.preventDefault(),e.keyCode>=33&&e.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(e){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:e.keyCode in this.ctrlKeysMapUp&&(e.ctrlKey||e.metaKey)&&(this[this.ctrlKeysMapUp[e.keyCode]](e),e.stopImmediatePropagation(),e.preventDefault(),this.canvas&&this.canvas.requestRenderAll())},onInput:function(e){var t=this.fromPaste;if(this.fromPaste=!1,e&&e.stopPropagation(),this.isEditing){var n,r,o,a,s,l=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,u=this._text.length,c=l.length,f=c-u,d=this.selectionStart,h=this.selectionEnd,p=d!==h;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var g=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),v=d>g.selectionStart;p?(n=this._text.slice(d,h),f+=h-d):c0&&(r+=(n=this.__charBounds[e][t-1]).left+n.width),r},getDownCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(i===this._textLines.length-1||e.metaKey||34===e.keyCode)return this._text.length-n;var o=r.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i+1,a);return this._textLines[i].slice(o).length+s+1+this.missingNewlineOffset(i)},_getSelectionForOffset:function(e,t){return e.shiftKey&&this.selectionStart!==this.selectionEnd&&t?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(e,t){var n=this._getSelectionForOffset(e,t),r=this.get2DCursorLocation(n),i=r.lineIndex;if(0===i||e.metaKey||33===e.keyCode)return-n;var o=r.charIndex,a=this._getWidthBeforeCursor(i,o),s=this._getIndexOnLine(i-1,a),l=this._textLines[i].slice(0,o),u=this.missingNewlineOffset(i-1);return-this._textLines[i-1].length+s-l.length+(1-u)},_getIndexOnLine:function(e,t){for(var n,r,i=this._textLines[e],o=this._getLineLeftOffset(e),a=0,s=0,l=i.length;st){r=!0;var u=o-n,c=o,f=Math.abs(u-t);a=Math.abs(c-t)=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",e)},moveCursorUp:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",e)},_moveCursorUpOrDown:function(e,t){var n=this["get"+e+"CursorOffset"](t,"right"===this._selectionDirection);t.shiftKey?this.moveCursorWithShift(n):this.moveCursorWithoutShift(n),0!==n&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(e){var t="left"===this._selectionDirection?this.selectionStart+e:this.selectionEnd+e;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,t),0!==e},moveCursorWithoutShift:function(e){return e<0?(this.selectionStart+=e,this.selectionEnd=this.selectionStart):(this.selectionEnd+=e,this.selectionStart=this.selectionEnd),0!==e},moveCursorLeft:function(e){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",e)},_move:function(e,t,n){var r;if(e.altKey)r=this["findWordBoundary"+n](this[t]);else{if(!e.metaKey&&35!==e.keyCode&&36!==e.keyCode)return this[t]+="Left"===n?-1:1,!0;r=this["findLineBoundary"+n](this[t])}if(void 0!==typeof r&&this[t]!==r)return this[t]=r,!0},_moveLeft:function(e,t){return this._move(e,t,"Left")},_moveRight:function(e,t){return this._move(e,t,"Right")},moveCursorLeftWithoutShift:function(e){var t=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(t=this._moveLeft(e,"selectionStart")),this.selectionEnd=this.selectionStart,t},moveCursorLeftWithShift:function(e){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(e,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(e,"selectionStart")):void 0},moveCursorRight:function(e){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",e)},_moveCursorLeftOrRight:function(e,t){var n="moveCursor"+e+"With";this._currentCursorOpacity=1,t.shiftKey?n+="Shift":n+="outShift",this[n](t)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(e){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(e,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(e,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(e){var t=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(t=this._moveRight(e,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,t},removeChars:function(e,t){"undefined"===typeof t&&(t=e+1),this.removeStyleFromTo(e,t),this._text.splice(e,t-e),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(e,t,n,r){"undefined"===typeof r&&(r=n),r>n&&this.removeStyleFromTo(n,r);var o=i.util.string.graphemeSplit(e);this.insertNewStyleBlock(o,n,t),this._text=[].concat(this._text.slice(0,n),o,this._text.slice(r)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var e=i.util.toFixed,t=/ +/g;i.util.object.extend(i.Text.prototype,{_toSVG:function(){var e=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(e.textTop,e.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(e){return this._createBaseSVGMarkup(this._toSVG(),{reviver:e,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(e){var t=this.getSvgTextDecoration(this);return[e.textBgRects.join(""),'\t\t",e.textSpans.join(""),"\n"]},_getSVGTextAndBg:function(e,t){var n,r=[],i=[],o=e;this._setSVGBg(i);for(var a=0,s=this._textLines.length;a",i.util.string.escapeXml(n),""].join("")},_setSVGTextLineText:function(e,t,n,r){var i,o,a,s,l,u=this.getHeightOfLine(t),c=-1!==this.textAlign.indexOf("justify"),f="",d=0,h=this._textLines[t];r+=u*(1-this._fontSizeFraction)/this.lineHeight;for(var p=0,g=h.length-1;p<=g;p++)l=p===g||this.charSpacing,f+=h[p],a=this.__charBounds[t][p],0===d?(n+=a.kernedWidth-a.width,d+=a.width):d+=a.kernedWidth,c&&!l&&this._reSpaceAndTab.test(h[p])&&(l=!0),l||(i=i||this.getCompleteStyleDeclaration(t,p),o=this.getCompleteStyleDeclaration(t,p+1),l=this._hasStyleChangedForSvg(i,o)),l&&(s=this._getStyleDeclaration(t,p)||{},e.push(this._createTextCharSpan(f,s,n,r)),f="",i=o,n+=d,d=0)},_pushTextBgRect:function(t,n,r,o,a,s){var l=i.Object.NUM_FRACTION_DIGITS;t.push("\t\t\n')},_setSVGTextLineBg:function(e,t,n,r){for(var i,o,a=this._textLines[t],s=this.getHeightOfLine(t)/this.lineHeight,l=0,u=0,c=this.getValueOfPropertyAt(t,0,"textBackgroundColor"),f=0,d=a.length;fthis.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(e){for(var t=0,n=0,r=0,i={},o=0;o0?(n=0,r++,t++):!this.splitByGrapheme&&this._reSpaceAndTab.test(e.graphemeText[r])&&o>0&&(n++,r++),i[o]={line:t,offset:n},r+=e.graphemeLines[o].length,n+=e.graphemeLines[o].length;return i},styleHas:function(e,n){if(this._styleMap&&!this.isWrapping){var r=this._styleMap[n];r&&(n=r.line)}return t.Text.prototype.styleHas.call(this,e,n)},isEmptyStyles:function(e){if(!this.styles)return!0;var t,n,r=0,i=!1,o=this._styleMap[e],a=this._styleMap[e+1];for(var s in o&&(e=o.line,r=o.offset),a&&(i=a.line===e,t=a.offset),n="undefined"===typeof e?this.styles:{line:this.styles[e]})for(var l in n[s])if(l>=r&&(!i||lr&&!v?(s.push(l),l=[],o=h,v=!0):o+=y,v||a||l.push(d),l=l.concat(c),p=a?0:this._measureWord([d],n,f),f++,v=!1,h>g&&(g=h);return m&&s.push(l),g+i>this.dynamicMinWidth&&(this.dynamicMinWidth=g-y+i),s},isEndOfWrapping:function(e){return!this._styleMap[e+1]||this._styleMap[e+1].line!==this._styleMap[e].line},missingNewlineOffset:function(e){return this.splitByGrapheme?this.isEndOfWrapping(e)?1:0:1},_splitTextIntoLines:function(e){for(var n=t.Text.prototype._splitTextIntoLines.call(this,e),r=this._wrapText(n.lines,this.width),i=new Array(r.length),o=0;o",LAST_PAGE_TEXT:">>",NEXT_PAGE_TITLE:"next page",LAST_PAGE_TITLE:"last page",PRE_PAGE_TITLE:"previous page",FIRST_PAGE_TITLE:"first page",SIZE_PER_PAGE_LIST:[10,25,30,50],HIDE_SIZE_PER_PAGE:!1,HIDE_PAGE_LIST_ONLY_ONE_PAGE:!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:this.props.currSizePerPage,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props.dataSize;return Math.ceil(t/e)}},{key:"calculateLastPage",value:function(e){return this.props.pageStartIndex+e-1}},{key:"calculateFromTo",value:function(){var e=this.props,t=e.dataSize,n=e.currPage,r=e.currSizePerPage,i=e.pageStartIndex,o=Math.abs(a.default.PAGE_START_INDEX-i),s=(n-i)*r;s=0===t?0:s+1;var l=Math.min(r*(n+o),t);return l>t&&(l=t),[s,l]}},{key:"calculatePages",value:function(e,t){var n=this.props,r=n.currPage,i=n.paginationSize,o=n.pageStartIndex,a=n.withFirstAndLast,s=n.firstPageText,l=n.prePageText,u=n.nextPageText,c=n.lastPageText,f=n.alwaysShowAllBtns,d=[],h=e;if(h<=0)return[];var p=Math.max(r-Math.floor(i/2),o);(h=p+i-1)>t&&(p=(h=t)-i+1),f&&(d=a?[s,l]:[l]),p!==o&&e>i&&a&&0===d.length?d=[s,l]:e>1&&0===d.length&&(d=[l]);for(var g=p;g<=h;g+=1)g>=o&&d.push(g);return(f||h<=t&&d.length>1)&&d.push(u),(h!==t&&a||a&&f)&&d.push(c),d}},{key:"calculatePageStatus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this,n=arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.props,o=i.currPage,a=i.pageStartIndex,s=i.firstPageText,l=i.prePageText,u=i.nextPageText,c=i.lastPageText,f=i.alwaysShowAllBtns,d=function(e){return o===a&&(e===s||e===l)},h=function(e){return o===n&&(e===u||e===c)};return e.filter((function(e){return!!f||!(d(e)||h(e))})).map((function(e){var n=void 0,i=e===o,a=d(e)||h(e);n=e===u?t.props.nextPageTitle:e===l?t.props.prePageTitle:e===s?t.props.firstPageTitle:e===c?t.props.lastPageTitle:""+e;var f={page:e,active:i,disabled:a};return r||(f.title=n),f}))}},{key:"calculateSizePerPageStatus",value:function(){return this.props.sizePerPageList.map((function(e){return{text:""+("undefined"!==typeof e.text?e.text:e),page:"undefined"!==typeof e.value?e.value:e}}))}}]),t}(e)}},function(e,t,n){"use strict";t.a={disabled:!1}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,i,o,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,i,o,a,s],c=0;(l=new Error(t.replace(/%s/g,(function(){return u[c++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,n){"use strict";var r=n(1),i=n(3),o=n(4),a=n.n(o),s=(n(60),n(0)),l=n.n(s),u=n(20),c=n(5),f=n(27),d=n(69),h=n(24),p=n(70),g=n(29),v=n(43),y=n(11),m=n(36),b=["as","onSelect","activeKey","role","onKeyDown"],w=function(){},x=l.a.forwardRef((function(e,t){var n,o,a=e.as,u=void 0===a?"ul":a,c=e.onSelect,f=e.activeKey,d=e.role,x=e.onKeyDown,_=Object(i.a)(e,b),O=Object(p.a)(),C=Object(s.useRef)(!1),S=Object(s.useContext)(y.a),E=Object(s.useContext)(m.a);E&&(d=d||"tablist",f=E.activeKey,n=E.getControlledId,o=E.getControllerId);var P=Object(s.useRef)(null),T=function(e){var t=P.current;if(!t)return null;var n=Object(h.a)(t,"[data-rb-event-key]:not(.disabled)"),r=t.querySelector(".active");if(!r)return null;var i=n.indexOf(r);if(-1===i)return null;var o=i+e;return o>=n.length&&(o=0),o<0&&(o=n.length-1),n[o]},k=function(e,t){null!=e&&(c&&c(e,t),S&&S(e,t))};Object(s.useEffect)((function(){if(P.current&&C.current){var e=P.current.querySelector("[data-rb-event-key].active");e&&e.focus()}C.current=!1}));var j=Object(g.a)(t,P);return l.a.createElement(y.a.Provider,{value:k},l.a.createElement(v.a.Provider,{value:{role:d,activeKey:Object(y.b)(f),getControlledId:n||w,getControllerId:o||w}},l.a.createElement(u,Object(r.a)({},_,{onKeyDown:function(e){var t;switch(x&&x(e),e.key){case"ArrowLeft":case"ArrowUp":t=T(-1);break;case"ArrowRight":case"ArrowDown":t=T(1);break;default:return}t&&(e.preventDefault(),k(t.dataset.rbEventKey,e),C.current=!0,O())},ref:j,role:d}))))})),_=n(71),O=n(45),C=["as","bsPrefix","variant","fill","justify","navbar","navbarScroll","className","children","activeKey"],S=l.a.forwardRef((function(e,t){var n,o,h,p=Object(u.a)(e,{activeKey:"onSelect"}),g=p.as,v=void 0===g?"div":g,y=p.bsPrefix,m=p.variant,b=p.fill,w=p.justify,_=p.navbar,O=p.navbarScroll,S=p.className,E=p.children,P=p.activeKey,T=Object(i.a)(p,C),k=Object(c.a)(y,"nav"),j=!1,R=Object(s.useContext)(f.a),A=Object(s.useContext)(d.a);return R?(o=R.bsPrefix,j=null==_||_):A&&(h=A.cardHeaderBsPrefix),l.a.createElement(x,Object(r.a)({as:v,ref:t,activeKey:P,className:a()(S,(n={},n[k]=!j,n[o+"-nav"]=j,n[o+"-nav-scroll"]=j&&O,n[h+"-"+m]=!!h,n[k+"-"+m]=!!m,n[k+"-fill"]=b,n[k+"-justified"]=w,n))},T),E)}));S.displayName="Nav",S.defaultProps={justify:!1,fill:!1},S.Item=_.a,S.Link=O.a;t.a=S},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Type=void 0;var r=s(n(79)),i=s(n(148)),o=s(n(149)),a=n(59);function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{createContext:r.default,createEditingCell:o.default,withRowLevelCellEdit:i.default,DBCLICK_TO_CELL_EDIT:a.DBCLICK_TO_CELL_EDIT,DELAY_FOR_DBCLICK:a.DELAY_FOR_DBCLICK,options:e}};t.Type=a.EDITTYPE},function(e,t,n){"use strict";t.a=function(e,t,n,r){var i=r&&"boolean"!==typeof r?r.capture:r;e.removeEventListener(t,n,i),n.__once&&e.removeEventListener(t,n.__once,i)}},function(e,t,n){"use strict";function r(e,t){return e.contains?e.contains(t):e.compareDocumentPosition?e===t||!!(16&e.compareDocumentPosition(t)):void 0}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(1),i=n(0),o=n.n(i),a=n(4),s=n.n(a);t.a=function(e){return o.a.forwardRef((function(t,n){return o.a.createElement("div",Object(r.a)({},t,{ref:n,className:s()(t.className,e)}))}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TIME_TO_CLOSE_MESSAGE=3e3,t.DELAY_FOR_DBCLICK=200,t.CLICK_TO_CELL_EDIT="click",t.DBCLICK_TO_CELL_EDIT="dbclick",t.EDITTYPE={TEXT:"text",SELECT:"select",TEXTAREA:"textarea",CHECKBOX:"checkbox",DATE:"date"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}var c=o.default.createContext();t.default=function(e,t,n,l){var f=function(a){function s(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}(this,(s.__proto__||Object.getPrototypeOf(s)).call(this,e));return t.doUpdate=t.doUpdate.bind(t),t.startEditing=t.startEditing.bind(t),t.escapeEditing=t.escapeEditing.bind(t),t.completeEditing=t.completeEditing.bind(t),t.handleCellUpdate=t.handleCellUpdate.bind(t),t.state={ridx:null,cidx:null,message:null},t}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(s,a),i(s,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){e.cellEdit&&n()&&(e.cellEdit.options.errorMessage?this.setState((function(){return{message:e.cellEdit.options.errorMessage}})):this.escapeEditing())}},{key:"handleCellUpdate",value:function(n,r,i){var o=this,a=t.typeConvert(r.type,i),s=this.props.cellEdit.options.beforeSaveCell,l=e.get(n,r.dataField);if(e.isFunction(s)){var u=s(l,a,n,r,(function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];e?o.doUpdate(n,r,a):o.escapeEditing()}));if(e.isObject(u)&&u.async)return}this.doUpdate(n,r,a)}},{key:"doUpdate",value:function(r,i,o){var a=this.props,s=a.keyField,u=a.cellEdit,c=a.data,f=u.options.afterSaveCell,d=e.get(r,s),h=e.get(r,i.dataField);n()?l(d,i.dataField,o):(t.editCell(c,s,d,i.dataField,o),e.isFunction(f)&&f(h,o,r,i),this.completeEditing())}},{key:"completeEditing",value:function(){this.setState((function(){return{ridx:null,cidx:null,message:null}}))}},{key:"startEditing",value:function(e,t){var n=this,r=this.props.selectRow;r&&!r.clickToEdit&&r.clickToSelect||n.setState((function(){return{ridx:e,cidx:t}}))}},{key:"escapeEditing",value:function(){this.setState((function(){return{ridx:null,cidx:null}}))}},{key:"render",value:function(){var t=this.props.cellEdit,n=t.options,i=n.nonEditableRows,a=(n.errorMessage,u(n,["nonEditableRows","errorMessage"])),s=u(t,["options"]),l=r({},a,s,this.state,{nonEditableRows:e.isDefined(i)?i():[],onStart:this.startEditing,onEscape:this.escapeEditing,onUpdate:this.handleCellUpdate});return o.default.createElement(c.Provider,{value:r({},l)},this.props.children)}}]),s}(o.default.Component);return f.propTypes={data:a.default.array.isRequired,selectRow:a.default.object,options:a.default.shape({mode:a.default.oneOf([s.CLICK_TO_CELL_EDIT,s.DBCLICK_TO_CELL_EDIT]).isRequired,onErrorMessageDisappear:a.default.func,blurToSave:a.default.bool,beforeSaveCell:a.default.func,afterSaveCell:a.default.func,onStartEdit:a.default.func,nonEditableRows:a.default.func,timeToCloseMessage:a.default.number,errorMessage:a.default.any})},{Provider:f}};t.Consumer=c.Consumer},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=i({},t);return Object.keys(t).forEach((function(r){s.default.contains(l,r)&&(n[r]=e.createDefaultEventHandler(t[r]))})),n}}]),t}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&a.length>i&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=i[e];if(void 0===l)return!1;if("function"===typeof l)o(l,this,t);else{var u=l.length,c=v(l,u);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;ts&&(o=s),r(i,o)}}},{key:"handleChangePage",value:function(e){var t=void 0,n=this.props,r=n.currPage,i=n.pageStartIndex,o=n.prePageText,a=n.nextPageText,s=n.lastPageText,l=n.firstPageText,u=n.onPageChange,c=this.state.lastPage;(t=e===o?this.backToPrevPage():e===a?r+1>c?c:r+1:e===s?c:e===l?i:parseInt(e,10))!==r&&u(t)}},{key:"render",value:function(){return a.default.createElement(e,r({},this.props,{lastPage:this.state.lastPage,totalPages:this.state.totalPages,onPageChange:this.handleChangePage,onSizePerPageChange:this.handleChangeSizePerPage}))}}]),n}((0,s.default)(o.Component))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["page","sizePerPage"]);return a.default.createElement(e,i({},o,{currPage:n,currSizePerPage:r}))}}},function(e,t,n){"use strict";var r=n(158),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var u=Object.defineProperty,c=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&e(t,i,r)}var a=c(n);f&&(a=a.concat(f(n)));for(var s=l(t),g=l(n),v=0;v>",s=o||n;if(null==t[n])return new Error("The "+i+" `"+s+"` is required to make `"+a+"` accessible for users of assistive technologies such as screen readers.");for(var l=arguments.length,u=Array(l>5?l-5:0),c=5;c0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.length>0,i=!0,a=e.map((function(e){return o.default.get(e,t)})),s=function(e){var t=a[e];"undefined"===typeof n.find((function(e){return e===t}))?r=!1:i=!1},l=0;l0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return 0===n.length?e.map((function(e){return o.default.get(e,t)})):e.filter((function(e){return!o.default.contains(n,o.default.get(e,t))})).map((function(e){return o.default.get(e,t)}))},t.unSelectableKeys=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return 0===t.length?[]:e.filter((function(e){return o.default.contains(t,e)}))},t.getSelectedRows=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n=arguments[2];return n.map((function(n){return(0,a.getRowByRowId)(e,t,n)})).filter((function(e){return!!e}))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(2)),o=a(n(19));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){var t=e.renderContent,n=e.selectRow,i=e.expandRow,a=e.cellEl,s=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["renderContent","selectRow","expandRow","cellEl"]),l=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o.default.INDICATOR_POSITION_LEFT;return e===o.default.INDICATOR_POSITION_LEFT},u=t()||[];return n&&!0!==n.hideSelectColumn&&(l(n.selectColumnPosition)?u.unshift(r.default.createElement(a,{key:"selection"})):u.push(r.default.createElement(a,{key:"selection"}))),i.showExpandColumn&&(l(i.expandColumnPosition)?u.unshift(r.default.createElement(a,{key:"expansion"})):u.push(r.default.createElement(a,{key:"expansion"}))),r.default.createElement("tr",s,u)};s.propTypes={renderContent:i.default.func.isRequired,cellEl:i.default.string.isRequired,selectRow:i.default.object,expandRow:i.default.object},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=r({},t);return Object.keys(t).forEach((function(r){o.default.contains(l,r)&&(n[r]=e.createDefaultEventHandler(t[r]))})),n}}]),t}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(e,t){for(var n=0;n=Math.floor(e/r)+i&&1===i?Math.ceil(e/r):n>=Math.floor(e/r)&&0===i?Math.ceil(e/r)-Math.abs(o.default.PAGE_START_INDEX-i):n},t.getByCurrPage=function(e,t,n,r){var i=e.length;if(!i)return[];for(var o=a(t,n,r),s=[],l=function(e,t){return e-(t-1)}(o,n);l<=o&&(s.push(e[l]),l+1!==i);l+=1);return s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SizePerPageDropdownWithAdapter=void 0;var r=Object.assign||function(e){for(var t=1;t1&&!l?u?u({options:this.calculateSizePerPageStatus(),currSizePerPage:""+s,onSizePerPageChange:this.handleChangeSizePerPage}):a.default.createElement(e,r({},this.props,{currSizePerPage:""+s,options:this.calculateSizePerPageStatus(),optionRenderer:c,onSizePerPageChange:this.handleChangeSizePerPage,onClick:this.toggleDropDown,onBlur:this.closeDropDown,open:f,tableId:n,bootstrap4:i})):null}}]),n}((0,s.default)(o.Component))};t.SizePerPageDropdownWithAdapter=c(l.default);t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;tj.length&&j.push(e)}function D(e,t,n){return null==e?0:function e(t,n,r,i){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case o:case a:l=!0}}if(l)return r(i,t,""===n?"."+I(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ye(e,t){var n;return n="undefined"!==typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!==typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&k(e,t)?O.merge([e],n):n}function me(e,t){for(var n=0,r=e.length;n",""]);var be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,l,u,c,f=t.createDocumentFragment(),d=[],h=0,p=e.length;h-1)i&&i.push(o);else if(u=ae(o),a=ye(f.appendChild(o),"script"),u&&me(a),n)for(c=0;o=a[c++];)ge.test(o.type||"")&&n.push(o);return f}var xe=/^([^.]*)(?:\.(.+)|)/;function _e(){return!0}function Oe(){return!1}function Ce(e,t){return e===function(){try{return b.activeElement}catch(e){}}()===("focus"===t)}function Se(e,t,n,r,i,o){var a,s;if("object"===typeof t){for(s in"string"!==typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"===typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Oe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return O().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=O.guid++)),e.each((function(){O.event.add(this,t,i,r,n)}))}function Ee(e,t,n){n?(Q.set(e,t,!1),O.event.add(e,t,{namespace:!1,handler:function(e){var r,i,o=Q.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(O.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=s.call(arguments),Q.set(this,t,o),r=n(this,t),this[t](),o!==(i=Q.get(this,t))||r?Q.set(this,t,!1):i={},o!==i)return e.stopImmediatePropagation(),e.preventDefault(),i&&i.value}else o.length&&(Q.set(this,t,{value:O.event.trigger(O.extend(o[0],O.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,t)&&O.event.add(e,t,_e)}O.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,h,p,g,v=Q.get(e);if(K(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&O.find.matchesSelector(oe,i),n.guid||(n.guid=O.guid++),(l=v.events)||(l=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return"undefined"!==typeof O&&O.event.triggered!==t.type?O.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(N)||[""]).length;u--;)h=g=(s=xe.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),h&&(f=O.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,f=O.event.special[h]||{},c=O.extend({type:h,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&O.expr.match.needsContext.test(i),namespace:p.join(".")},o),(d=l[h])||((d=l[h]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(h,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),O.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,f,d,h,p,g,v=Q.hasData(e)&&Q.get(e);if(v&&(l=v.events)){for(u=(t=(t||"").match(N)||[""]).length;u--;)if(h=g=(s=xe.exec(t[u])||[])[1],p=(s[2]||"").split(".").sort(),h){for(f=O.event.special[h]||{},d=l[h=(r?f.delegateType:f.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,p,v.handle)||O.removeEvent(e,h,v.handle),delete l[h])}else for(h in l)O.event.remove(e,h+t[u],n,r,!0);O.isEmptyObject(l)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=O.event.fix(e),u=(Q.get(this,"events")||Object.create(null))[l.type]||[],c=O.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:O.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l\s*$/g;function je(e,t){return k(e,"table")&&k(11!==t.nodeType?t:t.firstChild,"tr")&&O(e).children("tbody")[0]||e}function Re(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ae(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function De(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Q.hasData(e)&&(s=Q.get(e).events))for(i in Q.remove(t,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"===typeof p&&!v.checkClone&&Te.test(p))return e.each((function(i){var o=e.eq(i);g&&(t[0]=p.call(this,i,o.html())),Me(o,t,n,r)}));if(d&&(o=(i=we(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=O.map(ye(i,"script"),Re)).length;f0&&me(a,!l&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=O.event.special,o=0;void 0!==(n=e[o]);o++)if(K(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?O.event.remove(n,r):O.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),O.fn.extend({detach:function(e){return Le(this,e,!0)},remove:function(e){return Le(this,e)},text:function(e){return V(this,(function(e){return void 0===e?O.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Me(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)}))},prepend:function(){return Me(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Me(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(O.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return O.clone(this,e,t)}))},html:function(e){return V(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"===typeof e&&!Pe.test(e)&&!ve[(pe.exec(e)||["",""])[1].toLowerCase()]){e=O.htmlPrefilter(e);try{for(;n=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function Ze(e,t,n){var r=Fe(e),i=(!v.boxSizingReliable()||n)&&"border-box"===O.css(e,"boxSizing",!1,r),o=i,a=He(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ne.test(a)){if(!n)return a;a="auto"}return(!v.boxSizingReliable()&&i||!v.reliableTrDimensions()&&k(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===O.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===O.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Je(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}O.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=He(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=q(t),l=qe.test(t),u=e.style;if(l||(t=Xe(s)),a=O.cssHooks[t]||O.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"===(o=typeof n)&&(i=re.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"!==o||l||(n+=i&&i[3]||(O.cssNumber[s]?"":"px")),v.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=q(t);return qe.test(t)||(t=Xe(s)),(a=O.cssHooks[t]||O.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=He(e,t,r)),"normal"===i&&t in $e&&(i=$e[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),O.each(["height","width"],(function(e,t){O.cssHooks[t]={get:function(e,n,r){if(n)return!Ye.test(O.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,t,r):Be(e,Ke,(function(){return Ze(e,t,r)}))},set:function(e,n,r){var i,o=Fe(e),a=!v.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===O.css(e,"boxSizing",!1,o),l=r?Je(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Je(e,t,"border",!1,o)-.5)),l&&(i=re.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=O.css(e,t)),Qe(0,n,l)}}})),O.cssHooks.marginLeft=Ue(v.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(He(e,"marginLeft"))||e.getBoundingClientRect().left-Be(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),O.each({margin:"",padding:"",border:"Width"},(function(e,t){O.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"===typeof n?n.split(" "):[n];r<4;r++)i[e+ie[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(O.cssHooks[e+t].set=Qe)})),O.fn.extend({css:function(e,t){return V(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a1)}}),O.Tween=et,et.prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||O.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(O.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=O.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}},et.prototype.init.prototype=et.prototype,et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=O.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){O.fx.step[e.prop]?O.fx.step[e.prop](e):1!==e.elem.nodeType||!O.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:O.style(e.elem,e.prop,e.now+e.unit)}}},et.propHooks.scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},O.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},O.fx=et.prototype.init,O.fx.step={};var tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){nt&&(!1===b.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ot):n.setTimeout(ot,O.fx.interval),O.fx.tick())}function at(){return n.setTimeout((function(){tt=void 0})),tt=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ie[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(ut.tweeners[t]||[]).concat(ut.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){O.removeAttr(this,e)}))}}),O.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"===typeof e.getAttribute?O.prop(e,t,n):(1===o&&O.isXMLDoc(e)||(i=O.attrHooks[t.toLowerCase()]||(O.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void O.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=O.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!v.radioValue&&"radio"===t&&k(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(N);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?O.removeAttr(e,n):e.setAttribute(n,n),n}},O.each(O.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=ft[t]||O.find.attr;ft[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ft[a],ft[a]=i,i=null!=n(e,t,r)?a:null,ft[a]=o),i}}));var dt=/^(?:input|select|textarea|button)$/i,ht=/^(?:a|area)$/i;function pt(e){return(e.match(N)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"===typeof e&&e.match(N)||[]}O.fn.extend({prop:function(e,t){return V(this,O.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[O.propFix[e]||e]}))}}),O.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&O.isXMLDoc(e)||(t=O.propFix[t]||t,i=O.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=O.find.attr(e,"tabindex");return t?parseInt(t,10):dt.test(e.nodeName)||ht.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.optSelected||(O.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),O.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){O.propFix[this.toLowerCase()]=this})),O.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,l=0;if(y(e))return this.each((function(t){O(this).addClass(e.call(this,t,gt(this)))}));if((t=vt(e)).length)for(;n=this[l++];)if(i=gt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,l=0;if(y(e))return this.each((function(t){O(this).removeClass(e.call(this,t,gt(this)))}));if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;n=this[l++];)if(i=gt(n),r=1===n.nodeType&&" "+pt(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");i!==(s=pt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"===typeof t&&r?t?this.addClass(e):this.removeClass(e):y(e)?this.each((function(n){O(this).toggleClass(e.call(this,n,gt(this),t),t)})):this.each((function(){var t,i,o,a;if(r)for(i=0,o=O(this),a=vt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=gt(this))&&Q.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Q.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+pt(gt(n))+" ").indexOf(t)>-1)return!0;return!1}});var yt=/\r/g;O.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=y(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,O(this).val()):e)?i="":"number"===typeof i?i+="":Array.isArray(i)&&(i=O.map(i,(function(e){return null==e?"":e+""}))),(t=O.valHooks[this.type]||O.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=O.valHooks[i.type]||O.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"===typeof(n=i.value)?n.replace(yt,""):null==n?"":n:void 0}}),O.extend({valHooks:{option:{get:function(e){var t=O.find.attr(e,"value");return null!=t?t:pt(O.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),O.each(["radio","checkbox"],(function(){O.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=O.inArray(O(e).val(),t)>-1}},v.checkOn||(O.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),v.focusin="onfocusin"in n;var mt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};O.extend(O.event,{trigger:function(e,t,r,i){var o,a,s,l,u,c,f,d,p=[r||b],g=h.call(e,"type")?e.type:e,v=h.call(e,"namespace")?e.namespace.split("."):[];if(a=d=s=r=r||b,3!==r.nodeType&&8!==r.nodeType&&!mt.test(g+O.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),u=g.indexOf(":")<0&&"on"+g,(e=e[O.expando]?e:new O.Event(g,"object"===typeof e&&e)).isTrigger=i?2:3,e.namespace=v.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:O.makeArray(t,[e]),f=O.event.special[g]||{},i||!f.trigger||!1!==f.trigger.apply(r,t))){if(!i&&!f.noBubble&&!m(r)){for(l=f.delegateType||g,mt.test(l+g)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||b)&&p.push(s.defaultView||s.parentWindow||n)}for(o=0;(a=p[o++])&&!e.isPropagationStopped();)d=a,e.type=o>1?l:f.bindType||g,(c=(Q.get(a,"events")||Object.create(null))[e.type]&&Q.get(a,"handle"))&&c.apply(a,t),(c=u&&a[u])&&c.apply&&K(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||f._default&&!1!==f._default.apply(p.pop(),t)||!K(r)||u&&y(r[g])&&!m(r)&&((s=r[u])&&(r[u]=null),O.event.triggered=g,e.isPropagationStopped()&&d.addEventListener(g,bt),r[g](),e.isPropagationStopped()&&d.removeEventListener(g,bt),O.event.triggered=void 0,s&&(r[u]=s)),e.result}},simulate:function(e,t,n){var r=O.extend(new O.Event,n,{type:e,isSimulated:!0});O.event.trigger(r,null,t)}}),O.fn.extend({trigger:function(e,t){return this.each((function(){O.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return O.event.trigger(e,t,n,!0)}}),v.focusin||O.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){O.event.simulate(t,e.target,O.event.fix(e))};O.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=Q.access(r,t);i||r.addEventListener(e,n,!0),Q.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=Q.access(r,t)-1;i?Q.access(r,t,i):(r.removeEventListener(e,n,!0),Q.remove(r,t))}}}));var wt=n.location,xt={guid:Date.now()},_t=/\?/;O.parseXML=function(e){var t,r;if(!e||"string"!==typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(i){}return r=t&&t.getElementsByTagName("parsererror")[0],t&&!r||O.error("Invalid XML: "+(r?O.map(r.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var Ot=/\[\]$/,Ct=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function Pt(e,t,n,r){var i;if(Array.isArray(t))O.each(t,(function(t,i){n||Ot.test(e)?r(e,i):Pt(e+"["+("object"===typeof i&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(i in t)Pt(e+"["+i+"]",t[i],n,r)}O.param=function(e,t){var n,r=[],i=function(e,t){var n=y(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!O.isPlainObject(e))O.each(e,(function(){i(this.name,this.value)}));else for(n in e)Pt(n,e[n],t,i);return r.join("&")},O.fn.extend({serialize:function(){return O.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=O.prop(this,"elements");return e?O.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!O(this).is(":disabled")&&Et.test(this.nodeName)&&!St.test(e)&&(this.checked||!he.test(e))})).map((function(e,t){var n=O(this).val();return null==n?null:Array.isArray(n)?O.map(n,(function(e){return{name:t.name,value:e.replace(Ct,"\r\n")}})):{name:t.name,value:n.replace(Ct,"\r\n")}})).get()}});var Tt=/%20/g,kt=/#.*$/,jt=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,At=/^(?:GET|HEAD)$/,Dt=/^\/\//,It={},Mt={},Lt="*/".concat("*"),Nt=b.createElement("a");function Ft(e){return function(t,n){"string"!==typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(N)||[];if(y(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Bt(e,t,n,r){var i={},o=e===Mt;function a(s){var l;return i[s]=!0,O.each(e[s]||[],(function(e,s){var u=s(t,n,r);return"string"!==typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=O.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&O.extend(!0,e,r),e}Nt.href=wt.href,O.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:wt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(wt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Lt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":O.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,O.ajaxSettings),t):zt(O.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"===typeof e&&(t=e,e=void 0),t=t||{};var r,i,o,a,s,l,u,c,f,d,h=O.ajaxSetup({},t),p=h.context||h,g=h.context&&(p.nodeType||p.jquery)?O(p):O.event,v=O.Deferred(),y=O.Callbacks("once memory"),m=h.statusCode||{},w={},x={},_="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Rt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==u&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)C.always(e[C.status]);else for(t in e)m[t]=[m[t],e[t]];return this},abort:function(e){var t=e||_;return r&&r.abort(t),S(0,t),this}};if(v.promise(C),h.url=((e||h.url||wt.href)+"").replace(Dt,wt.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(N)||[""],null==h.crossDomain){l=b.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Nt.protocol+"//"+Nt.host!==l.protocol+"//"+l.host}catch(E){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!==typeof h.data&&(h.data=O.param(h.data,h.traditional)),Bt(It,h,t,C),u)return C;for(f in(c=O.event&&h.global)&&0===O.active++&&O.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!At.test(h.type),i=h.url.replace(kt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Tt,"+")):(d=h.url.slice(i.length),h.data&&(h.processData||"string"===typeof h.data)&&(i+=(_t.test(i)?"&":"?")+h.data,delete h.data),!1===h.cache&&(i=i.replace(jt,"$1"),d=(_t.test(i)?"&":"?")+"_="+xt.guid+++d),h.url=i+d),h.ifModified&&(O.lastModified[i]&&C.setRequestHeader("If-Modified-Since",O.lastModified[i]),O.etag[i]&&C.setRequestHeader("If-None-Match",O.etag[i])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&C.setRequestHeader("Content-Type",h.contentType),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Lt+"; q=0.01":""):h.accepts["*"]),h.headers)C.setRequestHeader(f,h.headers[f]);if(h.beforeSend&&(!1===h.beforeSend.call(p,C,h)||u))return C.abort();if(_="abort",y.add(h.complete),C.done(h.success),C.fail(h.error),r=Bt(Mt,h,t,C)){if(C.readyState=1,c&&g.trigger("ajaxSend",[C,h]),u)return C;h.async&&h.timeout>0&&(s=n.setTimeout((function(){C.abort("timeout")}),h.timeout));try{u=!1,r.send(w,S)}catch(E){if(u)throw E;S(-1,E)}}else S(-1,"No Transport");function S(e,t,a,l){var f,d,b,w,x,_=t;u||(u=!0,s&&n.clearTimeout(s),r=void 0,o=l||"",C.readyState=e>0?4:0,f=e>=200&&e<300||304===e,a&&(w=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(h,C,a)),!f&&O.inArray("script",h.dataTypes)>-1&&O.inArray("json",h.dataTypes)<0&&(h.converters["text script"]=function(){}),w=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(E){return{state:"parsererror",error:a?E:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(h,w,C,f),f?(h.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(O.lastModified[i]=x),(x=C.getResponseHeader("etag"))&&(O.etag[i]=x)),204===e||"HEAD"===h.type?_="nocontent":304===e?_="notmodified":(_=w.state,d=w.data,f=!(b=w.error))):(b=_,!e&&_||(_="error",e<0&&(e=0))),C.status=e,C.statusText=(t||_)+"",f?v.resolveWith(p,[d,_,C]):v.rejectWith(p,[C,_,b]),C.statusCode(m),m=void 0,c&&g.trigger(f?"ajaxSuccess":"ajaxError",[C,h,f?d:b]),y.fireWith(p,[C,_]),c&&(g.trigger("ajaxComplete",[C,h]),--O.active||O.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return O.get(e,t,n,"json")},getScript:function(e,t){return O.get(e,void 0,t,"script")}}),O.each(["get","post"],(function(e,t){O[t]=function(e,n,r,i){return y(n)&&(i=i||r,r=n,n=void 0),O.ajax(O.extend({url:e,type:t,dataType:i,data:n,success:r},O.isPlainObject(e)&&e))}})),O.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),O._evalUrl=function(e,t,n){return O.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){O.globalEval(e,t,n)}})},O.fn.extend({wrapAll:function(e){var t;return this[0]&&(y(e)&&(e=e.call(this[0])),t=O(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return y(e)?this.each((function(t){O(this).wrapInner(e.call(this,t))})):this.each((function(){var t=O(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=y(e);return this.each((function(n){O(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){O(this).replaceWith(this.childNodes)})),this}}),O.expr.pseudos.hidden=function(e){return!O.expr.pseudos.visible(e)},O.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},O.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Ut=O.ajaxSettings.xhr();v.cors=!!Ut&&"withCredentials"in Ut,v.ajax=Ut=!!Ut,O.ajaxTransport((function(e){var t,r;if(v.cors||Ut&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!==typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ht[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!==typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),r=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&n.setTimeout((function(){t&&r()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(l){if(t)throw l}},abort:function(){t&&t()}}})),O.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),O.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return O.globalEval(e),e}}}),O.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),O.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=O("