UNPKG

v-luck-draw

Version:
1 lines 168 kB
(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("vue")):"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["luckdraw"]=e(require("vue")):t["luckdraw"]=e(t["Vue"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"00ee":function(t,e,n){var r=n("b622"),i=r("toStringTag"),o={};o[i]="z",t.exports="[object z]"===String(o)},"0366":function(t,e,n){var r=n("1c0b");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}}},"06cf":function(t,e,n){var r=n("83ab"),i=n("d1e7"),o=n("5c6c"),a=n("fc6a"),s=n("c04e"),c=n("5135"),h=n("0cfb"),u=Object.getOwnPropertyDescriptor;e.f=r?u:function(t,e){if(t=a(t),e=s(e,!0),h)try{return u(t,e)}catch(n){}if(c(t,e))return o(!i.f.call(t,e),t[e])}},"06f8":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("9cb8"),i=n("ed3d"),o=n("4971"),a=n("d777"),s={node:1,duration:1,easing:1,onFinish:1,yoyo:1},c=1,h=2,u=3,l=0,f=["fill","stroke","shadowColor"],d=function(){function t(t,e,n,r,i,o,a){this.prop=t,this.propFunc=e,this.begin=r,this._pos=r,this.duration=o,this._change=0,this.prevPos=0,this.yoyo=a,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=i-this.begin,this.pause()}return t.prototype.fire=function(t){var e=this[t];e&&e()},t.prototype.setTime=function(t){t>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():t<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=t,this.update())},t.prototype.getTime=function(){return this._time},t.prototype.setPosition=function(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t},t.prototype.getPosition=function(t){return void 0===t&&(t=this._time),this.func(t,this.begin,this._change,this.duration)},t.prototype.play=function(){this.state=h,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")},t.prototype.reverse=function(){this.state=u,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")},t.prototype.seek=function(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")},t.prototype.reset=function(){this.pause(),this._time=0,this.update(),this.fire("onReset")},t.prototype.finish=function(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")},t.prototype.update=function(){this.setPosition(this.getPosition(this._time))},t.prototype.onEnterFrame=function(){var t=this.getTimer()-this._startTime;this.state===h?this.setTime(t):this.state===u&&this.setTime(this.duration-t)},t.prototype.pause=function(){this.state=c,this.fire("onPause")},t.prototype.getTimer=function(){return(new Date).getTime()},t}(),p=function(){function t(n){var o,c,h=this,u=n.node,f=u._id,p=n.easing||e.Easings.Linear,g=!!n.yoyo;o="undefined"===typeof n.duration?.3:0===n.duration?.001:n.duration,this.node=u,this._id=l++;var v=u.getLayer()||(u instanceof a.Konva["Stage"]?u.getLayers():null);for(c in v||r.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new i.Animation((function(){h.tween.onEnterFrame()}),v),this.tween=new d(c,(function(t){h._tweenFunc(t)}),p,0,1,1e3*o,g),this._addListeners(),t.attrs[f]||(t.attrs[f]={}),t.attrs[f][this._id]||(t.attrs[f][this._id]={}),t.tweens[f]||(t.tweens[f]={}),n)void 0===s[c]&&this._addAttr(c,n[c]);this.reset(),this.onFinish=n.onFinish,this.onReset=n.onReset}return t.prototype._addAttr=function(e,n){var i,o,a,s,c,h,u,l,d=this.node,p=d._id;if(a=t.tweens[p][e],a&&delete t.attrs[p][a][e],i=d.getAttr(e),r.Util._isArray(n))if(o=[],c=Math.max(n.length,i.length),"points"===e&&n.length!==i.length&&(n.length>i.length?(u=i,i=r.Util._prepareArrayForTween(i,n,d.closed())):(h=n,n=r.Util._prepareArrayForTween(n,i,d.closed()))),0===e.indexOf("fill"))for(s=0;s<c;s++)if(s%2===0)o.push(n[s]-i[s]);else{var g=r.Util.colorToRGBA(i[s]);l=r.Util.colorToRGBA(n[s]),i[s]=g,o.push({r:l.r-g.r,g:l.g-g.g,b:l.b-g.b,a:l.a-g.a})}else for(s=0;s<c;s++)o.push(n[s]-i[s]);else-1!==f.indexOf(e)?(i=r.Util.colorToRGBA(i),l=r.Util.colorToRGBA(n),o={r:l.r-i.r,g:l.g-i.g,b:l.b-i.b,a:l.a-i.a}):o=n-i;t.attrs[p][this._id][e]={start:i,diff:o,end:n,trueEnd:h,trueStart:u},t.tweens[p][e]=this._id},t.prototype._tweenFunc=function(e){var n,i,o,a,s,c,h,u,l=this.node,d=t.attrs[l._id][this._id];for(n in d){if(i=d[n],o=i.start,a=i.diff,u=i.end,r.Util._isArray(o))if(s=[],h=Math.max(o.length,u.length),0===n.indexOf("fill"))for(c=0;c<h;c++)c%2===0?s.push((o[c]||0)+a[c]*e):s.push("rgba("+Math.round(o[c].r+a[c].r*e)+","+Math.round(o[c].g+a[c].g*e)+","+Math.round(o[c].b+a[c].b*e)+","+(o[c].a+a[c].a*e)+")");else for(c=0;c<h;c++)s.push((o[c]||0)+a[c]*e);else s=-1!==f.indexOf(n)?"rgba("+Math.round(o.r+a.r*e)+","+Math.round(o.g+a.g*e)+","+Math.round(o.b+a.b*e)+","+(o.a+a.a*e)+")":o+a*e;l.setAttr(n,s)}},t.prototype._addListeners=function(){var e=this;this.tween.onPlay=function(){e.anim.start()},this.tween.onReverse=function(){e.anim.start()},this.tween.onPause=function(){e.anim.stop()},this.tween.onFinish=function(){var n=e.node,r=t.attrs[n._id][e._id];r.points&&r.points.trueEnd&&n.setAttr("points",r.points.trueEnd),e.onFinish&&e.onFinish.call(e)},this.tween.onReset=function(){var n=e.node,r=t.attrs[n._id][e._id];r.points&&r.points.trueStart&&n.points(r.points.trueStart),e.onReset&&e.onReset()}},t.prototype.play=function(){return this.tween.play(),this},t.prototype.reverse=function(){return this.tween.reverse(),this},t.prototype.reset=function(){return this.tween.reset(),this},t.prototype.seek=function(t){return this.tween.seek(1e3*t),this},t.prototype.pause=function(){return this.tween.pause(),this},t.prototype.finish=function(){return this.tween.finish(),this},t.prototype.destroy=function(){var e,n=this.node._id,r=this._id,i=t.tweens[n];for(e in this.pause(),i)delete t.tweens[n][e];delete t.attrs[n][r]},t.attrs={},t.tweens={},t}();e.Tween=p,o.Node.prototype.to=function(t){var e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()};var n=new p(t);n.play()},e.Easings={BackEaseIn:function(t,e,n,r){var i=1.70158;return n*(t/=r)*t*((i+1)*t-i)+e},BackEaseOut:function(t,e,n,r){var i=1.70158;return n*((t=t/r-1)*t*((i+1)*t+i)+1)+e},BackEaseInOut:function(t,e,n,r){var i=1.70158;return(t/=r/2)<1?n/2*(t*t*((1+(i*=1.525))*t-i))+e:n/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e},ElasticEaseIn:function(t,e,n,r,i,o){var a=0;return 0===t?e:1===(t/=r)?e+n:(o||(o=.3*r),!i||i<Math.abs(n)?(i=n,a=o/4):a=o/(2*Math.PI)*Math.asin(n/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)+e)},ElasticEaseOut:function(t,e,n,r,i,o){var a=0;return 0===t?e:1===(t/=r)?e+n:(o||(o=.3*r),!i||i<Math.abs(n)?(i=n,a=o/4):a=o/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin((t*r-a)*(2*Math.PI)/o)+n+e)},ElasticEaseInOut:function(t,e,n,r,i,o){var a=0;return 0===t?e:2===(t/=r/2)?e+n:(o||(o=r*(.3*1.5)),!i||i<Math.abs(n)?(i=n,a=o/4):a=o/(2*Math.PI)*Math.asin(n/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*-.5+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*.5+n+e)},BounceEaseOut:function(t,e,n,r){return(t/=r)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn:function(t,n,r,i){return r-e.Easings.BounceEaseOut(i-t,0,r,i)+n},BounceEaseInOut:function(t,n,r,i){return t<i/2?.5*e.Easings.BounceEaseIn(2*t,0,r,i)+n:.5*e.Easings.BounceEaseOut(2*t-i,0,r,i)+.5*r+n},EaseIn:function(t,e,n,r){return n*(t/=r)*t+e},EaseOut:function(t,e,n,r){return-n*(t/=r)*(t-2)+e},EaseInOut:function(t,e,n,r){return(t/=r/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},StrongEaseIn:function(t,e,n,r){return n*(t/=r)*t*t*t*t+e},StrongEaseOut:function(t,e,n,r){return n*((t=t/r-1)*t*t*t*t+1)+e},StrongEaseInOut:function(t,e,n,r){return(t/=r/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},Linear:function(t,e,n,r){return n*t/r+e}}},"0cfb":function(t,e,n){var r=n("83ab"),i=n("d039"),o=n("cc12");t.exports=!r&&!i((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0ff5":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n("9cb8"),o=n("ea61"),a=n("f0b4"),s=n("d6af"),c=n("f655"),h=n("fce6"),u=n("4546"),l=n("d777"),f="#",d="beforeDraw",p="draw",g=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],v=g.length,y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hitCanvas=new c.HitCanvas({pixelRatio:1}),e}return r(e,t),e.prototype.setSize=function(e){var n=e.width,r=e.height;return t.prototype.setSize.call(this,{width:n,height:r}),this.hitCanvas.setSize(n,r),this},e.prototype._validateAdd=function(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&i.Util.throw("You may only add groups and shapes to a layer.")},e.prototype.getIntersection=function(t,e){var n,r,i,o;if(!this.hitGraphEnabled()||!this.isVisible())return null;var a=1,s=!1;while(1){for(r=0;r<v;r++){if(i=g[r],n=this._getIntersection({x:t.x+i.x*a,y:t.y+i.y*a}),o=n.shape,o&&e)return o.findAncestor(e,!0);if(o)return o;if(s=!!n.antialiased,!n.antialiased)break}if(!s)return null;a+=1}},e.prototype._getIntersection=function(t){var e,n,r=this.hitCanvas.pixelRatio,o=this.hitCanvas.context.getImageData(Math.round(t.x*r),Math.round(t.y*r),1,1).data,a=o[3];return 255===a?(e=i.Util._rgbToHex(o[0],o[1],o[2]),n=h.shapes[f+e],n?{shape:n}:{antialiased:!0}):a>0?{antialiased:!0}:{}},e.prototype.drawScene=function(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas();return this._fire(d,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),o.Container.prototype.drawScene.call(this,r,e),this._fire(p,{node:this}),this},e.prototype.drawHit=function(t,e){var n=this.getLayer(),r=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),o.Container.prototype.drawHit.call(this,r,e),this},e.prototype.clear=function(t){return s.BaseLayer.prototype.clear.call(this,t),this.getHitCanvas().getContext().clear(t),this},e.prototype.enableHitGraph=function(){return this.hitGraphEnabled(!0),this},e.prototype.disableHitGraph=function(){return this.hitGraphEnabled(!1),this},e.prototype.toggleHitCanvas=function(){if(this.parent){var t=this.parent,e=!!this.hitCanvas._canvas.parentNode;e?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}},e}(s.BaseLayer);e.Layer=y,y.prototype.nodeType="Layer",l._registerNode(y),a.Factory.addGetterSetter(y,"hitGraphEnabled",!0,u.getBooleanValidator()),i.Collection.mapMethods(y)},"19aa":function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,e,n){var r=n("b622"),i=r("iterator"),o=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){o=!0}};s[i]=function(){return this},Array.from(s,(function(){throw 2}))}catch(c){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var r={};r[i]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(c){}return n}},"1cdc":function(t,e,n){var r=n("342f");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},"1d80":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1dde":function(t,e,n){var r=n("d039"),i=n("b622"),o=n("2d00"),a=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[],n=e.constructor={};return n[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},"1f21":function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n("9cb8"),o=n("f0b4"),a=n("fce6"),s=n("4546"),c=n("d777"),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype._sceneFunc=function(t){t.beginPath(),t.arc(0,0,this.radius(),0,2*Math.PI,!1),t.closePath(),t.fillStrokeShape(this)},e.prototype.getWidth=function(){return 2*this.radius()},e.prototype.getHeight=function(){return 2*this.radius()},e.prototype.setWidth=function(t){this.radius()!==t/2&&this.radius(t/2)},e.prototype.setHeight=function(t){this.radius()!==t/2&&this.radius(t/2)},e}(a.Shape);e.Circle=h,h.prototype._centroid=!0,h.prototype.className="Circle",h.prototype._attrsAffectingSize=["radius"],c._registerNode(h),o.Factory.addGetterSetter(h,"radius",0,s.getNumberValidator()),i.Collection.mapMethods(h)},2266:function(t,e,n){var r=n("825a"),i=n("e95a"),o=n("50c4"),a=n("0366"),s=n("35a1"),c=n("9bdd"),h=function(t,e){this.stopped=t,this.result=e},u=t.exports=function(t,e,n,u,l){var f,d,p,g,v,y,m,_=a(e,n,u?2:1);if(l)f=t;else{if(d=s(t),"function"!=typeof d)throw TypeError("Target is not iterable");if(i(d)){for(p=0,g=o(t.length);g>p;p++)if(v=u?_(r(m=t[p])[0],m[1]):_(t[p]),v&&v instanceof h)return v;return new h(!1)}f=d.call(t)}y=f.next;while(!(m=y.call(f)).done)if(v=c(f,_,m.value,u),"object"==typeof v&&v&&v instanceof h)return v;return new h(!1)};u.stop=function(t){return new h(!0,t)}},"23cb":function(t,e,n){var r=n("a691"),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},"23e7":function(t,e,n){var r=n("da84"),i=n("06cf").f,o=n("9112"),a=n("6eeb"),s=n("ce4e"),c=n("e893"),h=n("94ca");t.exports=function(t,e){var n,u,l,f,d,p,g=t.target,v=t.global,y=t.stat;if(u=v?r:y?r[g]||s(g,{}):(r[g]||{}).prototype,u)for(l in e){if(d=e[l],t.noTargetGet?(p=i(u,l),f=p&&p.value):f=u[l],n=h(v?l:g+(y?".":"#")+l,t.forced),!n&&void 0!==f){if(typeof d===typeof f)continue;c(d,f)}(t.sham||f&&f.sham)&&o(d,"sham",!0),a(u,l,d,t)}}},"241c":function(t,e,n){var r=n("ca84"),i=n("7839"),o=i.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},2626:function(t,e,n){"use strict";var r=n("d066"),i=n("9bf2"),o=n("b622"),a=n("83ab"),s=o("species");t.exports=function(t){var e=r(t),n=i.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},"2cf4":function(t,e,n){var r,i,o,a=n("da84"),s=n("d039"),c=n("c6b6"),h=n("0366"),u=n("1be4"),l=n("cc12"),f=n("1cdc"),d=a.location,p=a.setImmediate,g=a.clearImmediate,v=a.process,y=a.MessageChannel,m=a.Dispatch,_=0,b={},w="onreadystatechange",x=function(t){if(b.hasOwnProperty(t)){var e=b[t];delete b[t],e()}},S=function(t){return function(){x(t)}},C=function(t){x(t.data)},P=function(t){a.postMessage(t+"",d.protocol+"//"+d.host)};p&&g||(p=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return b[++_]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(_),_},g=function(t){delete b[t]},"process"==c(v)?r=function(t){v.nextTick(S(t))}:m&&m.now?r=function(t){m.now(S(t))}:y&&!f?(i=new y,o=i.port2,i.port1.onmessage=C,r=h(o.postMessage,o,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(P)||"file:"===d.protocol?r=w in l("script")?function(t){u.appendChild(l("script"))[w]=function(){u.removeChild(this),x(t)}}:function(t){setTimeout(S(t),0)}:(r=P,a.addEventListener("message",C,!1))),t.exports={set:p,clear:g}},"2d00":function(t,e,n){var r,i,o=n("da84"),a=n("342f"),s=o.process,c=s&&s.versions,h=c&&c.v8;h?(r=h.split("."),i=r[0]+r[1]):a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(i=r[1]))),t.exports=i&&+i},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"35a1":function(t,e,n){var r=n("f5df"),i=n("3f8c"),o=n("b622"),a=o("iterator");t.exports=function(t){if(void 0!=t)return t[a]||t["@@iterator"]||i[r(t)]}},"37e8":function(t,e,n){var r=n("83ab"),i=n("9bf2"),o=n("825a"),a=n("df75");t.exports=r?Object.defineProperties:function(t,e){o(t);var n,r=a(e),s=r.length,c=0;while(s>c)i.f(t,n=r[c++],e[n]);return t}},"3bbe":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"3ca3":function(t,e,n){"use strict";var r=n("6547").charAt,i=n("69f3"),o=n("7dd0"),a="String Iterator",s=i.set,c=i.getterFor(a);o(String,"String",(function(t){s(this,{type:a,string:String(t),index:0})}),(function(){var t,e=c(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})}))},"3f8c":function(t,e){t.exports={}},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),i=n("c6b6"),o="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},"44d2":function(t,e,n){var r=n("b622"),i=n("7c73"),o=n("9bf2"),a=r("unscopables"),s=Array.prototype;void 0==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},"44de":function(t,e,n){var r=n("da84");t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},4546:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("d777"),i=n("9cb8");function o(t){return i.Util._isString(t)?'"'+t+'"':"[object Number]"===Object.prototype.toString.call(t)||i.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function a(t){return t>255?255:t<0?0:Math.round(t)}function s(t){return t>1?1:t<1e-4?1e-4:t}function c(){if(r.Konva.isUnminified)return function(t,e){return i.Util._isNumber(t)||i.Util.warn(o(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function h(){if(r.Konva.isUnminified)return function(t,e){var n=i.Util._isNumber(t),r="auto"===t;return n||r||i.Util.warn(o(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function u(){if(r.Konva.isUnminified)return function(t,e){return i.Util._isString(t)||i.Util.warn(o(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function l(){if(r.Konva.isUnminified)return function(t,e){return i.Util._isFunction(t)||i.Util.warn(o(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}function f(){if(r.Konva.isUnminified)return function(t,e){return i.Util._isArray(t)?t.forEach((function(t){i.Util._isNumber(t)||i.Util.warn('"'+e+'" attribute has non numeric element '+t+". Make sure that all elements are numbers.")})):i.Util.warn(o(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.'),t}}function d(){if(r.Konva.isUnminified)return function(t,e){var n=!0===t||!1===t;return n||i.Util.warn(o(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function p(t){if(r.Konva.isUnminified)return function(e,n){return i.Util.isObject(e)||i.Util.warn(o(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}e.RGBComponent=a,e.alphaComponent=s,e.getNumberValidator=c,e.getNumberOrAutoValidator=h,e.getStringValidator=u,e.getFunctionValidator=l,e.getNumberArrayValidator=f,e.getBooleanValidator=d,e.getComponentValidator=p},4840:function(t,e,n){var r=n("825a"),i=n("1c0b"),o=n("b622"),a=o("species");t.exports=function(t,e){var n,o=r(t).constructor;return void 0===o||void 0==(n=r(o)[a])?e:i(n)}},4930:function(t,e,n){var r=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},4971:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("9cb8"),i=n("f0b4"),o=n("f655"),a=n("d777"),s=n("df93"),c=n("4546");e.ids={},e.names={};var h=function(t,n){n&&(e.ids[n]=t)};e._removeId=function(t,n){t&&e.ids[t]===n&&delete e.ids[t]},e._addName=function(t,n){n&&(e.names[n]||(e.names[n]=[]),e.names[n].push(t))},e._removeName=function(t,n){if(t){var r=e.names[t];if(r){for(var i=0;i<r.length;i++){var o=r[i];o._id===n&&r.splice(i,1)}0===r.length&&delete e.names[t]}}};var u="absoluteOpacity",l="absoluteTransform",f="absoluteScale",d="canvas",p="Change",g="children",v="konva",y="listening",m="mouseenter",_="mouseleave",b="name",w="set",x="Shape",S=" ",C="stage",P="transform",T="Stage",k="visible",O=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(S),A=(["scaleXChange.konva","scaleYChange.konva"].join(S),new r.Collection),E=1,D=function(){function t(t){var e=this;this._id=E++,this.eventListeners={},this.attrs={},this.index=0,this.parent=null,this._cache=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this.children=A,this._dragEventId=null,this.setAttrs(t),this.on(O,(function(){e._batchingTransformChange?e._needClearTransformCache=!0:(e._clearCache(P),e._clearSelfAndDescendantCache(l))})),this.on("visibleChange.konva",(function(){e._clearSelfAndDescendantCache(k)})),this.on("listeningChange.konva",(function(){e._clearSelfAndDescendantCache(y)})),this.on("opacityChange.konva",(function(){e._clearSelfAndDescendantCache(u)}))}return t.prototype.hasChildren=function(){return!1},t.prototype.getChildren=function(){return A},t.prototype._clearCache=function(t){t?this._cache.delete(t):this._cache.clear()},t.prototype._getCache=function(t,e){var n=this._cache.get(t);return void 0===n&&(n=e.call(this),this._cache.set(t,n)),n},t.prototype._getCanvasCache=function(){return this._cache.get(d)},t.prototype._clearSelfAndDescendantCache=function(t,e){this._clearCache(t),e&&t===l&&this.fire("_clearTransformCache"),this.isCached()||this.children&&this.children.each((function(e){e._clearSelfAndDescendantCache(t,!0)}))},t.prototype.clearCache=function(){return this._cache.delete(d),this._clearSelfAndDescendantCache(),this},t.prototype.cache=function(t){var e=t||{},n={};void 0!==e.x&&void 0!==e.y&&void 0!==e.width&&void 0!==e.height||(n=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var i=Math.ceil(e.width||n.width),a=Math.ceil(e.height||n.height),s=e.pixelRatio,c=void 0===e.x?n.x:e.x,h=void 0===e.y?n.y:e.y,l=e.offset||0,p=e.drawBorder||!1;if(i&&a){i+=2*l,a+=2*l,c-=l,h-=l;var g=new o.SceneCanvas({pixelRatio:s,width:i,height:a}),v=new o.SceneCanvas({pixelRatio:s,width:0,height:0}),y=new o.HitCanvas({pixelRatio:1,width:i,height:a}),m=g.getContext(),_=y.getContext();return y.isCache=!0,this._cache.delete("canvas"),this._filterUpToDate=!1,!1===e.imageSmoothingEnabled&&(g.getContext()._context.imageSmoothingEnabled=!1,v.getContext()._context.imageSmoothingEnabled=!1),m.save(),_.save(),m.translate(-c,-h),_.translate(-c,-h),this._isUnderCache=!0,this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(f),this.drawScene(g,this,!0),this.drawHit(y,this,!0),this._isUnderCache=!1,m.restore(),_.restore(),p&&(m.save(),m.beginPath(),m.rect(0,0,i,a),m.closePath(),m.setAttr("strokeStyle","red"),m.setAttr("lineWidth",5),m.stroke(),m.restore()),this._cache.set(d,{scene:g,filter:v,hit:y,x:c,y:h}),this}r.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.")},t.prototype.isCached=function(){return this._cache.has("canvas")},t.prototype.getClientRect=function(t){throw new Error('abstract "getClientRect" method call')},t.prototype._transformedRect=function(t,e){var n,r,i,o,a=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=this.getAbsoluteTransform(e);return a.forEach((function(t){var e=s.point(t);void 0===n&&(n=i=e.x,r=o=e.y),n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),o=Math.max(o,e.y)})),{x:n,y:r,width:i-n,height:o-r}},t.prototype._drawCachedSceneCanvas=function(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);var e=this._getCanvasCache();t.translate(e.x,e.y);var n=this._getCachedSceneCanvas(),r=n.pixelRatio;t.drawImage(n._canvas,0,0,n.width/r,n.height/r),t.restore()},t.prototype._drawCachedHitCanvas=function(t){var e=this._getCanvasCache(),n=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(n._canvas,0,0),t.restore()},t.prototype._getCachedSceneCanvas=function(){var t,e,n,i,o=this.filters(),a=this._getCanvasCache(),s=a.scene,c=a.filter,h=c.getContext();if(o){if(!this._filterUpToDate){var u=s.pixelRatio;c.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio);try{for(t=o.length,h.clear(),h.drawImage(s._canvas,0,0,s.getWidth()/u,s.getHeight()/u),e=h.getImageData(0,0,c.getWidth(),c.getHeight()),n=0;n<t;n++)i=o[n],"function"===typeof i?(i.call(this,e),h.putImageData(e,0,0)):r.Util.error("Filter should be type of function, but got "+typeof i+" instead. Please check correct filters")}catch(l){r.Util.error("Unable to apply filter. "+l.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return c}return s},t.prototype.on=function(t,e){if(3===arguments.length)return this._delegate.apply(this,arguments);var n,r,i,o,a,s=t.split(S),c=s.length;for(n=0;n<c;n++)r=s[n],i=r.split("."),o=i[0],a=i[1]||"",this.eventListeners[o]||(this.eventListeners[o]=[]),this.eventListeners[o].push({name:a,handler:e});return this},t.prototype.off=function(t,e){var n,r,i,o,a,s,c=(t||"").split(S),h=c.length;if(!t)for(r in this.eventListeners)this._off(r);for(n=0;n<h;n++)if(i=c[n],o=i.split("."),a=o[0],s=o[1],a)this.eventListeners[a]&&this._off(a,s,e);else for(r in this.eventListeners)this._off(r,s,e);return this},t.prototype.dispatchEvent=function(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this},t.prototype.addEventListener=function(t,e){return this.on(t,(function(t){e.call(this,t.evt)})),this},t.prototype.removeEventListener=function(t){return this.off(t),this},t.prototype._delegate=function(t,e,n){var i=this;this.on(t,(function(t){for(var o=t.target.findAncestors(e,!0,i),a=0;a<o.length;a++)t=r.Util.cloneObject(t),t.currentTarget=o[a],n.call(o[a],t)}))},t.prototype.remove=function(){return this.isDragging()&&this.stopDrag(),s.DD._dragElements.delete(this._id),this._remove(),this},t.prototype._clearCaches=function(){this._clearSelfAndDescendantCache(l),this._clearSelfAndDescendantCache(u),this._clearSelfAndDescendantCache(f),this._clearSelfAndDescendantCache(C),this._clearSelfAndDescendantCache(k),this._clearSelfAndDescendantCache(y)},t.prototype._remove=function(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)},t.prototype.destroy=function(){e._removeId(this.id(),this);for(var t=(this.name()||"").split(/\s/g),n=0;n<t.length;n++){var r=t[n];e._removeName(r,this._id)}return this.remove(),this},t.prototype.getAttr=function(t){var e="get"+r.Util._capitalize(t);return r.Util._isFunction(this[e])?this[e]():this.attrs[t]},t.prototype.getAncestors=function(){var t=this.getParent(),e=new r.Collection;while(t)e.push(t),t=t.getParent();return e},t.prototype.getAttrs=function(){return this.attrs||{}},t.prototype.setAttrs=function(t){var e,n;if(!t)return this;for(e in t)e!==g&&(n=w+r.Util._capitalize(e),r.Util._isFunction(this[n])?this[n](t[e]):this._setAttr(e,t[e]));return this},t.prototype.isListening=function(){return this._getCache(y,this._isListening)},t.prototype._isListening=function(){var t=this.listening(),e=this.getParent();return"inherit"===t?!e||e.isListening():t},t.prototype.isVisible=function(){return this._getCache(k,this._isVisible)},t.prototype._isVisible=function(t){var e=this.visible(),n=this.getParent();return"inherit"===e?!n||n===t||n._isVisible(t):t&&t!==n?e&&n._isVisible(t):e},t.prototype.shouldDrawHit=function(){var t=this.getLayer();return!t&&this.isListening()&&this.isVisible()||t&&t.hitGraphEnabled()&&this.isListening()&&this.isVisible()},t.prototype.show=function(){return this.visible(!0),this},t.prototype.hide=function(){return this.visible(!1),this},t.prototype.getZIndex=function(){return this.index||0},t.prototype.getAbsoluteZIndex=function(){var t,e,n,r,i=this.getDepth(),o=this,a=0;function s(c){for(t=[],e=c.length,n=0;n<e;n++)r=c[n],a++,r.nodeType!==x&&(t=t.concat(r.getChildren().toArray())),r._id===o._id&&(n=e);t.length>0&&t[0].getDepth()<=i&&s(t)}return o.nodeType!==T&&s(o.getStage().getChildren()),a},t.prototype.getDepth=function(){var t=0,e=this.parent;while(e)t++,e=e.parent;return t},t.prototype._batchTransformChanges=function(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(P),this._clearSelfAndDescendantCache(l,!0)),this._needClearTransformCache=!1},t.prototype.setPosition=function(t){var e=this;return this._batchTransformChanges((function(){e.x(t.x),e.y(t.y)})),this},t.prototype.getPosition=function(){return{x:this.x(),y:this.y()}},t.prototype.getAbsolutePosition=function(t){var e=!1,n=this.parent;while(n){if(n.isCached()){e=!0;break}n=n.parent}e&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new r.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()},t.prototype.setAbsolutePosition=function(t){var e,n=this._clearTransform();return this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(P),e=this._getAbsoluteTransform(),e.invert(),e.translate(t.x,t.y),t={x:this.attrs.x+e.getTranslation().x,y:this.attrs.y+e.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this},t.prototype._setTransform=function(t){var e;for(e in t)this.attrs[e]=t[e]},t.prototype._clearTransform=function(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t},t.prototype.move=function(t){var e=t.x,n=t.y,r=this.x(),i=this.y();return void 0!==e&&(r+=e),void 0!==n&&(i+=n),this.setPosition({x:r,y:i}),this},t.prototype._eachAncestorReverse=function(t,e){var n,r,i=[],o=this.getParent();if(e&&e._id===this._id)t(this);else{i.unshift(this);while(o&&(!e||o._id!==e._id))i.unshift(o),o=o.parent;for(n=i.length,r=0;r<n;r++)t(i[r])}},t.prototype.rotate=function(t){return this.rotation(this.rotation()+t),this},t.prototype.moveToTop=function(){if(!this.parent)return r.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index;return this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0},t.prototype.moveUp=function(){if(!this.parent)return r.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,e=this.parent.getChildren().length;return t<e-1&&(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0)},t.prototype.moveDown=function(){if(!this.parent)return r.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0)},t.prototype.moveToBottom=function(){if(!this.parent)return r.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0&&(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0)},t.prototype.setZIndex=function(t){if(!this.parent)return r.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&r.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var e=this.index;return this.parent.children.splice(e,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this},t.prototype.getAbsoluteOpacity=function(){return this._getCache(u,this._getAbsoluteOpacity)},t.prototype._getAbsoluteOpacity=function(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t},t.prototype.moveTo=function(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this},t.prototype.toObject=function(){var t,e,n,i,o,a={},s=this.getAttrs();for(t in a.attrs={},s)e=s[t],o=r.Util.isObject(e)&&!r.Util._isPlainObject(e)&&!r.Util._isArray(e),o||(n="function"===typeof this[t]&&this[t],delete s[t],i=n?n.call(this):null,s[t]=e,i!==e&&(a.attrs[t]=e));return a.className=this.getClassName(),r.Util._prepareToStringify(a)},t.prototype.toJSON=function(){return JSON.stringify(this.toObject())},t.prototype.getParent=function(){return this.parent},t.prototype.findAncestors=function(t,e,n){var r=[];e&&this._isMatch(t)&&r.push(this);var i=this.parent;while(i){if(i===n)return r;i._isMatch(t)&&r.push(i),i=i.parent}return r},t.prototype.isAncestorOf=function(t){return!1},t.prototype.findAncestor=function(t,e,n){return this.findAncestors(t,e,n)[0]},t.prototype._isMatch=function(t){if(!t)return!1;if("function"===typeof t)return t(this);var e,n,i=t.replace(/ /g,"").split(","),o=i.length;for(e=0;e<o;e++)if(n=i[e],r.Util.isValidSelector(n)||(r.Util.warn('Selector "'+n+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),r.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),r.Util.warn("Konva is awesome, right?")),"#"===n.charAt(0)){if(this.id()===n.slice(1))return!0}else if("."===n.charAt(0)){if(this.hasName(n.slice(1)))return!0}else if(this.className===n||this.nodeType===n)return!0;return!1},t.prototype.getLayer=function(){var t=this.getParent();return t?t.getLayer():null},t.prototype.getStage=function(){return this._getCache(C,this._getStage)},t.prototype._getStage=function(){var t=this.getParent();return t?t.getStage():void 0},t.prototype.fire=function(t,e,n){return void 0===e&&(e={}),e.target=e.target||this,n?this._fireAndBubble(t,e):this._fire(t,e),this},t.prototype.getAbsoluteTransform=function(t){return t?this._getAbsoluteTransform(t):this._getCache(l,this._getAbsoluteTransform)},t.prototype._getAbsoluteTransform=function(t){var e;if(t)return e=new r.Transform,this._eachAncestorReverse((function(t){var n=t.transformsEnabled();"all"===n?e.multiply(t.getTransform()):"position"===n&&e.translate(t.x()-t.offsetX(),t.y()-t.offsetY())}),t),e;e=this.parent?this.parent.getAbsoluteTransform().copy():new r.Transform;var n=this.transformsEnabled();return"all"===n?e.multiply(this.getTransform()):"position"===n&&e.translate(this.x()-this.offsetX(),this.y()-this.offsetY()),e},t.prototype.getAbsoluteScale=function(t){var e=this;while(e)e._isUnderCache&&(t=e),e=e.getParent();var n=this.getAbsoluteTransform(t),r=n.decompose();return{x:r.scaleX,y:r.scaleY}},t.prototype.getAbsoluteRotation=function(){return this.getAbsoluteTransform().decompose().rotation},t.prototype.getTransform=function(){return this._getCache(P,this._getTransform)},t.prototype._getTransform=function(){var t=new r.Transform,e=this.x(),n=this.y(),i=a.Konva.getAngle(this.rotation()),o=this.scaleX(),s=this.scaleY(),c=this.skewX(),h=this.skewY(),u=this.offsetX(),l=this.offsetY();return 0===e&&0===n||t.translate(e,n),0!==i&&t.rotate(i),0===c&&0===h||t.skew(c,h),1===o&&1===s||t.scale(o,s),0===u&&0===l||t.translate(-1*u,-1*l),t},t.prototype.clone=function(t){var e,n,i,o,a,s=r.Util.cloneObject(this.attrs);for(e in t)s[e]=t[e];var c=new this.constructor(s);for(e in this.eventListeners)for(n=this.eventListeners[e],i=n.length,o=0;o<i;o++)a=n[o],a.name.indexOf(v)<0&&(c.eventListeners[e]||(c.eventListeners[e]=[]),c.eventListeners[e].push(a));return c},t.prototype._toKonvaCanvas=function(t){t=t||{};var e=this.getClientRect(),n=this.getStage(),r=void 0!==t.x?t.x:e.x,i=void 0!==t.y?t.y:e.y,a=t.pixelRatio||1,s=new o.SceneCanvas({width:t.width||e.width||(n?n.width():0),height:t.height||e.height||(n?n.height():0),pixelRatio:a}),c=s.getContext();return c.save(),(r||i)&&c.translate(-1*r,-1*i),this.drawScene(s),c.restore(),s},t.prototype.toCanvas=function(t){return this._toKonvaCanvas(t)._canvas},t.prototype.toDataURL=function(t){t=t||{};var e=t.mimeType||null,n=t.quality||null,r=this._toKonvaCanvas(t).toDataURL(e,n);return t.callback&&t.callback(r),r},t.prototype.toImage=function(t){if(!t||!t.callback)throw"callback required for toImage method config argument";var e=t.callback;delete t.callback,r.Util._urlToImage(this.toDataURL(t),(function(t){e(t)}))},t.prototype.setSize=function(t){return this.width(t.width),this.height(t.height),this},t.prototype.getSize=function(){return{width:this.width(),height:this.height()}},t.prototype.getClassName=function(){return this.className||this.nodeType},t.prototype.getType=function(){return this.nodeType},t.prototype.getDragDistance=function(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():a.Konva.dragDistance},t.prototype._off=function(t,e,n){var r,i,o,a=this.eventListeners[t];for(r=0;r<a.length;r++)if(i=a[r].name,o=a[r].handler,("konva"!==i||"konva"===e)&&(!e||i===e)&&(!n||n===o)){if(a.splice(r,1),0===a.length){delete this.eventListeners[t];break}r--}},t.prototype._fireChangeEvent=function(t,e,n){this._fire(t+p,{oldVal:e,newVal:n})},t.prototype.setId=function(t){var n=this.id();return e._removeId(n,this),h(this,t),this._setAttr("id",t),this},t.prototype.setName=function(t){var n,r,i=(this.name()||"").split(/\s/g),o=(t||"").split(/\s/g);for(r=0;r<i.length;r++)n=i[r],-1===o.indexOf(n)&&n&&e._removeName(n,this._id);for(r=0;r<o.length;r++)n=o[r],-1===i.indexOf(n)&&n&&e._addName(this,n);return this._setAttr(b,t),this},t.prototype.addName=function(t){if(!this.hasName(t)){var e=this.name(),n=e?e+" "+t:t;this.setName(n)}return this},t.prototype.hasName=function(t){if(!t)return!1;var e=this.name();if(!e)return!1;var n=(e||"").split(/\s/g);return-1!==n.indexOf(t)},t.prototype.removeName=function(t){var e=(this.name()||"").split(/\s/g),n=e.indexOf(t);return-1!==n&&(e.splice(n,1),this.setName(e.join(" "))),this},t.prototype.setAttr=function(t,e){var n=this[w+r.Util._capitalize(t)];return r.Util._isFunction(n)?n.call(this,e):this._setAttr(t,e),this},t.prototype._setAttr=function(t,e){var n=this.attrs[t];(n!==e||r.Util.isObject(e))&&(void 0===e||null===e?delete this.attrs[t]:this.attrs[t]=e,this._fireChangeEvent(t,n,e))},t.prototype._setComponentAttr=function(t,e,n){var r;void 0!==n&&(r=this.attrs[t],r||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=n,this._fireChangeEvent(t,r,n))},t.prototype._fireAndBubble=function(t,e,n){e&&this.nodeType===x&&(e.target=this);var r=(t===m||t===_)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||"Stage"===this.nodeType&&!n);if(!r){this._fire(t,e);var i=(t===m||t===_)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!i&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,e,n):this._fireAndBubble.call(this.parent,t,e))}},t.prototype._fire=function(t,e){var n,r=this.eventListeners[t];if(r)for(e=e||{},e.currentTarget=this,e.type=t,n=0;n<r.length;n++)r[n].handler.call(this,e)},t.prototype.draw=function(){return this.drawScene(),this.drawHit(),this},t.prototype._createDragElement=function(t){var e=t?t.pointerId:void 0,n=this.getStage(),r=this.getAbsolutePosition(),i=n._getPointerById(e)||n._changedPointerPositions[0]||r;s.DD._dragElements.set(this._id,{node:this,startPointerPos:i,offset:{x:i.x-r.x,y:i.y-r.y},dragStatus:"ready",pointerId:e})},t.prototype.startDrag=function(t){s.DD._dragElements.has(this._id)||this._createDragElement(t);var e=s.DD._dragElements.get(this._id);e.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},!0)},t.prototype._setDragPosition=function(t,e){var n=this.getStage()._getPointerById(e.pointerId);if(n){var i={x:n.x-e.offset.x,y:n.y-e.offset.y},o=this.dragBoundFunc();if(void 0!==o){var a=o.call(this,i,t);a?i=a:r.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===i.x&&this._lastPos.y===i.y||(this.setAbsolutePosition(i),this.getLayer()?this.getLayer().batchDraw():this.getStage()&&this.getStage().batchDraw()),this._lastPos=i}},t.prototype.stopDrag=function(t){var e=s.DD._dragElements.get(this._id);e&&(e.dragStatus="stopped"),s.DD._endDragBefore(t),s.DD._endDragAfter(t)},t.prototype.setDraggable=function(t){this._setAttr("draggable",t),this._dragChange()},t.prototype.isDragging=function(){var t=s.DD._dragElements.get(this._id);return!!t&&"dragging"===t.dragStatus},t.prototype._listenDrag=function(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",(function(t){var e=this,n=void 0!==t.evt["button"],r=!n||a.Konva.dragButtons.indexOf(t.evt["button"])>=0;if(r&&!this.isDragging()){var i=!1;s.DD._dragElements.forEach((function(t){e.isAncestorOf(t.node)&&(i=!0)})),i||this._createDragElement(t)}}))},t.prototype._dragChange=function(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();t&&s.DD._dragElements.has(this._id)&&this.stopDrag()}},t.prototype._dragCleanup=function(){this.off("mousedown.konva"),this.off("touchstart.konva")},t.create=function(t,e){return r.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)},t._createNode=function(e,n){var i,o,s,c=t.prototype.getClassName.call(e),h=e.children;n&&(e.attrs.container=n),a._NODES_REGISTRY[c]||(r.Util.warn('Can not find a node with class name "'+c+'". Fallback to "Shape".'),c="Shape");var u=a._NODES_REGISTRY[c];if(i=new u(e.attrs),h)for(o=h.length,s=0;s<o;s++)i.add(t._createNode(h[s]));return i},t}();e.Node=D,D.prototype.nodeType="Node",D.prototype._attrsAffectingSize=[],i.Factory.addGetterSetter(D,"zIndex"),i.Factory.addGetterSetter(D,"absolutePosition"),i.Factory.addGetterSetter(D,"position"),i.Factory.addGetterSetter(D,"x",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"y",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"globalCompositeOperation","source-over",c.getStringValidator()),i.Factory.addGetterSetter(D,"opacity",1,c.getNumberValidator()),i.Factory.addGetterSetter(D,"name","",c.getStringValidator()),i.Factory.addGetterSetter(D,"id","",c.getStringValidator()),i.Factory.addGetterSetter(D,"rotation",0,c.getNumberValidator()),i.Factory.addComponentsGetterSetter(D,"scale",["x","y"]),i.Factory.addGetterSetter(D,"scaleX",1,c.getNumberValidator()),i.Factory.addGetterSetter(D,"scaleY",1,c.getNumberValidator()),i.Factory.addComponentsGetterSetter(D,"skew",["x","y"]),i.Factory.addGetterSetter(D,"skewX",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"skewY",0,c.getNumberValidator()),i.Factory.addComponentsGetterSetter(D,"offset",["x","y"]),i.Factory.addGetterSetter(D,"offsetX",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"offsetY",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"dragDistance",null,c.getNumberValidator()),i.Factory.addGetterSetter(D,"width",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"height",0,c.getNumberValidator()),i.Factory.addGetterSetter(D,"listening","inherit",(function(t){var e=!0===t||!1===t||"inherit"===t;return e||r.Util.warn(t+' is a not valid value for "listening" attribute. The value may be true, false or "inherit".'),t})),i.Factory.addGetterSetter(D,"preventDefault",!0,c.getBooleanValidator()),i.Factory.addGetterSetter(D,"filters",null,(function(t){return this._filterUpToDate=!1,t})),i.Factory.addGetterSetter(D,"visible","inherit",(function(t){var e=!0===t||!1===t||"inherit"===t;return e||r.Util.warn(t+' is a not valid value for "visible" attribute. The value may be true, false or "inherit".'),t})),i.Factory.addGetterSetter(D,"transformsEnabled","all",c.getStringValidator()),i.Factory.addGetterSetter(D,"size"),i.Factory.addGetterSetter(D,"dragBoundFunc"),i.Factory.addGetterSetter(D,"draggable",!1,c.getBooleanValidator()),i.Factory.backCompat(D,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"}),r.Collection.mapMethods(D)},"4d64":function(t,e,n){var r=n("fc6a"),i=n("50c4"),o=n("23cb"),a=function(t){return function(e,n,a){var s,c=r(e),h=i(c.length),u=o(a,h);if(t&&n!=n){while(h>u)if(s=c[u++],s!=s)return!0}else for(;h>u;u++)if((t||u in c)&&c[u]===n)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"50c4":function(t,e,n){var r=n("a691"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5414:function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i,o=n("9cb8"),a=n("f0b4"),s=n("fce6"),c=n("d777"),h=n("4546"),u=n("d777"),l="auto",f="center",d="justify",p="Change.konva",g="2d",v="-",y="left",m="text",_="Text",b="top",w="bottom",x="middle",S="normal",C="px ",P=" ",T="right",k="word",O="char",A="none",E="…",D=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],F=D.length;function G(){return i||(i=o.Util.createCanvasElement().getContext(g),i)}function R(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function I(t){t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function L(t){return t=t||{},t.fillLinearGradientColorStops||t.fillRadialGradientColorStops||t.fillPatternImage||(t.fill=t.fill||"black"),t}String.prototype.trimRight;var M=function(t){function e(e){var n=t.call(this,L(e))||this;n._partialTextX=0,n._partialTextY=0;for(var r=0;r<F;r++)n.on(D[r]+p,n._setTextData);return n._setTextData(),n}return r(e,t),e.prototype._sceneFunc=function(t){var e,n=this.padding(),r=this.fontSize(),i=this.lineHeight()*r,o=this.textArr,a=o.length,s=this.verticalAlign(),c=0,h=this.align(),u=this.getWidth(),l=this.letterSpacing(),p=this.fill(),g=this.textDecoration(),v=-1!==g.indexOf("underline"),m=-1!==g.indexOf("line-through"),_=0,b=(_=i/2,0),S=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",x),t.setAttr("textAlign",y),s===x?c=(this.getHeight()-a*i-2*n)/2:s===w&&(c=this.getHeight()-a*i-2*n),t.translate(n,c+n),e=0;e<a;e++){b=0,S=0;var C,P,k,O=o[e],A=O.text,E=O.width,D=e!==a-1;if(t.save(),h===T?b+=u-E-2*n:h===f&&(b+=(u-E-2*n)/2),v&&(t.save(),t.beginPath(),t.moveTo(b,_+S+Math.round(r/2)),C=A.split(" ").length-1,P=0===C,k=h===d&&D&&!P?u-2*n:E,t.lineTo(b+Math.round(k),_+S+Math.round(r/2)),t.lineWidth=r/15,t.strokeStyle=p,t.stroke(),t.restore()),m&&(t.save(),t.beginPath(),t.moveTo(b,_+S),C=A.split(" ").length-1,P=0===C,k=h===d&&D&&!P?u-2*n:E,t.lineTo(b+Math.round(k),_+S),t.lineWidth=r/15,t.strokeStyle=p,t.stroke(),t.restore()),0!==l||h===d){C=A.split(" ").length-1;for(var F=0;F<A.length;F++){var G=A[F];" "===G&&e!==a-1&&h===d&&(b+=Math.floor((u-2*n-E)/C)),this._partialTextX=b,this._partialTextY=_+S,this._partialText=G,t.fillStrokeShape(this),b+=Math.round(this.measureSize(G).width)+l}}else this._partialTextX=b,this._partialTextY=_+S,this._partialText=A,t.fillStrokeShape(this);t.restore(),a>1&&(_+=i)}},e.prototype._hitFunc=function(t){var e=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,e,n),t.closePath(),t.fillStrokeShape(this)},e.prototype.setText=function(t){var e=o.Util._isString(t)?t:null===t||void 0===t?"":t+"";return this._setAttr(m,e),this},e.prototype.getWidth=function(){var t=this.attrs.width===l||void 0===this.attrs.width;return t?this.getTextWidth()+2*this.padding():this.attrs.width},e.prototype.getHeight=function(){var t=this.attrs.height===l||void 0===this.attrs.height;return t?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height},e.prototype.getTextWidth=function(){return this.textWidth},e.prototype.getTextHeight=function(){return o.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one lin