1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9036],{96086:function(t){"use strict";var e=Object.assign.bind(Object);t.exports=e,t.exports.default=t.exports},796:function(t,e,n){"use strict";let r;n.d(e,{ZA:function(){return nL},Ee:function(){return nG},__:function(){return nI},mh:function(){return nR},UL:function(){return nD},Hf:function(){return nB},Vp:function(){return nO},xv:function(){return nN},$T:function(){return nz}});var i,a,s={};n.r(s),n.d(s,{appendChild:function(){return np},appendChildToContainer:function(){return nm},appendInitialChild:function(){return e4},cancelTimeout:function(){return nh},clearContainer:function(){return nT},commitMount:function(){return nS},commitTextUpdate:function(){return nx},commitUpdate:function(){return nw},createInstance:function(){return e6},createTextInstance:function(){return e8},finalizeInitialChildren:function(){return e9},getChildHostContext:function(){return no},getPublicInstance:function(){return e7},getRootHostContext:function(){return ns},hideInstance:function(){return nC},hideTextInstance:function(){return nk},idlePriority:function(){return e2.unstable_IdlePriority},insertBefore:function(){return nv},insertInContainerBefore:function(){return ny},isPrimaryRenderer:function(){return nd},noTimeout:function(){return nu},now:function(){return e2.unstable_now},prepareForCommit:function(){return nt},preparePortalMount:function(){return ne},prepareUpdate:function(){return nn},removeChild:function(){return nb},removeChildFromContainer:function(){return n_},resetAfterCommit:function(){return nr},resetTextContent:function(){return ni},run:function(){return e2.unstable_runWithPriority},scheduleTimeout:function(){return nl},shouldDeprioritizeSubtree:function(){return na},shouldSetTextContent:function(){return nc},supportsMutation:function(){return ng},unhideInstance:function(){return nP},unhideTextInstance:function(){return nE},warnsIfNotActing:function(){return nf}});var o=Math.PI/180;let l="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope?self:{},h={_global:l,version:"8.4.3",isBrowser:"undefined"!=typeof window&&("[object Window]"===({}).toString.call(window)||"[object global]"===({}).toString.call(window)),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle:t=>h.angleDeg?t*o:t,enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging:()=>h.DD.isDragging,isDragReady:()=>!!h.DD.node,releaseCanvasOnDestroy:!0,document:l.document,_injectGlobal(t){l.Konva=t}},u=t=>{h[t.prototype.getClassName()]=t};h._injectGlobal(h);class c{constructor(t=[1,0,0,1,0,0]){this.dirty=!1,this.m=t&&t.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new c(this.m)}copyInto(t){t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5]}point(t){var e=this.m;return{x:e[0]*t.x+e[2]*t.y+e[4],y:e[1]*t.x+e[3]*t.y+e[5]}}translate(t,e){return this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e,this}scale(t,e){return this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e,this}rotate(t){var e=Math.cos(t),n=Math.sin(t),r=this.m[0]*e+this.m[2]*n,i=this.m[1]*e+this.m[3]*n,a=-(this.m[0]*n)+this.m[2]*e,s=-(this.m[1]*n)+this.m[3]*e;return this.m[0]=r,this.m[1]=i,this.m[2]=a,this.m[3]=s,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(t,e){var n=this.m[0]+this.m[2]*e,r=this.m[1]+this.m[3]*e,i=this.m[2]+this.m[0]*t,a=this.m[3]+this.m[1]*t;return this.m[0]=n,this.m[1]=r,this.m[2]=i,this.m[3]=a,this}multiply(t){var e=this.m[0]*t.m[0]+this.m[2]*t.m[1],n=this.m[1]*t.m[0]+this.m[3]*t.m[1],r=this.m[0]*t.m[2]+this.m[2]*t.m[3],i=this.m[1]*t.m[2]+this.m[3]*t.m[3],a=this.m[0]*t.m[4]+this.m[2]*t.m[5]+this.m[4],s=this.m[1]*t.m[4]+this.m[3]*t.m[5]+this.m[5];return this.m[0]=e,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=s,this}invert(){var t=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),e=this.m[3]*t,n=-this.m[1]*t,r=-this.m[2]*t,i=this.m[0]*t,a=t*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),s=t*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=e,this.m[1]=n,this.m[2]=r,this.m[3]=i,this.m[4]=a,this.m[5]=s,this}getMatrix(){return this.m}decompose(){var t=this.m[0],e=this.m[1],n=this.m[2],r=this.m[3],i=this.m[4],a=this.m[5],s=t*r-e*n;let o={x:i,y:a,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!=t||0!=e){var l=Math.sqrt(t*t+e*e);o.rotation=e>0?Math.acos(t/l):-Math.acos(t/l),o.scaleX=l,o.scaleY=s/l,o.skewX=(t*n+e*r)/s,o.skewY=0}else if(0!=n||0!=r){var h=Math.sqrt(n*n+r*r);o.rotation=Math.PI/2-(r>
10?Math.acos(-n/h):-Math.acos(n/h)),o.scaleX=s/h,o.scaleY=h,o.skewX=0,o.skewY=(t*n+e*r)/s}return o.rotation=b._getRotation(o.rotation),o}}var d=Math.PI/180,f=180/Math.PI,g="Konva error: ",p={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},m=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,v=[];let y="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame||function(t){setTimeout(t,60)},b={_isElement:t=>!!(t&&1==t.nodeType),_isFunction:t=>!!(t&&t.constructor&&t.call&&t.apply),_isPlainObject:t=>!!t&&t.constructor===Object,_isArray:t=>"[object Array]"===Object.prototype.toString.call(t),_isNumber:t=>"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)&&isFinite(t),_isString:t=>"[object String]"===Object.prototype.toString.call(t),_isBoolean:t=>"[object Boolean]"===Object.prototype.toString.call(t),isObject:t=>t instanceof Object,isValidSelector(t){if("string"!=typeof t)return!1;var e=t[0];return"#"===e||"."===e||e===e.toUpperCase()},_sign:t=>0===t?1:t>
10?1:-1,requestAnimFrame(t){v.push(t),1===v.length&&y(function(){let t=v;v=[],t.forEach(function(t){t()})})},createCanvasElement(){var t=document.createElement("canvas");try{t.style=t.style||{}}catch(t){}return t},createImageElement:()=>document.createElement("img"),_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){var n=b.createImageElement();n.onload=function(){e(n)},n.src=t},_rgbToHex:(t,e,n)=>(16777216+(t<<16)+(e<<8)+n).toString(16).slice(1),_hexToRgb(t){var e=parseInt(t=t.replace("#",""),16);return{r:e>>16&255,g:e>>8&255,b:255&e}},getRandomColor(){for(var t=(16777215*Math.random()<<0).toString(16);t.length<6;)t="0"+t;return"#"+t},getRGB(t){var e;return t in p?{r:(e=p[t])[0],g:e[1],b:e[2]}:"#"===t[0]?this._hexToRgb(t.substring(1)):"rgb("===t.substr(0,4)?{r:parseInt((e=m.exec(t.replace(/ /g,"")))[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}:{r:0,g:0,b:0}},colorToRGBA:t=>(t=t||"black",b._namedColorToRBA(t)||b._hex3ColorToRGBA(t)||b._hex4ColorToRGBA(t)||b._hex6ColorToRGBA(t)||b._hex8ColorToRGBA(t)||b._rgbColorToRGBA(t)||b._rgbaColorToRGBA(t)||b._hslColorToRGBA(t)),_namedColorToRBA(t){var e=p[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(0===t.indexOf("rgb(")){var e=(t=t.match(/rgb\(([^)]+)\)/)[1]).split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(0===t.indexOf("rgba(")){var e=(t=t.match(/rgba\(([^)]+)\)/)[1]).split(/ *, */).map((t,e)=>"%"===t.slice(-1)?3===e?parseInt(t)/100:parseInt(t)/100*255:Number(t));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if("#"===t[0]&&9===t.length)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if("#"===t[0]&&7===t.length)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if("#"===t[0]&&5===t.length)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if("#"===t[0]&&4===t.length)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){let e,n,r;let[i,...a]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),s=Number(a[0])/360,o=Number(a[1])/100,l=Number(a[2])/100;if(0===o)return{r:Math.round(r=255*l),g:Math.round(r),b:Math.round(r),a:1};e=l<.5?l*(1+o):l+o-l*o;let h=2*l-e,u=[0,0,0];for(let t=0;t<3;t++)(n=s+-(1/3*(t-1)))<0&&n++,n>1&&n--,r=6*n<1?h+(e-h)*6*n:2*n<1?e:3*n<2?h+(e-h)*(2/3-n)*6:h,u[t]=255*r;return{r:Math.round(u[0]),g:Math.round(u[1]),b:Math.round(u[2]),a:1}}},haveIntersection:(t,e)=>!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y),cloneObject(t){var e={};for(var n in t)this._isPlainObject(t[n])?e[n]=this.cloneObject(t[n]):this._isArray(t[n])?e[n]=this.cloneArray(t[n]):e[n]=t[n];return e},cloneArray:t=>t.slice(0),degToRad:t=>t*d,radToDeg:t=>t*f,_degToRad:t=>(b.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),b.degToRad(t)),_radToDeg:t=>(b.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),b.radToDeg(t)),_getRotation:t=>h.angleDeg?b.radToDeg(t):t,_capitalize:t=>t.charAt(0).toUpperCase()+t.slice(1),throw(t){throw Error(g+t)},error(t){console.error(g+t)},warn(t){h.showWarnings&&console.warn("Konva warning: "+t)},each(t,e){for(var n in t)e(n,t[n])},_inRange:(t,e,n)=>e<=t&&t<n,_getProjectionToSegment(t,e,n,r,i,a){var s,o,l,h=(t-n)*(t-n)+(e-r)*(e-r);if(0==h)s=t,o=e,l=(i-n)*(i-n)+(a-r)*(a-r);else{var u=((i-t)*(n-t)+(a-e)*(r-e))/h;u<0?(s=t,o=e,l=(t-i)*(t-i)+(e-a)*(e-a)):u>1?(s=n,o=r,l=(n-i)*(n-i)+(r-a)*(r-a)):l=((s=t+u*(n-t))-i)*(s-i)+((o=e+u*(r-e))-a)*(o-a)}return[s,o,l]},_getProjectionToLine(t,e,n){var r=b.cloneObject(t),i=Number.MAX_VALUE;return e.forEach(function(a,s){if(n||s!==e.length-1){var o=e[(s+1)%e.length],l=b._getProjectionToSegment(a.x,a.y,o.x,o.y,t.x,t.y),h=l[0],u=l[1],c=l[2];c<i&&(r.x=h,r.y=u,i=c)}}),r},_prepareArrayForTween(t,e,n){var r,i=[],a=[];if(t.length>e.length){var s=e;e=t,t=s}for(r=0;r<t.length;r+=2)i.push({x:t[r],y:t[r+1]});for(r=0;r<e.length;r+=2)a.push({x:e[r],y:e[r+1]});var o=[];return a.forEach(function(t){var e=b._getProjectionToLine(t,i,n);o.push(e.x),o.push(e.y)}),o},_prepareToStringify(t){var e;
1for(var n in t.visitedByCircularReferenceRemoval=!0,t)if(t.hasOwnProperty(n)&&t[n]&&"object"==typeof t[n]){if(e=Object.getOwnPropertyDescriptor(t,n),t[n].visitedByCircularReferenceRemoval||b._isElement(t[n])){if(!e.configurable)return null;delete t[n]}else if(null===b._prepareToStringify(t[n])){if(!e.configurable)return null;delete t[n]}}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(var n in e)t[n]=e[n];return t},_getFirstPointerId:t=>t.touches?t.changedTouches[0].identifier:t.pointerId||999,releaseCanvas(...t){h.releaseCanvasOnDestroy&&t.forEach(t=>{t.width=0,t.height=0})},drawRoundedRectPath(t,e,n,r){let i=0,a=0,s=0,o=0;"number"==typeof r?i=a=s=o=Math.min(r,e/2,n/2):(i=Math.min(r[0]||0,e/2,n/2),a=Math.min(r[1]||0,e/2,n/2),o=Math.min(r[2]||0,e/2,n/2),s=Math.min(r[3]||0,e/2,n/2)),t.moveTo(i,0),t.lineTo(e-a,0),t.arc(e-a,a,a,3*Math.PI/2,0,!1),t.lineTo(e,n-o),t.arc(e-o,n-o,o,0,Math.PI/2,!1),t.lineTo(s,n),t.arc(s,n-s,s,Math.PI/2,Math.PI,!1),t.lineTo(0,i),t.arc(i,i,i,Math.PI,3*Math.PI/2,!1)}};function _(t){return b._isString(t)?'"'+t+'"':"[object Number]"===Object.prototype.toString.call(t)||b._isBoolean(t)?t:Object.prototype.toString.call(t)}function x(t){return t>255?255:t<0?0:Math.round(t)}function S(){if(h.isUnminified)return function(t,e){return b._isNumber(t)||b.warn(_(t)+' is a not val
1id value for "'+e+'" attribute. The value should be a number.'),t}}function w(t){if(h.isUnminified)return function(e,n){let r=b._isNumber(e),i=b._isArray(e)&&e.length==t;return r||i||b.warn(_(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function C(){if(h.isUnminified)return function(t,e){var n=b._isNumber(t),r="auto"===t;return n||r||b.warn(_(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function k(){if(h.isUnminified)return function(t,e){return b._isString(t)||b.warn(_(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function P(){if(h.isUnminified)return function(t,e){let n=b._isString(t),r="[object CanvasGradient]"===Object.prototype.toString.call(t)||t&&t.addColorStop;return n||r||b.warn(_(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function E(){if(h.isUnminified)return function(t,e){return!0===t||!1===t||b.warn(_(t)+' is a not val
1id value for "'+e+'" attribute. The value should be a boolean.'),t}}let T={addGetterSetter(t,e,n,r,i){T.addGetter(t,e,n),T.addSetter(t,e,r,i),T.addOverloadedGetterSetter(t,e)},addGetter(t,e,n){var r="get"+b._capitalize(e);t.prototype[r]=t.prototype[r]||function(){var t=this.attrs[e];return void 0===t?n:t}},addSetter(t,e,n,r){var i="set"+b._capitalize(e);t.prototype[i]||T.overWriteSetter(t,e,n,r)},overWriteSetter(t,e,n,r){var i="set"+b._capitalize(e);t.prototype[i]=function(t){return n&&null!=t&&(t=n.call(this,t,e)),this._setAttr(e,t),r&&r.call(this),this}},addComponentsGetterSetter(t,e,n,r,i){var a,s,o=n.length,l=b._capitalize,u="get"+l(e),c="set"+l(e);t.prototype[u]=function(){var t={};for(a=0;a<o;a++)t[s=n[a]]=this.getAttr(e+l(s));return t};var d=function(t){if(h.isUnminified)return function(e,n){return null==e||b.isObject(e)||b.warn(_(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}(n);t.prototype[c]=function(t){var a,s=this.attrs[e];for(a in r&&(t=r.call(this,t)),d&&d.call(this,t,e),t)t.hasOwnProperty(a)&&this._setAttr(e+l(a),t[a]);return t||n.forEach(t=>{this._setAttr(e+l(t),void 0)}),this._fireChangeEvent(e,s,t),i&&i.call(this),this},T.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){var n=b._capitalize(e),r="set"+n,i="get"+n;t.prototype[e]=function(){return arguments.length?(this[r](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,r){b.error("Adding deprecated "+e);var i="get"+b._capitalize(e),a=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){b.error(a);var t=this.attrs[e];return void 0===t?n:t},T.addSetter(t,e,r,function(){b.error(a)}),T.addOverloadedGetterSetter(t,e)},backCompat(t,e){b.each(e,function(e,n){var r=t.prototype[n],i="get"+b._capitalize(e),a="set"+b._capitalize(e);function s(){r.apply(this,arguments),b.error('"'+e+'" method is deprecated and will be removed soon. Use ""'+n+'" instead.')}t.prototype[e]=s,t.prototype[i]=s,t.prototype[a]=s})},afterSetFilter(){this._filterUpToDate=!1}};var A=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"];class M{constructor(t){this.canvas=t,h.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,e){var n,r,i,a,s=this.traceArr,o=s.length,l="";for(n=0;n<o;n++)(i=(r=s[n]).method)?(a=r.args,l+=i,t?l+="()":b._isArray(a[0])?l+="(["+a.join(",")+"])":(e&&(a=a.map(t=>"number"==typeof t?Math.floor(t):t)),l+="("+a.join(",")+")")):(l+=r.property,t||(l+="="+r.val)),l+=";";return l}clearTrace(){this.traceArr=[]}_trace(t){var e=this.traceArr;e.push(t),e.length>=100&&e.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var e=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,e.getWidth()/e.pixelRatio,e.getHeight()/e.pixelRatio)}_applyLineCap(t){let e=t.attrs.lineCap;e&&this.setAttr("lineCap",e)}_applyOpacity(t){var e=t.getAbsoluteOpacity();1!==e&&this.setAttr("globalAlpha",e)}_applyLineJoin(t){let e=t.attrs.lineJoin;e&&this.setAttr("lineJoin",e)}setAttr(t,e){this._context[t]=e}arc(t,e,n,r,i,a){this._context.arc(t,e,n,r,i,a)}arcTo(t,e,n,r,i){this._context.arcTo(t,e,n,r,i)}beginPath(){this._context.beginPath()}bezierCurveTo(t,e,n,r,i,a){this._context.bezierCurveTo(t,e,n,r,i,a)}clearRect(t,e,n,r){this._context.clearRect(t,e,n,r)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(t,e){var n=arguments;return 2===n.length?this._context.createImageData(t,e):1===n.length?this._context.createImageData(t):void 0}createLinearGradient(t,e,n,r){return this._context.createLinearGradient(t,e,n,r)}createPattern(t,e){return this._context.createPattern(t,e)}createRadialGradient(t,e,n,r,i,a){return this._context.createRadialGradient(t,e,n,r,i,a)}drawImage(t,e,n,r,i,a,s,o,l){var h=arguments,u=this._context;3===h.length?u.drawImage(t,e,n):5===h.length?u.drawImage(t,e,n,r,i):9===h.length&&u.drawImage(t,e,n,r,i,a,s,o,l)}ellipse(t,e,n,r,i,a,s,o){this._context.ellipse(t,e,n,r,i,a,s,o)}
1isPointInPath(t,e,n,r){return n?this._context.isPointInPath(n,t,e,r):this._context.isPointInPath(t,e,r)}fill(t){t?this._context.fill(t):this._context.fill()}fillRect(t,e,n,r){this._context.fillRect(t,e,n,r)}strokeRect(t,e,n,r){this._context.strokeRect(t,e,n,r)}fillText(t,e,n,r){r?this._context.fillText(t,e,n,r):this._context.fillText(t,e,n)}measureText(t){return this._context.measureText(t)}getImageData(t,e,n,r){return this._context.getImageData(t,e,n,r)}lineTo(t,e){this._context.lineTo(t,e)}moveTo(t,e){this._context.moveTo(t,e)}rect(t,e,n,r){this._context.rect(t,e,n,r)}putImageData(t,e,n){this._context.putImageData(t,e,n)}quadraticCurveTo(t,e,n,r){this._context.quadraticCurveTo(t,e,n,r)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,e){this._context.scale(t,e)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,e,n,r,i,a){this._context.setTransform(t,e,n,r,i,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,e,n,r){this._context.strokeText(t,e,n,r)}transform(t,e,n,r,i,a){this._context.transform(t,e,n,r,i,a)}translate(t,e){this._context.translate(t,e)}_enableTrace(){var t,e,n=this,r=A.length,i=this.setAttr,a=function(t){var r,i=n[t];n[t]=function(){return e=function(t){var e,n,r=[],i=t.length;for(e=0;e<i;e++)n=t[e],b._isNumber(n)?n=Math.round(1e3*n)/1e3:b._isString(n)||(n+=""),r.push(n);return r}(Array.prototype.slice.call(arguments,0)),r=i.apply(n,arguments),n._trace({method:t,args:e}),r}};for(t=0;t<r;t++)a(A[t]);n.setAttr=function(){i.apply(n,arguments);var t=arguments[0],e=arguments[1];("shadowOffsetX"===t||"shadowOffsetY"===t||"shadowBlur"===t)&&(e/=this.canvas.getPixelRatio()),n._trace({property:t,val:e})}}_applyGlobalCompositeOperation(t){let e=t.attrs.globalCompositeOperation;e&&"source-over"!==e&&this.setAttr("globalCompositeOperation",e)}}["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"].forEach(function(t){Object.defineProperty(M.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class R extends M{constructor(t){super(t),this._context=t._canvas.getContext("2d")}_fillColor(t){var e=t.fill();this.setAttr("fillStyle",e),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var e=t._getLinearGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fillRadialGradient(t){let e=t._getRadialGradient();e&&(this.setAttr("fillStyle",e),t._fillFunc(this))}_fill(t){let e=t.fill(),n=t.getFillPriority();if(e&&"color"===n){this._fillColor(t);return}let r=t.getFillPatternImage();if(r&&"pattern"===n){this._fillPattern(t);return}let i=t.getFillLinearGradientColorStops();if(i&&"linear-gradient"===n){this._fillLinearGradient(t);return}let a=t.getFillRadialGradientColorStops();if(a&&"radial-gradient"===n){this._fillRadialGradient(t);return}e?this._fillColor(t):r?this._fillPattern(t):i?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){let e=t.getStrokeLinearGradientStartPoint(),n=t.getStrokeLinearGradientEndPoint(),r=t.getStrokeLinearGradientColorStops(),i=this.createLinearGradient(e.x,e.y,n.x,n.y);if(r){for(var a=0;a<r.length;a+=2)i.addColorStop(r[a],r[a+1]);this.setAttr("strokeStyle",i)}}_stroke(t){var e=t.dash(),n=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!n){this.save();var r=this.getCanvas().getPixelRatio();this.setTransform(r,0,0,r,0,0)}this._applyLineCap(t),e&&t.dashEnabled()&&(this.setLineDash(e),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),t.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),n||this.restore(
1)}}_applyShadow(t){var e,n,r,i=null!==(e=t.getShadowRGBA())&&void 0!==e?e:"black",a=null!==(n=t.getShadowBlur())&&void 0!==n?n:5,s=null!==(r=t.getShadowOffset())&&void 0!==r?r:{x:0,y:0},o=t.getAbsoluteScale(),l=this.canvas.getPixelRatio(),h=o.x*l,u=o.y*l;this.setAttr("shadowColor",i),this.setAttr("shadowBlur",a*Math.min(Math.abs(h),Math.abs(u))),this.setAttr("shadowOffsetX",s.x*h),this.setAttr("shadowOffsetY",s.y*u)}}class L extends M{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){let i=t.getStrokeScaleEnabled();if(!i){this.save();var e=this.getCanvas().getPixelRatio();this.setTransform(e,0,0,e,0,0)}this._applyLineCap(t);var n=t.hitStrokeWidth(),r="auto"===n?t.strokeWidth():n;this.setAttr("lineWidth",r),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),i||this.restore()}}}class I{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var e=(t||{}).pixelRatio||h.pixelRatio||function(){if(i)return i;var t=b.createCanvasElement(),e=t.getContext("2d");return i=(h._global.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1),b.releaseCanvas(t),i}();this.pixelRatio=e,this._canvas=b.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var e=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/e,this.getHeight()/e)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var e=this.pixelRatio;this.getContext()._context.scale(e,e)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var e=this.pixelRatio;this.getContext()._context.scale(e,e)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,e){this.setWidth(t||0),this.setHeight(e||0)}toDataURL(t,e){try{return this._canvas.toDataURL(t,e)}catch(t){try{return this._canvas.toDataURL()}catch(t){return b.error("Unable to get data URL. "+t.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}T.addGetterSetter(I,"pixelRatio",void 0,S());class D extends I{constructor(t={width:0,height:0}){super(t),this.context=new R(this),this.setSize(t.width,t.height)}}class G extends I{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new L(this),this.setSize(t.width,t.height)}}let N={get isDragging(){var O=!1;return N._dragElements.forEach(t=>{"dragging"===t.dragStatus&&(O=!0)}),O},justDragged:!1,get node(){var z;return N._dragElements.forEach(t=>{z=t.node}),z},_dragElements:new Map,_drag(t){let e=[];N._dragElements.forEach((n,r)=>{let{node:i}=n,a=i.getStage();a.setPointersPositions(t),void 0===n.pointerId&&(n.pointerId=b._getFirstPointerId(t));let s=a._changedPointerPositions.find(t=>t.id===n.pointerId);if(s){if("dragging"!==n.dragStatus){var o=i.dragDistance();if(Math.max(Math.abs(s.x-n.startPointerPos.x),Math.abs(s.y-n.startPointerPos.y))<o||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,n),e.push(i)}}),e.forEach(e=>{e.fire("dragmove",{type:"dragmove",target:e,evt:t},!0)})},_endDragBefore(t){let e=[];N._dragElements.forEach(n=>{let{node:r}=n,i=r.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(t=>t.id===n.pointerId))return;("dragging"===n.dragStatus||"stopped"===n.dragStatus)&&(N.justDragged=!0,h._mouseListenClick=!1,h._touchListenClick=!1,h._pointerListenClick=!1,n.dragStatus="stopped");let a=n.node.getLayer()||n.node instanceof h.Stage&&n.node;a&&-1===e.indexOf(a)&&e.push(a)}),e.forEach(t=>{t.draw()})},_endDragAfter(t){N._dragElements.forEach((e,n)=>{"stopped"===e.dragStatus&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t}
1,!0),"dragging"!==e.dragStatus&&N._dragElements.delete(n)})}};h.isBrowser&&(window.addEventListener("mouseup",N._endDragBefore,!0),window.addEventListener("touchend",N._endDragBefore,!0),window.addEventListener("mousemove",N._drag),window.addEventListener("touchmove",N._drag),window.addEventListener("mouseup",N._endDragAfter,!1),window.addEventListener("touchend",N._endDragAfter,!1));var F="absoluteOpacity",B="allEventListeners",H="absoluteTransform",W="absoluteScale",U="canvas",j="listening",Y="mouseenter",X="mouseleave",q="Shape",Q="stage",V="transform",K="visible";let $=1;class J{constructor(t){this._id=$++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===V||t===H)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,e){var n=this._cache.get(t),r=t===V||t===H;return(void 0===n||r&&!0===n.dirty)&&(n=e.call(this),this._cache.set(t,n)),n}_calculate(t,e,n){if(!this._attachedDepsListeners.get(t)){let n=e.map(t=>t+"Change.konva").join(" ");this.on(n,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,n)}_getCanvasCache(){return this._cache.get(U)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===H&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(U)){let{scene:t,filter:e,hit:n}=this._cache.get(U);b.releaseCanvas(t,e,n),this._cache.delete(U)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(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 r=Math.ceil(e.width||n.width),i=Math.ceil(e.height||n.height),a=e.pixelRatio,s=void 0===e.x?Math.floor(n.x):e.x,o=void 0===e.y?Math.floor(n.y):e.y,l=e.offset||0,h=e.drawBorder||!1,u=e.hitCanvasPixelRatio||1;if(!r||!i){b.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}r+=2*l+1,i+=2*l+1,s-=l,o-=l;var c=new D({pixelRatio:a,width:r,height:i}),d=new D({pixelRatio:a,width:0,height:0}),f=new G({pixelRatio:u,width:r,height:i}),g=c.getContext(),p=f.getContext();return f.isCache=!0,c.isCache=!0,this._cache.delete(U),this._filterUpToDate=!1,!1===e.imageSmoothingEnabled&&(c.getContext()._context.imageSmoothingEnabled=!1,d.getContext()._context.imageSmoothingEnabled=!1),g.save(),p.save(),g.translate(-s,-o),p.translate(-s,-o),this._isUnderCache=!0,this._clearSelfAndDescendantCache(F),this._clearSelfAndDescendantCache(W),this.drawScene(c,this),this.drawHit(f,this),this._isUnderCache=!1,g.restore(),p.restore(),h&&(g.save(),g.beginPath(),g.rect(0,0,r,i),g.closePath(),g.setAttr("strokeStyle","red"),g.setAttr("lineWidth",5),g.stroke(),g.restore()),this._cache.set(U,{scene:c,filter:d,hit:f,x:s,y:o}),this._requestDraw(),this}isCached(){return this._cache.has(U)}getClientRect(t){throw Error('abstract "getClientRect" method call')}_transformedRect(t,e){var n,r,i,a,s=[{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}],o=this.getAbsoluteTransform(e);return s.forEach(function(t){var e=o.point(t);void 0===n&&(n=i=e.x,r=a=e.y),n=Math.min(n,e.x),r=Math.min(r,e.y),i=Math.max(i,e.x),a=Math.max(a,e.y)}),{x:n,y:r,width:i-n,height:a-r}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);let 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()}_drawCachedHitCanvas(t){var e=this._getCanvasCache(),n=e.hit;t.save(),t.translate(e.x,e.y),t.drawImage(n._canvas,0,0,n.width/n.pixelRatio,n.height/n.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t,e,n,r,i=this.filters(),a=this._getCanvasCache(),s=a.scene,o=a.filter,l=o.getContext();if(i){if(!this._filterUpToDate){var h=s.pixelRatio;o.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio);try{for(t=i.length,l.clear(),l.drawImage(s._canvas,0,0,s.getWidth()/h,s.getHeight()/h),e=l.getImageData(0,0,o.getWidth(),o.getHeight()),n=0;n<t;n++){if(r=i[n],"function"!=typeof r){b.error("Filter should be type of function, but got "+typeof r+" instead. Please check correct filters");continue}r.call(this,e),l.putImageData(e,0,0)}}catch(t){b.error("Unable to apply filter. "+t.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return o}return s}on(t,e){if(this._cache&&this._cache.delete(B),3==arguments.length)return this._delegate.apply(this,arguments);var n,r,i,a,s=t.split(" "),o=s.length;for(n=0;n<o;n++)i=(r=s[n].split("."))[0],a=r[1]||"",this.eventListeners[i]||(this.eventListeners[i]=[]),this.eventListeners[i].push({name:a,handler:e});return this}off(t,e){var n,r,i,a,s,o=(t||"").split(" "),l=o.length;if(this._cache&&this._cache.delete(B),!t)for(r in this.eventListeners)this._off(r);for(n=0;n<l;n++)if(a=(i=o[n].split("."))[0],s=i[1],a)this.eventListeners[a]&&this._off(a,s,e);else for(r in this.eventListeners)this._off(r,s,e);return this}
1dispatchEvent(t){var e={target:this,type:t.type,evt:t};return this.fire(t.type,e),this}addEventListener(t,e){return this.on(t,function(t){e.call(this,t.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,e,n){var r=this;this.on(t,function(t){for(var i=t.target.findAncestors(e,!0,r),a=0;a<i.length;a++)(t=b.cloneObject(t)).currentTarget=i[a],n.call(i[a],t)})}remove(){return this.isDragging()&&this.stopDrag(),N._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(H),this._clearSelfAndDescendantCache(F),this._clearSelfAndDescendantCache(W),this._clearSelfAndDescendantCache(Q),this._clearSelfAndDescendantCache(K),this._clearSelfAndDescendantCache(j)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var e="get"+b._capitalize(t);return b._isFunction(this[e])?this[e]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),e=[];t;)e.push(t),t=t.getParent();return e}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var e,n;if(!t)return this;for(e in t)"children"!==e&&(n="set"+b._capitalize(e),b._isFunction(this[n])?this[n](t[e]):this._setAttr(e,t[e]))}),this}isListening(){return this._getCache(j,this._isListening)}_isListening(t){if(!this.listening())return!1;let e=this.getParent();return!e||e===t||this===t||e._isListening(t)}isVisible(){return this._getCache(K,this._isVisible)}_isVisible(t){if(!this.visible())return!1;let e=this.getParent();return!e||e===t||this===t||e._isVisible(t)}shouldDrawHit(t,e=!1){if(t)return this._isVisible(t)&&this._isListening(t);var n=this.getLayer(),r=!1;N._dragElements.forEach(t=>{"dragging"===t.dragStatus&&("Stage"===t.node.nodeType?r=!0:t.node.getLayer()===n&&(r=!0))});var i=!e&&!h.hitOnDragEnabled&&r;return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t,e,n,r,i=this.getDepth(),a=this,s=0;return"Stage"!==a.nodeType&&function o(l){for(n=0,t=[],e=l.length;n<e;n++)r=l[n],s++,r.nodeType!==q&&(t=t.concat(r.getChildren().slice())),r._id===a._id&&(n=e);t.length>0&&t[0].getDepth()<=i&&o(t)}(a.getStage().getChildren()),s}getDepth(){for(var t=0,e=this.parent;e;)t++,e=e.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(V),this._clearSelfAndDescendantCache(H)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var e=this.getAbsoluteTransform().copy();return e.invert(),e.point(t)}getAbsolutePosition(t){let e=!1,n=this.parent;for(;n;){if(n.isCached()){e=!0;break}n=n.parent}e&&!t&&(t=!0);var r=this.getAbsoluteTransform(t).getMatrix(),i=new c,a=this.offset();return i.m=r.slice(),i.translate(a.x,a.y),i.getTranslation()}setAbsolutePosition(t){var e=this._clearTransform();this.attrs.x=e.x,this.attrs.y=e.y,delete e.x,delete e.y,this._clearCache(V);var n=this._getAbsoluteTransform().copy();return n.invert(),n.translate(t.x,t.y),t={x:this.attrs.x+n.getTranslation().x,y:this.attrs.y+n.getTranslation().y},this._setTransform(e),this.setPosition({x:t.x,y:t.y}),this._clearCache(V),this._clearSelfAndDescendantCache(H),this}_setTransform(t){var e;for(e in t)this.attrs[e]=t[e]}_clearTransform(){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}move(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}_eachAncestorReverse(t,e){var n,r,i=[],a=this.getParent();if(!e||e._id!==this._id){for(i.unshift(this);a&&(!e||a._id!==e._id);)i.unshift(a),a=a.parent;for(r=0,n=i.length;r<n;r++)t(i[r])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return b.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index;return t<this.parent.getChildren().length-1&&(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0)}moveUp(){if(!this.parent)return b.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index;return t<this.parent.getChildren().length-1&&(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0)}moveDown(){if(!this.parent)return b.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)}moveToBottom(){if(!this.parent)return b.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)}setZIndex(t){if(!this.parent)return b.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&b.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}getAbsoluteOpacity(){return this._getCache(F,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),e=this.getParent();return e&&!e._isUnderCache&&(t*=e.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t,e,n,r,i={},a=this.getAttrs();for(t in i.attrs={},a)e=a[t],(!b.isObject(e)||b._isPlainObject(e)||b._isArray(e))&&(n="function"==typeof this[t]&&this[t],delete a[t],r=n?n.call(this):null,a[t]=e,r!==e&&(i.attrs[t]=e));return i.className=this.getClassName(),b._prepareToStringify(i)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,e,n){var r=[];e&&this._isMatch(t)&&r.push(this);for(var i=this.parent;i&&i!==n;)i._isMatch(t)&&r.push(i),i=i.parent;return r}isAncestorOf(t){return!1}
1findAncestor(t,e,n){return this.findAncestors(t,e,n)[0]}_isMatch(t){if(!t)return!1;if("function"==typeof t)return t(this);var e,n,r=t.replace(/ /g,"").split(","),i=r.length;for(e=0;e<i;e++)if(n=r[e],b.isValidSelector(n)||(b.warn('Selector "'+n+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),b.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),b.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}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(Q,this._getStage)}_getStage(){var t=this.getParent();return t?t.getStage():void 0}fire(t,e={},n){return e.target=e.target||this,n?this._fireAndBubble(t,e):this._fire(t,e),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(H,this._getAbsoluteTransform)}_getAbsoluteTransform(t){if(t)return e=new c,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._cache.get(H)||new c,this.parent?this.parent.getAbsoluteTransform().copyInto(e):e.reset();var e,n=this.transformsEnabled();if("all"===n)e.multiply(this.getTransform());else if("position"===n){let t=this.attrs.x||0,n=this.attrs.y||0,r=this.attrs.offsetX||0,i=this.attrs.offsetY||0;e.translate(t-r,n-i)}return e.dirty=!1,e}getAbsoluteScale(t){for(var e=this;e;)e._isUnderCache&&(t=e),e=e.getParent();let n=this.getAbsoluteTransform(t).decompose();return{x:n.scaleX,y:n.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(V,this._getTransform)}_getTransform(){var t,e,n=this._cache.get(V)||new c;n.reset();var r=this.x(),i=this.y(),a=h.getAngle(this.rotation()),s=null!==(t=this.attrs.scaleX)&&void 0!==t?t:1,o=null!==(e=this.attrs.scaleY)&&void 0!==e?e:1,l=this.attrs.skewX||0,u=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(0!==r||0!==i)&&n.translate(r,i),0!==a&&n.rotate(a),(0!==l||0!==u)&&n.skew(l,u),(1!==s||1!==o)&&n.scale(s,o),(0!==d||0!==f)&&n.translate(-1*d,-1*f),n.dirty=!1,n}clone(t){var e,n,r,i,a,s=b.cloneObject(this.attrs);for(e in t)s[e]=t[e];var o=new this.constructor(s);for(e in this.eventListeners)for(i=0,r=(n=this.eventListeners[e]).length;i<r;i++)0>(a=n[i]).name.indexOf("konva")&&(o.eventListeners[e]||(o.eventListeners[e]=[]),o.eventListeners[e].push(a));return o}_toKonvaCanvas(t){t=t||{};var e=this.getClientRect(),n=this.getStage(),r=void 0!==t.x?t.x:Math.floor(e.x),i=void 0!==t.y?t.y:Math.floor(e.y),a=t.pixelRatio||1,s=new D({width:t.width||Math.ceil(e.width)||(n?n.width():0),height:t.height||Math.ceil(e.height)||(n?n.height():0),pixelRatio:a}),o=s.getContext();return!1===t.imageSmoothingEnabled&&(o._context.imageSmoothingEnabled=!1),o.save(),(r||i)&&o.translate(-1*r,-1*i),this.drawScene(s),o.restore(),s}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){var e=(t=t||{}).mimeType||null,n=t.quality||null,r=this._toKonvaCanvas(t).toDataURL(e,n);return t.callback&&t.callback(r),r}toImage(t){return new Promise((e,n)=>{try{let n=null==t?void 0:t.callback;n&&delete t.callback,b._urlToImage(this.toDataURL(t),function(t){e(t),null==n||n(t)})}catch(t){n(t)}})}toBlob(t){return new Promise((e,n)=>{try{let n=null==t?void 0:t.callback;n&&delete t.callback,this.toCanvas(t).toBlob(t=>{e(t),null==n||n(t)})}catch(t){n(t)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return void 0!==this.attrs.dragDistance?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():h.dragDistance}_off(t,e,n){var r,i,a,s=this.eventListeners[t];for(r=0;r<s.length;r++)if(i=s[r].name,a=s[r].handler,("konva"!==i||"konva"===e)&&(!e||i===e)&&(!n||n===a)){if(s.splice(r,1),0===s.length){delete this.eventListeners[t];break}r--}}_fireChangeEvent(t,e,n){this._fire(t+"Change",{oldVal:e,newVal:n})}addName(t){if(!this.hasName(t)){var e=this.name();this.name(e?e+" "+t:t)}return this}hasName(t){if(!t)return!1;let e=this.name();return!!e&&-1!==(e||"").split(/\s/g).indexOf(t)}removeName(t){var e=(this.name()||"").split(/\s/g),n=e.indexOf(t);return -1!==n&&(e.splice(n,1),this.name(e.join(" "))),this}setAttr(t,e){var n=this["set"+b._capitalize(t)];return b._isFunction(n)?n.call(this,e):this._setAttr(t,e),this}_requestDraw(){if(h.autoDrawEnabled){let t=this.getLayer()||this.get
1Stage();null==t||t.batchDraw()}}_setAttr(t,e){var n=this.attrs[t];(n!==e||b.isObject(e))&&(null==e?delete this.attrs[t]:this.attrs[t]=e,this._shouldFireChangeEvents&&this._fireChangeEvent(t,n,e),this._requestDraw())}_setComponentAttr(t,e,n){var r;void 0!==n&&((r=this.attrs[t])||(this.attrs[t]=this.getAttr(t)),this.attrs[t][e]=n,this._fireChangeEvent(t,r,n))}_fireAndBubble(t,e,n){if(e&&this.nodeType===q&&(e.target=this),!((t===Y||t===X)&&(n&&(this===n||this.isAncestorOf&&this.isAncestorOf(n))||"Stage"===this.nodeType&&!n))){this._fire(t,e);var r=(t===Y||t===X)&&n&&n.isAncestorOf&&n.isAncestorOf(this)&&!n.isAncestorOf(this.parent);(e&&!e.cancelBubble||!e)&&this.parent&&this.parent.isListening()&&!r&&(n&&n.parent?this._fireAndBubble.call(this.parent,t,e,n):this._fireAndBubble.call(this.parent,t,e))}}_getProtoListeners(t){let e=this._cache.get(B);if(!e){e={};let t=Object.getPrototypeOf(this);for(;t;){if(!t.eventListeners){t=Object.getPrototypeOf(t);continue}for(var n in t.eventListeners){let r=t.eventListeners[n],i=e[n]||[];e[n]=r.concat(i)}t=Object.getPrototypeOf(t)}this._cache.set(B,e)}return e[t]}_fire(t,e){(e=e||{}).currentTarget=this,e.type=t;let n=this._getProtoListeners(t);if(n)for(var r=0;r<n.length;r++)n[r].handler.call(this,e);let i=this.eventListeners[t];if(i)for(var r=0;r<i.length;r++)i[r].handler.call(this,e)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var e=t?t.pointerId:void 0,n=this.getStage(),r=this.getAbsolutePosition(),i=n._getPointerById(e)||n._changedPointerPositions[0]||r;N._dragElements.set(this._id,{node:this,startPointerPos:i,offset:{x:i.x-r.x,y:i.y-r.y},dragStatus:"ready",pointerId:e})}startDrag(t,e=!0){N._dragElements.has(this._id)||this._createDragElement(t),N._dragElements.get(this._id).dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},e)}_setDragPosition(t,e){let n=this.getStage()._getPointerById(e.pointerId);if(n){var r={x:n.x-e.offset.x,y:n.y-e.offset.y},i=this.dragBoundFunc();if(void 0!==i){let e=i.call(this,r,t);e?r=e:b.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}this._lastPos&&this._lastPos.x===r.x&&this._lastPos.y===r.y||(this.setAbsolutePosition(r),this._requestDraw()),this._lastPos=r}}stopDrag(t){let e=N._dragElements.get(this._id);e&&(e.dragStatus="stopped"),N._endDragBefore(t),N._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){let t=N._dragElements.get(this._id);return!!t&&"dragging"===t.dragStatus}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){if(!(!(!(void 0!==t.evt.button)||h.dragButtons.indexOf(t.evt.button)>=0)||this.isDragging())){var e=!1;N._dragElements.forEach(t=>{this.isAncestorOf(t.node)&&(e=!0)}),e||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;let t=N._dragElements.get(this._id),e=t&&"dragging"===t.dragStatus,n=t&&"ready"===t.dragStatus;
1e?this.stopDrag():n&&N._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){let e=this.getStage();if(!e)return!1;let n={x:-t.x,y:-t.y,width:e.width()+2*t.x,height:e.height()+2*t.y};return b.haveIntersection(n,this.getClientRect())}static create(t,e){return b._isString(t)&&(t=JSON.parse(t)),this._createNode(t,e)}static _createNode(t,e){var n,r,i,a=J.prototype.getClassName.call(t),s=t.children;if(e&&(t.attrs.container=e),h[a]||(b.warn('Can not find a node with class name "'+a+'". Fallback to "Shape".'),a="Shape"),n=new h[a](t.attrs),s)for(i=0,r=s.length;i<r;i++)n.add(J._createNode(s[i]));return n}}J.prototype.nodeType="Node",J.prototype._attrsAffectingSize=[],J.prototype.eventListeners={},J.prototype.on.call(J.prototype,"xChange.konva yChange.konva scaleXChange.konva scaleYChange.konva skewXChange.konva skewYChange.konva rotationChange.konva offsetXChange.konva offsetYChange.konva transformsEnabledChange.konva",function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(V),this._clearSelfAndDescendantCache(H)}),J.prototype.on.call(J.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(K)}),J.prototype.on.call(J.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(j)}),J.prototype.on.call(J.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(F)});let Z=T.addGetterSetter;Z(J,"zIndex"),Z(J,"absolutePosition"),Z(J,"position"),Z(J,"x",0,S()),Z(J,"y",0,S()),Z(J,"globalCompositeOperation","source-over",k()),Z(J,"opacity",1,S()),Z(J,"name","",k()),Z(J,"id","",k()),Z(J,"rotation",0,S()),T.addComponentsGetterSetter(J,"scale",["x","y"]),Z(J,"scaleX",1,S()),Z(J,"scaleY",1,S()),T.addComponentsGetterSetter(J,"skew",["x","y"]),Z(J,"skewX",0,S()),Z(J,"skewY",0,S()),T.addComponentsGetterSetter(J,"offset",["x","y"]),Z(J,"offsetX",0,S()),Z(J,"offsetY",0,S()),Z(J,"dragDistance",null,S()),Z(J,"width",0,S()),Z(J,"height",0,S()),Z(J,"listening",!0,E()),Z(J,"preventDefault",!0,E()),Z(J,"filters",null,function(t){return this._filterUpToDate=!1,t}),Z(J,"visible",!0,E()),Z(J,"transformsEnabled","all",k()),Z(J,"size"),Z(J,"dragBoundFunc"),Z(J,"draggable",!1,E()),T.backCompat(J,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class tt extends J{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];let e=this.children||[];var n=[];return e.forEach(function(e){t(e)&&n.push(e)}),n}hasChildren(){return this.getChildren().length>0}
1removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(0===t.length)return this;if(t.length>1){for(var e=0;e<t.length;e++)this.add(t[e]);return this}let n=t[0];return n.getParent()?n.moveTo(this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw()),this}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(t){return this._generalFind(t,!1)}findOne(t){var e=this._generalFind(t,!0);return e.length>0?e[0]:void 0}_generalFind(t,e){var n=[];return this._descendants(r=>{let i=r._isMatch(t);return i&&n.push(r),!!i&&!!e}),n}_descendants(t){for(let e of this.getChildren())if(t(e)||e.hasChildren()&&e._descendants(t))return!0;return!1}toObject(){var t=J.prototype.toObject.call(this);
1return t.children=[],this.getChildren().forEach(e=>{t.children.push(e.toObject())}),t}isAncestorOf(t){for(var e=t.getParent();e;){if(e._id===this._id)return!0;e=e.getParent()}return!1}clone(t){var e=J.prototype.clone.call(this,t);return this.getChildren().forEach(function(t){e.add(t.clone())}),e}getAllIntersections(t){var e=[];return this.find("Shape").forEach(function(n){n.isVisible()&&n.intersects(t)&&e.push(n)}),e}_clearSelfAndDescendantCache(t){var e;super._clearSelfAndDescendantCache(t),this.isCached()||null===(e=this.children)||void 0===e||e.forEach(function(e){e._clearSelfAndDescendantCache(t)})}_setChildrenIndices(){var t;null===(t=this.children)||void 0===t||t.forEach(function(t,e){t.index=e}),this._requestDraw()}drawScene(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas(),i=r&&r.getContext(),a=this._getCanvasCache(),s=a&&a.scene,o=r&&r.isCache;if(!this.isVisible()&&!o)return this;if(s){i.save();var l=this.getAbsoluteTransform(e).getMatrix();i.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedSceneCanvas(i),i.restore()}else this._drawChildren("drawScene",r,e);return this}drawHit(t,e){if(!this.shouldDrawHit(e))return this;var n=this.getLayer(),r=t||n&&n.hitCanvas,i=r&&r.getContext(),a=this._getCanvasCache();if(a&&a.hit){i.save();var s=this.getAbsoluteTransform(e).getMatrix();i.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren("drawHit",r,e);return this}_drawChildren(t,e,n){var r,i=e&&e.getContext(),a=this.clipWidth(),s=this.clipHeight(),o=this.clipFunc(),l=a&&s||o;let h=n===this;if(l){i.save();var u=this.getAbsoluteTransform(n),c=u.getMatrix();if(i.transform(c[0],c[1],c[2],c[3],c[4],c[5]),i.beginPath(),o)o.call(this,i,this);else{var d=this.clipX(),f=this.clipY();i.rect(d,f,a,s)}i.clip(),c=u.copy().invert().getMatrix(),i.transform(c[0],c[1],c[2],c[3],c[4],c[5])}var g=!h&&"source-over"!==this.globalCompositeOperation()&&"drawScene"===t;g&&(i.save(),i._applyGlobalCompositeOperation(this)),null===(r=this.children)||void 0===r||r.forEach(function(r){r[t](e,n)}),g&&i.restore(),l&&i.restore()}getClientRect(t){var e,n,r,i,a,s=(t=t||{}).skipTransform,o=t.relativeTo,l={x:1/0,y:1/0,width:0,height:0},h=this;null===(e=this.children)||void 0===e||e.forEach(function(e){if(e.visible()){var s=e.getClientRect({relativeTo:h,skipShadow:t.skipShadow,skipStroke:t.skipStroke});(0!==s.width||0!==s.height)&&(void 0===n?(n=s.x,r=s.y,i=s.x+s.width,a=s.y+s.height):(n=Math.min(n,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x+s.width),a=Math.max(a,s.y+s.height)))}});for(var u=this.find("Shape"),c=!1,d=0;d<u.length;d++)if(u[d]._isVisible(this)){c=!0;break}return(l=c&&void 0!==n?{x:n,y:r,width:i-n,height:a-r}:{x:0,y:0,width:0,height:0},s)?l:this._transformedRect(l,o)}}T.addComponentsGetterSetter(tt,"clip",["x","y","width","height"]),T.addGetterSetter(tt,"clipX",void 0,S()),T.addGetterSetter(tt,"clipY",void 0,S()),T.addGetterSetter(tt,"clipWidth",void 0,S()),T.addGetterSetter(tt,"clipHeight",void 0,S()),T.addGetterSetter(tt,"clipFunc");let te=new Map,tn=void 0!==h._global.PointerEvent;function tr(t){return{evt:t,pointerId:t.pointerId}}function ti(t,e){ta(t),e.getStage()&&(te.set(t,e),tn&&e._fire("gotpointercapture",tr(new PointerEvent("gotpointercapture"))))}function ta(t,e){let n=te.get(t);if(!n)return;let r=n.getStage();r&&r.content,te.delete(t),tn&&n._fire("lostpointercapture",tr(new PointerEvent("lostpointercapture")))}var ts="mouseleave",to="mouseover",tl="mouseenter",th="mousemove",tu="mousedown",tc="mouseup",td="pointermove",tf="pointerdown",tg="pointerup",tp="pointercancel",tm="pointerout",tv="pointerleave",ty="pointerover",tb="pointerenter",t_="contextmenu",tx="touchstart",tS="touchend",tw="touchmove",tC="touchcancel",tk="wheel",tP=[[tl,"_pointerenter"],[tu,"_pointerdown"],[th,"_pointermove"],[tc,"_pointerup"],[ts,"_pointerleave"],[tx,"_pointerdown"],[tw,"_pointermove"],[tS,"_pointerup"],[tC,"_pointercancel"],[to,"_pointerover"],[tk,"_wheel"],[t_,"_contextmenu"],[tf,"_pointerdown"],[td,"_pointermove"],[tg,"_pointerup"],[tp,"_pointercancel"],["lostpointercapture","_lostpointercapture"]];let tE={mouse:{[tm]:"mouseout",[tv]:ts,[ty]:to,[tb]:tl,[td]:th,[tf]:tu,[tg]:tc,[tp]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[tm]:"touchout",[tv]:"touchleave",[ty]:"touchover",[tb]:"touchenter",[td]:tw,[tf]:tx,[tg]:tS,[tp]:tC,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[tm]:tm,[tv]:tv,[ty]:ty,[tb]:tb,[td]:td,[tf]:tf,[tg]:tg,[tp]:tp,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},tT=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",tA=t=>{let e=tT(t);return"pointer"===e?h.pointerEventsEnabled&&tE.pointer:"touch"===e?tE.touch:"mouse"===e?tE.mouse:void 0};function tM(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&b.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}let tR=[];class tL extends tt{constructor(t){super(tM(t)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),tR.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{tM(this.attrs)}),this._checkVisibility()}_validateAdd(t){let e="Layer"===t.getType(),n="FastLayer"===t.getType();e||n||b.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;let t=this.visible()?"":"none";this.content.style.display=t}setContainer(t){if("string"==typeof t){if("."===t.charAt(0)){var e,n=t.slice(1);t=document.getElementsByClassName(n)[0]}else e="#"!==t.charAt(0)?t:t.slice(1),t=document.getElementById(e);if(!t)throw"Can not find container in document with id "+e}return this._setAttr("container",t),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),t.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var t,e=this.children,n=e.length;for(t=0;t<n;t++)e[t].clear();return this}clone(t){return t||(t={}),t.container="undefined"!=typeof document&&document.createElement("div"),tt.prototype.clone.call(this,t)}destroy(){super.destroy();var t=this.content;t&&b._isInDocument(t)&&this.container().removeChild(t);var e=tR.indexOf(this);return e>-1&&tR.splice(e,1),b.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){let t=this._pointerPositions[0]||this._changedPointerPositions[0];return t?{x:t.x,y:t.y}:(b.warn("Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);"),null)}_getPointerById(t){return this._pointerPositions.find(e=>e.id===t)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(t){(t=t||{}).x=t.x||0,t.y=t.y||0,t.width=t.width||this.width(),t.height=t.height||this.height();var e=new D({width:t.width,height:t.height,pixelRatio:t.pixelRatio||1}),n=e.getContext()._context,r=this.children;return(t.x||t.y)&&n.translate(-1*t.x,-1*t.y),r.forEach(function(e){if(e.isVisible()){var r=e._toKonvaCanvas(t);n.drawImage(r._canvas,t.x,t.y,r.getWidth()/r.getPixelRatio(),r.getHeight()/r.getPixelRatio())}}),e}getIntersection(t){if(!t)return null;var e,n=this.children;for(e=n.length-1;e>=0;e--){let r=n[e].getIntersection(t);
1if(r)return r}return null}_resizeDOM(){var t=this.width(),e=this.height();this.content&&(this.content.style.width=t+"px",this.content.style.height=e+"px"),this.bufferCanvas.setSize(t,e),this.bufferHitCanvas.setSize(t,e),this.children.forEach(n=>{n.setSize({width:t,height:e}),n.draw()})}add(t,...e){if(arguments.length>1){for(var n=0;n<arguments.length;n++)this.add(arguments[n]);return this}super.add(t);var r=this.children.length;return r>5&&b.warn("The stage has "+r+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),t.setSize({width:this.width(),height:this.height()}),t.draw(),h.isBrowser&&this.content.appendChild(t.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(t){return te.get(t)===this}setPointerCapture(t){ti(t,this)}releaseCapture(t){ta(t,this)}getLayers(){return this.children}_bindContentEvents(){h.isBrowser&&tP.forEach(([t,e])=>{this.content.addEventListener(t,t=>{this[e](t)},{passive:!1})})}_pointerenter(t){this.setPointersPositions(t);let e=tA(t.type);this._fire(e.pointerenter,{evt:t,target:this,currentTarget:this})}_pointerover(t){this.setPointersPositions(t);let e=tA(t.type);this._fire(e.pointerover,{evt:t,target:this,currentTarget:this})}_getTargetShape(t){let e=this[t+"targetShape"];return e&&!e.getStage()&&(e=null),e}_pointerleave(t){let e=tA(t.type),n=tT(t.type);if(e){this.setPointersPositions(t);var r=this._getTargetShape(n),i=!N.isDragging||h.hitOnDragEnabled;r&&i?(r._fireAndBubble(e.pointerout,{evt:t}),r._fireAndBubble(e.pointerleave,{evt:t}),this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this[n+"targetShape"]=null):i&&(this._fire(e.pointerleave,{evt:t,target:this,currentTarget:this}),this._fire(e.pointerout,{evt:t,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(t){let e=tA(t.type),n=tT(t.type);if(e){this.setPointersPositions(t);var r=!1;this._changedPointerPositions.forEach(i=>{var a=this.getIntersection(i);if(N.justDragged=!1,h["_"+n+"ListenClick"]=!0,!(a&&a.isListening()))return;h.capturePointerEventsEnabled&&a.setPointerCapture(i.id),this[n+"ClickStartShape"]=a,a._fireAndBubble(e.pointerdown,{evt:t,pointerId:i.id}),r=!0;let s=t.type.indexOf("touch")>=0;a.preventDefault()&&t.cancelable&&s&&t.preventDefault()}),r||this._fire(e.pointerdown,{evt:t,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(t){let e=tA(t.type),n=tT(t.type);if(!e||(N.isDragging&&N.node.preventDefault()&&t.cancelable&&t.preventDefault(),this.setPointersPositions(t),!(!N.isDragging||h.hitOnDragEnabled)))return;var r={};let i=!1;var a=this._getTargetShape(n);this._changedPointerPositions.forEach(s=>{let o=(u=s.id,te.get(u)||this.getIntersection(s)),l=s.id,h={evt:t,pointerId:l};var u,c=a!==o;if(c&&a&&(a._fireAndBubble(e.pointerout,Object.assign({},h),o),a._fireAndBubble(e.pointerleave,Object.assign({},h),o)),o){if(r[o._id])return;r[o._id]=!0}o&&o.isListening()?(i=!0,c&&(o._fireAndBubble(e.pointerover,Object.assign({},h),a),o._fireAndBubble(e.pointerenter,Object.assign({},h),a),this[n+"targetShape"]=o),o._fireAndBubble(e.pointermove,Object.assign({},h))):a&&(this._fire(e.pointerover,{evt:t,target:this,currentTarget:this,pointerId:l}),this[n+"targetShape"]=null)}),i||this._fire(e.pointermove,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(t){let e=tA(t.type),n=tT(t.type);if(!e)return;this.setPointersPositions(t);let r=this[n+"ClickStartShape"],i=this[n+"ClickEndShape"];var a={};let s=!1;this._changedPointerPositions.forEach(o=>{var l;let u=(l=o.id,te.get(l)||this.getIntersection(o));if(u){if(u.releaseCapture(o.id),a[u._id])return;a[u._id]=!0}let c=o.id,d={evt:t,pointerId:c},f=!1;h["_"+n+"InDblClickWindow"]?(f=!0,clearTimeout(this[n+"DblTimeout"])):N.justDragged||(h["_"+n+"InDblClickWindow"]=!0,clearTimeout(this[n+"DblTimeout"])),this[n+"DblTimeout"]=setTimeout(function(){h["_"+n+"InDblClickWindow"]=!1},h.dblClickWindow),u&&u.isListening()?(s=!0,this[n+"ClickEndShape"]=u,u._fireAndBubble(e.pointerup,Object.assign({},d)),h["_"+n+"ListenClick"]&&r&&r===u&&(u._fireAndBubble(e.pointerclick,Object.assign({},d)),f&&i&&i===u&&u._fireAndBubble(e.pointerdblclick,Object.assign({},d)))):(this[n+"ClickEndShape"]=null,h["_"+n+"ListenClick"]&&this._fire(e.pointerclick,{evt:t,target:this,currentTarget:this,pointerId:c}),f&&this._fire(e.pointerdblclick,{evt:t,target:this,currentTarget:this,pointerId:c}))}),s||this._fire(e.pointerup,{evt:t,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),h["_"+n+"ListenClick"]=!1,t.cancelable&&"touch"!==n&&t.preventDefault()}_contextmenu(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(t_,{evt:t}):this._fire(t_,{evt:t,target:this,currentTarget:this})}_wheel(t){this.setPointersPositions(t);var e=this.getIntersection(this.getPointerPosition());e&&e.isListening()?e._fireAndBubble(tk,{evt:t}):this._fire(tk,{evt:t,target:this,currentTarget:this})}_pointercancel(t){var e;this.setPointersPositions(t);let n=(e=t.pointerId,te.get(e)||this.getIntersection(this.getPointerPosition()));n&&n._fireAndBubble(tg,tr(t)),ta(t.pointerId)}_lostpointercapture(t){ta(t.pointerId)}setPointersPositions(t){var e=this._getContentPosition(),n=null,r=null;void 0!==(t=t||window.event).touches?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(t.touches,t=>{this._pointerPositions.push({id:t.identifier,x:(t.clientX-e.left)/e.scaleX,y:(t.clientY-e.top)/e.scaleY})}),Array.prototype.forEach.call(t.changedTouches||t.touches,t=>{this._changedPointerPositions.push({id:t.identifier,x:(t.clientX-e.left)/e.scaleX,y:(t.clientY-e.top)/e.scaleY})})):(n=(t.clientX-e.left)/e.scaleX,r=(t.clientY-e.top)/e.scaleY,this.pointerPos={x:n,y:r},this._pointerPositions=[{x:n,y:r,id:b._getFirstPointerId(t)}],this._changedPointerPositions=[{x:n,y:r,id:b._getFirstPointerId(t)}])}_setPointerPosition(t){b.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(t)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var t=this.content.getBoundingClientRect();
1return{top:t.top,left:t.left,scaleX:t.width/this.content.clientWidth||1,scaleY:t.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new D({width:this.width(),height:this.height()}),this.bufferHitCanvas=new G({pixelRatio:1,width:this.width(),height:this.height()}),h.isBrowser){var t=this.container();if(!t)throw"Stage has no container. A container is required.";t.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),t.appendChild(this.content),this._resizeDOM()}}cache(){return b.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(t){t.batchDraw()}),this}}tL.prototype.nodeType="Stage",u(tL),T.addGetterSetter(tL,"container");var tI="hasShadow",tD="shadowRGBA",tG="patternImage",tN="linearGradient",tO="radialGradient";function tz(){return r||(r=b.createCanvasElement().getContext("2d"))}let tF={};class tB extends J{constructor(t){let e;for(super(t);!(e=b.getRandomColor())||(e in tF););this.colorKey=e,tF[e]=this}getContext(){return b.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return b.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(tI,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&0!==this.shadowOpacity()&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(tG,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){let t=tz().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(t&&t.setTransform){let e=new c;e.translate(this.fillPatternX(),this.fillPatternY()),e.rotate(h.getAngle(this.fillPatternRotation())),e.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),e.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());let n=e.getMatrix(),r="undefined"==typeof DOMMatrix?{a:n[0],b:n[1],c:n[2],d:n[3],e:n[4],f:n[5]}:new DOMMatrix(n);t.setTransform(r)}return t}}_getLinearGradient(){return this._getCache(tN,this.__getLinearGradient)}__getLinearGradient(){var t=this.fillLinearGradientColorStops();if(t){for(var e=tz(),n=this.fillLinearGradientStartPoint(),r=this.fillLinearGradientEndPoint(),i=e.createLinearGradient(n.x,n.y,r.x,r.y),a=0;a<t.length;
1a+=2)i.addColorStop(t[a],t[a+1]);return i}}_getRadialGradient(){return this._getCache(tO,this.__getRadialGradient)}__getRadialGradient(){var t=this.fillRadialGradientColorStops();if(t){for(var e=tz(),n=this.fillRadialGradientStartPoint(),r=this.fillRadialGradientEndPoint(),i=e.createRadialGradient(n.x,n.y,this.fillRadialGradientStartRadius(),r.x,r.y,this.fillRadialGradientEndRadius()),a=0;a<t.length;a+=2)i.addColorStop(t[a],t[a+1]);return i}}getShadowRGBA(){return this._getCache(tD,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var t=b.colorToRGBA(this.shadowColor());if(t)return"rgba("+t.r+","+t.g+","+t.b+","+t.a*(this.shadowOpacity()||1)+")"}}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){let t=this.hitStrokeWidth();return"auto"===t?this.hasStroke():this.strokeEnabled()&&!!t}intersects(t){var e=this.getStage().bufferHitCanvas;return e.getContext().clear(),this.drawHit(e,null,!0),e.context.getImageData(Math.round(t.x),Math.round(t.y),1,1).data[3]>0}destroy(){return J.prototype.destroy.call(this),delete tF[this.colorKey],delete this.colorKey,this}_useBufferCanvas(t){var e;if(!this.getStage()||!(null===(e=this.attrs.perfectDrawEnabled)||void 0===e||e))return!1;let n=t||this.hasFill(),r=this.hasStroke(),i=1!==this.getAbsoluteOpacity();if(n&&r&&i)return!0;let a=this.hasShadow(),s=this.shadowForStrokeEnabled();return!!n&&!!r&&!!a&&!!s}setStrokeHitEnabled(t){b.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),t?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return 0!==this.hitStrokeWidth()}getSelfRect(){var t=this.size();return{x:this._centroid?-t.width/2:0,y:this._centroid?-t.height/2:0,width:t.width,height:t.height}}getClientRect(t={}){let e=t.skipTransform,n=t.relativeTo,r=this.getSelfRect(),i=!t.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,a=r.width+i,s=r.height+i,o=!t.skipShadow&&this.hasShadow(),l=o?this.shadowOffsetX():0,h=o?this.shadowOffsetY():0,u=o&&this.shadowBlur()||0,c={width:a+Math.abs(l)+2*u,height:s+Math.abs(h)+2*u,x:-(i/2+u)+Math.min(l,0)+r.x,y:-(i/2+u)+Math.min(h,0)+r.y};return e?c:this._transformedRect(c,n)}drawScene(t,e){var n,r,i=this.getLayer(),a=t||i.getCanvas(),s=a.getContext(),o=this._getCanvasCache(),l=this.getSceneFunc(),h=this.hasShadow(),u=a.isCache,c=e===this;if(!this.isVisible()&&!c)return this;if(o){s.save();var d=this.getAbsoluteTransform(e).getMatrix();return s.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(s),s.restore(),this}if(!l)return this;if(s.save(),this._useBufferCanvas()&&!u){(r=(n=this.getStage().bufferCanvas).getContext()).clear(),r.save(),r._applyLineJoin(this);var f=this.getAbsoluteTransform(e).getMatrix();r.transform(f[0],f[1],f[2],f[3],f[4],f[5]),l.call(this,r,this),r.restore();var g=n.pixelRatio;h&&s._applyShadow(this),s._applyOpacity(this),s._applyGlobalCompositeOperation(this),s.drawImage(n._canvas,0,0,n.width/g,n.height/g)}else{if(s._applyLineJoin(this),!c){var f=this.getAbsoluteTransform(e).getMatrix();s.transform(f[0],f[1],f[2],f[3],f[4],f[5]),s._applyOpacity(this),s._applyGlobalCompositeOperation(this)}h&&s._applyShadow(this),l.call(this,s,this)}return s.restore(),this}drawHit(t,e,n=!1){if(!this.shouldDrawHit(e,n))return this;var r=this.getLayer(),i=t||r.hitCanvas,a=i&&i.getContext(),s=this.hitFunc()||this.sceneFunc(),o=this._getCanvasCache(),l=o&&o.hit;if(this.colorKey||b.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),l){a.save();var h=this.getAbsoluteTransform(e).getMatrix();return a.transform(h[0],h[1],h[2],h[3],h[4],h[5]),this._drawCachedHitCanvas(a),a.restore(
1),this}if(!s)return this;if(a.save(),a._applyLineJoin(this),this!==e){var u=this.getAbsoluteTransform(e).getMatrix();a.transform(u[0],u[1],u[2],u[3],u[4],u[5])}return s.call(this,a,this),a.restore(),this}drawHitFromCache(t=0){var e,n,r,i,a,s=this._getCanvasCache(),o=this._getCachedSceneCanvas(),l=s.hit,h=l.getContext(),u=l.getWidth(),c=l.getHeight();h.clear(),h.drawImage(o._canvas,0,0,u,c);try{for(a=0,r=(n=(e=h.getImageData(0,0,u,c)).data).length,i=b._hexToRgb(this.colorKey);a<r;a+=4)n[a+3]>t?(n[a]=i.r,n[a+1]=i.g,n[a+2]=i.b,n[a+3]=255):n[a+3]=0;h.putImageData(e,0,0)}catch(t){b.error("Unable to draw hit graph from cached scene canvas. "+t.message)}return this}hasPointerCapture(t){return te.get(t)===this}setPointerCapture(t){ti(t,this)}releaseCapture(t){ta(t,this)}}tB.prototype._fillFunc=function(t){t.fill()},tB.prototype._strokeFunc=function(t){t.stroke()},tB.prototype._fillFuncHit=function(t){t.fill()},tB.prototype._strokeFuncHit=function(t){t.stroke()},tB.prototype._centroid=!1,tB.prototype.nodeType="Shape",u(tB),tB.prototype.eventListeners={},tB.prototype.on.call(tB.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",function(){this._clearCache(tI)}),tB.prototype.on.call(tB.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",function(){this._clearCache(tD)}),tB.prototype.on.call(tB.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",function(){this._clearCache(tG)}),tB.prototype.on.call(tB.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",function(){this._clearCache(tN)}),tB.prototype.on.call(tB.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",function(){this._clearCache(tO)}),T.addGetterSetter(tB,"stroke",void 0,P()),T.addGetterSetter(tB,"strokeWidth",2,S()),T.addGetterSetter(tB,"fillAfterStrokeEnabled",!1),T.addGetterSetter(tB,"hitStrokeWidth","auto",C()),T.addGetterSetter(tB,"strokeHitEnabled",!0,E()),T.addGetterSetter(tB,"perfectDrawEnabled",!0,E()),T.addGetterSetter(tB,"shadowForStrokeEnabled",!0,E()),T.addGetterSetter(tB,"lineJoin"),T.addGetterSetter(tB,"lineCap"),T.addGetterSetter(tB,"sceneFunc"),T.addGetterSetter(tB,"hitFunc"),T.addGetterSetter(tB,"dash"),T.addGetterSetter(tB,"dashOffset",0,S()),T.addGetterSetter(tB,"shadowColor",void 0,k()),T.addGetterSetter(tB,"shadowBlur",0,S()),T.addGetterSetter(tB,"shadowOpacity",1,S()),T.addComponentsGetterSetter(tB,"shadowOffset",["x","y"]),T.addGetterSetter(tB,"shadowOffsetX",0,S()),T.addGetterSetter(tB,"shadowOffsetY",0,S()),T.addGetterSetter(tB,"fillPatternImage"),T.addGetterSetter(tB,"fill",void 0,P()),T.addGetterSetter(tB,"fillPatternX",0,S()),T.addGetterSetter(tB,"fillPatternY",0,S()),T.addGetterSetter(tB,"fillLinearGradientColorStops"),T.addGetterSetter(tB,"strokeLinearGradientColorStops"),T.addGetterSetter(tB,"fillRadialGradientStartRadius",0),T.addGetterSetter(tB,"fillRadialGradientEndRadius",0),T.addGetterSetter(tB,"fillRadialGradientColorStops"),T.addGetterSetter(tB,"fillPatternRepeat","repeat"),T.addGetterSetter(tB,"fillEnabled",!0),T.addGetterSetter(tB,"strokeEnabled",!0),T.addGetterSetter(tB,"shadowEnabled",!0),T.addGetterSetter(tB,"dashEnabled",!0),T.addGetterSetter(tB,"strokeScaleEnabled",!0),T.addGetterSetter(tB,"fillPriority","color"),T.addComponentsGetterSetter(tB,"fillPatternOffset",["x","y"]),T.addGetterSetter(tB,"fillPatternOffsetX",0,S()),T.addGetterSetter(tB,"fillPatternOffsetY",0,S()),T.addComponentsGetterSetter(tB,"fillPatternScale",["x","y"]),T.addGetterSetter(tB,"fillPatternScaleX",1,S()),T.addGetterSetter(tB,"fillPatternScaleY",1,S()),T.addComponentsGetterSetter(tB,"fillLinearGradientStartPoint",["x","y"]),T.addComponentsGetterSetter(tB,"strokeLinearGradientStartPoint",["x","y"]),T.addGetterSetter(tB,"fillLinearGradientStartPointX",0),T.addGetterSetter(tB,"strokeLinearGradientStartPointX",0),T.addGetterSetter(tB,"fillLinearGradientStartPointY",0),T.addGetterSetter(tB,"strokeLinearGradientStartPointY",0),T.addComponentsGetterSetter(tB,"fillLinearGradientEndPoint",["x","y"]),T.addComponentsGetterSetter(tB,"strokeLinearGradientEndPoint",["x","y"]),T.addGetterSetter(tB,"fillLinearGradientEndPointX",0),T.addGetterSetter(tB,"strokeLinearGradientEndPointX",0),T.addGetterSetter(tB,"fillLinearGradientEndPointY",0),T.addGetterSetter(tB,"strokeLinearGradientEndPointY",0),T.addComponentsGetterSetter(tB,"fillRadialGradientStartPoint",["x","y"]),T.addGetterSetter(tB,"fillRadialGradientStartPointX",0),T.addGetterSetter(tB,"fillRadialGradientStartPointY",0),T.addComponentsGetterSetter(tB,"fillRadialGradientEndPoint",["x","y"]),T.addGetterSetter(tB,"fillRadialGradientEndPointX",0),T.addGetterSetter(tB,"fillRadialGradientEndPointY",0),T.addGetterSetter(tB,"fillPatternRotation",0),T.backCompat(tB,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var tH=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],tW=tH.length;class tU extends tt{constructor(t){super(t),this.canvas=new D,this.hitCanvas=new G({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}
1createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t<e.children.length-1?e.content.insertBefore(this.getNativeCanvasElement(),e.children[t+1].getCanvas()._canvas):e.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){J.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!J.prototype.moveUp.call(this))return!1;var t=this.getStage();return!!t&&!!t.content&&(t.content.removeChild(this.getNativeCanvasElement()),this.index<t.children.length-1?t.content.insertBefore(this.getNativeCanvasElement(),t.children[this.index+1].getCanvas()._canvas):t.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(J.prototype.moveDown.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(J.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var e=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),e[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return J.prototype.remove.call(this),t&&t.parentNode&&b._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:e}){return this.canvas.setSize(t,e),this.hitCanvas.setSize(t,e),this._setSmoothEnabled(),this}_validateAdd(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&b.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return(t=t||{}).width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=void 0!==t.x?t.x:this.x(),t.y=void 0!==t.y?t.y:this.y(),J.prototype._toKonvaCanvas.call(this,t)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){b.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){b.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,b.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var e=1,n=!1;;){for(let r=0;r<tW;r++){let i=tH[r],a=this._getIntersection({x:t.x+i.x*e,y:t.y+i.y*e}),s=a.shape;if(s)return s;if(n=!!a.antialiased,!a.antialiased)break}if(!n)return null;e+=1}}_getIntersection(t){let e=this.hitCanvas.pixelRatio,n=this.hitCanvas.context.getImageData(Math.round(t.x*e),Math.round(t.y*e),1,1).data,r=n[3];if(255===r){let t=tF["#"+b._rgbToHex(n[0],n[1],n[2])];return t?{shape:t}:{antialiased:!0}}return r>0?{antialiased:!0}:{}}drawScene(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas();return this._fire("beforeDraw",{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),tt.prototype.drawScene.call(this,r,e),this._fire("draw",{node:this}),this}drawHit(t,e){var n=this.getLayer(),r=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),tt.prototype.drawHit.call(this,r,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){b.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return b.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(this.parent&&this.parent.content){var t=this.parent;this.hitCanvas._canvas.parentNode?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return b.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}tU.prototype.nodeType="Layer",u(tU),T.addGetterSetter(tU,"imageSmoothingEnabled",!0),T.addGetterSetter(tU,"clearBeforeDraw",!0),T.addGetterSetter(tU,"hitGraphEnabled",!0,E());class tj extends tU{constructor(t){super(t),this.listening(!1),b.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}tj.prototype.nodeType="FastLayer",u(tj);class tY extends tt{_validateAdd(t){var e=t.getType();"Group"!==e&&"Shape"!==e&&b.throw("You may only add groups and shapes to groups.")}}tY.prototype.nodeType="Group",u(tY);var tX=l.performance&&l.performance.now?function(){return l.performance.now()}:function(){return new Date().getTime()};class tq{constructor(t,e){this.id=tq.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:tX(),frameRate:0},this.func=t,this.setLayers(e)}setLayers(t){var e=[];return e=t?t.length>0?t:[t]:[],this.layers=e,this}getLayers(){return this.layers}addLayer(t){var e,n=this.layers,r=n.length;for(e=0;e<r;e++)if(n[e]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t,e=tq.animations,n=e.length;for(t=0;t<n;t++)if(e[t].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=tX(),tq._addAnimation(this),this}stop(){return tq._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}
1static _removeAnimation(t){var e,n=t.id,r=this.animations,i=r.length;for(e=0;e<i;e++)if(r[e].id===n){this.animations.splice(e,1);break}}static _runFrames(){var t,e,n,r,i,a,s,o,l={},h=this.animations;for(r=0;r<h.length;r++)if(e=(t=h[r]).layers,n=t.func,t._updateFrameObject(tX()),a=e.length,!n||!1!==n.call(t,t.frame))for(i=0;i<a;i++)void 0!==(s=e[i])._id&&(l[s._id]=s);for(o in l)l.hasOwnProperty(o)&&l[o].batchDraw()}static _animationLoop(){tq.animations.length?(tq._runFrames(),b.requestAnimFrame(tq._animationLoop)):tq.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,b.requestAnimFrame(this._animationLoop))}}tq.animations=[],tq.animIdCounter=0,tq.animRunning=!1;var tQ={node:1,duration:1,easing:1,onFinish:1,yoyo:1},tV=0,tK=["fill","stroke","shadowColor"];class t${constructor(t,e,n,r,i,a,s){this.prop=t,this.propFunc=e,this.begin=r,this._pos=r,this.duration=a,this._change=0,this.prevPos=0,this.yoyo=s,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=n,this._change=i-this.begin,this.pause()}fire(t){var e=this[t];e&&e()}setTime(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())}getTime(){return this._time}setPosition(t){this.prevPos=this._pos,this.propFunc(t),this._pos=t}getPosition(t){return void 0===t&&(t=this._time),this.func(t,this.begin,this._change,this.duration)}play(){this.state=2,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=3,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(t){this.pause(),this._time=t,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var t=this.getTimer()-this._startTime;2===this.state?this.setTime(t):3===this.state&&this.setTime(this.duration-t)}pause(){this.state=1,this.fire("onPause")}getTimer(){return new Date().getTime()}}class tJ{constructor(t){var e,n,r=this,i=t.node,a=i._id,s=t.easing||tZ.Linear,o=!!t.yoyo;e=void 0===t.duration?.3:0===t.duration?.001:t.duration,this.node=i,this._id=tV++;var l=i.getLayer()||(i instanceof h.Stage?i.getLayers():null);for(n in l||b.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new tq(function(){r.tween.onEnterFrame()},l),this.tween=new t$(n,function(t){r._tweenFunc(t)},s,0,1,1e3*e,o),this._addListeners(),tJ.attrs[a]||(tJ.attrs[a]={}),tJ.attrs[a][this._id]||(tJ.attrs[a][this._id]={}),tJ.tweens[a]||(tJ.tweens[a]={}),t)void 0===tQ[n]&&this._addAttr(n,t[n]);this.reset(),this.onFinish=t.onFinish,this.onReset=t.onReset,this.onUpdate=t.onUpdate}_addAttr(t,e){var n,r,i,a,s,o,l,h,u=this.node,c=u._id;if((i=tJ.tweens[c][t])&&delete tJ.attrs[c][i][t],n=u.getAttr(t),b._isArray(e)){if(r=[],s=Math.max(e.length,n.length),"points"===t&&e.length!==n.length&&(e.length>n.length?(l=n,n=b._prepareArrayForTween(n,e,u.closed())):(o=e,e=b._prepareArrayForTween(e,n,u.closed()))),0===t.indexOf("fill"))for(a=0;a<s;a++)if(a%2==0)r.push(e[a]-n[a]);else{var d=b.colorToRGBA(n[a]);h=b.colorToRGBA(e[a]),n[a]=d,r.push({r:h.r-d.r,g:h.g-d.g,b:h.b-d.b,a:h.a-d.a})}else for(a=0;a<s;a++)r.push(e[a]-n[a])}else -1!==tK.indexOf(t)?(n=b.colorToRGBA(n),r={r:(h=b.colorToRGBA(e)).r-n.r,g:h.g-n.g,b:h.b-n.b,a:h.a-n.a}):r=e-n;tJ.attrs[c][this._id][t]={start:n,diff:r,end:e,trueEnd:o,trueStart:l},tJ.tweens[c][t]=this._id}_tweenFunc(t){var e,n,r,i,a,s,o,l,h=this.node,u=tJ.attrs[h._id][this._id];for(e in u){if(r=(n=u[e]).start,i=n.diff,l=n.end,b._isArray(r)){if(a=[],o=Math.max(r.length,l.length),0===e.indexOf("fill"))for(s=0;s<o;s++)s%2==0?a.push((r[s]||0)+i[s]*t):a.push("rgba("+Math.round(r[s].r+i[s].r*t)+","+Math.round(r[s].g+i[s].g*t)+","+Math.round(r[s].b+i[s].b*t)+","+(r[s].a+i[s].a*t)+")");else for(s=0;s<o;s++)a.push((r[s]||0)+i[s]*t)}else a=-1!==tK.indexOf(e)?"rgba("+Math.round(r.r+i.r*t)+","+Math.round(r.g+i.g*t)+","+Math.round(r.b+i.b*t)+","+(r.a+i.a*t)+")":r+i*t;h.setAttr(e,a)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var t=this.node,e=tJ.attrs[t._id][this._id];e.points&&e.points.trueEnd&&t.setAttr("points",e.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var t=this.node,e=tJ.attrs[t._id][this._id];e.points&&e.points.trueStart&&t.points(e.points.trueStart),this.onReset&&this.onReset()}
1,this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(t){return this.tween.seek(1e3*t),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var t,e=this.node._id,n=this._id,r=tJ.tweens[e];for(t in this.pause(),r)delete tJ.tweens[e][t];delete tJ.attrs[e][n]}}tJ.attrs={},tJ.tweens={},J.prototype.to=function(t){var e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new tJ(t).play()};let tZ={BackEaseIn:(t,e,n,r)=>n*(t/=r)*t*(2.70158*t-1.70158)+e,BackEaseOut:(t,e,n,r)=>n*((t=t/r-1)*t*(2.70158*t+1.70158)+1)+e,BackEaseInOut(t,e,n,r){var i=1.70158;return(t/=r/2)<1?n/2*(t*t*(((i*=1.525)+1)*t-i))+e:n/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,n,r,i,a){var s=0;return 0===t?e:1==(t/=r)?e+n:(a||(a=.3*r),!i||i<Math.abs(n)?(i=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(t-=1))*Math.sin(2*Math.PI*(t*r-s)/a))+e)},ElasticEaseOut(t,e,n,r,i,a){var s=0;return 0===t?e:1==(t/=r)?e+n:(a||(a=.3*r),!i||i<Math.abs(n)?(i=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin(2*Math.PI*(t*r-s)/a)+n+e)},ElasticEaseInOut(t,e,n,r,i,a){var s=0;return 0===t?e:2==(t/=r/2)?e+n:(a||(a=.3*1.5*r),!i||i<Math.abs(n)?(i=n,s=a/4):s=a/(2*Math.PI)*Math.asin(n/i),t<1)?-(i*Math.pow(2,10*(t-=1))*Math.sin(2*Math.PI*(t*r-s)/a)*.5)+e:i*Math.pow(2,-10*(t-=1))*Math.sin(2*Math.PI*(t*r-s)/a)*.5+n+e},BounceEaseOut:(t,e,n,r)=>(t/=r)<1/2.75?7.5625*t*t*n+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:(t,e,n,r)=>n-tZ.BounceEaseOut(r-t,0,n,r)+e,BounceEaseInOut:(t,e,n,r)=>t<r/2?.5*tZ.BounceEaseIn(2*t,0,n,r)+e:.5*tZ.BounceEaseOut(2*t-r,0,n,r)+.5*n+e,EaseIn:(t,e,n,r)=>n*(t/=r)*t+e,EaseOut:(t,e,n,r)=>-n*(t/=r)*(t-2)+e,EaseInOut:(t,e,n,r)=>(t/=r/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e,StrongEaseIn:(t,e,n,r)=>n*(t/=r)*t*t*t*t+e,StrongEaseOut:(t,e,n,r)=>n*((t=t/r-1)*t*t*t*t+1)+e,StrongEaseInOut:(t,e,n,r)=>(t/=r/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e,Linear:(t,e,n,r)=>n*t/r+e},t0=b._assign(h,{Util:b,Transform:c,Node:J,Container:tt,Stage:tL,stages:tR,Layer:tU,FastLayer:tj,Group:tY,DD:N,Shape:tB,shapes:tF,Animation:tq,Tween:tJ,Easings:tZ,Context:M,Canvas:I});class t1 extends tB{_sceneFunc(t){var e=h.getAngle(this.angle()),n=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,e,n),t.arc(0,0,this.innerRadius(),e,0,!n),t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){let t=this.innerRadius(),e=this.outerRadius(),n=this.clockwise(),r=h.getAngle(n?360-this.angle():this.angle()),i=Math.cos(Math.min(r,Math.PI)),a=Math.sin(Math.min(Math.max(Math.PI,r),3*Math.PI/2)),s=Math.sin(Math.min(r,Math.PI/2)),o=i*(i>0?t:e),l=a*(a>0?t:e),u=s*(s>0?e:t);return{x:o,y:n?-1*u:l,width:1*e-o,height:u-l}}}function t2(t,e,n,r,i,a,s){var o=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(a-r,2)),h=s*o/(o+l),u=s*l/(o+l);return[n-h*(i-t),r-h*(a-e),n+u*(i-t),r+u*(a-e)]}function t5(t,e){var n,r,i=t.length,a=[];for(n=2;n<i-2;n+=2)isNaN((r=t2(t[n-2],t[n-1],t[n],t[n+1],t[n+2],t[n+3],e))[0])||(a.push(r[0]),a.push(r[1]),a.push(t[n]),a.push(t[n+1]),a.push(r[2]),a.push(r[3]));return a}t1.prototype._centroid=!0,t1.prototype.className="Arc",t1.prototype._attrsAffectingSize=["innerRadius","outerRadius"],u(t1),T.addGetterSetter(t1,"innerRadius",0,S()),T.addGetterSetter(t1,"outerRadius",0,S()),T.addGetterSetter(t1,"angle",0,S()),T.addGetterSetter(t1,"clockwise",!1,E());class t3 extends tB{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var e,n,r,i=this.points(),a=i.length,s=this.tension(),o=this.closed(),l=this.bezier();if(a){if(t.beginPath(),t.moveTo(i[0],i[1]),0!==s&&a>4){for(n=(e=this.getTensionPoints()).length,r=o?0:4,o||t.quadraticCurveTo(e[0],e[1],e[2],e[3]);r<n-2;)t.bezierCurveTo(e[r++],e[r++],e[r++],e[r++],e[r++],e[r++]);o||t.quadraticCurveTo(e[n-2],e[n-1],i[a-2],i[a-1])}else if(l)for(r=2;r<a;)t.bezierCurveTo(i[r++],i[r++],i[r++],i[r++],i[r++],i[r++]);else for(r=2;r<a;r+=2)t.lineTo(i[r],i[r+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():t5(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),e=t.length,n=this.tension(),r=t2(t[e-2],t[e-1],t[0],t[1],t[2],t[3],n),i=t2(t[e-4],t[e-3],t[e-2],t[e-1],t[0],t[1],n),a=t5(t,n);
1return[r[2],r[3]].concat(a).concat([i[0],i[1],t[e-2],t[e-1],i[2],i[3],r[0],r[1],t[0],t[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t,e,n=this.points();if(n.length<4)return{x:n[0]||0,y:n[1]||0,width:0,height:0};for(var r=(n=0!==this.tension()?[n[0],n[1],...this._getTensionPoints(),n[n.length-2],n[n.length-1]]:this.points())[0],i=n[0],a=n[1],s=n[1],o=0;o<n.length/2;o++)t=n[2*o],e=n[2*o+1],r=Math.min(r,t),i=Math.max(i,t),a=Math.min(a,e),s=Math.max(s,e);return{x:r,y:a,width:i-r,height:s-a}}}t3.prototype.className="Line",t3.prototype._attrsAffectingSize=["points","bezier","tension"],u(t3),T.addGetterSetter(t3,"closed",!1),T.addGetterSetter(t3,"bezier",!1),T.addGetterSetter(t3,"tension",0,S()),T.addGetterSetter(t3,"points",[],function(){if(h.isUnminified)return function(t,e){let n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(b._isArray(t)?t.forEach(function(t){b._isNumber(t)||b.warn('"'+e+'" attribute has non numeric element '+t+". Make sure that all elements are numbers.")}
1):b.warn(_(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}());class t4 extends tB{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this.dataArray=t4.parsePathData(this.data()),this.pathLength=0;for(var e=0;e<this.dataArray.length;++e)this.pathLength+=this.dataArray[e].pathLength;this.on("dataChange.konva",function(){this.dataArray=t4.parsePathData(this.data()),this.pathLength=0;for(var t=0;t<this.dataArray.length;++t)this.pathLength+=this.dataArray[t].pathLength})}_sceneFunc(t){var e=this.dataArray;t.beginPath();for(var n=!1,r=0;r<e.length;r++){var i=e[r].command,a=e[r].points;switch(i){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var s=a[0],o=a[1],l=a[2],h=a[3],u=a[4],c=a[5],d=a[6],f=a[7],g=l>h?l:h,p=l>h?1:l/h,m=l>h?h/l:1;t.translate(s,o),t.rotate(d),t.scale(p,m),t.arc(0,0,g,u,u+c,1-f),t.scale(1/p,1/m),t.rotate(-d),t.translate(-s,-o);break;case"z":n=!0,t.closePath()}}n||this.hasFill()?t.fillStrokeShape(this):t.strokeShape(this)}getSelfRect(){var t,e,n=[];this.dataArray.forEach(function(t){if("A"===t.command){var e=t.points[4],r=t.points[5],i=t.points[4]+r,a=Math.PI/180;if(Math.abs(e-i)<a&&(a=Math.abs(e-i)),r<0)for(let r=e-a;r>i;r-=a){let e=t4.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);n.push(e.x,e.y)}else for(let r=e+a;r<i;r+=a){let e=t4.getPointOnEllipticalArc(t.points[0],t.points[1],t.points[2],t.points[3],r,0);n.push(e.x,e.y)}}else if("C"===t.command)for(let e=0;e<=1;e+=.01){let r=t4.getPointOnCubicBezier(e,t.start.x,t.start.y,t.points[0],t.points[1],t.points[2],t.points[3],t.points[4],t.points[5]);n.push(r.x,r.y)}else n=n.concat(t.points)});for(var r=n[0],i=n[0],a=n[1],s=n[1],o=0;o<n.length/2;o++)t=n[2*o],e=n[2*o+1],isNaN(t)||(r=Math.min(r,t),i=Math.max(i,t)),isNaN(e)||(a=Math.min(a,e),s=Math.max(s,e));return{x:r,y:a,width:i-r,height:s-a}}getLength(){return this.pathLength}getPointAtLength(t){var e,n=0,r=this.dataArray.length;if(!r)return null;for(;n<r&&t>this.dataArray[n].pathLength;)t-=this.dataArray[n].pathLength,++n;if(n===r)return{x:(e=this.dataArray[n-1].points.slice(-2))[0],y:e[1]};if(t<.01)return{x:(e=this.dataArray[n].points.slice(0,2))[0],y:e[1]};var i=this.dataArray[n],a=i.points;switch(i.command){case"L":return t4.getPointOnLine(t,i.start.x,i.start.y,a[0],a[1]);case"C":return t4.getPointOnCubicBezier(t/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3],a[4],a[5]);case"Q":return t4.getPointOnQuadraticBezier(t/i.pathLength,i.start.x,i.start.y,a[0],a[1],a[2],a[3]);case"A":var s=a[0],o=a[1],l=a[2],h=a[3],u=a[4],c=a[5],d=a[6];return u+=c*t/i.pathLength,t4.getPointOnEllipticalArc(s,o,l,h,u,d)}return null}static getLineLength(t,e,n,r){return Math.sqrt((n-t)*(n-t)+(r-e)*(r-e))}static getPointOnLine(t,e,n,r,i,a,s){void 0===a&&(a=e),void 0===s&&(s=n);var o=(i-n)/(r-e+1e-8),l=Math.sqrt(t*t/(1+o*o));r<e&&(l*=-1);var h=o*l;if(r===e)u={x:a,y:s+h};else if((s-n)/(a-e+1e-8)===o)u={x:a+l,y:s+h};else{var u,c,d,f=this.getLineLength(e,n,r,i),g=(a-e)*(r-e)+(s-n)*(i-n);g/=f*f,c=e+g*(r-e),d=n+g*(i-n);var p=this.getLineLength(a,s,c,d),m=Math.sqrt(t*t-p*p);l=Math.sqrt(m*m/(1+o*o)),r<e&&(l*=-1),h=o*l,u={x:c+l,y:d+h}}return u}static getPointOnCubicBezier(t,e,n,r,i,a,s,o,l){function h(t){return 3*t*(1-t)*(1-t)}return{x:t*t*t*o+3*t*t*(1-t)*a+r*h(t)+(1-t)*(1-t)*(1-t)*e,y:t*t*t*l+3*t*t*(1-t)*s+i*h(t)+(1-t)*(1-t)*(1-t)*n}}static getPointOnQuadraticBezier(t,e,n,r,i,a,s){return{x:t*t*a+2*t*(1-t)*r+(1-t)*(1-t)*e,y:t*t*s+2*t*(1-t)*i+(1-t)*(1-t)*n}}static getPointOnEllipticalArc(t,e,n,r,i,a){var s=Math.cos(a),o=Math.sin(a),l={x:n*Math.cos(i),y:r*Math.sin(i)};return{x:t+(l.x*s-l.y*o),y:e+(l.x*o+l.y*s)}}static parsePathData(t){if(!t)return[];var e=t,n=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];e=e.replace(RegExp(" ","g"),",");for(var r=0;r<n.length;r++)e=e.replace(RegExp(n[r],"g"),"|"+n[r]);var i=e.split("|"),a=[],s=[],o=0,l=0,h=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;for(r=1;r<i.length;r++){var u=i[r],c=u.charAt(0);for(u=u.slice(1),s.length=0;m=h.exec(u);)s.push(m[0]);for(var d=[],f=0,g=s.length;f<g;
1f++){if("00"===s[f]){d.push(0,0);continue}var p=parseFloat(s[f]);isNaN(p)?d.push(0):d.push(p)}for(;d.length>0&&!isNaN(d[0]);){var m,v,y,b,_,x,S,w,C,k,P,E=null,T=[],A=o,M=l;switch(c){case"l":o+=d.shift(),l+=d.shift(),E="L",T.push(o,l);break;case"L":o=d.shift(),l=d.shift(),T.push(o,l);break;case"m":var R=d.shift(),L=d.shift();if(o+=R,l+=L,E="M",a.length>2&&"z"===a[a.length-1].command){for(var I=a.length-2;I>=0;I--)if("M"===a[I].command){o=a[I].points[0]+R,l=a[I].points[1]+L;break}}T.push(o,l),c="l";break;case"M":o=d.shift(),l=d.shift(),E="M",T.push(o,l),c="L";break;case"h":o+=d.shift(),E="L",T.push(o,l);break;case"H":o=d.shift(),E="L",T.push(o,l);break;case"v":l+=d.shift(),E="L",T.push(o,l);break;case"V":l=d.shift(),E="L",T.push(o,l);break;case"C":T.push(d.shift(),d.shift(),d.shift(),d.shift()),o=d.shift(),l=d.shift(),T.push(o,l);break;case"c":T.push(o+d.shift(),l+d.shift(),o+d.shift(),l+d.shift()),o+=d.shift(),l+=d.shift(),E="C",T.push(o,l);break;case"S":y=o,b=l,"C"===(v=a[a.length-1]).command&&(y=o+(o-v.points[2]),b=l+(l-v.points[3])),T.push(y,b,d.shift(),d.shift()),o=d.shift(),l=d.shift(),E="C",T.push(o,l);break;case"s":y=o,b=l,"C"===(v=a[a.length-1]).command&&(y=o+(o-v.points[2]),b=l+(l-v.points[3])),T.push(y,b,o+d.shift(),l+d.shift()),o+=d.shift(),l+=d.shift(),E="C",T.push(o,l);break;case"Q":T.push(d.shift(),d.shift()),o=d.shift(),l=d.shift(),T.push(o,l);break;case"q":T.push(o+d.shift(),l+d.shift()),o+=d.shift(),l+=d.shift(),E="Q",T.push(o,l);break;case"T":y=o,b=l,"Q"===(v=a[a.length-1]).command&&(y=o+(o-v.points[0]),b=l+(l-v.points[1])),o=d.shift(),l=d.shift(),E="Q",T.push(y,b,o,l);break;case"t":y=o,b=l,"Q"===(v=a[a.length-1]).command&&(y=o+(o-v.points[0]),b=l+(l-v.points[1])),o+=d.shift(),l+=d.shift(),E="Q",T.push(y,b,o,l);break;case"A":_=d.shift(),x=d.shift(),S=d.shift(),w=d.shift(),C=d.shift(),k=o,P=l,o=d.shift(),l=d.shift(),E="A",T=this.convertEndpointToCenterParameterization(k,P,o,l,w,C,_,x,S);break;case"a":_=d.shift(),x=d.shift(),S=d.shift(),w=d.shift(),C=d.shift(),k=o,P=l,o+=d.shift(),l+=d.shift(),E="A",T=this.convertEndpointToCenterParameterization(k,P,o,l,w,C,_,x,S)}a.push({command:E||c,points:T,start:{x:A,y:M},pathLength:this.calcLength(A,M,E||c,T)})}("z"===c||"Z"===c)&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,e,n,r){var i,a,s,o;switch(n){case"L":return t4.getLineLength(t,e,r[0],r[1]);case"C":for(o=.01,i=0,a=t4.getPointOnCubicBezier(0,t,e,r[0],r[1],r[2],r[3],r[4],r[5]);o<=1;o+=.01)s=t4.getPointOnCubicBezier(o,t,e,r[0],r[1],r[2],r[3],r[4],r[5]),i+=t4.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"Q":for(o=.01,i=0,a=t4.getPointOnQuadraticBezier(0,t,e,r[0],r[1],r[2],r[3]);o<=1;o+=.01)s=t4.getPointOnQuadraticBezier(o,t,e,r[0],r[1],r[2],r[3]),i+=t4.getLineLength(a.x,a.y,s.x,s.y),a=s;return i;case"A":i=0;var l=r[4],h=r[5],u=r[4]+h,c=Math.PI/180;if(Math.abs(l-u)<c&&(c=Math.abs(l-u)),a=t4.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],l,0),h<0)for(o=l-c;o>u;o-=c)s=t4.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),i+=t4.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(o=l+c;o<u;o+=c)s=t4.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],o,0),i+=t4.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=t4.getPointOnEllipticalArc(r[0],r[1],r[2],r[3],u,0),i+=t4.getLineLength(a.x,a.y,s.x,s.y)}return 0}static convertEndpointToCenterParameterization(t,e,n,r,i,a,s,o,l){var h=Math.PI/180*l,u=Math.cos(h)*(t-n)/2+Math.sin(h)*(e-r)/2,c=-1*Math.sin(h)*(t-n)/2+Math.cos(h)*(e-r)/2,d=u*u/(s*s)+c*c/(o*o);d>1&&(s*=Math.sqrt(d),o*=Math.sqrt(d));var f=Math.sqrt((s*s*(o*o)-s*s*(c*c)-o*o*(u*u))/(s*s*(c*c)+o*o*(u*u)));i===a&&(f*=-1),isNaN(f)&&(f=0);var g=f*s*c/o,p=-(f*o)*u/s,m=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},v=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(m(t)*m(e))},y=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(v(t,e))},b=y([1,0],[(u-g)/s,(c-p)/o]),_=[(u-g)/s,(c-p)/o],x=[(-1*u-g)/s,(-1*c-p)/o],S=y(_,x);return -1>=v(_,x)&&(S=Math.PI),v(_,x)>=1&&(S=0),0===a&&S>0&&(S-=2*Math.PI),1===a&&S<0&&(S+=2*Math.PI),[(t+n)/2+Math.cos(h)*g-Math.sin(h)*p,(e+r)/2+Math.sin(h)*g+Math.cos(h)*p,s,o,b,S,h,a]}}t4.prototype.className="Path",t4.prototype._attrsAffectingSize=["data"],u(t4),T.addGetterSetter(t4,"data");class t6 extends t3{_sceneFunc(t){super._sceneFunc(t);var e,n,r=2*Math.PI,i=this.points(),a=i,s=0!==this.tension()&&i.length>4;s&&(a=this.getTensionPoints());var o=this.pointerLength(),l=i.length;if(s){let t=[a[a.length-4],a[a.length-3],a[a.length-2],a[a.length-1],i[l-2],i[l-1]],r=t4.calcLength(a[a.length-4],a[a.length-3],"C",t),s=t4.getPointOnQuadraticBezier(Math.min(1,1-o/r),t[0],t[1],t[2],t[3],t[4],t[5]);e=i[l-2]-s.x,n=i[l-1]-s.y}else e=i[l-2]-i[l-4],n=i[l-1]-i[l-3];var h=(Math.atan2(n,e)+r)%r,u=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(i[l-2],i[l-1]),t.rotate(h),t.moveTo(0,0),t.lineTo(-o,u/2),t.lineTo(-o,-u/2),t.closePath(),t.restore(
1),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(i[0],i[1]),s?(e=(a[0]+a[2])/2-i[0],n=(a[1]+a[3])/2-i[1]):(e=i[2]-i[0],n=i[3]-i[1]),t.rotate((Math.atan2(-n,-e)+r)%r),t.moveTo(0,0),t.lineTo(-o,u/2),t.lineTo(-o,-u/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var e=this.dashEnabled();e&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),e&&(this.attrs.dashEnabled=!0)}getSelfRect(){let t=super.getSelfRect(),e=this.pointerWidth()/2;return{x:t.x-e,y:t.y-e,width:t.width+2*e,height:t.height+2*e}}}t6.prototype.className="Arrow",u(t6),T.addGetterSetter(t6,"pointerLength",10,S()),T.addGetterSetter(t6,"pointerWidth",10,S()),T.addGetterSetter(t6,"pointerAtBeginning",!1),T.addGetterSetter(t6,"pointerAtEnding",!0);class t8 extends tB{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,2*Math.PI,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}}t8.prototype._centroid=!0,t8.prototype.className="Circle",t8.prototype._attrsAffectingSize=["radius"],u(t8),T.addGetterSetter(t8,"radius",0,S());class t9 extends tB{_sceneFunc(t){var e=this.radiusX(),n=this.radiusY();t.beginPath(),t.save(),e!==n&&t.scale(1,n/e),t.arc(0,0,e,0,2*Math.PI,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.radiusX()}getHeight(){return 2*this.radiusY()}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}t9.prototype.className="Ellipse",t9.prototype._centroid=!0,t9.prototype._attrsAffectingSize=["radiusX","radiusY"],u(t9),T.addComponentsGetterSetter(t9,"radius",["x","y"]),T.addGetterSetter(t9,"radiusX",0,S()),T.addGetterSetter(t9,"radiusY",0,S());class t7 extends tB{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){let t=this.image();t&&t.complete||t&&4===t.readyState||!t||!t.addEventListener||t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){let e;let n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),a=this.attrs.image;if(a){let t=this.attrs.cropWidth,i=this.attrs.cropHeight;e=t&&i?[a,this.cropX(),this.cropY(),t,i,0,0,n,r]:[a,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?b.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),a&&(i&&t.clip(),t.drawImage.apply(t,e))}_hitFunc(t){var e=this.width(),n=this.height(),r=this.cornerRadius();t.beginPath(),r?b.drawRoundedRectPath(t,e,n,r):t.rect(0,0,e,n),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,e;return null!==(t=this.attrs.width)&&void 0!==t?t:null===(e=this.image())||void 0===e?void 0:e.width}getHeight(){var t,e;return null!==(t=this.attrs.height)&&void 0!==t?t:null===(e=this.image())||void 0===e?void 0:e.height}static fromURL(t,e,n=null){var r=b.createImageElement();r.onload=function(){e(new t7({image:r}))},r.onerror=n,r.crossOrigin="Anonymous",r.src=t}}t7.prototype.className="Image",u(t7),T.addGetterSetter(t7,"cornerRadius",0,w(4)),T.addGetterSetter(t7,"image"),T.addComponentsGetterSetter(t7,"crop",["x","y","width","height"]),T.addGetterSetter(t7,"cropX",0,S()),T.addGetterSetter(t7,"cropY",0,S()),T.addGetterSetter(t7,"cropWidth",0,S()),T.addGetterSetter(t7,"cropHeight",0,S());var et=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],ee="right",en="down",er="left",ei=et.length;class ea extends tY{constructor(t){super(t),this.on("add.konva",function(t){this._addListeners(t.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(t){var e,n=this,r=function(){n._sync()};for(e=0;e<ei;e++)t.on(et[e]+"Change.konva",r)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t,e,n,r,i,a,s,o=this.getText(),l=this.getTag();if(o&&l){switch(t=o.width(),e=o.height(),n=l.pointerDirection(),r=l.pointerWidth(),s=l.pointerHeight(),i=0,a=0,n){case"up":i=t/2,a=-1*s;break;case ee:i=t+r,a=e/2;break;case en:i=t/2,a=e+s;break;case er:i=-1*r,a=e/2}l.setAttrs({x:-1*i,y:-1*a,width:t,height:e}),o.setAttrs({x:-1*i,y:-1*a})}}}ea.prototype.className="Label",u(ea);class es extends tB{_sceneFunc(t){var e=this.width(),n=this.height(),r=this.pointerDirection(),i=this.pointerWidth(),a=this.pointerHeight(),s=this.cornerRadius();let o=0,l=0,h=0,u=0;"number"==typeof s?o=l=h=u=Math.min(s,e/2,n/2):(o=Math.min(s[0]||0,e/2,n/2),l=Math.min(s[1]||0,e/2,n/2),u=Math.min(s[2]||0,e/2,n/2),h=Math.min(s[3]||0,e/2,n/2)),t.beginPath(),t.moveTo(o,0),"up"===r&&(t.lineTo((e-i)/2,0),t.lineTo(e/2,-1*a),t.lineTo((e+i)/2,0)
1),t.lineTo(e-l,0),t.arc(e-l,l,l,3*Math.PI/2,0,!1),r===ee&&(t.lineTo(e,(n-a)/2),t.lineTo(e+i,n/2),t.lineTo(e,(n+a)/2)),t.lineTo(e,n-u),t.arc(e-u,n-u,u,0,Math.PI/2,!1),r===en&&(t.lineTo((e+i)/2,n),t.lineTo(e/2,n+a),t.lineTo((e-i)/2,n)),t.lineTo(h,n),t.arc(h,n-h,h,Math.PI/2,Math.PI,!1),r===er&&(t.lineTo(0,(n+a)/2),t.lineTo(-1*i,n/2),t.lineTo(0,(n-a)/2)),t.lineTo(0,o),t.arc(o,o,o,Math.PI,3*Math.PI/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,e=0,n=this.pointerWidth(),r=this.pointerHeight(),i=this.pointerDirection(),a=this.width(),s=this.height();return"up"===i?(e-=r,s+=r):i===en?s+=r:i===er?(t-=1.5*n,a+=n):i===ee&&(a+=1.5*n),{x:t,y:e,width:a,height:s}}}es.prototype.className="Tag",u(es),T.addGetterSetter(es,"pointerDirection","none"),T.addGetterSetter(es,"pointerWidth",0,S()),T.addGetterSetter(es,"pointerHeight",0,S()),T.addGetterSetter(es,"cornerRadius",0,w(4));class eo extends tB{_sceneFunc(t){var e=this.cornerRadius(),n=this.width(),r=this.height();t.beginPath(),e?b.drawRoundedRectPath(t,n,r,e):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}}eo.prototype.className="Rect",u(eo),T.addGetterSetter(eo,"cornerRadius",0,w(4));class el extends tB{_sceneFunc(t){let e=this._getPoints();t.beginPath(),t.moveTo(e[0].x,e[0].y);for(var n=1;n<e.length;n++)t.lineTo(e[n].x,e[n].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){let t=this.attrs.sides,e=this.attrs.radius||0,n=[];for(var r=0;r<t;r++)n.push({x:e*Math.sin(2*r*Math.PI/t),y:-1*e*Math.cos(2*r*Math.PI/t)});return n}getSelfRect(){let t=this._getPoints();var e=t[0].x,n=t[0].y,r=t[0].x,i=t[0].y;return t.forEach(t=>{e=Math.min(e,t.x),n=Math.max(n,t.x),r=Math.min(r,t.y),i=Math.max(i,t.y)}),{x:e,y:r,width:n-e,height:i-r}}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}el.prototype.className="RegularPolygon",el.prototype._centroid=!0,el.prototype._attrsAffectingSize=["radius"],u(el),T.addGetterSetter(el,"radius",0,S()),T.addGetterSetter(el,"sides",0,S());var eh=2*Math.PI;class eu extends tB{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,eh,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),eh,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}eu.prototype.className="Ring",eu.prototype._centroid=!0,eu.prototype._attrsAffectingSize=["innerRadius","outerRadius"],u(eu),T.addGetterSetter(eu,"innerRadius",0,S()),T.addGetterSetter(eu,"outerRadius",0,S());class ec extends tB{constructor(t){super(t),this._updated=!0,this.anim=new tq(()=>{var t=this._updated;return this._updated=!1,t}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(t){var e=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[e],a=this.frameOffsets(),s=i[r+0],o=i[r+1],l=i[r+2],h=i[r+3],u=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,l,h),t.closePath(),t.fillStrokeShape(this)),u){if(a){var c=a[e],d=2*n;t.drawImage(u,s,o,l,h,c[d+0],c[d+1],l,h)}else t.drawImage(u,s,o,l,h,0,0,l,h)}}_hitFunc(t){var e=this.animation(),n=this.frameIndex(),r=4*n,i=this.animations()[e],a=this.frameOffsets(),s=i[r+2],o=i[r+3];if(t.beginPath(),a){var l=a[e],h=2*n;t.rect(l[h+0],l[h+1],s,o)}else t.rect(0,0,s,o);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),e=this.animation();t<this.animations()[e].length/4-1?this.frameIndex(t+1):this.frameIndex(0)}}
1ec.prototype.className="Sprite",u(ec),T.addGetterSetter(ec,"animation"),T.addGetterSetter(ec,"animations"),T.addGetterSetter(ec,"frameOffsets"),T.addGetterSetter(ec,"image"),T.addGetterSetter(ec,"frameIndex",0,S()),T.addGetterSetter(ec,"frameRate",17,S()),T.backCompat(ec,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class ed extends tB{_sceneFunc(t){var e=this.innerRadius(),n=this.outerRadius(),r=this.numPoints();t.beginPath(),t.moveTo(0,0-n);for(var i=1;i<2*r;i++){var a=i%2==0?n:e,s=a*Math.sin(i*Math.PI/r),o=-1*a*Math.cos(i*Math.PI/r);t.lineTo(s,o)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.outerRadius()}getHeight(){return 2*this.outerRadius()}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}function ef(t){return Array.from(t)}ed.prototype.className="Star",ed.prototype._centroid=!0,ed.prototype._attrsAffectingSize=["innerRadius","outerRadius"],u(ed),T.addGetterSetter(ed,"numPoints",5,S()),T.addGetterSetter(ed,"innerRadius",0,S()),T.addGetterSetter(ed,"outerRadius",0,S());var eg="auto",ep="justify",em="left",ev="middle",ey="normal",eb="none",e_=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],ex=e_.length;function eS(){return a||(a=b.createCanvasElement().getContext("2d"))}class ew extends tB{constructor(t){var e;super(((e=(e=t)||{}).fillLinearGradientColorStops||e.fillRadialGradientColorStops||e.fillPatternImage||(e.fill=e.fill||"black"),e)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<ex;n++)this.on(e_[n]+"Change.konva",this._setTextData);this._setTextData()}_sceneFunc(t){var e=this.textArr,n=e.length;if(this.text()){var r,i=this.padding(),a=this.fontSize(),s=this.lineHeight()*a,o=this.verticalAlign(),l=0,h=this.align(),u=this.getWidth(),c=this.letterSpacing(),d=this.fill(),f=this.textDecoration(),g=-1!==f.indexOf("underline"),p=-1!==f.indexOf("line-through"),m=s/2,v=0,y=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",ev),t.setAttr("textAlign",em),o===ev?l=(this.getHeight()-n*s-2*i)/2:"bottom"===o&&(l=this.getHeight()-n*s-2*i),t.translate(i,l+i),r=0;r<n;r++){var b,_,x,v=0,y=0,S=e[r],w=S.text,C=S.width,k=S.lastInParagraph;if(t.save(),"right"===h?v+=u-C-2*i:"center"===h&&(v+=(u-C-2*i)/2),g){t.save(),t.beginPath(),t.moveTo(v,m+y+Math.round(a/2)),_=0==(b=w.split(" ").length-1),x=h!==ep||k?C:u-2*i,t.lineTo(v+Math.round(x),m+y+Math.round(a/2)),t.lineWidth=a/15;let e=this._getLinearGradient();t.strokeStyle=e||d,t.stroke(),t.restore()}if(p){t.save(),t.beginPath(),t.moveTo(v,m+y),_=0==(b=w.split(" ").length-1),x=h===ep&&k&&!_?u-2*i:C,t.lineTo(v+Math.round(x),m+y),t.lineWidth=a/15;let e=this._getLinearGradient();t.strokeStyle=e||d,t.stroke(),t.restore()}if(0!==c||h===ep){b=w.split(" ").length-1;for(var P=ef(w),E=0;E<P.length;E++){var T=P[E];" "!==T||k||h!==ep||(v+=(u-2*i-C)/b),this._partialTextX=v,this._partialTextY=m+y,this._partialText=T,t.fillStrokeShape(this),v+=this.measureSize(T).width+c}}else this._partialTextX=v,this._partialTextY=m+y,this._partialText=w,t.fillStrokeShape(this);t.restore(),n>1&&(m+=s)}}}_hitFunc(t){var e=this.getWidth(),n=this.getHeight();t.beginPath(),t.rect(0,0,e,n),t.closePath(),t.fillStrokeShape(this)}setText(t){var e=b._isString(t)?t:null==t?"":t+"";return this._setAttr("text",e),this}getWidth(){return this.attrs.width===eg||void 0===this.attrs.width?this.getTextWidth()+2*this.padding():this.attrs.width}getHeight(){return this.attrs.height===eg||void 0===this.attrs.height?this.fontSize()*this.textArr.length*this.lineHeight()+2*this.padding():this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return b.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var e,n=eS(),r=this.fontSize();return n.save(),n.font=this._getContextFont(),e=n.measureText(t),n.restore(),{width:e.width,height:r}}_getContextFont(){return this.fontStyle()+" "+this.fontVariant()+" "+this.fontSize()+"px "+this.fontFamily().split(",").map(t=>{let e=(t=t.trim()).indexOf(" ")>=0,n=t.indexOf('"')>=0||t.indexOf("'")>=0;return e&&!n&&(t=`"${t}"`),t}).join(", ")}_addTextLine(t){this.align()===ep&&(t=t.trim());var e=this._getTextWidth(t);return this.textArr.push({text:t,width:e,lastInParagraph:!1})}_getTextWidth(t){var e=this.letterSpacing(),n=t.length;return eS().measureText(t).width+(n?e*(n-1):0)}_setTextData(){var t=this.text().split("\n"),e=+this.fontSize(),n=0,r=this.lineHeight()*e,i=this.attrs.width,a=this.attrs.height,s=i!==eg&&void 0!==i,o=a!==eg&&void 0!==a,l=this.padding(),h=i-2*l,u=a-2*l,c=0,d=this.wrap(),f="char"!==d&&d!==eb,g=this.ellipsis();this.textArr=[],eS().font=this._getContextFont();for(var p=g?this._getTextWidth("…"):0,m=0,v=t.length;m<v;++m){var y=t[m],b=this._getTextWidth(y);if(s&&b>h)for(;y.length>0;){for(var _=0,x=y.length,S="",w=0;_<x;){var C=_+x>>>1,k=y.slice(0,C+1),P=this._getTextWidth(k)+p;P<=h?(_=C+1,S=k,w=P):x=C}if(S){if(f){var E,T=y[S.length];(E=(" "===T||"-"===T)&&w<=h?S.length:Math.max(S.lastIndexOf(" "),S.lastIndexOf("-"))+1)>0&&(_=E,S=S.slice(0,_),w=this._getTextWidth(S))}if(S=S.trimRight(),this._addTextLine(S),n=Math.max(n,w),c+=r,this._shouldHandleEllipsis(c)){this._tryToAddEllipsisToLastLine();break}if((y=(y=y.slice(_)).trimLeft()).length>0&&(b=this._getTextWidth(y))<=h){this._addTextLine(y),c+=r,n=Math.max(n,b);break}}else break}else this._addTextLine(y),c+=r,n=Math.max(n,b),this._shouldHandleEllipsis(c)&&m<v-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),o&&c+r>u)break}this.textHeight=e,this.textWidth=n}_shouldHandleEllipsis(t){var e=+this.fontSize(),n=this.lineHeight()*e,r=this.attrs.height,i=this.padding();return!(this.wrap()!==eb)||r!==eg&&void 0!==r&&t+n>r-2*i}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,e=this.padding(),n=this.ellipsis(),r=this.textArr[this.textArr.length-1];r&&n&&(t===eg||void 0===t||this._getTextWidth(r.text+"…")<t-2*e||(r.text=r.text.slice(0,r.text.length-3)),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(r.text
1+"…"))}getStrokeScaleEnabled(){return!0}}ew.prototype._fillFunc=function(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)},ew.prototype._strokeFunc=function(t){t.strokeText(this._partialText,this._partialTextX,this._partialTextY)},ew.prototype.className="Text",ew.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"],u(ew),T.overWriteSetter(ew,"width",C()),T.overWriteSetter(ew,"height",C()),T.addGetterSetter(ew,"fontFamily","Arial"),T.addGetterSetter(ew,"fontSize",12,S()),T.addGetterSetter(ew,"fontStyle",ey),T.addGetterSetter(ew,"fontVariant",ey),T.addGetterSetter(ew,"padding",0,S()),T.addGetterSetter(ew,"align",em),T.addGetterSetter(ew,"verticalAlign","top"),T.addGetterSetter(ew,"lineHeight",1,S()),T.addGetterSetter(ew,"wrap","word"),T.addGetterSetter(ew,"ellipsis",!1,E()),T.addGetterSetter(ew,"letterSpacing",0,S()),T.addGetterSetter(ew,"text","",k()),T.addGetterSetter(ew,"textDecoration","");var eC="normal";function ek(t){t.fillText(this.partialText,0,0)}function eP(t){t.strokeText(this.partialText,0,0)}class eE extends tB{constructor(t){super(t),this.dummyCanvas=b.createCanvasElement(),this.dataArray=[],this.dataArray=t4.parsePathData(this.attrs.data),this.on("dataChange.konva",function(){this.dataArray=t4.parsePathData(this.attrs.data),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncCh
1ange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var e=this.textDecoration(),n=this.fill(),r=this.fontSize(),i=this.glyphInfo;"underline"===e&&t.beginPath();for(var a=0;a<i.length;a++){t.save();var s=i[a].p0;t.translate(s.x,s.y),t.rotate(i[a].rotation),this.partialText=i[a].text,t.fillStrokeShape(this),"underline"===e&&(0===a&&t.moveTo(0,r/2+1),t.lineTo(r,r/2+1)),t.restore()}"underline"===e&&(t.strokeStyle=n,t.lineWidth=r/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var e=this.glyphInfo;if(e.length>=1){var n=e[0].p0;t.moveTo(n.x,n.y)}for(var r=0;r<e.length;r++){var i=e[r].p1;t.lineTo(i.x,i.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return b.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return ew.prototype.setText.call(this,t)}_getContextFont(){return ew.prototype._getContextFont.call(this)}_getTextSize(t){var e=this.dummyCanvas.getContext("2d");e.save(),e.font=this._getContextFont();var n=e.measureText(t);return e.restore(),{width:n.width,height:parseInt(this.attrs.fontSize,10)}}_setTextData(){var t,e,n,r=this,i=this._getTextSize(this.attrs.text),a=this.letterSpacing(),s=this.align(),o=this.kerningFunc();this.textWidth=i.width,this.textHeight=i.height;var l=Math.max(this.textWidth+((this.attrs.text||"").length-1)*a,0);this.glyphInfo=[];for(var h=0,u=0;u<r.dataArray.length;u++)r.dataArray[u].pathLength>0&&(h+=r.dataArray[u].pathLength);var c=0;"center"===s&&(c=Math.max(0,h/2-l/2)),"right"===s&&(c=Math.max(0,h-l));for(var d=ef(this.text()),f=this.text().split(" ").length-1,g=-1,p=0,m=function(){p=0;for(var e=r.dataArray,n=g+1;n<e.length;n++){if(e[n].pathLength>0)return g=n,e[n];"M"===e[n].command&&(t={x:e[n].points[0],y:e[n].points[1]})}return{}},v=function(i){var o=r._getTextSize(i).width+a;" "===i&&"justify"===s&&(o+=(h-l)/f);var u=0,c=0;for(e=void 0;Math.abs(o-u)/o>.01&&c<20;){c++;for(var d=u;void 0===n;)(n=m())&&d+n.pathLength<o&&(d+=n.pathLength,n=void 0);if(0===Object.keys(n).length||void 0===t)return;var g=!1;switch(n.command){case"L":t4.getLineLength(t.x,t.y,n.points[0],n.points[1])>o?e=t4.getPointOnLine(o,t.x,t.y,n.points[0],n.points[1],t.x,t.y):n=void 0;break;case"A":var v=n.points[4],y=n.points[5],b=n.points[4]+y;0===p?p=v+1e-8:o>u?p+=Math.PI/180*y/Math.abs(y):p-=Math.PI/360*y/Math.abs(y),(y<0&&p<b||y>=0&&p>b)&&(p=b,g=!0),e=t4.getPointOnEllipticalArc(n.points[0],n.points[1],n.points[2],n.points[3],p,n.points[6]);break;case"C":0===p?p=o>n.pathLength?1e-8:o/n.pathLength:o>u?p+=(o-u)/n.pathLength/2:p=Math.max(p-(u-o)/n.pathLength/2,0),p>1&&(p=1,g=!0),e=t4.getPointOnCubicBezier(p,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3],n.points[4],n.points[5]);break;case"Q":0===p?p=o/n.pathLength:o>u?p+=(o-u)/n.pathLength:p-=(u-o)/n.pathLength,p>1&&(p=1,g=!0),e=t4.getPointOnQuadraticBezier(p,n.start.x,n.start.y,n.points[0],n.points[1],n.points[2],n.points[3])}void 0!==e&&(u=t4.getLineLength(t.x,t.y,e.x,e.y)),g&&(g=!1,n=void 0)}},y=c/(r._getTextSize("C").width+a)-1,b=0;b<y&&(v("C"),void 0!==t&&void 0!==e);b++)t=e;for(var _=0;_<d.length&&(v(d[_]),void 0!==t&&void 0!==e);_++){var x=t4.getLineLength(t.x,t.y,e.x,e.y),S=0;if(o)try{S=o(d[_-1],d[_])*this.fontSize()}catch(t){S=0}t.x+=S,e.x+=S,this.textWidth+=S;var w=t4.getPointOnLine(S+x/2,t.x,t.y,e.x,e.y),C=Math.atan2(e.y-t.y,e.x-t.x);this.glyphInfo.push({transposeX:w.x,transposeY:w.y,text:d[_],rotation:C,p0:t,p1:e}),t=e}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t,e,n=[];this.glyphInfo.forEach(function(t){n.push(t.p0.x),n.push(t.p0.y),n.push(t.p1.x),n.push(t.p1.y)});for(var r=n[0]||0,i=n[0]||0,a=n[1]||0,s=n[1]||0,o=0;o<n.length/2;o++)t=n[2*o],e=n[2*o+1],r=Math.min(r,t),i=Math.max(i,t),a=Math.min(a,e),s=Math.max(s,e);var l=this.fontSize();return{x:r-l/2,y:a-l/2,width:i-r+l,height:s-a+l}}destroy(){return b.releaseCanvas(this.dummyCanvas),super.destroy()}}eE.prototype._fillFunc=ek,eE.prototype._strokeFunc=eP,eE.prototype._fillFuncHit=ek,eE.prototype._strokeFuncHit=eP,eE.prototype.className="TextPath",eE.prototype._attrsAffectingSize=["text","fontSize","data"],u(eE),T.addGetterSetter(eE,"data"),T.addGetterSetter(eE,"fontFamily","Arial"),T.addGetterSetter(eE,"fontSize",12,S()),T.addGetterSetter(eE,"fontStyle",eC),T.addGetterSetter(eE,"align","left"),T.addGetterSetter(eE,"letterSpacing",0,S()),T.addGetterSetter(eE,"textBaseline","middle"),T.addGetterSetter(eE,"fontVariant",eC),T.addGetterSetter(eE,"text",""),T.addGetterSetter(eE,"textDecoration",null),T.addGetterSetter(eE,"kerningFunc",null);var eT="tr-konva",eA=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange"].map(t=>t+`.${eT}`).join(" "),eM="nodesRect",eR=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],eL={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};let eI="ontouchstart"in h._global;var eD=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];
1function eG(t,e,n){let r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return Object.assign(Object.assign({},t),{rotation:t.rotation+e,x:r,y:i})}class eN extends tY{constructor(t){super(t),this._transforming=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(eA,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return b.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return eT+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();let e=t.filter(t=>!t.isAncestorOf(this)||(b.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1));return this._nodes=t=e,1===t.length&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(t=>{let e=()=>{1===this.nodes().length&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),this._transforming||this.isDragging()||this.update()},n=t._attrsAffectingSize.map(t=>t+"Change."+this._getEventNamespace()).join(" ");t.on(n,e),t.on(eR.map(t=>t+`.${this._getEventNamespace()}`).join(" "),e),t.on(`absoluteTransformChange.${this._getEventNamespace()}`,e),this._proxyDrag(t)}),this._resetTransformCache(),this.findOne(".top-left")&&this.update(),this}_proxyDrag(t){let e;t.on(`dragstart.${this._getEventNamespace()}`,n=>{e=t.getAbsolutePosition(),this.isDragging()||t===this.findOne(".back")||this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!e)return;let r=t.getAbsolutePosition(),i=r.x-e.x,a=r.y-e.y;this.nodes().forEach(e=>{if(e===t||e.isDragging())return;let r=e.getAbsolutePosition();e.setAbsolutePosition({x:r.x+i,y:r.y+a}),e.startDrag(n)}),e=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(eM),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(eM,this.__getNodeRect)}__getNodeShape(t,e=this.rotation(),n){var r=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),i=t.getAbsoluteScale(n),a=t.getAbsolutePosition(n),s=r.x*i.x-t.offsetX()*i.x,o=r.y*i.y-t.offsetY()*i.y;let l=(h.getAngle(t.getAbsoluteRotation())+2*Math.PI)%(2*Math.PI);return eG({x:a.x+s*Math.cos(l)+o*Math.sin(-l),y:a.y+o*Math.cos(l)+s*Math.sin(l),width:r.width*i.x,height:r.height*i.y,rotation:l},-h.getAngle(e),{x:0,y:0})}__getNodeRect(){var t,e,n,r;if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};let i=[];this.nodes().map(t=>{let e=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var n=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],r=t.getAbsoluteTransform();n.forEach(function(t){var e=r.point(t);i.push(e)})});let a=new c;a.rotate(-h.getAngle(this.rotation())),i.forEach(function(i){var s=a.point(i);void 0===t&&(t=n=s.x,e=r=s.y),t=Math.min(t,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),r=Math.max(r,s.y)}),a.invert();let s=a.point({x:t,y:e});return{x:s.x,y:s.y,width:n-t,height:r-e,rotation:h.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),eD.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var e=new eo({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:eI?10:"auto"}),n=this;e.on("mousedown touchstart",function(t){n._handleMouseDown(t)}),e.on("dragstart",t=>
1{e.stopDrag(),t.cancelBubble=!0}),e.on("dragend",t=>{t.cancelBubble=!0}),e.on("mouseenter",()=>{var n=function(t,e){if("rotater"===t)return"crosshair";e+=b.degToRad(eL[t]||0);var n=(b.radToDeg(e)%360+360)%360;if(b._inRange(n,337.5,360)||b._inRange(n,0,22.5))return"ns-resize";if(b._inRange(n,22.5,67.5))return"nesw-resize";if(b._inRange(n,67.5,112.5))return"ew-resize";if(b._inRange(n,112.5,157.5))return"nwse-resize";if(b._inRange(n,157.5,202.5))return"ns-resize";if(b._inRange(n,202.5,247.5))return"nesw-resize";if(b._inRange(n,247.5,292.5))return"ew-resize";else if(b._inRange(n,292.5,337.5))return"nwse-resize";else return b.error("Transformer has unknown angle for cursor detection: "+n),"pointer"}(t,h.getAngle(this.rotation()));e.getStage().content&&(e.getStage().content.style.cursor=n),this._cursorChange=!0}),e.on("mouseout",()=>{e.getStage().content&&(e.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(e)}_createBack(){var t=new tB({name:"back",width:0,height:0,draggable:!0,sceneFunc(t){var e=this.getParent(),n=e.padding();t.beginPath(),t.rect(-n,-n,this.width()+2*n,this.height()+2*n),t.moveTo(this.width()/2,-n),e.rotateEnabled()&&t.lineTo(this.width()/2,-e.rotateAnchorOffset()*b._sign(this.height())-n),t.fillStrokeShape(this)},hitFunc:(t,e)=>{if(this.shouldOverdrawWholeArea()){var n=this.padding();t.beginPath(),t.rect(-n,-n,e.width()+2*n,e.height()+2*n),t.fillStrokeShape(e)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",t=>{t.cancelBubble=!0}),t.on("dragmove",t=>{t.cancelBubble=!0}),t.on("dragend",t=>{t.cancelBubble=!0}),this.on("dragmove",t=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var e=this._getNodeRect(),n=e.width,r=e.height,i=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/i),this.cos=Math.abs(n/i),"undefined"!=typeof window&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(e=>{e._fire("transformstart",{evt:t.evt,target:e})})}_handleMouseMove(t){var e,n,r,i=this.findOne("."+this._movingAnchorName),a=i.getStage();a.setPointersPositions(t);let s=a.getPointerPosition(),o={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y},l=i.getAbsolutePosition();this.anchorDragBoundFunc()&&(o=this.anchorDragBoundFunc()(l,o,t)),i.setAbsolutePosition(o);let u=i.getAbsolutePosition();if(l.x!==u.x||l.y!==u.y){if("rotater"===this._movingAnchorName){var c=this._getNodeRect();e=i.x()-c.width/2;let r=Math.atan2(-(n=-i.y()+c.height/2),e)+Math.PI/2;c.height<0&&(r-=Math.PI);let a=h.getAngle(this.rotation())+r,s=h.getAngle(this.rotationSnapTolerance()),o=function(t,e,n){let r=e;for(let i=0;i<t.length;i++){let a=h.getAngle(t[i]),s=Math.abs(a-e)%(2*Math.PI);Math.min(s,2*Math.PI-s)<n&&(r=a)}return r}(this.rotationSnaps(),a,s)-c.rotation,l=function(t,e){let n={x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)};return eG(t,e,n)}(c,o);this._fitNodesInto(l,t);return}var d=this.keepRatio()||t.shiftKey,f=this.centeredScaling()||t.altKey;if("top-left"===this._movingAnchorName){if(d){var g=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(g.x-i.x(),2)+Math.pow(g.y-i.y(),2));var p=this.findOne(".top-left").x()>g.x?-1:1,m=this.findOne(".top-left").y()>g.y?-1:1;e=r*this.cos*p,n=r*this.sin*m,this.findOne(".top-left").x(g.x-e),this.findOne(".top-left").y(g.y-n)}}else if("top-center"===this._movingAnchorName)this.findOne(".top-left").y(i.y());else if("top-right"===this._movingAnchorName){if(d){var g=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(i.x()-g.x,2)+Math.pow(g.y-i.y(),2));var p=this.findOne(".top-right").x()<g.x?-1:1,m=this.findOne(".top-right").y()>g.y?-1:1;e=r*this.cos*p,n=r*this.sin*m,this.findOne(".top-right").x(g.x+e),this.findOne(".top-right").y(g.y-n)}var v=i.position();this.findOne(".top-left").y(v.y),this.findOne(".bottom-right").x(v.x)}else if("middle-left"===this._movingAnchorName)this.findOne(".top-left").x(i.x());else if("middle-right"===this._movingAnchorName)this.findOne(".bottom-right").x(i.x());else if("bottom-left"===this._movingAnchorName){if(d){var g=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(g.x-i.x(),2)+Math.pow(i.y()-g.y,2));var p=g.x<i.x()?-1:1,m=i.y()<g.y?-1:1;e=r*this.cos*p,n=r*this.sin*m,i.x(g.x-e),i.y(g.y+n)}v=i.position(),this.findOne(".top-left").x(v.x),this.findOne(".bottom-right").y(v.y)}else if("bottom-center"===this._movingAnchorName)this.findOne(".bottom-right").y(i.y());else if("bottom-right"===this._movingAnchorName){if(d){var g=f?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};r=Math.sqrt(Math.pow(i.x()-g.x,2)+Math.pow(i.y()-g.y,2));var p=this.findOne(".bottom-right").x()<g.x?-1:1,m=this.findOne(".bottom-right").y()<g.y?-1:1;e=r*this.cos*p,n=r*this.sin*m,this.findOne(".bottom-right").x(g.x+e),this.findOne(".bottom-right").y(g.y+n)}}else console.error(Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var f=this.centeredScaling()||t.altKey;if(f){var y=this.findOne(".top-left"),b=this.findOne(".bottom-right"),_=y.x(),x=y.y(),S=this.getWidth()-b.x(),w=this.getHeight()-b.y();b.move({x:-_,y:-x}),y.move({x:S,y:w})}var C=this.findOne(".top-left").getAbsolutePosition();e=C.x,n=C.y;var k=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),P=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:e,y:n,width:k,height:P,rotation:h.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){if(this._transforming){this._transforming=!1,"undefined"!=typeof window&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var e=this.getNode();this._fire("transformend",{evt:t,target:e}
1),e&&this._nodes.forEach(e=>{e._fire("transformend",{evt:t,target:e})}),this._movingAnchorName=null}}_fitNodesInto(t,e){var n=this._getNodeRect();if(b._inRange(t.width,-(2*this.padding())-1,1)||b._inRange(t.height,-(2*this.padding())-1,1)){this.update();return}let r=this.flipEnabled();var i=new c;if(i.rotate(h.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){let e=i.point({x:-(2*this.padding()),y:0});if(t.x+=e.x,t.y+=e.y,t.width+=2*this.padding(),this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=e.x,this._anchorDragOffset.y-=e.y,!r){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){let e=i.point({x:2*this.padding(),y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=e.x,this._anchorDragOffset.y-=e.y,t.width+=2*this.padding(),!r){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){let e=i.point({x:0,y:-(2*this.padding())});if(t.x+=e.x,t.y+=e.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=e.x,this._anchorDragOffset.y-=e.y,t.height+=2*this.padding(),!r){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){let e=i.point({x:0,y:2*this.padding()});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=e.x,this._anchorDragOffset.y-=e.y,t.height+=2*this.padding(),!r){this.update();return}}if(this.boundBoxFunc()){let e=this.boundBoxFunc()(n,t);e?t=e:b.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}let a=new c;a.translate(n.x,n.y),a.rotate(n.rotation),a.scale(n.width/1e7,n.height/1e7);let s=new c;s.translate(t.x,t.y),s.rotate(t.rotation),s.scale(t.width/1e7,t.height/1e7);let o=s.multiply(a.invert());this._nodes.forEach(t=>{var n;let r=t.getParent().getAbsoluteTransform(),i=t.getTransform().copy();i.translate(t.offsetX(),t.offsetY());let a=new c;a.multiply(r.copy().invert()).multiply(o).multiply(r).multiply(i);let s=a.decompose();t.setAttrs(s),this._fire("transform",{evt:e,target:t}),t._fire("transform",{evt:e,target:t}),null===(n=t.getLayer())||void 0===n||n.batchDraw()}),this.rotation(b._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,e){this.findOne(t).setAttrs(e)}update(){var t,e=this._getNodeRect();this.rotation(b._getRotation(e.rotation));var n=e.width,r=e.height,i=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),o=this.anchorSize();this.find("._anchor").forEach(t=>{t.setAttrs({width:o,height:o,offsetX:o/2,offsetY:o/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:o/2+s,offsetY:o/2+s,visible:a&&i.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:o/2+s,visible:a&&i.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:o/2-s,offsetY:o/2+s,visible:a&&i.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:o/2+s,visible:a&&i.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:o/2-s,visible:a&&i.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:o/2+s,offsetY:o/2-s,visible:a&&i.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:o/2-s,visible:a&&i.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:o/2-s,offsetY:o/2-s,visible:a&&i.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*b._sign(r)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),null===(t=this.getLayer())||void 0===t||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);
vendor: 1,899 bytes, line 1
1t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),tY.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return J.prototype.toObject.call(this)}clone(t){return J.prototype.clone.call(this,t)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}eN.prototype.className="Transformer",u(eN),T.addGetterSetter(eN,"enabledAnchors",eD,function(t){return t instanceof Array||b.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(t){-1===eD.indexOf(t)&&b.warn("Unknown anchor name: "+t+". Available names are: "+eD.join(", "))}),t||[]}),T.addGetterSetter(eN,"flipEnabled",!0,E()),T.addGetterSetter(eN,"resizeEnabled",!0),T.addGetterSetter(eN,"anchorSize",10,S()),T.addGetterSetter(eN,"rotateEnabled",!0),T.addGetterSetter(eN,"rotationSnaps",[]),T.addGetterSetter(eN,"rotateAnchorOffset",50,S()),T.addGetterSetter(eN,"rotationSnapTolerance",5,S()),T.addGetterSetter(eN,"borderEnabled",!0),T.addGetterSetter(eN,"anchorStroke","rgb(0, 161, 255)"),T.addGetterSetter(eN,"anchorStrokeWidth",1,S()),T.addGetterSetter(eN,"anchorFill","white"),T.addGetterSetter(eN,"anchorCornerRadius",0,S()),T.addGetterSetter(eN,"borderStroke","rgb(0, 161, 255)"),T.addGetterSetter(eN,"borderStrokeWidth",1,S()),T.addGetterSetter(eN,"borderDash"),T.addGetterSetter(eN,"keepRatio",!0),T.addGetterSetter(eN,"centeredScaling",!1),T.addGetterSetter(eN,"ignoreStroke",!1),T.addGetterSetter(eN,"padding",0,S()),T.addGetterSetter(eN,"node"),T.addGetterSetter(eN,"nodes"),T.addGetterSetter(eN,"boundBoxFunc"),T.addGetterSetter(eN,"anchorDragBoundFunc"),T.addGetterSetter(eN,"shouldOverdrawWholeArea",!1),T.addGetterSetter(eN,"useSingleNodeRotation",!0),T.backCompat(eN,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledH
1andlers:"enabledAnchors"});class eO extends tB{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,h.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return 2*this.radius()}getHeight(){return 2*this.radius()}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}function ez(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}eO.prototype.className="Wedge",eO.prototype._centroid=!0,eO.prototype._attrsAffectingSize=["radius"],u(eO),T.addGetterSetter(eO,"radius",0,S()),T.addGetterSetter(eO,"angle",0,S()),T.addGetterSetter(eO,"clockwise",!1),T.backCompat(eO,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var eF=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,39
16,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],eB=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function eH(t,e,n,r,i){var a=n-e,s=i-r;return 0===a?r+s/2:0===s?r:(t-e)/a*s+r}T.addGetterSetter(J,"blurRadius",0,S(),T.afterSetFilter),T.addGetterSetter(J,"brightness",0,S(),T.afterSetFilter),T.addGetterSetter(J,"contrast",0,S(),T.afterSetFilter),T.addGetterSetter(J,"embossStrength",.5,S(),T.afterSetFilter),T.addGetterSetter(J,"embossWhiteLevel",.5,S(),T.afterSetFilter),T.addGetterSetter(J,"embossDirection","top-left",null,T.afterSetFilter),T.addGetterSetter(J,"embossBlend",!1,null,T.afterSetFilter),T.addGetterSetter(J,"enhance",0,S(),T.afterSetFilter),T.addGetterSetter(J,"hue",0,S(),T.afterSetFilter),T.addGetterSetter(J,"saturation",0,S(),T.afterSetFilter),T.addGetterSetter(J,"luminance",0,S(),T.afterSetFilter),T.addGetterSetter(J,"hue",0,S(),T.afterSetFilter),T.addGetterSetter(J,"saturation",0,S(),T.afterSetFilter),T.addGetterSetter(J,"value",0,S(),T.afterSetFilter);var eW=function(t,e,n){var r,i,a,s,o=t.data,l=e.data,h=t.width,u=t.height,c=n.polarCenterX||h/2,d=n.polarCenterY||u/2,f=0,g=0,p=0,m=0,v=Math.sqrt(c*c+d*d);v=(s=Math.sqrt((i=h-c)*i+(a=u-d)*a))>v?s:v;var y,b,_,x,S=360/h*Math.PI/180;for(b=0;b<h;b+=1)for(y=0,_=Math.sin(b*S),x=Math.cos(b*S);y<u;y+=1)i=Math.floor(c+v*y/u*x),f=o[(r=((a=Math.floor(d+v*y/u*_))*h+i)*4)+0],g=o[r+1],p=o[r+2],m=o[r+3],l[(r=(b+y*h)*4)+0]=f,l[r+1]=g,l[r+2]=p,l[r+3]=m},eU=function(t,e,n){var r,i,a,s,o,l,h,u=t.data,c=e.data,d=t.width,f=t.height,g=n.polarCenterX||d/2,p=n.polarCenterY||f/2,m=0,v=0,y=0,b=0,_=Math.sqrt(g*g+p*p);_=(h=Math.sqrt((a=d-g)*a+(s=f-p)*s))>_?h:_;var x,S=n.polarRotation||0;for(a=0;a<d;a+=1)for(s=0;s<f;s+=1)x=Math.sqrt((o=a-g)*o+(l=s-p)*l)*f/_,r=Math.floor((180*Math.atan2(l,o)/Math.PI+360+S)%360*d/360),m=u[(i=(Math.floor(x)*d+r)*4)+0],v=u[i+1],y=u[i+2],b=u[i+3],c[(i=(s*d+a)*4)+0]=m,c[i+1]=v,c[i+2]=y,c[i+3]=b};function ej(t,e,n){var r=(n*t.width+e)*4,i=[];return i.push(t.data[r++],t.data[r++],t.data[r++],t.data[r++]),i}function eY(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}T.addGetterSetter(J,"kaleidoscopePower",2,S(),T.afterSetFilter),T.addGetterSetter(J,"kaleidoscopeAngle",0,S(),T.afterSetFilter),T.addGetterSetter(J,"threshold",0,S(),T.afterSetFilter),T.addGetterSetter(J,"noise",.2,S(),T.afterSetFilter),T.addGetterSetter(J,"pixelSize",8,S(),T.afterSetFilter),T.addGetterSetter(J,"levels",.5,S(),T.afterSetFilter),T.addGetterSetter(J,"red",0,function(t){return(this._filterUpToDate=!1,t>255)?255:t<0?0:Math.round(t)}),T.addGetterSetter(J,"green",0,function(t){return(this._filterUpToDate=!1,t>255)?255:t<0?0:Math.round(t)}),T.addGetterSetter(J,"blue",0,x,T.afterSetFilter),T.addGetterSetter(J,"red",0,function(t){return(this._filterUpToDate=!1,t>255)?255:t<0?0:Math.round(t)}),T.addGetterSetter(J,"green",0,function(t){return(this._filterUpToDate=!1,t>255)?255:t<0?0:Math.round(t)}),T.addGetterSetter(J,"blue",0,x,T.afterSetFilter),T.addGetterSetter(J,"alpha",1,function(t){return(this._filterUpToDate=!1,t>1)?1:t<0?0:t}),T.addGetterSetter(J,"threshold",.5,S(),T.afterSetFilter),t0.Util._assign(t0,{Arc:t1,Arrow:t6,Circle:t8,Ellipse:t9,Image:t7,Label:ea,Tag:es,Line:t3,Path:t4,Rect:eo,RegularPolygon:el,Ring:eu,Sprite:ec,Star:ed,Text:ew,TextPath:eE,Transformer:eN,Wedge:eO,Filters:{Blur:function(t){var e=Math.round(this.blurRadius());e>0&&function(t,e){var n,r,i,a,s,o,l,h,u,c,d,f,g,p,m,v,y,b,_,x,S,w,C,k,P=t.data,E=t.width,T=t.height,A=e+e+1,M=E-1,R=T-1,L=e+1,I=L*(L+1)/2,D=new ez,G=null,N=D,O=null,z=null,F=eF[e],B=eB[e];for(i=1;i<A;i++)N=N.next=new ez,i===L&&(G=N);for(r=0,N.next=D,l=o=0;r<T;
1r++){for(v=y=b=_=h=u=c=d=0,f=L*(x=P[o]),g=L*(S=P[o+1]),p=L*(w=P[o+2]),m=L*(C=P[o+3]),h+=I*x,u+=I*S,c+=I*w,d+=I*C,N=D,i=0;i<L;i++)N.r=x,N.g=S,N.b=w,N.a=C,N=N.next;for(i=1;i<L;i++)a=o+((M<i?M:i)<<2),h+=(N.r=x=P[a])*(k=L-i),u+=(N.g=S=P[a+1])*k,c+=(N.b=w=P[a+2])*k,d+=(N.a=C=P[a+3])*k,v+=x,y+=S,b+=w,_+=C,N=N.next;for(n=0,O=D,z=G;n<E;n++)P[o+3]=C=d*F>>B,0!==C?(C=255/C,P[o]=(h*F>>B)*C,P[o+1]=(u*F>>B)*C,P[o+2]=(c*F>>B)*C):P[o]=P[o+1]=P[o+2]=0,h-=f,u-=g,c-=p,d-=m,f-=O.r,g-=O.g,p-=O.b,m-=O.a,a=l+((a=n+e+1)<M?a:M)<<2,v+=O.r=P[a],y+=O.g=P[a+1],b+=O.b=P[a+2],_+=O.a=P[a+3],h+=v,u+=y,c+=b,d+=_,O=O.next,f+=x=z.r,g+=S=z.g,p+=w=z.b,m+=C=z.a,v-=x,y-=S,b-=w,_-=C,z=z.next,o+=4;l+=E}for(n=0;n<E;n++){for(y=b=_=v=u=c=d=h=0,f=L*(x=P[o=n<<2]),g=L*(S=P[o+1]),p=L*(w=P[o+2]),m=L*(C=P[o+3]),h+=I*x,u+=I*S,c+=I*w,d+=I*C,N=D,i=0;i<L;i++)N.r=x,N.g=S,N.b=w,N.a=C,N=N.next;for(i=1,s=E;i<=e;i++)o=s+n<<2,h+=(N.r=x=P[o])*(k=L-i),u+=(N.g=S=P[o+1])*k,c+=(N.b=w=P[o+2])*k,d+=(N.a=C=P[o+3])*k,v+=x,y+=S,b+=w,_+=C,N=N.next,i<R&&(s+=E);for(r=0,o=n,O=D,z=G;r<T;r++)P[(a=o<<2)+3]=C=d*F>>B,C>0?(C=255/C,P[a]=(h*F>>B)*C,P[a+1]=(u*F>>B)*C,P[a+2]=(c*F>>B)*C):P[a]=P[a+1]=P[a+2]=0,h-=f,u-=g,c-=p,d-=m,f-=O.r,g-=O.g,p-=O.b,m-=O.a,a=n+((a=r+L)<R?a:R)*E<<2,h+=v+=O.r=P[a],u+=y+=O.g=P[a+1],c+=b+=O.b=P[a+2],d+=_+=O.a=P[a+3],O=O.next,f+=x=z.r,g+=S=z.g,p+=w=z.b,m+=C=z.a,v-=x,y-=S,b-=w,_-=C,z=z.next,o+=E}}(t,e)},Brighten:function(t){var e,n=255*this.brightness(),r=t.data,i=r.length;for(e=0;e<i;e+=4)r[e]+=n,r[e+1]+=n,r[e+2]+=n},Contrast:function(t){var e,n=Math.pow((this.contrast()+100)/100,2),r=t.data,i=r.length,a=150,s=150,o=150;for(e=0;e<i;e+=4)a=r[e],s=r[e+1],o=r[e+2],a/=255,a-=.5,a*=n,a+=.5,a*=255,s/=255,s-=.5,s*=n,s+=.5,s*=255,o/=255,o-=.5,o*=n,o+=.5,o*=255,a=a<0?0:a>255?255:a,s=s<0?0:s>255?255:s,o=o<0?0:o>255?255:o,r[e]=a,r[e+1]=s,r[e+2]=o},Emboss:function(t){var e=10*this.embossStrength(),n=255*this.embossWhiteLevel(),r=this.embossDirection(),i=this.embossBlend(),a=0,s=0,o=t.data,l=t.width,h=t.height,u=4*l,c=h;switch(r){case"top-left":a=-1,s=-1;break;case"top":a=-1,s=0;break;case"top-right":a=-1,s=1;break;case"right":a=0,s=1;break;case"bottom-right":a=1,s=1;break;case"bottom":a=1,s=0;break;case"bottom-left":a=1,s=-1;break;case"left":a=0,s=-1;break;default:b.error("Unknown emboss direction: "+r)}do{var d=(c-1)*u,f=a;c+f<1&&(f=0),c+f>h&&(f=0);var g=(c-1+f)*l*4,p=l;do{var m=d+(p-1)*4,v=s;p+v<1&&(v=0),p+v>l&&(v=0);var y=g+(p-1+v)*4,_=o[m]-o[y],x=o[m+1]-o[y+1],S=o[m+2]-o[y+2],w=_,C=w>0?w:-w,k=S>0?S:-S;if((x>0?x:-x)>C&&(w=x),k>C&&(w=S),w*=e,i){var P=o[m]+w,E=o[m+1]+w,T=o[m+2]+w;o[m]=P>255?255:P<0?0:P,o[m+1]=E>255?255:E<0?0:E,o[m+2]=T>255?255:T<0?0:T}else{var A=n-w;A<0?A=0:A>255&&(A=255),o[m]=o[m+1]=o[m+2]=A}}while(--p)}while(--c)},Enhance:function(t){var e,n,r,i,a,s,o,l,h,u,c,d,f,g=t.data,p=g.length,m=g[0],v=m,y=g[1],b=y,_=g[2],x=_,S=this.enhance();if(0!==S){for(f=0;f<p;f+=4)(u=g[f+0])<m?m=u:u>v&&(v=u),(c=g[f+1])<y?y=c:c>b&&(b=c),(d=g[f+2])<_?_=d:d>x&&(x=d);for(v===m&&(v=255,m=0),b===y&&(b=255,y=0),x===_&&(x=255,_=0),S>0?(n=v+S*(255-v),r=m-S*(m-0),a=b+S*(255-b),s=y-S*(y-0),l=x+S*(255-x),h=_-S*(_-0)):(e=(v+m)*.5,n=v+S*(v-e),r=m+S*(m-e),i=(b+y)*.5,a=b+S*(b-i),s=y+S*(y-i),o=(x+_)*.5,l=x+S*(x-o),h=_+S*(_-o)),f=0;f<p;f+=4)g[f+0]=eH(g[f+0],m,v,r,n),g[f+1]=eH(g[f+1],y,b,s,a),g[f+2]=eH(g[f+2],_,x,h,l)}},Grayscale:function(t){var e,n,r=t.data,i=r.length;for(e=0;e<i;e+=4)n=.34*r[e]+.5*r[e+1]+.16*r[e+2],r[e]=n,r[e+1]=n,r[e+2]=n},HSL:function(t){var e,n,r,i,a,s=t.data,o=s.length,l=Math.pow(2,this.saturation()),h=Math.abs(this.hue()+360)%360,u=127*this.luminance(),c=1*l*Math.cos(h*Math.PI/180),d=1*l*Math.sin(h*Math.PI/180),f=.299+.701*c+.167*d,g=.587-.587*c+.33*d,p=.114-.114*c-.497*d,m=.299-.299*c-.328*d,v=.587+.413*c+.035*d,y=.114-.114*c+.293*d,b=.299-.3*c+1.25*d,_=.587-.586*c-1.05*d,x=.114+.886*c-.2*d;for(a=0;a<o;
1a+=4)e=s[a+0],n=s[a+1],r=s[a+2],i=s[a+3],s[a+0]=f*e+g*n+p*r+u,s[a+1]=m*e+v*n+y*r+u,s[a+2]=b*e+_*n+x*r+u,s[a+3]=i},HSV:function(t){var e,n,r,i,a,s=t.data,o=s.length,l=Math.pow(2,this.value()),h=Math.pow(2,this.saturation()),u=Math.abs(this.hue()+360)%360,c=l*h*Math.cos(u*Math.PI/180),d=l*h*Math.sin(u*Math.PI/180),f=.299*l+.701*c+.167*d,g=.587*l-.587*c+.33*d,p=.114*l-.114*c-.497*d,m=.299*l-.299*c-.328*d,v=.587*l+.413*c+.035*d,y=.114*l-.114*c+.293*d,b=.299*l-.3*c+1.25*d,_=.587*l-.586*c-1.05*d,x=.114*l+.886*c-.2*d;for(a=0;a<o;a+=4)e=s[a+0],n=s[a+1],r=s[a+2],i=s[a+3],s[a+0]=f*e+g*n+p*r,s[a+1]=m*e+v*n+y*r,s[a+2]=b*e+_*n+x*r,s[a+3]=i},Invert:function(t){var e,n=t.data,r=n.length;for(e=0;e<r;e+=4)n[e]=255-n[e],n[e+1]=255-n[e+1],n[e+2]=255-n[e+2]},Kaleidoscope:function(t){var e,n,r,i,a,s,o,l,h,u,c=t.width,d=t.height,f=Math.round(this.kaleidoscopePower()),g=Math.floor(Math.round(this.kaleidoscopeAngle())%360*c/360);if(!(f<1)){var p=b.createCanvasElement();p.width=c,p.height=d;var m=p.getContext("2d").getImageData(0,0,c,d);b.releaseCanvas(p),eW(t,m,{polarCenterX:c/2,polarCenterY:d/2});for(var v=c/Math.pow(2,f);v<=8;)v*=2,f-=1;var y=v=Math.ceil(v),_=0,x=y,S=1;for(g+v>c&&(_=y,x=0,S=-1),n=0;n<d;n+=1)for(e=_;e!==x;e+=S)r=Math.round(e+g)%c,h=(c*n+r)*4,a=m.data[h+0],s=m.data[h+1],o=m.data[h+2],l=m.data[h+3],u=(c*n+e)*4,m.data[u+0]=a,m.data[u+1]=s,m.data[u+2]=o,m.data[u+3]=l;for(n=0;n<d;n+=1)for(i=0,y=Math.floor(v);i<f;i+=1){for(e=0;e<y+1;e+=1)h=(c*n+e)*4,a=m.data[h+0],s=m.data[h+1],o=m.data[h+2],l=m.data[h+3],u=(c*n+2*y-e-1)*4,m.data[u+0]=a,m.data[u+1]=s,m.data[u+2]=o,m.data[u+3]=l;y*=2}eU(m,t,{polarRotation:0})}},Mask:function(t){var e=function(t,e){var n=ej(t,0,0),r=ej(t,t.width-1,0),i=ej(t,0,t.height-1),a=ej(t,t.width-1,t.height-1),s=e||10;if(eY(n,r)<s&&eY(r,a)<s&&eY(a,i)<s&&eY(i,n)<s){for(var o=function(t){for(var e=[0,0,0],n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}([r,n,a,i]),l=[],h=0;h<t.width*t.height;h++){var u=eY(o,[t.data[4*h],t.data[4*h+1],t.data[4*h+2]]);l[h]=u<s?0:255}return l}}(t,this.threshold());return e&&(e=function(t,e,n){for(var r=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),s=[],o=0;o<n;o++)for(var l=0;l<e;l++){for(var h=o*e+l,u=0,c=0;c<i;c++)for(var d=0;d<i;d++){var f=o+c-a,g=l+d-a;if(f>=0&&f<n&&g>=0&&g<e){var p=f*e+g,m=r[c*i+d];u+=t[p]*m}}s[h]=u}return s}(e=function(t,e,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),s=[],o=0;o<n;o++)for(var l=0;l<e;l++){for(var h=o*e+l,u=0,c=0;c<i;c++)for(var d=0;d<i;d++){var f=o+c-a,g=l+d-a;if(f>=0&&f<n&&g>=0&&g<e){var p=f*e+g,m=r[c*i+d];u+=t[p]*m}}s[h]=u>=1020?255:0}return s}(e=function(t,e,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),a=Math.floor(i/2),s=[],o=0;o<n;o++)for(var l=0;l<e;l++){for(var h=o*e+l,u=0,c=0;c<i;c++)for(var d=0;d<i;d++){var f=o+c-a,g=l+d-a;if(f>=0&&f<n&&g>=0&&g<e){var p=f*e+g,m=r[c*i+d];u+=t[p]*m}}s[h]=2040===u?255:0}return s}(e,t.width,t.height),t.width,t.height),t.width,t.height),function(t,e){for(var n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}(t,e)),t},Noise:function(t){var e,n=255*this.noise(),r=t.data,i=r.length,a=n/2;for(e=0;e<i;e+=4)r[e+0]+=a-2*a*Math.random(),r[e+1]+=a-2*a*Math.random(),r[e+2]+=a-2*a*Math.random()},Pixelate:function(t){var e,n,r,i,a,s,o,l,h,u,c,d,f,g,p=Math.ceil(this.pixelSize()),m=t.width,v=t.height,y=Math.ceil(m/p),_=Math.ceil(v/p),x=t.data;if(p<=0){b.error("pixelSize value can not be <= 0");return}for(d=0;d<y;d+=1)for(f=0;f<_;f+=1){for(i=0,a=0,s=0,o=0,h=(l=d*p)+p,c=(u=f*p)+p,g=0,e=l;e<h;e+=1)if(!(e>=m))for(n=u;n<c;n+=1)n>=v||(i+=x[(r=(m*n+e)*4)+0],a+=x[r+1],s+=x[r+2],o+=x[r+3],g+=1);for(i/=g,a/=g,s/=g,o/=g,e=l;e<h;e+=1)if(!(e>=m))for(n=u;n<c;n+=1)n>=v||(x[(r=(m*n+e)*4)+0]=i,x[r+1]=a,x[r+2]=s,x[r+3]=o)}},Posterize:function(t){var e,n=Math.round(254*this.levels())+1,r=t.data,i=r.length,a=255/n;for(e=0;e<i;e+=1)r[e]=Math.floor(r[e]/a)*a},RGB:function(t){var e,n,r=t.data,i=r.length,a=this.red(),s=this.green(),o=this.blue();for(e=0;e<i;e+=4)n=(.34*r[e]+.5*r[e+1]+.16*r[e+2])/255,r[e]=n*a,r[e+1]=n*s,r[e+2]=n*o,r[e+3]=r[e+3]},RGBA:function(t){var e,n,r=t.data,i=r.length,a=this.red(),s=this.green(),o=this.blue(),l=this.alpha();for(e=0;e<i;e+=4)n=1-l,r[e]=a*l+r[e]*n,r[e+1]=s*l+r[e+1]*n,r[e+2]=o*l+r[e+2]*n},Sepia:function(t){var e,n,r,i,a=t.data,s=a.length;for(e=0;e<s;e+=4)n=a[e+0],r=a[e+1],i=a[e+2],a[e+0]=Math.min(255,.393*n+.769*r+.189*i),a[e+1]=Math.min(255,.349*n+.686*r+.168*i),a[e+2]=Math.min(255,.272*n+.534*r+.131*i)},Solarize:function(t){var e=t.data,n=t.width,r=t.height,i=4*n,a=r;do{var s=(a-1)*i,o=n;do{var l=s+(o-1)*4,h=e[l],u=e[l+1],c=e[l+2];h>127&&(h=255-h),u>127&&(u=255-u),c>127&&(c=255-c),e[l]=h,e[l+1]=u,e[l+2]=c}while(--o)}while(--a)},Threshold:function(t){var e,n=255*this.threshold(),r=t.data,i=r.length;for(e=0;e<i;e+=1)r[e]=r[e]<n?0:255}}});var eX=n(67294),eq=n(76525),eQ=n.n(eq),eV={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0},eK=!1,e$=!1,eJ=".react-konva-event",eZ={};function e0(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eZ;if(e===n&&console.error("same props"),!eK&&"zIndex"in e&&(console.warn('ReactKonva: You are using "zIndex" attribute for a Konva node.\nreact-konva may get confused with ordering. Just define correct order of elements in your render function of a component.\nFor more info see: https://github.com/konvajs/react-konva/issues/194\n'),eK=!0),!e$&&e.draggable){var r=void 0!==e.x||void 0!==e.y,i=e.onDragEnd||e.onDragMove;r&&!i&&(console.warn("ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.\nPosition of a node will be changed during drag&drop, so you should update state of the react app as well.\nConsider to add onDragMove or onDragEnd events.\nFor more info see: https://github.com/konvajs/react-konva/issues/256\n"),e$=!0)}for(var a in n)if(!eV[a]){var s="on"===a.slice(0,2),o=n[a]!==e[a];if(s&&o){var l=a.substr(2).toLowerCase();"content"===l.substr(0,7)&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t.off(l,n[a])}e.hasOwnProperty(a)||t.setAttr(a,void 0)}var h=e._useStrictMode,u={},c=!1,d={};for(var a in e)if(!eV[a]){var s="on"===a.slice(0,2),f=n[a]!==e[a];if(s&&f){var l=a.substr(2).toLowerCase();"content"===l.substr(0,7)&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e[a]&&(d[l]=e[a])}!s&&(e[a]!==n[a]||h&&e[a]!==t.getAttr(a))&&(c=!0,u[a]=e[a])}for(var l in c&&(t.setAttrs(u),e1(t)),d)t.on(l+eJ,d[l])}function e1(t){if(!h.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var e2=n(63840),e5={},e3={};function e4(t,e){if("string"==typeof e){console.error("Do not use plain text as child of Konva.Node. You are using text: "+e);return}t.add(e),e1(t)}function e6(t,e,n){var r=t0[t];r||(console.error("Konva has no node with the type "+t+'. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/'+t+'" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html'),r=t0.Group);var i={},a={};for(var s in e)"on"===s.slice(0,2)?a[s]=e[s]:i[s]=e[s];var o=new r(i);return e0(o,a),o}function e8(t,e,n){console.error('Text components are not supported for now in ReactKonva. Your text is: "'+t+'"')}function e9(t,e,n){return!1}function e7(t){return t}function nt(){return null}function ne(){return null}function nn(t,e,n,r){return e3}function nr(){}function ni(t){}function na(t,e){return!1}function ns(){return e5}function no(){return e5}t0.Node.prototype._applyProps=e0;var nl=setTimeout,nh=clearTimeout,nu=-1;function nc(t,e){return!1}var nd=!1,nf=!0,ng=!0;function np(t,e){e.parent===t?e.moveToTop():t.add(e),e1(t)}function nm(t,e){e.parent===t?e.moveToTop():t.add(e),e1(t)}function nv(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),e1(t)}function ny(t,e,n){nv(t,e,n)}function nb(t,e){e.destroy(),e.off(eJ),e1(t)}function n_(t,e){e.destroy(),e.off(eJ),e1(t)}function nx(t,e,n){console.error('Text components are not yet supported in ReactKonva. You text is: "'+n+'"')}function nS(t,e,n){}function nw(t,e,n,r,i){e0(t,i,r)}function nC(t){t.hide(),e1(t)}function nk(t){}function nP(t,e){(null==e.visible||e.visible)&&t.show()}function nE(t,e){}function nT(t){}var nA=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},nM=function(t){var e,n=eX.useRef(),r=eX.useRef(),i=eX.useRef(),a=(e=eX.useRef(),eX.useLayoutEffect(function(){e.current=t}),e.current),s=function(e){var n=t.forwardedRef;n&&("function"==typeof n?n(e):n.current=e)};
1return eX.useLayoutEffect(function(){return r.current=new t0.Stage({width:t.width,height:t.height,container:n.current}),s(r.current),i.current=nF.createContainer(r.current),nF.updateContainer(t.children,i.current),function(){t0.isBrowser&&(s(null),nF.updateContainer(null,i.current,null),r.current.destroy())}},[]),eX.useLayoutEffect(function(){s(r.current),e0(r.current,t,a),nF.updateContainer(t.children,i.current,null)}),eX.createElement("div",{ref:n,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},nR="Layer",nL="Group",nI="Label",nD="Rect",nG="Image",nN="Text",nO="Tag",nz="Transformer",nF=eQ()(s);nF.injectIntoDevTools({findHostInstanceByFiber:function(){return null},bundleType:0,version:eX.version,rendererPackageName:"react-konva"});var nB=eX.forwardRef(function(t,e){return eX.createElement(nM,nA({},t,{forwardedRef:e}))})},67287:function(t,e,n){(t=n.nmd(t)).exports=function(e){"use strict";var r,i,a,s,o,l={},h=n(96086),u=n(67294),c=n(63840);function d(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var f=u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,g=60103,p=60106,m=60107,v=60108,y=60114,b=60109,_=60110,x=60112,S=60113,w=60120,C=60115,k=60116,P=60121,E=60129,T=60130,A=60131;if("function"==typeof Symbol&&Symbol.for){var M=Symbol.for;g=M("react.element"),p=M("react.portal"),m=M("react.fragment"),v=M("react.strict_mode"),y=M("react.profiler"),b=M("react.provider"),_=M("react.context"),x=M("react.forward_ref"),S=M("react.suspense"),w=M("react.suspense_list"),C=M("react.memo"),k=M("react.lazy"),P=M("react.block"),M("react.scope"),E=M("react.debug_trace_mode"),T=M("react.offscreen"),A=M("react.legacy_hidden")}var R="function"==typeof Symbol&&Symbol.iterator;function L(t){return null===t||"object"!=typeof t?null:"function"==typeof(t=R&&t[R]||t["@@iterator"])?t:null}function I(t){if(null==t)return null;if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case m:return"Fragment";case p:return"Portal";case y:return"Profiler";case v:return"StrictMode";case S:return"Suspense";case w:return"SuspenseList"}if("object"==typeof t)switch(t.$$typeof){case _:return(t.displayName||"Context")+".Consumer";case b:return(t._context.displayName||"Context")+".Provider";case x:var e=t.render;return e=e.displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case C:return I(t.type);case P:return I(t._render);case k:e=t._payload,t=t._init;try{return I(t(e))}catch(t){}}return null}function D(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do 0!=(1026&(e=t).flags)&&(n=e.return),t=e.return;while(t)}return 3===e.tag?n:null}function G(t){if(D(t)!==t)throw Error(d(188))}function N(t){var e=t.alternate;if(!e){if(null===(e=D(t)))throw Error(d(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(r=i.return)){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return G(i),t;if(a===r)return G(i),e;a=a.sibling}throw Error(d(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,o=i.child;o;){if(o===n){s=!0,n=i,r=a;break}if(o===r){s=!0,r=i,n=a;break}o=o.sibling}if(!s){for(o=a.child;o;){if(o===n){s=!0,n=a,r=i;break}if(o===r){s=!0,r=a,n=i;break}o=o.sibling}if(!s)throw Error(d(189))}}if(n.alternate!==r)throw Error(d(190))}if(3!==n.tag)throw Error(d(188));return n.stateNode.current===n?t:e}function O(t){if(!(t=N(t)))return null;for(var e=t;;){if(5===e.tag||6===e.tag)return e;if(e.child)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}function z(t,e){for(var n=t.alternate;null!==e;){if(e===t||e===n)return!0;e=e.return}return!1}var F,B=e.getPublicInstance,H=e.getRootHostContext,W=e.getChildHostContext,U=e.prepareForCommit,j=e.resetAfterCommit,Y=e.createInstance,X=e.appendInitialChild,q=e.finalizeInitialChildren,Q=e.prepareUpdate,V=e.shouldSetTextContent,K=e.createTextInstance,$=e.scheduleTimeout,J=e.cancelTimeout,Z=e.noTimeout,tt=e.isPrimaryRenderer,te=e.supportsMutation,tn=e.supportsPersistence,tr=e.supportsHydration,ti=e.getInstanceFromNode,ta=e.makeOpaqueHydratingObject,ts=e.makeClientId,to=e.beforeActiveInstanceBlur,tl=e.afterActiveInstanceBlur,th=e.preparePortalMount,tu=e.supportsTestSelectors,tc=e.findFiberRoot,td=e.getBoundingRect,tf=e.getTextContent,tg=e.isHiddenSubtree,tp=e.matchAccessibilityRole,tm=e.setFocusIfFocusable,tv=e.setupIntersectionObserver,ty=e.appendChild,tb=e.appendChildToContainer,t_=e.commitTextUpdate,tx=e.commitMount,tS=e.commitUpdate,tw=e.insertBefore,tC=e.insertInContainerBefore,tk=e.removeChild,tP=e.removeChildFromContainer,tE=e.resetTextContent,tT=e.hideInstance,tA=e.hideTextInstance,tM=e.unhideInstance,tR=e.unhideTextInstance,tL=e.clearContainer,tI=e.cloneInstance,tD=e.createContainerChildSet,tG=e.appendChildToContainerChildSet,tN=e.finalizeContainerChildren,tO=e.replaceContainerChildren,tz=e.cloneHiddenInstance,tF=e.cloneHiddenTextInstance,tB=e.canHydrateInstance,tH=e.canHydrateTextInstance,tW=e.isSuspenseInstancePending,tU=e.isSuspenseInstanceFallback,tj=e.getNextHydratableSibling,tY=e.getFirstHydratableChild,tX=e.hydrateInstance,tq=e.hydrateTextInstance,tQ=e.getNextHydratableInstanceAfterSuspenseInstance,tV=e.commitHydratedContainer,tK=e.commitHydratedSuspenseInstance;function t$(t){if(void 0===F)try{throw Error()}catch(t){var e=t.stack.trim().match(/\n( *(at )?)/);F=e&&e[1]||""}return"\n"+F+t}var tJ=!1;function tZ(t,e){if(!t||tJ)return"";tJ=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e){if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(e,[])}catch(t){var r=t}Reflect.construct(t,[],e)}else{try{e.call()}catch(t){r=t}t.call(e.prototype)}}else{try{throw Error()}catch(t){r=t}t()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),a=r.stack.split("\n"),s=i.length-1,o=a.length-1;1<=s&&0<=o&&i[s]!==a[o];)o--;for(;1<=s&&0<=o;s--,o--)if(i[s]!==a[o]){if(1!==s||1!==o)do if(s--,0>--o||i[s]!==a[o])return"\n"+i[s].replace(" at new "," at ");while(1<=s&&0<=o);break}}}finally{tJ=!1,Error.prepareStackTrace=n}
1return(t=t?t.displayName||t.name:"")?t$(t):""}var t0=[],t1=-1;function t2(t){return{current:t}}function t5(t){0>t1||(t.current=t0[t1],t0[t1]=null,t1--)}function t3(t,e){t0[++t1]=t.current,t.current=e}var t4={},t6=t2(t4),t8=t2(!1),t9=t4;function t7(t,e){var n=t.type.contextTypes;if(!n)return t4;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i,a={};for(i in n)a[i]=e[i];return r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a),a}function et(t){return null!=(t=t.childContextTypes)}function ee(){t5(t8),t5(t6)}function en(t,e,n){if(t6.current!==t4)throw Error(d(168));t3(t6,e),t3(t8,n)}function er(t,e,n){var r=t.stateNode;if(t=e.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var i in r=r.getChildContext())if(!(i in t))throw Error(d(108,I(e)||"Unknown",i));return h({},n,r)}function ei(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||t4,t9=t6.current,t3(t6,t),t3(t8,t8.current),!0}function ea(t,e,n){var r=t.stateNode;if(!r)throw Error(d(169));n?(t=er(t,e,t9),r.__reactInternalMemoizedMergedChildContext=t,t5(t8),t5(t6),t3(t6,t)):t5(t8),t3(t8,n)}var es=null,eo=null;(0,c.unstable_now)();var el=0,eh=8;function eu(t){if(0!=(1&t))return eh=15,1;if(0!=(2&t))return eh=14,2;if(0!=(4&t))return eh=13,4;var e=24&t;return 0!==e?(eh=12,e):0!=(32&t)?(eh=11,32):0!=(e=192&t)?(eh=10,e):0!=(256&t)?(eh=9,256):0!=(e=3584&t)?(eh=8,e):0!=(4096&t)?(eh=7,4096):0!=(e=4186112&t)?(eh=6,e):0!=(e=62914560&t)?(eh=5,e):67108864&t?(eh=4,67108864):0!=(134217728&t)?(eh=3,134217728):0!=(e=805306368&t)?(eh=2,e):0!=(1073741824&t)?(eh=1,1073741824):(eh=8,t)}function ec(t,e){var n=t.pendingLanes;if(0===n)return eh=0;var r=0,i=0,a=t.expiredLanes,s=t.suspendedLanes,o=t.pingedLanes;if(0!==a)r=a,i=eh=15;else if(0!=(a=134217727&n)){var l=a&~s;0!==l?(r=eu(l),i=eh):0!=(o&=a)&&(r=eu(o),i=eh)}else 0!=(a=n&~s)?(r=eu(a),i=eh):0!==o&&(r=eu(o),i=eh);if(0===r)return 0;if(r=n&((0>(r=31-em(r))?0:1<<r)<<1)-1,0!==e&&e!==r&&0==(e&s)){if(eu(e),i<=eh)return e;eh=i}if(0!==(e=t.entangledLanes))for(t=t.entanglements,e&=r;0<e;)i=1<<(n=31-em(e)),r|=t[n],e&=~i;return r}function ed(t){return 0!=(t=-1073741825&t.pendingLanes)?t:1073741824&t?1073741824:0}function ef(t,e){var n,r,i,a,s;switch(t){case 15:return 1;case 14:return 2;case 12:return 0==(t=(n=24&~e)&-n)?ef(10,e):t;case 10:return 0==(t=(r=192&~e)&-r)?ef(8,e):t;case 8:return 0==(t=(i=3584&~e)&-i)&&0==(t=(a=4186112&~e)&-a)&&(t=512),t;case 2:return 0==(e=(s=805306368&~e)&-s)&&(e=268435456),e}throw Error(d(358,t))}function eg(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function ep(t,e,n){t.pendingLanes|=e;var r=e-1;t.suspendedLanes&=r,t.pingedLanes&=r,(t=t.eventTimes)[e=31-em(e)]=n}var em=Math.clz32?Math.clz32:function(t){return 0===t?32:31-(ev(t)/ey|0)|0},ev=Math.log,ey=Math.LN2,eb=c.unstable_runWithPriority,e_=c.unstable_scheduleCallback,ex=c.unstable_cancelCallback,eS=c.unstable_shouldYield,ew=c.unstable_requestPaint,eC=c.unstable_now,ek=c.unstable_getCurrentPriorityLevel,eP=c.unstable_ImmediatePriority,eE=c.unstable_UserBlockingPriority,eT=c.unstable_NormalPriority,eA=c.unstable_LowPriority,eM=c.unstable_IdlePriority,eR={},eL=void 0!==ew?ew:function(){},eI=null,eD=null,eG=!1,eN=eC(),eO=1e4>eN?eC:function(){return eC()-eN};function ez(){switch(ek()){case eP:return 99;case eE:return 98;case eT:return 97;case eA:return 96;case eM:return 95;default:throw Error(d(332))}}function eF(t){switch(t){case 99:return eP;case 98:return eE;case 97:return eT;case 96:return eA;case 95:return eM;default:throw Error(d(332))}}function eB(t,e){return eb(t=eF(t),e)}function eH(t,e,n){return e_(t=eF(t),e,n)}function eW(){if(null!==eD){var t=eD;eD=null,ex(t)}eU()}function eU(){if(!eG&&null!==eI){eG=!0;var t=0;try{var e=eI;eB(99,function(){for(;t<e.length;t++){var n=e[t];do n=n(!0);while(null!==n)}}),eI=null}catch(e){throw null!==eI&&(eI=eI.slice(t+1)),e_(eP,eW),e}finally{eG=!1}}}var ej=f.ReactCurrentBatchConfig,eY="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},eX=Object.prototype.hasOwnProperty;function eq(t,e){if(eY(t,e))return!0;
vendor: 4,192 bytes, line 1
1if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!eX.call(e,n[r])||!eY(t[n[r]],e[n[r]]))return!1;return!0}function eQ(t,e){if(t&&t.defaultProps)for(var n in e=h({},e),t=t.defaultProps)void 0===e[n]&&(e[n]=t[n]);return e}var eV=t2(null),eK=null,e$=null,eJ=null;function eZ(){eJ=e$=eK=null}function e0(t,e){t=t.type._context,tt?(t3(eV,t._currentValue),t._currentValue=e):(t3(eV,t._currentValue2),t._currentValue2=e)}function e1(t){var e=eV.current;t5(eV),t=t.type._context,tt?t._currentValue=e:t._currentValue2=e}function e2(t,e){for(;null!==t;){var n=t.alternate;if((t.childLanes&e)===e){if(null===n||(n.childLanes&e)===e)break;n.childLanes|=e}else t.childLanes|=e,null!==n&&(n.childLanes|=e);t=t.return}}function e5(t,e){eK=t,eJ=e$=null,null!==(t=t.dependencies)&&null!==t.firstContext&&(0!=(t.lanes&e)&&(rg=!0),t.firstContext=null)}function e3(t,e){if(eJ!==t&&!1!==e&&0!==e){if(("number"!=typeof e||1073741823===e)&&(eJ=t,e=1073741823),e={context:t,observedBits:e,next:null},null===e$){if(null===eK)throw Error(d(308));e$=e,eK.dependencies={lanes:0,firstContext:e,responders:null}}else e$=e$.next=e}return tt?t._currentValue:t._currentValue2}var e4=!1;function e6(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function e8(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function e9(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function e7(t,e){if(null!==(t=t.updateQueue)){var n=(t=t.shared).pending;null===n?e.next=e:(e.next=n.next,n.next=e),t.pending=e}}function nt(t,e){var n=t.updateQueue,r=t.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===a?i=a=s:a=a.next=s,n=n.next}while(null!==n);null===a?i=a=e:a=a.next=e}else i=a=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},t.updateQueue=n;return}null===(t=n.lastBaseUpdate)?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ne(t,e,n,r){var i=t.updateQueue;e4=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(null!==o){i.shared.pending=null;var l=o,u=l.next;l.next=null,null===s?a=u:s.next=u,s=l;var c=t.alternate;if(null!==c){var d=(c=c.updateQueue).lastBaseUpdate;d!==s&&(null===d?c.firstBaseUpdate=u:d.next=u,c.lastBaseUpdate=l)}}if(null!==a){for(d=i.baseState,s=0,c=u=l=null;;){o=a.lane;var f=a.eventTime;if((r&o)===o){null!==c&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});t:{var g=t,p=a;switch(o=e,f=n,p.tag){case 1:if("function"==typeof(g=p.payload)){d=g.call(f,d,o);break t}d=g;break t;case 3:g.flags=-4097&g.flags|64;case 0:if(null==(o="function"==typeof(g=p.payload)?g.call(f,d,o):g))break t;d=h({},d,o);break t;case 2:e4=!0}}null!==a.callback&&(t.flags|=32,null===(o=i.effects)?i.effects=[a]:o.push(a))}else f={eventTime:f,lane:o,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===c?(u=c=f,l=d):c=c.next=f,s|=o;if(null===(a=a.next)){if(null===(o=i.shared.pending))break;a=o.next,o.next=null,i.lastBaseUpdate=o,i.shared.pending=null}}null===c&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,im|=s,t.lanes=s,t.memoizedState=d}}function nn(t,e,n){if(t=e.effects,e.effects=null,null!==t)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(d(191,i));i.call(r)}}}var nr=(new u.Component).refs;function ni(t,e,n,r){n=null==(n=n(r,e=t.memoizedState))?e:h({},e,n),t.memoizedState=n,0===t.lanes&&(t.updateQueue.baseState=n)}var na={isMounted:function(t){return!!(t=t._reactInternals)&&D(t)===t},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=iB(),i=iH(t),a=e9(r,i);a.payload=e,null!=n&&(a.callback=n),e7(t,a),iW(t,i,r)},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=iB(),i=iH(t),a=e9(r,i);
vendor: 4,592 bytes, line 1
1a.tag=1,a.payload=e,null!=n&&(a.callback=n),e7(t,a),iW(t,i,r)},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=iB(),r=iH(t),i=e9(n,r);i.tag=2,null!=e&&(i.callback=e),e7(t,i),iW(t,r,n)}};function ns(t,e,n,r,i,a,s){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(r,a,s):!e.prototype||!e.prototype.isPureReactComponent||!eq(n,r)||!eq(i,a)}function no(t,e,n){var r=!1,i=t4,a=e.contextType;return"object"==typeof a&&null!==a?a=e3(a):(i=et(e)?t9:t6.current,a=(r=null!=(r=e.contextTypes))?t7(t,i):t4),e=new e(n,a),t.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,e.updater=na,t.stateNode=e,e._reactInternals=t,r&&((t=t.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=a),e}function nl(t,e,n,r){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&na.enqueueReplaceState(e,e.state,null)}function nh(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs=nr,e6(t);var a=e.contextType;"object"==typeof a&&null!==a?i.context=e3(a):(a=et(e)?t9:t6.current,i.context=t7(t,a)),ne(t,n,i,r),i.state=t.memoizedState,"function"==typeof(a=e.getDerivedStateFromProps)&&(ni(t,e,a,n),i.state=t.memoizedState),"function"==typeof e.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(e=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),e!==i.state&&na.enqueueReplaceState(i,i.state,null),ne(t,n,i,r),i.state=t.memoizedState),"function"==typeof i.componentDidMount&&(t.flags|=4)}var nu=Array.isArray;function nc(t,e,n){if(null!==(t=n.ref)&&"function"!=typeof t&&"object"!=typeof t){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(d(309));var r=n.stateNode}if(!r)throw Error(d(147,t));var i=""+t;return null!==e&&null!==e.ref&&"function"==typeof e.ref&&e.ref._stringRef===i?e.ref:((e=function(t){var e=r.refs;e===nr&&(e=r.refs={}),null===t?delete e[i]:e[i]=t})._stringRef=i,e)}if("string"!=typeof t)throw Error(d(284));if(!n._owner)throw Error(d(290,t))}return t}function nd(t,e){if("textarea"!==t.type)throw Error(d(31,"[object Object]"===Object.prototype.toString.call(e)?"object with keys {"+Object.keys(e).join(", ")+"}":e))}function nf(t){function e(e,n){if(t){var r=e.lastEffect;null!==r?(r.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!t)return null;for(;null!==r;)e(n,r),r=r.sibling;return null}function r(t,e){for(t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(t,e){return(t=ad(t,e)).index=0,t.sibling=null,t}function a(e,n,r){return(e.index=r,t)?null!==(r=e.alternate)?(r=r.index)<n?(e.flags=2,n):r:(e.flags=2,n):n}function s(e){return t&&null===e.alternate&&(e.flags=2),e}function o(t,e,n,r){return null===e||6!==e.tag?(e=am(n,t.mode,r)).return=t:(e=i(e,n)).return=t,e}function l(t,e,n,r){return null!==e&&e.elementType===n.type?(r=i(e,n.props)).ref=nc(t,e,n):(r=af(n.type,n.key,n.props,null,t.mode,r)).ref=nc(t,e,n),r.return=t,r}function h(t,e,n,r){return null===e||4!==e.tag||e.stateNode.containerInfo!==n.containerInfo||e.stateNode.implementation!==n.implementation?(e=av(n,t.mode,r)).return=t:(e=i(e,n.children||[])).return=t,e}function u(t,e,n,r,a){return null===e||7!==e.tag?(e=ag(n,t.mode,r,a)).return=t:(e=i(e,n)).return=t,e}function c(t,e,n){if("string"==typeof e||"number"==typeof e)return(e=am(""+e,t.mode,n)).return=t,e;if("object"==typeof e&&null!==e){switch(e.$$typeof){case g:return(n=af(e.type,e.key,e.props,null,t.mode,n)).ref=nc(t,null,e),n.return=t,n;case p:return(e=av(e,t.mode,n)).return=t,e}if(nu(e)||L(e))return(e=ag(e,t.mode,n,null)).return=t,e;nd(t,e)}return null}function f(t,e,n,r){var i=null!==e?e.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:o(t,e,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case g:return n.key===i?n.type===m?u(t,e,n.props.children,r,i):l(t,e,n,r):null;case p:return n.key===i?h(t,e,n,r):null}if(nu(n)||L(n))return null!==i?null:u(t,e,n,r,null);nd(t,n)}return null}function v(t,e,n,r,i){if("string"==typeof r||"number"==typeof r)return o(e,t=t.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case g:return t=t.get(null===r.key?n:r.key)||null,r.type===m?u(e,t,r.props.children,i,r.key):l(e,t,r,i
vendor: 5,122 bytes, line 1
1);case p:return h(e,t=t.get(null===r.key?n:r.key)||null,r,i)}if(nu(r)||L(r))return u(e,t=t.get(n)||null,r,i,null);nd(e,r)}return null}return function(o,l,h,u){var y="object"==typeof h&&null!==h&&h.type===m&&null===h.key;y&&(h=h.props.children);var b="object"==typeof h&&null!==h;if(b)switch(h.$$typeof){case g:t:{for(b=h.key,y=l;null!==y;){if(y.key===b){if(7===y.tag){if(h.type===m){n(o,y.sibling),(l=i(y,h.props.children)).return=o,o=l;break t}}else if(y.elementType===h.type){n(o,y.sibling),(l=i(y,h.props)).ref=nc(o,y,h),l.return=o,o=l;break t}n(o,y);break}e(o,y),y=y.sibling}h.type===m?((l=ag(h.props.children,o.mode,u,h.key)).return=o,o=l):((u=af(h.type,h.key,h.props,null,o.mode,u)).ref=nc(o,l,h),u.return=o,o=u)}return s(o);case p:t:{for(y=h.key;null!==l;){if(l.key===y){if(4===l.tag&&l.stateNode.containerInfo===h.containerInfo&&l.stateNode.implementation===h.implementation){n(o,l.sibling),(l=i(l,h.children||[])).return=o,o=l;break t}n(o,l);break}e(o,l),l=l.sibling}(l=av(h,o.mode,u)).return=o,o=l}return s(o)}if("string"==typeof h||"number"==typeof h)return h=""+h,null!==l&&6===l.tag?(n(o,l.sibling),(l=i(l,h)).return=o):(n(o,l),(l=am(h,o.mode,u)).return=o),s(o=l);if(nu(h))return function(i,s,o,l){for(var h=null,u=null,d=s,g=s=0,p=null;null!==d&&g<o.length;g++){d.index>g?(p=d,d=null):p=d.sibling;var m=f(i,d,o[g],l);if(null===m){null===d&&(d=p);break}t&&d&&null===m.alternate&&e(i,d),s=a(m,s,g),null===u?h=m:u.sibling=m,u=m,d=p}if(g===o.length)return n(i,d),h;if(null===d){for(;g<o.length;g++)null!==(d=c(i,o[g],l))&&(s=a(d,s,g),null===u?h=d:u.sibling=d,u=d);return h}for(d=r(i,d);g<o.length;g++)null!==(p=v(d,i,g,o[g],l))&&(t&&null!==p.alternate&&d.delete(null===p.key?g:p.key),s=a(p,s,g),null===u?h=p:u.sibling=p,u=p);return t&&d.forEach(function(t){return e(i,t)}),h}(o,l,h,u);if(L(h))return function(i,s,o,l){var h=L(o);if("function"!=typeof h)throw Error(d(150));if(null==(o=h.call(o)))throw Error(d(151));for(var u=h=null,g=s,p=s=0,m=null,y=o.next();null!==g&&!y.done;p++,y=o.next()){g.index>p?(m=g,g=null):m=g.sibling;var b=f(i,g,y.value,l);if(null===b){null===g&&(g=m);break}t&&g&&null===b.alternate&&e(i,g),s=a(b,s,p),null===u?h=b:u.sibling=b,u=b,g=m}if(y.done)return n(i,g),h;if(null===g){for(;!y.done;p++,y=o.next())null!==(y=c(i,y.value,l))&&(s=a(y,s,p),null===u?h=y:u.sibling=y,u=y);return h}for(g=r(i,g);!y.done;p++,y=o.next())null!==(y=v(g,i,p,y.value,l))&&(t&&null!==y.alternate&&g.delete(null===y.key?p:y.key),s=a(y,s,p),null===u?h=y:u.sibling=y,u=y);return t&&g.forEach(function(t){return e(i,t)}),h}(o,l,h,u);if(b&&nd(o,h),void 0===h&&!y)switch(o.tag){case 1:case 22:case 0:case 11:case 15:throw Error(d(152,I(o.type)||"Component"))}return n(o,l)}}var ng=nf(!0),np=nf(!1),nm={},nv=t2(nm),ny=t2(nm),nb=t2(nm);function n_(t){if(t===nm)throw Error(d(174));return t}function nx(t,e){t3(nb,e),t3(ny,t),t3(nv,nm),t=H(e),t5(nv),t3(nv,t)}function nS(){t5(nv),t5(ny),t5(nb)}function nw(t){var e=n_(nb.current),n=n_(nv.current);e=W(n,t.type,e),n!==e&&(t3(ny,t),t3(nv,e))}function nC(t){ny.current===t&&(t5(nv),t5(ny))}var nk=t2(0);function nP(t){for(var e=t;null!==e;){if(13===e.tag){var n=e.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||tW(n)||tU(n)))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(64&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var nE=null,nT=null,nA=!1;function nM(t,e){var n=au(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=e,n.return=t,n.flags=8,null!==t.lastEffect?(t.lastEffect.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n}function nR(t,e){switch(t.tag){case 5:return null!==(e=tB(e,t.type,t.pendingProps))&&(t.stateNode=e,!0);case 6:return null!==(e=tH(e,t.pendingProps))&&(t.stateNode=e,!0);default:return!1}}function nL(t){if(nA){var e=nT;if(e){var n=e;if(!nR(t,e)){if(!(e=tj(n))||!nR(t,e)){t.flags=-1025&t.flags|2,nA=!1,nE=t;return}nM(nE,n)}nE=t,nT=tY(e)}else t.flags=-1025&t.flags|2,nA=!1,nE=t}}function nI(t){for(t=t.return;null!==t&&5!==t.tag&&3!==t.tag&&13!==t.tag;)t=t.return;nE=t}function nD(t){if(!tr||t!==nE)return!1;if(!nA)return nI(t),nA=!0,!1;var e=t.type;if(5!==t.tag||"head"!==e&&"body"!==e&&!V(e,t.memoizedProps))for(e=nT;e;)nM(t,e),e=tj(e);if(nI(t),13===t.tag){if(!tr)throw Error(d(316));if(!(t=null!==(t=t.memoizedState)?t.dehydrated:null))throw Error(d(317));nT=tQ(t)}else nT=nE?tj(t.stateNode):null;return!0}function nG(){tr&&(nT=nE=null,nA=!1)}var nN=[];function nO(){for(var t=0;t<nN.length;t++){var e=nN[t];tt?e._workInProgressVersionPrimary=null:e._workInProgressVersionSecondary=null}nN.length=0}var nz=f.ReactCurrentDispatcher,nF=f.ReactCurrentBatchConfig,nB=0,nH=null,nW=null,nU=null,nj=!1,nY=!1;function nX(){throw Error(d(321))}function nq(t,e){if(null===e)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!eY(t[n],e[n]))return!1;return!0}function nQ(t,e,n,r,i,a){if(nB=a,nH=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,nz.current=null===t||null===t.memoizedState?ru:rc,t=n(r,i),nY){a=0;
vendor: 15,845 bytes, line 1
1do{if(nY=!1,!(25>a))throw Error(d(301));a+=1,nU=nW=null,e.updateQueue=null,nz.current=rd,t=n(r,i)}while(nY)}if(nz.current=rh,e=null!==nW&&null!==nW.next,nB=0,nU=nW=nH=null,nj=!1,e)throw Error(d(300));return t}function nV(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===nU?nH.memoizedState=nU=t:nU=nU.next=t,nU}function nK(){if(null===nW){var t=nH.alternate;t=null!==t?t.memoizedState:null}else t=nW.next;var e=null===nU?nH.memoizedState:nU.next;if(null!==e)nU=e,nW=t;else{if(null===t)throw Error(d(310));t={memoizedState:(nW=t).memoizedState,baseState:nW.baseState,baseQueue:nW.baseQueue,queue:nW.queue,next:null},null===nU?nH.memoizedState=nU=t:nU=nU.next=t}return nU}function n$(t,e){return"function"==typeof e?e(t):e}function nJ(t){var e=nK(),n=e.queue;if(null===n)throw Error(d(311));n.lastRenderedReducer=t;var r=nW,i=r.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}r.baseQueue=i=a,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var o=s=a=null,l=i;do{var h=l.lane;if((nB&h)===h)null!==o&&(o=o.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===t?l.eagerState:t(r,l.action);else{var u={lane:h,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===o?(s=o=u,a=r):o=o.next=u,nH.lanes|=h,im|=h}l=l.next}while(null!==l&&l!==i);null===o?a=r:o.next=s,eY(r,e.memoizedState)||(rg=!0),e.memoizedState=r,e.baseState=a,e.baseQueue=o,n.lastRenderedState=r}return[e.memoizedState,n.dispatch]}function nZ(t){var e=nK(),n=e.queue;if(null===n)throw Error(d(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,a=e.memoizedState;if(null!==i){n.pending=null;var s=i=i.next;do a=t(a,s.action),s=s.next;while(s!==i);eY(a,e.memoizedState)||(rg=!0),e.memoizedState=a,null===e.baseQueue&&(e.baseState=a),n.lastRenderedState=a}return[a,r]}function n0(t,e,n){var r=e._getVersion;r=r(e._source);var i=tt?e._workInProgressVersionPrimary:e._workInProgressVersionSecondary;if(null!==i?t=i===r:(t=t.mutableReadLanes,(t=(nB&t)===t)&&(tt?e._workInProgressVersionPrimary=r:e._workInProgressVersionSecondary=r,nN.push(e))),t)return n(e._source);throw nN.push(e),Error(d(350))}function n1(t,e,n,r){var i=io;if(null===i)throw Error(d(349));var a=e._getVersion,s=a(e._source),o=nz.current,l=o.useState(function(){return n0(i,e,n)}),h=l[1],u=l[0];l=nU;var c=t.memoizedState,f=c.refs,g=f.getSnapshot,p=c.source;c=c.subscribe;var m=nH;return t.memoizedState={refs:f,source:e,subscribe:r},o.useEffect(function(){f.getSnapshot=n,f.setSnapshot=h;var t=a(e._source);if(!eY(s,t)){t=n(e._source),eY(u,t)||(h(t),t=iH(m),i.mutableReadLanes|=t&i.pendingLanes),t=i.mutableReadLanes,i.entangledLanes|=t;for(var r=i.entanglements,o=t;0<o;){var l=31-em(o),c=1<<l;r[l]|=t,o&=~c}}},[n,e,r]),o.useEffect(function(){return r(e._source,function(){var t=f.getSnapshot,n=f.setSnapshot;try{n(t(e._source));var r=iH(m);i.mutableReadLanes|=r&i.pendingLanes}catch(t){n(function(){throw t})}})},[e,r]),eY(g,n)&&eY(p,e)&&eY(c,r)||((t={pending:null,dispatch:null,lastRenderedReducer:n$,lastRenderedState:u}).dispatch=h=rl.bind(null,nH,t),l.queue=t,l.baseQueue=null,u=n0(i,e,n),l.memoizedState=l.baseState=u),u}function n2(t,e,n){return n1(nK(),t,e,n)}function n5(t){var e=nV();return"function"==typeof t&&(t=t()),e.memoizedState=e.baseState=t,t=(t=e.queue={pending:null,dispatch:null,lastRenderedReducer:n$,lastRenderedState:t}).dispatch=rl.bind(null,nH,t),[e.memoizedState,t]}function n3(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},null===(e=nH.updateQueue)?(e={lastEffect:null},nH.updateQueue=e,e.lastEffect=t.next=t):null===(n=e.lastEffect)?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t),t}function n4(t){return t={current:t},nV().memoizedState=t}function n6(){return nK().memoizedState}function n8(t,e,n,r){var i=nV();nH.flags|=t,i.memoizedState=n3(1|e,n,void 0,void 0===r?null:r)}function n9(t,e,n,r){var i=nK();r=void 0===r?null:r;var a=void 0;if(null!==nW){var s=nW.memoizedState;if(a=s.destroy,null!==r&&nq(r,s.deps)){n3(e,n,a,r);return}}nH.flags|=t,i.memoizedState=n3(1|e,n,a,r)}function n7(t,e){return n8(516,4,t,e)}function rt(t,e){return n9(516,4,t,e)}function re(t,e){return n9(4,2,t,e)}function rn(t,e){return"function"==typeof e?(e(t=t()),function(){e(null)}):null!=e?(t=t(),e.current=t,function(){e.current=null}):void 0}function rr(t,e,n){return n=null!=n?n.concat([t]):null,n9(4,2,rn.bind(null,e,t),n)}function ri(){}function ra(t,e){var n=nK();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&nq(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function rs(t,e){var n=nK();e=void 0===e?null:e;var r=n.memoizedState;return null!==r&&null!==e&&nq(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function ro(t,e){var n=ez();eB(98>n?98:n,function(){t(!0)}),eB(97<n?97:n,function(){var n=nF.transition;nF.transition=1;try{t(!1),e()}finally{nF.transition=n}})}function rl(t,e,n){var r=iB(),i=iH(t),a={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},s=e.pending;if(null===s?a.next=a:(a.next=s.next,s.next=a),e.pending=a,s=t.alternate,t===nH||null!==s&&s===nH)nY=nj=!0;else{if(0===t.lanes&&(null===s||0===s.lanes)&&null!==(s=e.lastRenderedReducer))try{var o=e.lastRenderedState,l=s(o,n);if(a.eagerReducer=s,a.eagerState=l,eY(l,o))return}catch(t){}finally{}iW(t,i,r)}}var rh={readContext:e3,useCallback:nX,useContext:nX,useEffect:nX,useImperativeHandle:nX,useLayoutEffect:nX,useMemo:nX,useReducer:nX,useRef:nX,useState:nX,useDebugValue:nX,useDeferredValue:nX,useTransition:nX,useMutableSource:nX,useOpaqueIdentifier:nX,unstable_isNewReconciler:!1},ru={readContext:e3,useCallback:function(t,e){return nV().memoizedState=[t,void 0===e?null:e],t},useContext:e3,useEffect:n7,useImperativeHandle:function(t,e,n){return n=null!=n?n.concat([t]):null,n8(4,2,rn.bind(null,e,t),n)},useLayoutEffect:function(t,e){return n8(4,2,t,e)},useMemo:function(t,e){var n=nV();return e=void 0===e?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=nV();return e=void 0!==n?n(e):e,r.memoizedState=r.baseState=e,t=(t=r.queue={pending:null,dispatch:null,lastRenderedReducer:t,lastRenderedState:e}).dispatch=rl.bind(null,nH,t),[r.memoizedState,t]},useRef:n4,useState:n5,useDebugValue:ri,useDeferredValue:function(t){var e=n5(t),n=e[0],r=e[1];return n7(function(){var e=nF.transition;nF.transition=1;try{r(t)}finally{nF.transition=e}},[t]),n},useTransition:function(){var t=n5(!1),e=t[0];return n4(t=ro.bind(null,t[1])),[t,e]},useMutableSource:function(t,e,n){var r=nV();return r.memoizedState={refs:{getSnapshot:e,setSnapshot:null},source:t,subscribe:n},n1(r,t,e,n)},useOpaqueIdentifier:function(){if(nA){var t=!1,e=ta(function(){throw t||(t=!0,n(ts())),Error(d(355))}),n=n5(e)[1];return 0==(2&nH.mode)&&(nH.flags|=516,n3(5,function(){n(ts())},void 0,null)),e}return n5(e=ts()),e},unstable_isNewReconciler:!1},rc={readContext:e3,useCallback:ra,useContext:e3,useEffect:rt,useImperativeHandle:rr,useLayoutEffect:re,useMemo:rs,useReducer:nJ,useRef:n6,useState:function(){return nJ(n$)},useDebugValue:ri,useDeferredValue:function(t){var e=nJ(n$),n=e[0],r=e[1];return rt(function(){var e=nF.transition;nF.transition=1;try{r(t)}finally{nF.transition=e}},[t]),n},useTransition:function(){var t=nJ(n$)[0];return[n6().current,t]},useMutableSource:n2,useOpaqueIdentifier:function(){return nJ(n$)[0]},unstable_isNewReconciler:!1},rd={readContext:e3,useCallback:ra,useContext:e3,useEffect:rt,useImperativeHandle:rr,useLayoutEffect:re,useMemo:rs,useReducer:nZ,useRef:n6,useState:function(){return nZ(n$)},useDebugValue:ri,useDeferredValue:function(t){var e=nZ(n$),n=e[0],r=e[1];return rt(function(){var e=nF.transition;nF.transition=1;try{r(t)}finally{nF.transition=e}},[t]),n},useTransition:function(){var t=nZ(n$)[0];return[n6().current,t]},useMutableSource:n2,useOpaqueIdentifier:function(){return nZ(n$)[0]},unstable_isNewReconciler:!1},rf=f.ReactCurrentOwner,rg=!1;function rp(t,e,n,r){e.child=null===t?np(e,null,n,r):ng(e,t.child,n,r)}function rm(t,e,n,r,i){n=n.render;var a=e.ref;return(e5(e,i),r=nQ(t,e,n,r,a,i),null===t||rg)?(e.flags|=1,rp(t,e,r,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,rR(t,e,i))}function rv(t,e,n,r,i,a){if(null===t){var s=n.type;return"function"!=typeof s||ac(s)||void 0!==s.defaultProps||null!==n.compare||void 0!==n.defaultProps?((t=af(n.type,null,r,e,e.mode,a)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=s,ry(t,e,s,r,i,a))}return(s=t.child,0==(i&a)&&(i=s.memoizedProps,(n=null!==(n=n.compare)?n:eq)(i,r)&&t.ref===e.ref))?rR(t,e,a):(e.flags|=1,(t=ad(s,r)).ref=e.ref,t.return=e,e.child=t)}function ry(t,e,n,r,i,a){if(null!==t&&eq(t.memoizedProps,r)&&t.ref===e.ref){if(rg=!1,0==(a&i))return e.lanes=t.lanes,rR(t,e,a);0!=(16384&t.flags)&&(rg=!0)}return rx(t,e,n,r,a)}function rb(t,e,n){var r=e.pendingProps,i=r.children,a=null!==t?t.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode){if(0==(4&e.mode))e.memoizedState={baseLanes:0},iK(e,n);else{if(0==(1073741824&n))return t=null!==a?a.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t},iK(e,t),null;e.memoizedState={baseLanes:0},iK(e,null!==a?a.baseLanes:n)}}else null!==a?(r=a.baseLanes|n,e.memoizedState=null):r=n,iK(e,r);return rp(t,e,i,n),e.child}function r_(t,e){var n=e.ref;(null===t&&null!==n||null!==t&&t.ref!==n)&&(e.flags|=128)}function rx(t,e,n,r,i){var a=et(n)?t9:t6.current;return(a=t7(e,a),e5(e,i),n=nQ(t,e,n,r,a,i),null===t||rg)?(e.flags|=1,rp(t,e,n,i),e.child):(e.updateQueue=t.updateQueue,e.flags&=-517,t.lanes&=~i,rR(t,e,i))}function rS(t,e,n,r,i){if(et(n)){var a=!0;ei(e)}else a=!1;if(e5(e,i),null===e.stateNode)null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),no(e,n,r),nh(e,n,r,i),r=!0;else if(null===t){var s=e.stateNode,o=e.memoizedProps;s.props=o;var l=s.context,h=n.contextType;h="object"==typeof h&&null!==h?e3(h):t7(e,h=et(n)?t9:t6.current);var u=n.getDerivedStateFromProps,c="function"==typeof u||"function"==typeof s.getSnapshotBeforeUpdate;c||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(o!==r||l!==h)&&nl(e,s,r,h),e4=!1;var d=e.memoizedState;s.state=d,ne(e,r,s,i),l=e.memoizedState,o!==r||d!==l||t8.current||e4?("function"==typeof u&&(ni(e,n,u,r),l=e.memoizedState),(o=e4||ns(e,n,o,r,d,l,h))?(c||"function"!=typeof s.UNSAFE_componentWillMount&&"function"!=typeof s.componentWillMount||("function"==typeof s.componentWillMount&&s.componentWillMount(),"function"==typeof s.UNSAFE_componentWillMount&&s.UNSAFE_componentWillMount()),"function"==typeof s.componentDidMount&&(e.flags|=4)):("function"==typeof s.componentDidMount&&(e.flags|=4),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=h,r=o):("function"==typeof s.componentDidMount&&(e.flags|=4),r=!1)}else{s=e.stateNode,e8(t,e),o=e.memoizedProps,h=e.type===e.elementType?o:eQ(e.type,o),s.props=h,c=e.pendingProps,d=s.context,l="object"==typeof(l=n.contextType)&&null!==l?e3(l):t7(e,l=et(n)?t9:t6.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof s.getSnapshotBeforeUpdate)||"function"!=typeof s.UNSAFE_componentWillReceiveProps&&"function"!=typeof s.componentWillReceiveProps||(o!==c||d!==l)&&nl(e,s,r,l),e4=!1,d=e.memoizedState,s.state=d,ne(e,r,s,i);var g=e.memoizedState;o!==c||d!==g||t8.current||e4?("function"==typeof f&&(ni(e,n,f,r),g=e.memoizedState),(h=e4||ns(e,n,h,r,d,g,l))?(u||"function"!=typeof s.UNSAFE_componentWillUpdate&&"function"!=typeof s.componentWillUpdate||("function"==typeof s.componentWillUpdate&&s.componentWillUpdate(r,g,l),"function"==typeof s.UNSAFE_componentWillUpdate&&s.UNSAFE_componentWillUpdate(r,g,l)),"function"==typeof s.componentDidUpdate&&(e.flags|=4),"function"==typeof s.getSnapshotBeforeUpdate&&(e.flags|=256)):("function"!=typeof s.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=256),e.memoizedProps=r,e.memoizedState=g),s.props=r,s.state=g,s.context=l,r=h):("function"!=typeof s.componentDidUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof s.getSnapshotBeforeUpdate||o===t.memoizedProps&&d===t.memoizedState||(e.flags|=256),r=!1)}return rw(t,e,n,r,a,i)}function rw(t,e,n,r,i,a){r_(t,e);var s=0!=(64&e.flags);if(!r&&!s)return i&&ea(e,n,!1),rR(t,e,a);r=e.stateNode,rf.current=e;var o=s&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return e.flags|=1,null!==t&&s?(e.child=ng(e,t.child,null,a),e.child=ng(e,null,o,a)):rp(t,e,o,a),e.memoizedState=r.state,i&&ea(e,n,!0),e.child}function rC(t){var e=t.stateNode;e.pendingContext?en(t,e.pendingContext,e.pendingContext!==e.context):e.context&&en(t,e.context,!1),nx(t,e.containerInfo)}var rk={dehydrated:null,retryLane:0};function rP(t,e,n){var r,i,a,s,o,l,h,u,c,d,f,g,p,m,v=e.pendingProps,y=nk.current,b=!1;return((m=0!=(64&e.flags))||(m=(null===t||null!==t.memoizedState)&&0!=(2&y)),m?(b=!0,e.flags&=-65):null!==t&&null===t.memoizedState||void 0===v.fallback||!0===v.unstable_avoidThisFallback||(y|=1),t3(nk,1&y),null===t)?(void 0!==v.fallback&&nL(e),t=v.children,y=v.fallback,b)?(t=rE(e,t,y,n),e.child.memoizedState={baseLanes:n},e.memoizedState=rk,t):"number"==typeof v.unstable_expectedLoadTime?(t=rE(e,t,y,n),e.child.memoizedState={baseLanes:n},e.memoizedState=rk,e.lanes=33554432,t):((n=ap({mode:"visible",children:t},e.mode,n,null)).return=e,e.child=n):(t.memoizedState,b?(r=t,i=e,a=v.children,s=v.fallback,o=n,l=i.mode,r=(h=r.child).sibling,u={mode:"hidden",children:a},0==(2&l)&&i.child!==h?((a=i.child).childLanes=0,a.pendingProps=u,null!==(h=a.lastEffect)?(i.firstEffect=a.firstEffect,i.lastEffect=h,h.nextEffect=null):i.firstEffect=i.lastEffect=null):a=ad(h,u),null!==r?s=ad(r,s):(s=ag(s,l,o,null),s.flags|=2),s.return=i,a.return=i,a.sibling=s,i.child=a,v=s,b=e.child,y=t.child.memoizedState,b.memoizedState=null===y?{baseLanes:n}:{baseLanes:y.baseLanes|n},b.childLanes=t.childLanes&~n,e.memoizedState=rk,v):(c=t,d=e,f=v.children,g=n,c=(p=c.child).sibling,f=ad(p,{mode:"visible",children:f}),0==(2&d.mode)&&(f.lanes=g),f.return=d,f.sibling=null,null!==c&&(c.nextEffect=null,c.flags=8,d.firstEffect=d.lastEffect=c),n=d.child=f,e.memoizedState=null,n))}function rE(t,e,n,r){var i=t.mode,a=t.child;return e={mode:"hidden",children:e},0==(2&i)&&null!==a?(a.childLanes=0,a.pendingProps=e):a=ap(e,i,0,null),n=ag(n,i,r,null),a.return=t,n.return=t,a.sibling=n,t.child=a,n}function rT(t,e){t.lanes|=e;var n=t.alternate;null!==n&&(n.lanes|=e),e2(t.return,e)}function rA(t,e,n,r,i,a){var s=t.memoizedState;null===s?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:a}:(s.isBackwards=e,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i,s.lastEffect=a)}function rM(t,e,n){var r=e.pendingProps,i=r.revealOrder,a=r.tail;if(rp(t,e,r.children,n),0!=(2&(r=nk.current)))r=1&r|2,e.flags|=64;else{if(null!==t&&0!=(64&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&rT(t,n);else if(19===t.tag)rT(t,n);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(t3(nk,r),0==(2&e.mode))e.memoizedState=null;else switch(i){case"forwards":for(i=null,n=e.child;null!==n;)null!==(t=n.alternate)&&null===nP(t)&&(i=n),n=n.sibling;null===(n=i)?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),rA(e,!1,i,n,a,e.lastEffect);break;case"backwards":for(n=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===nP(t)){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}rA(e,!0,n,null,a,e.lastEffect);break;case"together":rA(e,!1,null,null,void 0,e.lastEffect);break;default:e.memoizedState=null}return e.child}
vendor: 6,483 bytes, line 1
1function rR(t,e,n){if(null!==t&&(e.dependencies=t.dependencies),im|=e.lanes,0!=(n&e.childLanes)){if(null!==t&&e.child!==t.child)throw Error(d(153));if(null!==e.child){for(n=ad(t=e.child,t.pendingProps),e.child=n,n.return=e;null!==t.sibling;)t=t.sibling,(n=n.sibling=ad(t,t.pendingProps)).return=e;n.sibling=null}return e.child}return null}function rL(t){t.flags|=4}if(te)r=function(t,e){for(var n=e.child;null!==n;){if(5===n.tag||6===n.tag)X(t,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},i=function(){},a=function(t,e,n,r,i){(t=t.memoizedProps)!==r&&(n=Q(e.stateNode,n,t,r,i,n_(nv.current)),(e.updateQueue=n)&&rL(e))},s=function(t,e,n,r){n!==r&&rL(e)};else if(tn){r=function(t,e,n,i){for(var a=e.child;null!==a;){if(5===a.tag){var s=a.stateNode;n&&i&&(s=tz(s,a.type,a.memoizedProps,a)),X(t,s)}else if(6===a.tag)s=a.stateNode,n&&i&&(s=tF(s,a.memoizedProps,a)),X(t,s);else if(4!==a.tag){if(13===a.tag&&0!=(4&a.flags)&&(s=null!==a.memoizedState)){var o=a.child;if(null!==o&&(null!==o.child&&(o.child.return=o,r(t,o,!0,s)),null!==(s=o.sibling))){s.return=a,a=s;continue}}if(null!==a.child){a.child.return=a,a=a.child;continue}}if(a===e)break;for(;null===a.sibling;){if(null===a.return||a.return===e)return;a=a.return}a.sibling.return=a.return,a=a.sibling}};var rI=function(t,e,n,r){for(var i=e.child;null!==i;){if(5===i.tag){var a=i.stateNode;n&&r&&(a=tz(a,i.type,i.memoizedProps,i)),tG(t,a)}else if(6===i.tag)a=i.stateNode,n&&r&&(a=tF(a,i.memoizedProps,i)),tG(t,a);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(a=null!==i.memoizedState)){var s=i.child;if(null!==s&&(null!==s.child&&(s.child.return=s,rI(t,s,!0,a)),null!==(a=s.sibling))){a.return=i,i=a;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};i=function(t){var e=t.stateNode;if(null!==t.firstEffect){var n=e.containerInfo,r=tD(n);rI(r,t,!1,!1),e.pendingChildren=r,rL(t),tN(n,r)}},a=function(t,e,n,i,a){var s=t.stateNode,o=t.memoizedProps;if((t=null===e.firstEffect)&&o===i)e.stateNode=s;else{var l=e.stateNode,h=n_(nv.current),u=null;o!==i&&(u=Q(l,n,o,i,a,h)),t&&null===u?e.stateNode=s:(q(s=tI(s,u,n,o,i,e,t,l),n,i,a,h)&&rL(e),e.stateNode=s,t?rL(e):r(s,e,!1,!1))}},s=function(t,e,n,r){n!==r?(t=n_(nb.current),n=n_(nv.current),e.stateNode=K(r,t,n,e),rL(e)):e.stateNode=t.stateNode}}else i=function(){},a=function(){},s=function(){};function rD(t,e){if(!nA)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;null!==e;)null!==e.alternate&&(n=e),e=e.sibling;null===n?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?e||null===t.tail?t.tail=null:t.tail.sibling=null:r.sibling=null}}function rG(t,e){try{var n="",r=e;do n+=function(t){switch(t.tag){case 5:return t$(t.type);case 16:return t$("Lazy");case 13:return t$("Suspense");case 19:return t$("SuspenseList");case 0:case 2:case 15:return t=tZ(t.type,!1);case 11:return t=tZ(t.type.render,!1);case 22:return t=tZ(t.type._render,!1);case 1:return t=tZ(t.type,!0);default:return""}}(r),r=r.return;while(r);var i=n}catch(t){i="\nError generating stack: "+t.message+"\n"+t.stack}return{value:t,source:e,stack:i}}function rN(t,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var rO="function"==typeof WeakMap?WeakMap:Map;function rz(t,e,n){(n=e9(-1,n)).tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){iC||(iC=!0,ik=r),rN(t,e)},n}function rF(t,e,n){(n=e9(-1,n)).tag=3;var r=t.type.getDerivedStateFromError;if("function"==typeof r){var i=e.value;n.payload=function(){return rN(t,e),r(i)}}var a=t.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===iP?iP=new Set([this]):iP.add(this),rN(t,e));var n=e.stack;this.componentDidCatch(e.value,{componentStack:null!==n?n:""})}),n}var rB="function"==typeof WeakSet?WeakSet:Set;function rH(t){var e=t.ref;if(null!==e){if("function"==typeof e)try{e(null)}catch(e){at(t,e)}else e.current=null}}function rW(t,e){if(null!==(e=null!==(e=e.updateQueue)?e.lastEffect:null)){var n=e=e.next;do{if((n.tag&t)===t){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==e)}}function rU(t,e){if(te)for(var n=t;;){if(5===n.tag){var r=n.stateNode;e?tT(r):tM(n.stateNode,n.memoizedProps)}else if(6===n.tag)r=n.stateNode,e?tA(r):tR(r,n.memoizedProps);else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===t)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function rj(t,e){if(eo&&"function"==typeof eo.onCommitFiberUnmount)try{eo.onCommitFiberUnmount(es,e)}catch(t){}switch(e.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(t=e.updateQueue)&&null!==(t=t.lastEffect)){var n=t=t.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i){if(0!=(4&r))i8(e,n);else{r=e;try{i()}catch(t){at(r,t)}}}n=n.next}while(n!==t)}break;case 1:if(rH(e),"function"==typeof(t=e.stateNode).componentWillUnmount)try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(t){at(e,t)}break;case 5:rH(e);break;case 4:te?rV(t,e):tn&&tn&&(t=tD(e=e.stateNode.containerInfo),tO(e,t))}}function rY(t,e){for(var n=e;;)if(rj(t,n),null===n.child||te&&4===n.tag){if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else n.child.return=n,n=n.child}function rX(t){t.alternate=null,t.child=null,t.dependencies=null,t.firstEffect=null,t.lastEffect=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.return=null,t.updateQueue=null}function rq(t){return 5===t.tag||3===t.tag||4===t.tag}function rQ(t){if(te){t:{for(var e=t.return;null!==e;){if(rq(e))break t;e=e.return}throw Error(d(160))}var n=e;switch(e=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:e=e.containerInfo,r=!0;break;default:throw Error(d(161))}16&n.flags&&(tE(e),n.flags&=-17);t:e:for(n=t;;){for(;null===n.sibling;){if(null===n.return||rq(n.return)){n=null;break t}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags||null===n.child||4===n.tag)continue e;n.child.return=n,n=n.child}
1if(!(2&n.flags)){n=n.stateNode;break t}}r?function t(e,n,r){var i=e.tag,a=5===i||6===i;if(a)e=a?e.stateNode:e.stateNode.instance,n?tC(r,e,n):tb(r,e);else if(4!==i&&null!==(e=e.child))for(t(e,n,r),e=e.sibling;null!==e;)t(e,n,r),e=e.sibling}(t,n,e):function t(e,n,r){var i=e.tag,a=5===i||6===i;if(a)e=a?e.stateNode:e.stateNode.instance,n?tw(r,e,n):ty(r,e);else if(4!==i&&null!==(e=e.child))for(t(e,n,r),e=e.sibling;null!==e;)t(e,n,r),e=e.sibling}(t,n,e)}}function rV(t,e){for(var n,r,i=e,a=!1;;){if(!a){a=i.return;t:for(;;){if(null===a)throw Error(d(160));switch(n=a.stateNode,a.tag){case 5:r=!1;break t;case 3:case 4:n=n.containerInfo,r=!0;break t}a=a.return}a=!0}if(5===i.tag||6===i.tag)rY(t,i),r?tP(n,i.stateNode):tk(n,i.stateNode);else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(rj(t,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===e)break;for(;null===i.sibling;){if(null===i.return||i.return===e)return;4===(i=i.return).tag&&(a=!1)}i.sibling.return=i.return,i=i.sibling}}function rK(t,e){if(te){switch(e.tag){case 0:case 11:case 14:case 15:case 22:rW(3,e);return;case 1:case 12:case 17:return;case 5:var n=e.stateNode;if(null!=n){var r=e.memoizedProps;t=null!==t?t.memoizedProps:r;var i=e.type,a=e.updateQueue;e.updateQueue=null,null!==a&&tS(n,a,i,t,r,e)}return;case 6:if(null===e.stateNode)throw Error(d(162));n=e.memoizedProps,t_(e.stateNode,null!==t?t.memoizedProps:n,n);return;case 3:tr&&(e=e.stateNode).hydrate&&(e.hydrate=!1,tV(e.containerInfo));return;case 13:r$(e),rJ(e);return;case 19:rJ(e);return;case 23:case 24:rU(e,null!==e.memoizedState);return}throw Error(d(163))}switch(e.tag){case 0:case 11:case 14:case 15:case 22:rW(3,e);return;case 12:case 23:case 24:return;case 13:r$(e),rJ(e);return;case 19:rJ(e);return;case 3:tr&&(n=e.stateNode).hydrate&&(n.hydrate=!1,tV(n.containerInfo))}t:if(tn){switch(e.tag){case 1:case 5:case 6:case 20:break t;case 3:case 4:tO((e=e.stateNode).containerInfo,e.pendingChildren);break t}throw Error(d(163))}}function r$(t){null!==t.memoizedState&&(i_=eO(),te&&rU(t.child,!0))}function rJ(t){var e=t.updateQueue;if(null!==e){t.updateQueue=null;var n=t.stateNode;null===n&&(n=t.stateNode=new rB),e.forEach(function(e){var r=an.bind(null,t,e);n.has(e)||(n.add(e),e.then(r,r))})}}var rZ=0,r0=1,r1=2,r2=3,r5=4;if("function"==typeof Symbol&&Symbol.for){var r3=Symbol.for;rZ=r3("selector.component"),r0=r3("selector.has_pseudo_class"),r1=r3("selector.role"),r2=r3("selector.test_id"),r5=r3("selector.text")}function r4(t){var e=ti(t);if(null!=e){if("string"!=typeof e.memoizedProps["data-testname"])throw Error(d(364));return e}if(null===(t=tc(t)))throw Error(d(362));return t.stateNode.current}function r6(t,e){switch(e.$$typeof){case rZ:if(t.type===e.value)return!0;break;case r0:t:{e=e.value,t=[t,0];for(var n=0;n<t.length;){var r=t[n++],i=t[n++],a=e[i];if(5!==r.tag||!tg(r)){for(;null!=a&&r6(r,a);)a=e[++i];if(i===e.length){e=!0;break t}for(r=r.child;null!==r;)t.push(r,i),r=r.sibling}}e=!1}return e;case r1:if(5===t.tag&&tp(t.stateNode,e.value))return!0;break;case r5:if((5===t.tag||6===t.tag)&&null!==(t=tf(t))&&0<=t.indexOf(e.value))return!0;break;case r2:if(5===t.tag&&"string"==typeof(t=t.memoizedProps["data-testname"])&&t.toLowerCase()===e.value.toLowerCase())return!0;break;default:throw Error(d(365,e))}return!1}function r8(t){switch(t.$$typeof){case rZ:return"<"+(I(t.value)||"Unknown")+">";case r0:return":has("+(r8(t)||"")+")";case r1:return'[role="'+t.value+'"]';case r5:return'"'+t.value+'"';case r2:return'[data-testname="'+t.value+'"]';default:throw Error(d(365,t))}}function r9(t,e){var n=[];t=[t,0];for(var r=0;r<t.length;){var i=t[r++],a=t[r++],s=e[a];if(5!==i.tag||!tg(i)){for(;null!=s&&r6(i,s);)s=e[++a];if(a===e.length)n.push(i);else for(i=i.child;null!==i;)t.push(i,a),i=i.sibling}}return n}function r7(t,e){if(!tu)throw Error(d(363));t=r9(t=r4(t),e),e=[],t=Array.from(t);for(var n=0;n<t.length;){var r=t[n++];if(5===r.tag)tg(r)||e.push(r.stateNode);else for(r=r.child;null!==r;)t.push(r),r=r.sibling}return e}var it=null,ie=Math.ceil,ir=f.ReactCurrentDispatcher,ii=f.ReactCurrentOwner,ia=f.IsSomeRendererActing,is=0,io=null,il=null,ih=0,iu=0,ic=t2(0),id=0,ig=null,ip=0,im=0,iv=0,iy=0,ib=null,i_=0,ix=1/0;function iS(){ix=eO()+500}var iw=null,iC=!1,ik=null,iP=null,iE=!1,iT=null,iA=90,iM=[],iR=[],iL=null,iI=0,iD=null,iG=-1,iN=0,iO=0,iz=null,iF=!1;function iB(){return 0!=(48&is)?eO():-1!==iG?iG:iG=eO()}function iH(t){if(0==(2&(t=t.mode)))return 1;if(0==(4&t))return 99===ez()?1:2;if(0===iN&&(iN=ip),0!==ej.transition){0!==iO&&(iO=null!==ib?ib.pen
vendor: 4,242 bytes, line 1
1dingLanes:0),t=iN;var e=4186112&~iO;return 0==(e&=-e)&&0==(e=(t=4186112&~t)&-t)&&(e=8192),e}return t=ez(),t=0!=(4&is)&&98===t?ef(12,iN):ef(t=function(t){switch(t){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(t),iN)}function iW(t,e,n){if(50<iI)throw iI=0,iD=null,Error(d(185));if(null===(t=iU(t,e)))return null;ep(t,e,n),t===io&&(iv|=e,4===id&&iX(t,ih));var r=ez();1===e?0!=(8&is)&&0==(48&is)?iq(t):(ij(t,n),0===is&&(iS(),eW())):(0==(4&is)||98!==r&&99!==r||(null===iL?iL=new Set([t]):iL.add(t)),ij(t,n)),ib=t}function iU(t,e){t.lanes|=e;var n=t.alternate;for(null!==n&&(n.lanes|=e),n=t,t=t.return;null!==t;)t.childLanes|=e,null!==(n=t.alternate)&&(n.childLanes|=e),n=t,t=t.return;return 3===n.tag?n.stateNode:null}function ij(t,e){for(var n=t.callbackNode,r=t.suspendedLanes,i=t.pingedLanes,a=t.expirationTimes,s=t.pendingLanes;0<s;){var o=31-em(s),l=1<<o,h=a[o];if(-1===h){if(0==(l&r)||0!=(l&i)){h=e,eu(l);var u=eh;a[o]=10<=u?h+250:6<=u?h+5e3:-1}}else h<=e&&(t.expiredLanes|=l);s&=~l}if(r=ec(t,t===io?ih:0),e=eh,0===r)null!==n&&(n!==eR&&ex(n),t.callbackNode=null,t.callbackPriority=0);else{if(null!==n){if(t.callbackPriority===e)return;n!==eR&&ex(n)}15===e?(n=iq.bind(null,t),null===eI?(eI=[n],eD=e_(eP,eU)):eI.push(n),n=eR):n=14===e?eH(99,iq.bind(null,t)):eH(n=function(t){switch(t){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(d(358,t))}}(e),iY.bind(null,t)),t.callbackPriority=e,t.callbackNode=n}}function iY(t){if(iG=-1,iO=iN=0,0!=(48&is))throw Error(d(327));var e=t.callbackNode;if(i6()&&t.callbackNode!==e)return null;var n=ec(t,t===io?ih:0);if(0===n)return null;var r=n,i=is;is|=16;var a=i0();for((io!==t||ih!==r)&&(iS(),iJ(t,r));;)try{!function(){for(;null!==il&&!eS();)i2(il)}();break}catch(e){iZ(t,e)}if(eZ(),ir.current=a,is=i,null!==il?r=0:(io=null,ih=0,r=id),0!=(ip&iv))iJ(t,0);else if(0!==r){if(2===r&&(is|=64,t.hydrate&&(t.hydrate=!1,tL(t.containerInfo)),0!==(n=ed(t))&&(r=i1(t,n))),1===r)throw e=ig,iJ(t,0),iX(t,n),ij(t,eO()),e;switch(t.finishedWork=t.current.alternate,t.finishedLanes=n,r){case 0:case 1:throw Error(d(345));case 2:case 5:i3(t);break;case 3:if(iX(t,n),(62914560&n)===n&&10<(r=i_+500-eO())){if(0!==ec(t,0))break;if(((i=t.suspendedLanes)&n)!==n){iB(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=$(i3.bind(null,t),r);break}i3(t);break;case 4:if(iX(t,n),(4186112&n)===n)break;for(i=-1,r=t.eventTimes;0<n;){var s=31-em(n);a=1<<s,(s=r[s])>i&&(i=s),n&=~a}if(n=i,10<(n=(120>(n=eO()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*ie(n/1960))-n)){t.timeoutHandle=$(i3.bind(null,t),n);break}i3(t);break;default:throw Error(d(329))}}return ij(t,eO()),t.callbackNode===e?iY.bind(null,t):null}function iX(t,e){for(e&=~iy,e&=~iv,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-em(e),r=1<<n;t[n]=-1,e&=~r}}function iq(t){if(0!=(48&is))throw Error(d(327));if(i6(),t===io&&0!=(t.expiredLanes&ih)){var e=ih,n=i1(t,e);0!=(ip&iv)&&(e=ec(t,e),n=i1(t,e))}else e=ec(t,0),n=i1(t,e);if(0!==t.tag&&2===n&&(is|=64,t.hydrate&&(t.hydrate=!1,tL(t.containerInfo)),0!==(e=ed(t))&&(n=i1(t,e))),1===n)throw n=ig,iJ(t,0),iX(t,e),ij(t,eO()),n;return t.finishedWork=t.current.alternate,t.finishedLanes=e,i3(t),ij(t,eO()),null}function iQ(t,e){var n=is;is|=1;try{return t(e)}finally{0===(is=n)&&(iS(),eW())}}function iV(t,e){var n=is;if(0!=(48&n))return t(e);is|=1;try{if(t)return eB(99,t.bind(null,e))}finally{is=n,eW()}}function iK(t,e){t3(ic,iu),iu|=e,ip|=e}function i$(){iu=ic.current,t5(ic)}function iJ(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==Z&&(t.timeoutHandle=Z,J(n)),null!==il)for(n=il.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&ee();break;case 3:nS(),t5(t8),t5(t6),nO();break;case 5:nC(r);break;case 4:nS();break;case 13:case 19:t5(nk);break;case 10:e1(r);break;case 23:case 24:i$()}n=n.return}io=t,il=ad(t.current,null),ih=iu=ip=e,id=0,ig=null,iy=iv=im=0}function iZ(t,e){for(;;){var n=il;try{if(eZ(),nz.current=rh,nj){for(var r=nH.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}nj=!1}
1if(nB=0,nU=nW=nH=null,nY=!1,ii.current=null,null===n||null===n.return){id=1,ig=e,il=null;break}t:{var a=t,s=n.return,o=n,l=e;if(e=ih,o.flags|=2048,o.firstEffect=o.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var h,u=l;if(0==(2&o.mode)){var c=o.alternate;c?(o.updateQueue=c.updateQueue,o.memoizedState=c.memoizedState,o.lanes=c.lanes):(o.updateQueue=null,o.memoizedState=null)}var d=0!=(1&nk.current),f=s;do{if(h=13===f.tag){var g=f.memoizedState;if(null!==g)h=null!==g.dehydrated;else{var p=f.memoizedProps;h=void 0!==p.fallback&&(!0!==p.unstable_avoidThisFallback||!d)}}if(h){var m=f.updateQueue;if(null===m){var v=new Set;v.add(u),f.updateQueue=v}else m.add(u);if(0==(2&f.mode)){if(f.flags|=64,o.flags|=16384,o.flags&=-2981,1===o.tag){if(null===o.alternate)o.tag=17;else{var y=e9(-1,1);y.tag=2,e7(o,y)}}o.lanes|=1;break t}l=void 0,o=e;var b=a.pingCache;if(null===b?(b=a.pingCache=new rO,l=new Set,b.set(u,l)):(l=b.get(u),void 0===l&&(l=new Set,b.set(u,l))),!l.has(o)){l.add(o);var _=ae.bind(null,a,u,o);u.then(_,_)}f.flags|=4096,f.lanes=e;break t}f=f.return}while(null!==f);l=Error((I(o.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==id&&(id=2),l=rG(l,o),f=s;do{switch(f.tag){case 3:a=l,f.flags|=4096,e&=-e,f.lanes|=e;var x=rz(f,a,e);nt(f,x);break t;case 1:a=l;var S=f.type,w=f.stateNode;if(0==(64&f.flags)&&("function"==typeof S.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===iP||!iP.has(w)))){f.flags|=4096,e&=-e,f.lanes|=e;var C=rF(f,a,e);nt(f,C);break t}}f=f.return}while(null!==f)}i5(n)}catch(t){e=t,il===n&&null!==n&&(il=n=n.return);continue}break}}function i0(){var t=ir.current;return ir.current=rh,null===t?rh:t}function i1(t,e){var n=is;is|=16;var r=i0();for(io===t&&ih===e||iJ(t,e);;)try{!function(){for(;null!==il;)i2(il)}();break}catch(e){iZ(t,e)}if(eZ(),is=n,ir.current=r,null!==il)throw Error(d(261));return io=null,ih=0,id}function i2(t){var e=o(t.alternate,t,iu);t.memoizedProps=t.pendingProps,null===e?i5(t):il=e,ii.current=null}function i5(t){var e=t;do{var n=e.alternate;if(t=e.return,0==(2048&e.flags)){if(null!==(n=function(t,e,n){var o=e.pendingProps;switch(e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return et(e.type)&&ee(),null;case 3:return nS(),t5(t8),t5(t6),nO(),(o=e.stateNode).pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(null===t||null===t.child)&&(nD(e)?rL(e):o.hydrate||(e.flags|=256)),i(e),null;case 5:nC(e);var l=n_(nb.current);if(n=e.type,null!==t&&null!=e.stateNode)a(t,e,n,o,l),t.ref!==e.ref&&(e.flags|=128);else{if(!o){if(null===e.stateNode)throw Error(d(166));return null}if(t=n_(nv.current),nD(e)){if(!tr)throw Error(d(175));t=tX(e.stateNode,e.type,e.memoizedProps,l,t,e),e.updateQueue=t,null!==t&&rL(e)}else{var h=Y(n,o,l,t,e);r(h,e,!1,!1),e.stateNode=h,q(h,n,o,l,t)&&rL(e)}null!==e.ref&&(e.flags|=128)}return null;case 6:if(t&&null!=e.stateNode)s(t,e,t.memoizedProps,o);else{if("string"!=typeof o&&null===e.stateNode)throw Error(d(166));if(t=n_(nb.current),l=n_(nv.current),nD(e)){if(!tr)throw Error(d(176));tq(e.stateNode,e.memoizedProps,e)&&rL(e)}else e.stateNode=K(o,t,l,e)}return null;case 13:if(t5(nk),o=e.memoizedState,0!=(64&e.flags))return e.lanes=n,e;return o=null!==o,l=!1,null===t?void 0!==e.memoizedProps.fallback&&nD(e):l=null!==t.memoizedState,o&&!l&&0!=(2&e.mode)&&(null===t&&!0!==e.memoizedProps.unstable_avoidThisFallback||0!=(1&nk.current)?0===id&&(id=3):((0===id||3===id)&&(id=4),null===io||0==(134217727&im)&&0==(134217727&iv)||iX(io,ih))),tn&&o&&(e.flags|=4),te&&(o||l)&&(e.flags|=4),null;case 4:return nS(),i(e),null===t&&th(e.stateNode.containerInfo),null;case 10:return e1(e),null;case 19:if(t5(nk),null===(o=e.memoizedState))return null;if(l=0!=(64&e.flags),null===(h=o.rendering)){if(l)rD(o,!1);else{if(0!==id||null!==t&&0!=(64&t.flags))for(t=e.child;null!==t;){if(null!==(h=nP(t))){for(e.flags|=64,rD(o,!1),null!==(t=h.updateQueue)&&(e.updateQueue=t,e.flags|=4),null===o.lastEffect&&(e.firstEffect=null),e.lastEffect=o.lastEffect,t=n,o=e.child;null!==o;)l=o,n=t,l.flags&=2,l.nextEffect=null,l.firstEffect=null,l.lastEffect=null,null===(h=l.alternate)?(l.childLanes=0,l.lanes=n,l.child=null,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=h.childLanes,l.lanes=h.lanes,l.child=h.child,l.memoizedProps=h.memoizedProps,l.memoizedState=h.memoizedState,l.updateQueue=h.updateQueue,l.type=h.type,n=h.dependencies,l.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext}),o=o.sibling;return t3(nk,1&nk.current|2),e.child}t=t.sibling}null!==o.tail&&eO()>ix&&(e.flags|=64,l=!0,rD(o,!1),e.lanes=33554432)}}else{if(!l){if(null!==(t=nP(h))){if(e.flags|=64,l=!0,null!==(t=t.updateQueue)&&(e.updateQueue=t,e.flags|=4),rD(o,!0),null===o.tail&&"hidden"===o.tailMode&&!h.alternate&&!nA)return null!==(e=e.lastEffect=o.lastEffect)&&(e.nextEffect=null),null}else 2*eO()-o.renderingStartTime>ix&&1073741824!==n&&(e.flags|=64,l=!0,rD(o,!1),e.lanes=33554432)}o.isBackwards?(h.sibling=e.child,e.child=h):(null!==(t=o.last)?t.sibling=h:e.child=h,o.last=h)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.lastEffect=e.lastEffect,o.renderingStartTime=eO(),t.sibling=null,e=nk.current,t3(nk,l?1&e|2:1&e),t):null;case 23:case 24:return i$(),null!==t&&null!==t.memoizedState!=(null!==e.memoizedState)&&"unstable-defer-without-hiding"!==o.mode&&(e.flags|=4),null}throw Error(d(156,e.tag))}(n,e,iu))){il=n;return}if(24!==(n=e).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&iu)||0==(4&n.mode)){for(var o=0,l=n.child;null!==l;)o|=l.lanes|l.childLanes,l=l.sibling;n.childLanes=o}null!==t&&0==(2048&t.flags)&&(null===t.firstEffect&&(t.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==t.lastEffect&&(t.lastEffect.nextEffect=e.firstEffect),t.lastEffect=e.lastEffect),1<e.flags&&(null!==t.lastEffect?t.lastEffect.nextEffect=e:t.firstEffect=e,t.lastEffect=e))}else{if(null!==(n=function(t){switch(t.tag){case 1:et(t.type)&&ee();var e=t.flags;return 4096&e?(t.flags=-4097&e|64,t):null;case 3:if(nS(),t5(t8),t5(t6),nO(),0!=(64&(e=t.flags)))throw Error(d(285));return t.flags=-4097&e|64,t;case 5:return nC(t),null;case 13:return t5(nk),4096&(e=t.flags)?(t.flags=-4097&e|64,t):null;case 19:return t5(nk),null;case 4:return nS(),null;case 10:return e1(t),null;case 23:case 24:return i$(),null;default:return null}}(e))){n.flags&=2047,il=n;return}null!==t&&(t.firstEffect=t.lastEffect=null,t.flags|=2048)}if(null!==(e=e.sibling)){il=e;return}il=e=t}while(null!==e);0===id&&(id=5)}function i3(t){return eB(99,i4.bind(null,t,ez())),null}function i4(t,e){do i6();while(null!==iT);if(0!=(48&is))throw Error(d(327));var n=t.finishedWork;if(null===n)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(d(177));t.callbackNode=null;var r=n.lanes|n.childLanes,i=r,a=t.pendingLanes&~i;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=i,t.mutableReadLanes&=i,t.entangledLanes&=i,i=t.entanglements;for(var s=t.eventTimes,o=t.expirationTimes;0<a;){var l=31-em(a),h=1<<l;i[l]=0,s[l]=-1,o[l]=-1,a&=~h}if(null!==iL&&0==(24&r)&&iL.has(t)&&iL.delete(t),t===io&&(il=io=null,ih=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){i=is,is|=32,ii.current=null,iz=U(t.containerInfo),iF=!1,iw=r;do try{!function(){for(;null!==iw;){var t,e,n=iw.alternate;iF||null===iz||(0!=(8&iw.flags)?z(iw,iz)&&(iF=!0,to()):13===iw.tag&&(t=n,e=iw,null!==t&&(null===(t=t.memoizedState)||null!==t.dehydrated)&&null!==(e=e.memoizedState)&&null===e.dehydrated)&&z(iw,iz)&&(iF=!0,to()));var r=iw.flags;0!=(256&r)&&function(t,e){switch(e.tag){case 0:case 11:case 15:case 22:case 5:case
16:case 4:case 17:return;case 1:if(256&e.flags&&null!==t){var n=t.memoizedProps,r=t.memoizedState;e=(t=e.stateNode).getSnapshotBeforeUpdate(e.elementType===e.type?n:eQ(e.type,n),r),t.__reactInternalSnapshotBeforeUpdate=e}return;case 3:te&&256&e.flags&&tL(e.stateNode.containerInfo);return}throw Error(d(163))}(n,iw),0==(512&r)||iE||(iE=!0,eH(97,function(){return i6(),null})),iw=iw.nextEffect}}()}catch(t){if(null===iw)throw Error(d(330));at(iw,t),iw=iw.nextEffect}while(null!==iw);iz=null,iw=r;do try{for(s=t;null!==iw;){var u=iw.flags;if(16&u&&te&&tE(iw.stateNode),128&u){var c=iw.alternate;if(null!==c){var f=c.ref;null!==f&&("function"==typeof f?f(null):f.current=null)}}switch(1038&u){case 2:rQ(iw),iw.flags&=-3;break;case 6:rQ(iw),iw.flags&=-3,rK(iw.alternate,iw);break;case 1024:iw.flags&=-1025;break;case 1028:iw.flags&=-1025,rK(iw.alternate,iw);break;case 4:rK(iw.alternate,iw);break;case 8:o=s,a=iw,te?rV(o,a):rY(o,a);var g=a.alternate;rX(a),null!==g&&rX(g)}iw=iw.nextEffect}}catch(t){if(null===iw)throw Error(d(330));at(iw,t),iw=iw.nextEffect}while(null!==iw);iF&&tl(),j(t.containerInfo),t.current=n,iw=r;do try{for(u=t;null!==iw;){var p=iw.flags;if(36&p&&function(t,e,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(e=null!==(e=n.updateQueue)?e.lastEffect:null)){t=e=e.next;do{if(3==(3&t.tag)){var r=t.create;t.destroy=r()}t=t.next}while(t!==e)}if(null!==(e=null!==(e=n.updateQueue)?e.lastEffect:null)){t=e=e.next;do{var i,a,s=t;r=s.next,0!=(4&(s=s.tag))&&0!=(1&s)&&(i8(n,t),i=n,a=t,iM.push(a,i),iE||(iE=!0,eH(97,function(){return i6(),null}))),t=r}while(t!==e)}return;case 1:t=n.stateNode,4&n.flags&&(null===e?t.componentDidMount():(r=n.elementType===n.type?e.memoizedProps:eQ(n.type,e.memoizedProps),t.componentDidUpdate(r,e.memoizedState,t.__reactInternalSnapshotBeforeUpdate))),null!==(e=n.updateQueue)&&nn(n,e,t);return;case 3:if(null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 5:t=B(n.child.stateNode);break;case 1:t=n.child.stateNode}nn(n,e,t)}return;case 5:t=n.stateNode,null===e&&4&n.flags&&tx(t,n.type,n.memoizedProps,n);return;case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:tr&&null===n.memoizedState&&null!==(n=n.alternate)&&null!==(n=n.memoizedState)&&null!==(n=n.dehydrated)&&tK(n);return}throw Error(d(163))}(u,iw.alternate,iw),128&p){c=void 0;var m=iw.ref;if(null!==m){var v=iw.stateNode;c=5===iw.tag?B(v):v,"function"==typeof m?m(c):m.current=c}}iw=iw.nextEffect}}catch(t){if(null===iw)throw Error(d(330));at(iw,t),iw=iw.nextEffect}while(null!==iw);iw=null,eL(),is=i}else t.current=n;if(iE)iE=!1,iT=t,iA=e;else for(iw=r;null!==iw;)e=iw.nextEffect,iw.nextEffect=null,8&iw.flags&&((p=iw).sibling=null,p.stateNode=null),iw=e;if(0===(r=t.pendingLanes)&&(iP=null),1===r?t===iD?iI++:(iI=0,iD=t):iI=0,n=n.stateNode,eo&&"function"==typeof eo.onCommitFiberRoot)try{eo.onCommitFiberRoot(es,n,void 0,64==(64&n.current.flags))}catch(t){}if(ij(t,eO()),iC)throw iC=!1,t=ik,ik=null,t;return 0!=(8&is)||eW(),null}function i6(){if(90!==iA){var t=97<iA?97:iA;return iA=90,eB(t,i9)}return!1}function i8(t,e){iR.push(e,t),iE||(iE=!0,eH(97,function(){return i6(),null}))}function i9(){if(null===iT)return!1;var t=iT;if(iT=null,0!=(48&is))throw Error(d(331));var e=is;is|=32;var n=iR;iR=[];for(var r=0;r<n.length;r+=2){var i=n[r],a=n[r+1],s=i.destroy;if(i.destroy=void 0,"function"==typeof s)try{s()}catch(t){if(null===a)throw Error(d(330));at(a,t)}}for(r=0,n=iM,iM=[];r<n.length;r+=2){i=n[r],a=n[r+1];try{var o=i.create;i.destroy=o()}catch(t){if(null===a)throw Error(d(330));at(a,t)}}for(o=t.current.firstEffect;null!==o;)t=o.nextEffect,o.nextEffect=null,8&o.flags&&(o.sibling=null,o.stateNode=null),o=t;return is=e,eW(),!0}function i7(t,e,n){e=rz(t,e=rG(n,e),1),e7(t,e),e=iB(),null!==(t=iU(t,1))&&(ep(t,1,e),ij(t,e))}function at(t,e){if(3===t.tag)i7(t,t,e);else for(var n=t.return;null!==n;){if(3===n.tag){i7(n,t,e);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===iP||!iP.has(r))){var i=rF(n,t=rG(e,t),1);if(e7(n,i),i=iB(),null!==(n=iU(n,1)))ep(n,1,i),ij(n,i);else if("function"==typeof r.componentDidCatch&&(null===iP||!iP.has(r)))try{r.componentDidCatch(e,t)}catch(t){}break}}n=n.return}}function ae(t,e,n){var r=t.pingCache;null!==r&&r.delete(e),e=iB(),t.pingedLanes|=t.suspendedLanes&n,io===t&&(ih&n)===n&&(4===id||3===id&&(62914560&ih)===ih&&500>eO()-i_?iJ(t,0):iy|=n),ij(t,e)}function an(t,e){var n,r=t.stateNode;null!==r&&r.delete(e),0==(e=0)&&(0==(2&(e=t.mode))?e=1:0==(4&e)?e=99===ez()?1:2:(0===iN&&(iN=ip),0==(e=(n=62914560&~iN)&-n)&&(e=4194304))),r=iB(),null!==(t=iU(t,e))&&(ep(t,e,r),ij(t,r))}o=function(t,e,n){var r=e.lanes;if(null!==t){if(t.memoizedProps!==e.pendingProps||t8.current)rg=!0;else if(0!=(n&r))rg=0!=(16384&t.flags);else{switch(rg=!1,e.tag){case 3:rC(e),nG();break;case 5:nw(e);break;case 1:et(e.type)&&ei(e);break;case 4:nx(e,e.stateNode.containerInfo);break;case 10:e0(e,e.memoizedProps.value);break;case 13:if(null!==e.memoizedState){if(0!=(n&e.child.childLanes))return rP(t,e,n);return t3(nk,1&nk.current),null!==(e=rR(t,e,n))?e.sibling:null}t3(nk,1&nk.current);break;case 19:if(r=0!=(n&e.childLanes),0!=(64&t.flags)){if(r)return rM(t,e,n);e.flags|=64}var i=e.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),t3(nk,nk.current),!r)return null;break;case 23:case 24:return e.lanes=0,rb(t,e,n)}return rR(t,e,n)}}else rg=!1;switch(e.lanes=0,e.tag){case 2:if(r=e.type,null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=t7(e,t6.current),e5(e,n),i=nQ(null,e,r,t,i,n),e.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(e.tag=1,e.memoizedState=null,e.updateQueue=null,et(r)){var a=!0;ei(e)}else a=!1;e.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,e6(e);var s=r.getDerivedStateFromProps;"function"==typeof s&&ni(e,r,s,t),i.updater=na,e.stateNode=i,i._reactInternals=e,nh(e,r,t,n),e=rw(null,e,r,!0,a,n)}else e.tag=0,rp(null,e,i,n),e=e.child;return e;case 16:i=e.elementType;t:{switch(null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),t=e.pendingProps,i=(a=i._init)(i._payload),e.type=i,a=e.tag=function(t){if("function"==typeof t)return ac(t)?1:0;if(null!=t){if((t=t.$$typeof)===x)return 11;if(t===C)return 14}return 2}(i),t=eQ(i,t),a){case 0:e=rx(null,e,i,t,n);break t;case 1:e=rS(null,e,i,t,n);break t;case 11:e=rm(null,e,i,t,n);break t;case 14:e=rv(null,e,i,eQ(i.type,t),r,n);break t}throw Error(d(306,i,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:eQ(r,i),rx(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:eQ(r,i),rS(t,e,r,i,n);case 3:if(rC(e),r=e.updateQueue,null===t||null===r)throw Error(d(282));if(r=e.pendingProps,i=null!==(i=e.memoizedState)?i.element:null,e8(t,e),ne(e,r,null,n),(r=e.memoizedState.element)===i)nG(),e=rR(t,e,n);else{if((a=(i=e.stateNode).hydrate)&&(tr?(nT=tY(e.stateNode.containerInfo),nE=e,a=nA=!0):a=!1),a){if(tr&&null!=(t=i.mutableSourceEagerHydrationData))for(i=0;i<t.length;i+=2)a=t[i],s=t[i+1],tt?a._workInProgressVersionPrimary=s:a._workInProgressVersionSecondary=s,nN.push(a);for(n=np(e,null,r,n),e.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else rp(t,e,r,n),nG();e=e.child}return e;case 5:return nw(e),null===t&&nL(e),r=e.type,i=e.pendingProps,a=null!==t?t.memoizedProps:null,s=i.children,V(r,i)?s=null:null!==a&&V(r,a)&&(e.flags|=16),r_(t,e),rp(t,e,s,n),e.child;case 6:return null===t&&nL(e),null;case 13:return rP(t,e,n);case 4:return nx(e,e.stateNode.containerInfo),r=e.pendingProps,null===t?e.child=ng(e,null,r,n):rp(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:eQ(r,i),rm(t,e,r,i,n);case 7:return rp(t,e,e.pendingProps,n),e.child;case 8:case 12:return rp(t,e,e.pendingProps.children,n),e.child;
vendor: 7,266 bytes, line 1
1case 10:t:{if(r=e.type._context,i=e.pendingProps,s=e.memoizedProps,e0(e,a=i.value),null!==s){var o=s.value;if(0==(a=eY(o,a)?0:("function"==typeof r._calculateChangedBits?r._calculateChangedBits(o,a):1073741823)|0)){if(s.children===i.children&&!t8.current){e=rR(t,e,n);break t}}else for(null!==(o=e.child)&&(o.return=e);null!==o;){var l=o.dependencies;if(null!==l){s=o.child;for(var h=l.firstContext;null!==h;){if(h.context===r&&0!=(h.observedBits&a)){1===o.tag&&((h=e9(-1,n&-n)).tag=2,e7(o,h)),o.lanes|=n,null!==(h=o.alternate)&&(h.lanes|=n),e2(o.return,n),l.lanes|=n;break}h=h.next}}else s=10===o.tag&&o.type===e.type?null:o.child;if(null!==s)s.return=o;else for(s=o;null!==s;){if(s===e){s=null;break}if(null!==(o=s.sibling)){o.return=s.return,s=o;break}s=s.return}o=s}}rp(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=(a=e.pendingProps).children,e5(e,n),r=r(i=e3(i,a.unstable_observedBits)),e.flags|=1,rp(t,e,r,n),e.child;case 14:return a=eQ(i=e.type,e.pendingProps),a=eQ(i.type,a),rv(t,e,i,a,r,n);case 15:return ry(t,e,e.type,e.pendingProps,r,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:eQ(r,i),null!==t&&(t.alternate=null,e.alternate=null,e.flags|=2),e.tag=1,et(r)?(t=!0,ei(e)):t=!1,e5(e,n),no(e,r,i),nh(e,r,i,n),rw(null,e,r,!0,t,n);case 19:return rM(t,e,n);case 23:case 24:return rb(t,e,n)}throw Error(d(156,e.tag))};var ar={current:!1},ai=c.unstable_flushAllWithoutAsserting,aa="function"==typeof ai;function as(){if(void 0!==ai)return ai();for(var t=!1;i6();)t=!0;return t}var ao=0,al=!1;function ah(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function au(t,e,n,r){return new ah(t,e,n,r)}function ac(t){return!(!(t=t.prototype)||!t.isReactComponent)}function ad(t,e){var n=t.alternate;return null===n?((n=au(t.tag,e,t.key,t.mode)).elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function af(t,e,n,r,i,a){var s=2;if(r=t,"function"==typeof t)ac(t)&&(s=1);else if("string"==typeof t)s=5;else t:switch(t){case m:return ag(n.children,i,a,e);case E:s=8,i|=16;break;case v:s=8,i|=1;break;case y:return(t=au(12,n,e,8|i)).elementType=y,t.type=y,t.lanes=a,t;case S:return(t=au(13,n,e,i)).type=S,t.elementType=S,t.lanes=a,t;case w:return(t=au(19,n,e,i)).elementType=w,t.lanes=a,t;case T:return ap(n,i,a,e);case A:return(t=au(24,n,e,i)).elementType=A,t.lanes=a,t;default:if("object"==typeof t&&null!==t)switch(t.$$typeof){case b:s=10;break t;case _:s=9;break t;case x:s=11;break t;case C:s=14;break t;case k:s=16,r=null;break t;case P:s=22;break t}throw Error(d(130,null==t?t:typeof t,""))}return(e=au(s,n,e,i)).elementType=t,e.type=r,e.lanes=a,e}function ag(t,e,n,r){return(t=au(7,t,r,e)).lanes=n,t}function ap(t,e,n,r){return(t=au(23,t,r,e)).elementType=T,t.lanes=n,t}function am(t,e,n){return(t=au(6,t,null,e)).lanes=n,t}function av(t,e,n){return(e=au(4,null!==t.children?t.children:[],t.key,e)).lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function ay(t,e,n){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Z,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=eg(0),this.expirationTimes=eg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eg(0),tr&&(this.mutableSourceEagerHydrationData=null)}function ab(t){var e=t._reactInternals;if(void 0===e){if("function"==typeof t.render)throw Error(d(188));throw Error(d(268,Object.keys(t)))}return null===(t=O(e))?null:t.stateNode}function a_(t,e){if(null!==(t=t.memoizedState)&&null!==t.dehydrated){var n=t.retryLane;t.retryLane=0!==n&&n<e?n:e}}function ax(t,e){a_(t,e),(t=t.alternate)&&a_(t,e)}function aS(t){return null===(t=O(t))?null:t.stateNode}function aw(){return null}return l.IsThisRendererActing=ar,l.act=function(e){function n(){ao--,ia.current=r,ar.current=i}!1===al&&(al=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),ao++;var r=ia.current,i=ar.current;ia.current=!0,ar.current=!0;try{var a=iQ(e)}catch(t){throw n(),t}if(null!==a&&"object"==typeof a&&"function"==typeof a.then)return{then:function(e,i){a.then(function(){1<ao||!0===aa&&!0===r?(n(),e()):function e(n){try{as(),function(e){if(null===it)try{var n=("require"+Math.random()).slice(0,7);it=(t&&t[n]).call(t,"timers").setImmediate}catch(t){it=function(t){var e=new MessageChannel;e.port1.onmessage=t,e.port2.postMessage(void 0)}}it(e)}(function(){as()?e(n):n()})}catch(t){n(t)}}(function(t){n(),t?i(t):e()})},function(t){n(),i(t)})}};try{1!==ao||!1!==aa&&!1!==r||as(),n()}catch(t){throw n(),t}return{then:function(t){t()}}},l.attemptContinuousHydration=function(t){13===t.tag&&(iW(t,67108864,iB()),ax(t,67108864))},l.attemptHydrationAtCurrentPriority=function(t){if(13===t.tag){var e=iB(),n=iH(t);iW(t,n,e),ax(t,n)}},l.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.hydrate){var n=eu(e.pendingLanes);e.expiredLanes|=n&e.pendingLanes,ij(e,eO()),0==(48&is)&&(iS(),eW())}break;case 13:var r=iB();iV(function(){return iW(t,1,r)}),ax(t,4)}},l.attemptUserBlockingHydration=function(t){13===t.tag&&(iW(t,4,iB()),ax(t,4))},l.batchedEventUpdates=function(t,e){var n=is;is|=2;try{return t(e)}finally{0===(is=n)&&(iS(),eW())}},l.batchedUpdates=iQ,l.createComponentSelector=function(t){return{$$typeof:rZ,value:t}},l.createContainer=function(t,e,n){return t=new ay(t,e,n),e=au(3,null,null,2===e?7:1===e?3:0),t.current=e,e.stateNode=t,e6(e),t},l.createHasPsuedoClassSelector=function(t){return{$$typeof:r0,value:t}},l.createPortal=function(t,e,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:p,key:null==r?null:""+r,children:t,containerInfo:e,implementation:n}},l.createRoleSelector=function(t){return{$$typeof:r1,value:t}},l.createTestNameSelector=function(t){return{$$typeof:r2,value:t}},l.createTextSelector=function(t){return{$$typeof:r5,value:t}},l.deferredUpdates=function(t){return eB(97,t)},l.discreteUpdates=function(t,e,n,r,i){var a=is;is|=4;try{return eB(98,t.bind(null,e,n,r,i))}finally{0===(is=a)&&(iS(),eW())}},l.findAllNodes=r7,l.findBoundingRects=function(t,e){if(!tu)throw Error(d(363));e=r7(t,e),t=[];for(var n=0;n<e.length;n++)t.push(td(e[n]));for(e=t.length-1;0<e;e--){n=t[e];for(var r=n.x,i=r+n.width,a=n.y,s=a+n.height,o=e-1;0<=o;o--)if(e!==o){var l=t[o],h=l.x,u=h+l.width,c=l.y,f=c+l.height;if(r>
1=h&&a>=c&&i<=u&&s<=f){t.splice(e,1);break}if(r!==h||n.width!==l.width||f<a||c>s){if(!(a!==c||n.height!==l.height||u<r||h>i)){h>r&&(l.width+=h-r,l.x=r),u<i&&(l.width=i-h),t.splice(e,1);break}}else{c>a&&(l.height+=c-a,l.y=a),f<s&&(l.height=s-c),t.splice(e,1);break}}}return t},l.findHostInstance=ab,l.findHostInstanceWithNoPortals=function(t){return null===(t=function(t){if(!(t=N(t)))return null;for(var e=t;;){if(5===e.tag||6===e.tag)return e;if(e.child&&4!==e.tag)e.child.return=e,e=e.child;else{if(e===t)break;for(;!e.sibling;){if(!e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}}return null}(t))?null:20===t.tag?t.stateNode.instance:t.stateNode},l.findHostInstanceWithWarning=function(t){return ab(t)},l.flushControlled=function(t){var e=is;is|=1;try{eB(99,t)}finally{0===(is=e)&&(iS(),eW())}},l.flushDiscreteUpdates=function(){0==(49&is)&&(function(){if(null!==iL){var t=iL;iL=null,t.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,ij(t,eO())})}eW()}(),i6())},l.flushPassiveEffects=i6,l.flushSync=iV,l.focusWithin=function(t,e){if(!tu)throw Error(d(363));for(e=Array.from(e=r9(t=r4(t),e)),t=0;t<e.length;){var n=e[t++];if(!tg(n)){if(5===n.tag&&tm(n.stateNode))return!0;for(n=n.child;null!==n;)e.push(n),n=n.sibling}}return!1},l.getCurrentUpdateLanePriority=function(){return el},l.getFindAllNodesFailureDescription=function(t,e){if(!tu)throw Error(d(363));var n=0,r=[];t=[r4(t),0];for(var i=0;i<t.length;){var a=t[i++],s=t[i++],o=e[s];if((5!==a.tag||!tg(a))&&(r6(a,o)&&(r.push(r8(o)),++s>n&&(n=s)),s<e.length))for(a=a.child;null!==a;)t.push(a,s),a=a.sibling}if(n<e.length){for(t=[];n<e.length;n++)t.push(r8(e[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+t.join(" > ")}return null},l.getPublicRootInstance=function(t){return(t=t.current).child?5===t.child.tag?B(t.child.stateNode):t.child.stateNode:null},l.injectIntoDevTools=function(t){if(t={bundleType:t.bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:f.ReactCurrentDispatcher,findHostInstanceByFiber:aS,findFiberByHostInstance:t.findFiberByHostInstance||aw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)t=!1;else{var e=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!e.isDisabled&&e.supportsFiber)try{es=e.inject(t),eo=e}catch(t){}t=!0}return t},l.observeVisibleRects=function(t,e,n,r){if(!tu)throw Error(d(363));var i=tv(t=r7(t,e),n,r).disconnect;return{disconnect:function(){i()}}},l.registerMutableSourceForHydration=function(t,e){var n=e._getVersion;n=n(e._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[e,n]:t.mutableSourceEagerHydrationData.push(e,n)},l.runWithPriority=function(t,e){var n=el;try{return el=t,e()}finally{el=n}},l.shouldSuspend=function(){return!1},l.unbatchedUpdates=function(t,e){var n=is;is&=-2,is|=8;try{return t(e)}finally{0===(is=n)&&(iS(),eW())}},l.updateContainer=function(t,e,n,r){var i=e.current,a=iB(),s=iH(i);t:if(n){n=n._reactInternals;e:{if(D(n)!==n||1!==n.tag)throw Error(d(170));var o=n;do{switch(o.tag){case 3:o=o.stateNode.context;break e;case 1:if(et(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break e}}o=o.return}while(null!==o);throw Error(d(171))}if(1===n.tag){var l=n.type;if(et(l)){n=er(n,l,o);break t}}n=o}else n=t4;return null===e.context?e.context=n:e.pendingContext=n,(e=e9(a,s)).payload={element:t},null!==(r=void 0===r?null:r)&&(e.callback=r),e7(i,e),iW(i,s,a),s},l}},76525:function(t,e,n){"use strict";t.exports=n(67287)},60053:function(t,e){"use strict";if("object"==typeof performance&&"function"==typeof performance.now){var n,r,i,a,s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var h=null,u=null,c=function(){if(null!==h)try{var t=e.unstable_now();h(!0,t),h=null}catch(t){throw setTimeout(c,0),t}};n=function(t){null!==h?setTimeout(n,0,t):(h=t,setTimeout(c,0))},r=function(t,e){u=setTimeout(t,e)},i=function(){clearTimeout(u)},e.unstable_shouldYield=function(){return!1},a=e.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,f=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var p=!1,m=null,v=-1,y=5,b=0;e.unstable_shouldYield=function(){return e.unstable_now()>=b},a=function(){},e.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<t?Math.floor(1e3/t):5};var _=new MessageChannel,x=_.port2;_.port1.onmessage=function(){if(null!==m){var t=e.unstable_now();b=t+y;try{m(!0,t)?x.postMessage(null):(p=!1,m=null)}catch(t){throw x.postMessage(null),t}}else p=!1},n=function(t){m=t,p||(p=!0,x.postMessage(null))},r=function(t,n){v=d(function(){t(e.unstable_now())},n)},i=function(){f(v),v=-1}}function S(t,e){var n=t.length;for(t.push(e);;){var r=n-1>>>1,i=t[r];
1if(void 0!==i&&0<k(i,e))t[r]=e,t[n]=i,n=r;else break}}function w(t){return void 0===(t=t[0])?null:t}function C(t){var e=t[0];if(void 0!==e){var n=t.pop();if(n!==e){t[0]=n;for(var r=0,i=t.length;r<i;){var a=2*(r+1)-1,s=t[a],o=a+1,l=t[o];if(void 0!==s&&0>k(s,n))void 0!==l&&0>k(l,s)?(t[r]=l,t[o]=n,r=o):(t[r]=s,t[a]=n,r=a);else if(void 0!==l&&0>k(l,n))t[r]=l,t[o]=n,r=o;else break}}return e}return null}function k(t,e){var n=t.sortIndex-e.sortIndex;return 0!==n?n:t.id-e.id}var P=[],E=[],T=1,A=null,M=3,R=!1,L=!1,I=!1;function D(t){for(var e=w(E);null!==e;){if(null===e.callback)C(E);else if(e.startTime<=t)C(E),e.sortIndex=e.expirationTime,S(P,e);else break;e=w(E)}}function G(t){if(I=!1,D(t),!L){if(null!==w(P))L=!0,n(N);else{var e=w(E);null!==e&&r(G,e.startTime-t)}}}function N(t,n){L=!1,I&&(I=!1,i()),R=!0;var a=M;try{for(D(n),A=w(P);null!==A&&(!(A.expirationTime>n)||t&&!e.unstable_shouldYield());){var s=A.callback;if("function"==typeof s){A.callback=null,M=A.priorityLevel;var o=s(A.expirationTime<=n);n=e.unstable_now(),"function"==typeof o?A.callback=o:A===w(P)&&C(P),D(n)}else C(P);A=w(P)}if(null!==A)var l=!0;else{var h=w(E);null!==h&&r(G,h.startTime-n),l=!1}return l}finally{A=null,M=a,R=!1}}var O=a;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(t){t.callback=null},e.unstable_continueExecution=function(){L||R||(L=!0,n(N))},e.unstable_getCurrentPriorityLevel=function(){return M},e.unstable_getFirstCallbackNode=function(){return w(P)},e.unstable_next=function(t){switch(M){case 1:case 2:case 3:var e=3;break;default:e=M}var n=M;M=e;try{return t()}finally{M=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=O,e.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=M;M=t;try{return e()}finally{M=n}},e.unstable_scheduleCallback=function(t,a,s){var o=e.unstable_now();switch(s="object"==typeof s&&null!==s&&"number"==typeof(s=s.delay)&&0<s?o+s:o,t){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return l=s+l,t={id:T++,callback:a,priorityLevel:t,startTime:s,expirationTime:l,sortIndex:-1},s>o?(t.sortIndex=s,S(E,t),null===w(P)&&t===w(E)&&(I?i():I=!0,r(G,s-o))):(t.sortIndex=l,S(P,t),L||R||(L=!0,n(N))),t},e.unstable_wrapCallback=function(t){var e=M;return function(){var n=M;M=e;try{return t.apply(this,arguments)}finally{M=n}}}},63840:function(t,e,n){"use strict";t.exports=n(60053)},84420:function(t,e,n){var r=n(67294);t.exports=function(t,e,n){let i=r.useRef("loading"),a=r.useRef(),[s,o]=r.useState(0),l=r.useRef(),h=r.useRef(),u=r.useRef();return(l.current!==t||h.current!==e||u.current!==n)&&(i.current="loading",a.current=void 0,l.current=t,h.current=e,u.current=n),r.useLayoutEffect(function(){if(t){var r=document.createElement("img");return r.addEventListener("load",s),r.addEventListener("error",l),e&&(r.crossOrigin=e),n&&(r.referrerPolicy=n),r.src=t,function(){r.removeEventListener("load",s),r.removeEventListener("error",l)}}function s(){i.current="loaded",a.current=r,o(Math.random())}function l(){i.current="failed",a.current=void 0,o(Math.random())}},[t,e,n]),[a.current,i.current]}}}]); 2//# sourceMappingURL=9036.0b297cb4d59d685b.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.