PageSourceSearch

https://www.goaffpro.app/assets/CanvasEditorInternal-CLGWdgYM.js

js goaffpro.app collected 2026-10-04 14:37:51 UTC 276,182 bytes, 17 lines download raw bytes

1import{bt as Wd,ca as ph,bv as Yd,r as ae,R as Je,j as T,b as De,cb as vh,cc as mh,M as Xd,aw as Ms,au as Vd,y as qd,g as zi,cd as Qd,a$ as Kd,B as Jd,L as Ll,ce as Zd,cf as $d,cg as ec,ch as tc,bj as rc,c3 as nc,ci as ic}from"./index-lEmP1PRk.js";import{u as ac}from"./index-CNGqg7G5.js";import{C as Bi}from"./ColorpickerBlock-JZzUDFPO.js";import{Q as sc}from"./browser-He7sDufS.js";import"./isSymbol-Dgn69Nba.js";var oc=Math.PI/180;function lc(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Yr=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Y={_global:Yr,version:"8.4.3",isBrowser:lc(),isUnminified:/param/.test((function(o){}).toString()),dblClickWindow:400,getAngle(o){return Y.angleDeg?o*oc:o},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:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return Y.DD.isDragging},isDragReady(){return!!Y.DD.node},releaseCanvasOnDestroy:!0,document:Yr.document,_injectGlobal(o){Yr.Konva=o}},Ae=o=>{Y[o.prototype.getClassName()]=o};Y._injectGlobal(Y);class ot{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.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 ot(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){var n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){var n=Math.cos(e),i=Math.sin(e),s=this.m[0]*n+this.m[2]*i,l=this.m[1]*n+this.m[3]*i,u=this.m[0]*-i+this.m[2]*n,c=this.m[1]*-i+this.m[3]*n;return this.m[0]=s,this.m[1]=l,this.m[2]=u,this.m[3]=c,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){var i=this.m[0]+this.m[2]*n,s=this.m[1]+this.m[3]*n,l=this.m[2]+this.m[0]*e,u=this.m[3]+this.m[1]*e;return this.m[0]=i,this.m[1]=s,this.m[2]=l,this.m[3]=u,this}multiply(e){var n=this.m[0]*e.m[0]+this.m[2]*e.m[1],i=this.m[1]*e.m[0]+this.m[3]*e.m[1],s=this.m[0]*e.m[2]+this.m[2]*e.m[3],l=this.m[1]*e.m[2]+this.m[3]*e.m[3],u=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],c=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=i,this.m[2]=s,this.m[3]=l,this.m[4]=u,this.m[5]=c,this}invert(){var e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,i=-this.m[1]*e,s=-this.m[2]*e,l=this.m[0]*e,u=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),c=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=i,this.m[2]=s,this.m[3]=l,this.m[4]=u,this.m[5]=c,this}getMatrix(){return this.m}decompose(){var e=this.m[0],n=this.m[1],i=this.m[2],s=this.m[3],l=this.m[4],u=this.m[5],c=e*s-n*i;let f={x:l,y:u,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){var p=Math.sqrt(e*e+n*n);f.rotation=n>0?Math.acos(e/p):-Math.acos(e/p),f.scaleX=p,f.scaleY=c/p,f.skewX=(e*i+n*s)/c,f.skewY=0}else if(i!=0||s!=0){var v=Math.sqrt(i*i+s*s);f.rotation=Math.PI/2-(s>0?Math.acos(-i/v):-Math.acos(i/v)),f.scaleX=c/v,f.scaleY=v,f.skewX=0,f.skewY=(e*i+n*s)/c}return f.rotation=k._getRotation(f.rotation),f}}var hc="[object Array]",uc="[object Number]",dc="[object String]",cc="[object Boolean]",fc=Math.PI/180,gc=180/Math.PI,hs="#",pc="",vc="0",mc="Konva warning: ",Il="Konva error: ",yc="rgb(",us={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],ol
1ive:[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]},_c=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,Ei=[];const Sc=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(o){setTimeout(o,60)},k={_isElement(o){return!!(o&&o.nodeType==1)},_isFunction(o){return!!(o&&o.constructor&&o.call&&o.apply)},_isPlainObject(o){return!!o&&o.constructor===Object},_isArray(o){return Object.prototype.toString.call(o)===hc},_isNumber(o){return Object.prototype.toString.call(o)===uc&&!isNaN(o)&&isFinite(o)},_isString(o){return Object.prototype.toString.call(o)===dc},_isBoolean(o){return Object.prototype.toString.call(o)===cc},isObject(o){return o instanceof Object},isValidSelector(o){if(typeof o!="string")return!1;var e=o[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(o){return o===0||o>0?1:-1},requestAnimFrame(o){Ei.push(o),Ei.length===1&&Sc(function(){const e=Ei;Ei=[],e.forEach(function(n){n()})})},createCanvasElement(){var o=document.createElement("canvas");try{o.style=o.style||{}}catch(e){}return o},createImageElement(){return document.createElement("img")},_isInDocument(o){for(;o=o.parentNode;)if(o==document)return!0;return!1},_urlToImage(o,e){var n=k.createImageElement();n.onload=function(){e(n)},n.src=o},_rgbToHex(o,e,n){return((1<<24)+(o<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(o){o=o.replace(hs,pc);var e=parseInt(o,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){for(var o=(Math.random()*16777215<<0).toString(16);o.length<6;)o=vc+o;return hs+o},getRGB(o){var e;return o in us?(e=us[o],{r:e[0],g:e[1],b:e[2]}):o[0]===hs?this._hexToRgb(o.substring(1)):o.substr(0,4)===yc?(e=_c.exec(o.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(o){return o=o||"black",k._namedColorToRBA(o)||k._hex3ColorToRGBA(o)||k._hex4ColorToRGBA(o)||k._hex6ColorToRGBA(o)||k._hex8ColorToRGBA(o)||k._rgbColorToRGBA(o)||k._rgbaColorToRGBA(o)||k._hslColorToRGBA(o)},_namedColorToRBA(o){var e=us[o.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(o){if(o.indexOf("rgb(")===0){o=o.match(/rgb\(([^)]+)\)/)[1];var e=o.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(o){if(o.indexOf("rgba(")===0){o=o.match(/rgba\(([^)]+)\)/)[1];var e=o.split(/ *, */).map((n,i)=>n.slice(-1)==="%"?i===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(o){if(o[0]==="#"&&o.length===9)return{r:parseInt(o.slice(1,3),16),g:parseInt(o.slice(3,5),16),b:parseInt(o.slice(5,7),16),a:parseInt(o.slice(7,9),16)/255}},_hex6ColorToRGBA(o){if(o[0]==="#"&&o.length===7)return{r:parseInt(o.slice(1,3),16),g:parseInt(o.slice(3,5),16),b:parseInt(o.slice(5,7),16),a:1}},_hex4ColorToRGBA(o){if(o[0]==="#"&&o.length===5)return{r:parseInt(o[1]+o[1],16),g:parseInt(o[2]+o[2],16),b:parseInt(o[3]+o[3],16),a:parseInt(o[4]+o[4],16)/255}},_hex3ColorToRGBA(o){if(o[0]==="#"&&o.length===4)return{r:parseInt(o[1]+o[1],16),g:parseInt(o[2]+o[2],16),b:parseInt(o[3]+o[3],16),a:1}},_hslColorToRGBA(o){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(o)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(o),i=Number(n[0])/360,s=Number(n[1])/100,l=Number(n[2])/100;let u,c,f;if(s===0)return f=l*255,{r:Math.round(f),g:Math.round(f),b:Math.round(f),a:1};l<.5?u=l*(1+s):u=l+s-l*s;const p=2*l-u,v=[0,0,0];for(let _=0;_<3;_++)c=i+1/3*-(_-1),c<0&&c++,c>1&&c--,6*c<1?f=p+(u-p)*6*c:2*c<1?f=u:3*c<2?f=p+(u-p)*(2/3-c)*6:f=p,v[_]=f*255;return{r:Math.round(v[0]),g:Math.round(v[1]),b:Math.round(v[2]),a:1}}},haveIntersection(o,e){return!(e.x>o.x+o.width||e.x+e.width<o.x||e.y>o.y+o.height||e.y+e.height<o.y)},cloneObject(o){var e={};for(var n in o)this._isPlainObject(o[n])?e[n]=this.cloneObject(o[n]):this._isArray(o[n])?e[n]=this.cloneArray(o[n]):e[n]=o[n];return e},cloneArray(o){return o.slice(0)},degToRad(o){return o*fc}
1,radToDeg(o){return o*gc},_degToRad(o){return k.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),k.degToRad(o)},_radToDeg(o){return k.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),k.radToDeg(o)},_getRotation(o){return Y.angleDeg?k.radToDeg(o):o},_capitalize(o){return o.charAt(0).toUpperCase()+o.slice(1)},throw(o){throw new Error(Il+o)},error(o){console.error(Il+o)},warn(o){Y.showWarnings&&console.warn(mc+o)},each(o,e){for(var n in o)e(n,o[n])},_inRange(o,e,n){return e<=o&&o<n},_getProjectionToSegment(o,e,n,i,s,l){var u,c,f,p=(o-n)*(o-n)+(e-i)*(e-i);if(p==0)u=o,c=e,f=(s-n)*(s-n)+(l-i)*(l-i);else{var v=((s-o)*(n-o)+(l-e)*(i-e))/p;v<0?(u=o,c=e,f=(o-s)*(o-s)+(e-l)*(e-l)):v>1?(u=n,c=i,f=(n-s)*(n-s)+(i-l)*(i-l)):(u=o+v*(n-o),c=e+v*(i-e),f=(u-s)*(u-s)+(c-l)*(c-l))}return[u,c,f]},_getProjectionToLine(o,e,n){var i=k.cloneObject(o),s=Number.MAX_VALUE;return e.forEach(function(l,u){if(!(!n&&u===e.length-1)){var c=e[(u+1)%e.length],f=k._getProjectionToSegment(l.x,l.y,c.x,c.y,o.x,o.y),p=f[0],v=f[1],_=f[2];_<s&&(i.x=p,i.y=v,s=_)}}),i},_prepareArrayForTween(o,e,n){var i,s=[],l=[];if(o.length>e.length){var u=e;e=o,o=u}for(i=0;i<o.length;i+=2)s.push({x:o[i],y:o[i+1]});for(i=0;i<e.length;i+=2)l.push({x:e[i],y:e[i+1]});var c=[];return l.forEach(function(f){var p=k._getProjectionToLine(f,s,n);c.push(p.x),c.push(p.y)}),c},_prepareToStringify(o){var e;o.visitedByCircularReferenceRemoval=!0;for(var n in o)if(o.hasOwnProperty(n)&&o[n]&&typeof o[n]=="object"){if(e=Object.getOwnPropertyDescriptor(o,n),o[n].visitedByCircularReferenceRemoval||k._isElement(o[n]))if(e.configurable)delete o[n];else return null;else if(k._prepareToStringify(o[n])===null)if(e.configurable)delete o[n];else return null}return delete o.visitedByCircularReferenceRemoval,o},_assign(o,e){for(var n in e)o[n]=e[n];return o},_getFirstPointerId(o){return o.touches?o.changedTouches[0].identifier:o.pointerId||999},releaseCanvas(...o){Y.releaseCanvasOnDestroy&&o.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(o,e,n,i){let s=0,l=0,u=0,c=0;typeof i=="number"?s=l=u=c=Math.min(i,e/2,n/2):(s=Math.min(i[0]||0,e/2,n/2),l=Math.min(i[1]||0,e/2,n/2),c=Math.min(i[2]||0,e/2,n/2),u=Math.min(i[3]||0,e/2,n/2)),o.moveTo(s,0),o.lineTo(e-l,0),o.arc(e-l,l,l,Math.PI*3/2,0,!1),o.lineTo(e,n-c),o.arc(e-c,n-c,c,0,Math.PI/2,!1),o.lineTo(u,n),o.arc(u,n-u,u,Math.PI/2,Math.PI,!1),o.lineTo(0,s),o.arc(s,s,s,Math.PI,Math.PI*3/2,!1)}};function or(o){return k._isString(o)?'"'+o+'"':Object.prototype.toString.call(o)==="[object Number]"||k._isBoolean(o)?o:Object.prototype.toString.call(o)}function yh(o){return o>255?255:o<0?0:Math.round(o)}function b(){if(Y.isUnminified)return function(o,e){return k._isNumber(o)||k.warn(or(o)+' is a not val
1id value for "'+e+'" attribute. The value should be a number.'),o}}function Ls(o){if(Y.isUnminified)return function(e,n){let i=k._isNumber(e),s=k._isArray(e)&&e.length==o;return!i&&!s&&k.warn(or(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+o+")"),e}}function Is(){if(Y.isUnminified)return function(o,e){var n=k._isNumber(o),i=o==="auto";return n||i||k.warn(or(o)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),o}}function qr(){if(Y.isUnminified)return function(o,e){return k._isString(o)||k.warn(or(o)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),o}}function _h(){if(Y.isUnminified)return function(o,e){const n=k._isString(o),i=Object.prototype.toString.call(o)==="[object CanvasGradient]"||o&&o.addColorStop;return n||i||k.warn(or(o)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),o}}function xc(){if(Y.isUnminified)return function(o,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&o instanceof n||(k._isArray(o)?o.forEach(function(i){k._isNumber(i)||k.warn('"'+e+'" attribute has non numeric element '+i+". Make sure that all elements are numbers.")}
1):k.warn(or(o)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),o}}function Tt(){if(Y.isUnminified)return function(o,e){var n=o===!0||o===!1;return n||k.warn(or(o)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),o}}function wc(o){if(Y.isUnminified)return function(e,n){return e==null||k.isObject(e)||k.warn(or(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+o),e}}var yn="get",_n="set";const x={addGetterSetter(o,e,n,i,s){x.addGetter(o,e,n),x.addSetter(o,e,i,s),x.addOverloadedGetterSetter(o,e)},addGetter(o,e,n){var i=yn+k._capitalize(e);o.prototype[i]=o.prototype[i]||function(){var s=this.attrs[e];return s===void 0?n:s}},addSetter(o,e,n,i){var s=_n+k._capitalize(e);o.prototype[s]||x.overWriteSetter(o,e,n,i)},overWriteSetter(o,e,n,i){var s=_n+k._capitalize(e);o.prototype[s]=function(l){return n&&l!==void 0&&l!==null&&(l=n.call(this,l,e)),this._setAttr(e,l),i&&i.call(this),this}},addComponentsGetterSetter(o,e,n,i,s){var l=n.length,u=k._capitalize,c=yn+u(e),f=_n+u(e),p,v;o.prototype[c]=function(){var y={};for(p=0;p<l;p++)v=n[p],y[v]=this.getAttr(e+u(v));return y};var _=wc(n);o.prototype[f]=function(y){var w=this.attrs[e],S;i&&(y=i.call(this,y)),_&&_.call(this,y,e);for(S in y)y.hasOwnProperty(S)&&this._setAttr(e+u(S),y[S]);return y||n.forEach(N=>{this._setAttr(e+u(N),void 0)}),this._fireChangeEvent(e,w,y),s&&s.call(this),this},x.addOverloadedGetterSetter(o,e)},addOverloadedGetterSetter(o,e){var n=k._capitalize(e),i=_n+n,s=yn+n;o.prototype[e]=function(){return arguments.length?(this[i](arguments[0]),this):this[s]()}},addDeprecatedGetterSetter(o,e,n,i){k.error("Adding deprecated "+e);var s=yn+k._capitalize(e),l=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[s]=function(){k.error(l);var u=this.attrs[e];return u===void 0?n:u},x.addSetter(o,e,i,function(){k.error(l)}),x.addOverloadedGetterSetter(o,e)},backCompat(o,e){k.each(e,function(n,i){var s=o.prototype[i],l=yn+k._capitalize(n),u=_n+k._capitalize(n);function c(){s.apply(this,arguments),k.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+i+'" instead.')}o.prototype[n]=c,o.prototype[l]=c,o.prototype[u]=c})},afterSetFilter(){this._filterUpToDate=!1}};function Cc(o){var e=[],n=o.length,i=k,s,l;for(s=0;s<n;s++)l=o[s],i._isNumber(l)?l=Math.round(l*1e3)/1e3:i._isString(l)||(l=l+""),e.push(l);return e}var Ol=",",Pc="(",kc=")",Ec="([",Tc="])",Rc=";",Ac="()",Nc="=",Dl=["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"],Mc=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const Lc=100;class Ui{constructor(e){this.canvas=e,Y.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){var i=this.traceArr,s=i.length,l="",u,c,f,p;for(u=0;u<s;u++)c=i[u],f=c.method,f?(p=c.args,l+=f,e?l+=Ac:k._isArray(p[0])?l+=Ec+p.join(Ol)+Tc:(n&&(p=p.map(v=>typeof v=="number"?Math.floor(v):v)),l+=Pc+p.join(Ol)+kc)):(l+=c.property,e||(l+=Nc+c.val)),l+=Rc;return l}clearTrace(){this.traceArr=[]}_trace(e){var n=this.traceArr,i;n.push(e),i=n.length,i>=Lc&&n.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){var n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,i,s,l,u){this._context.arc(e,n,i,s,l,u)}arcTo(e,n,i,s,l){this._context.arcTo(e,n,i,s,l)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,i,s,l,u){this._context.bezierCurveTo(e,n,i,s,l,u)}clearRect(e,n,i,s){this._context.clearRect(e,n,i,s)}clip(){this._context.clip()}closePath(){this._context.closePath()}createImageData(e,n){var i=arguments;if(i.length===2)return this._context.createImageData(e,n);if(i.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,i,s){return this._context.createLinearGradient(e,n,i,s)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,i,s,l,u){return this._context.createRadialGradient(e,n,i,s,l,u)}drawImage(e,n,i,s,l,u,c,f,p){var v=arguments,_=this._context;v.length===3?_.drawImage(e,n,i):v.length===5?_.drawImage(e,n,i,s,l):v.length===9&&_.drawImage(e,n,i,s,l,u,c,f,p)}ellipse(e,n,i,s,l,u,c,f){this._context.ellipse(e,n,i,s,l,u,c,f)}
1isPointInPath(e,n,i,s){return i?this._context.isPointInPath(i,e,n,s):this._context.isPointInPath(e,n,s)}fill(e){e?this._context.fill(e):this._context.fill()}fillRect(e,n,i,s){this._context.fillRect(e,n,i,s)}strokeRect(e,n,i,s){this._context.strokeRect(e,n,i,s)}fillText(e,n,i,s){s?this._context.fillText(e,n,i,s):this._context.fillText(e,n,i)}measureText(e){return this._context.measureText(e)}getImageData(e,n,i,s){return this._context.getImageData(e,n,i,s)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,i,s){this._context.rect(e,n,i,s)}putImageData(e,n,i){this._context.putImageData(e,n,i)}quadraticCurveTo(e,n,i,s){this._context.quadraticCurveTo(e,n,i,s)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,i,s,l,u){this._context.setTransform(e,n,i,s,l,u)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,i,s){this._context.strokeText(e,n,i,s)}transform(e,n,i,s,l,u){this._context.transform(e,n,i,s,l,u)}translate(e,n){this._context.translate(e,n)}_enableTrace(){var e=this,n=Dl.length,i=this.setAttr,s,l,u=function(c){var f=e[c],p;e[c]=function(){return l=Cc(Array.prototype.slice.call(arguments,0)),p=f.apply(e,arguments),e._trace({method:c,args:l}),p}};for(s=0;s<n;s++)u(Dl[s]);e.setAttr=function(){i.apply(e,arguments);var c=arguments[0],f=arguments[1];(c==="shadowOffsetX"||c==="shadowOffsetY"||c==="shadowBlur")&&(f=f/this.canvas.getPixelRatio()),e._trace({property:c,val:f})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;var i=!n||n==="source-over";i||this.setAttr("globalCompositeOperation",n)}}Mc.forEach(function(o){Object.defineProperty(Ui.prototype,o,{get(){return this._context[o]},set(e){this._context[o]=e}})});class Ic extends Ui{constructor(e){super(e),this._context=e._canvas.getContext("2d")}_fillColor(e){var n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){var n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),i=e.getFillPriority();if(n&&i==="color"){this._fillColor(e);return}const s=e.getFillPatternImage();if(s&&i==="pattern"){this._fillPattern(e);return}const l=e.getFillLinearGradientColorStops();if(l&&i==="linear-gradient"){this._fillLinearGradient(e);return}const u=e.getFillRadialGradientColorStops();if(u&&i==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):s?this._fillPattern(e):l?this._fillLinearGradient(e):u&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),i=e.getStrokeLinearGradientEndPoint(),s=e.getStrokeLinearGradientColorStops(),l=this.createLinearGradient(n.x,n.y,i.x,i.y);if(s){for(var u=0;u<s.length;u+=2)l.addColorStop(s[u],s[u+1]);this.setAttr("strokeStyle",l)}}_stroke(e){var n=e.dash(),i=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!i){this.save();var s=this.getCanvas().getPixelRatio();this.setTransform(s,0,0,s,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var l=e.getStrokeLinearGradientColorStops();l?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),i||this.restore()}}_applyShadow(e){var n,i,s,l=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",u=(i=e.getShadowBlur())!==null&&i!==void 0?i:5,c=(s=e.getShadowOffset())!==null&&s!==void 0?s:{x:0,y:0},f=e.getAbsoluteScale(),p=this.canvas.getPixelRatio(),v=f.x*p,_=f.y*p;this.setAttr("shadowColor",l),this.setAttr("shadowBlur",u*Math.min(Math.abs(v),Math.abs(_))),this.setAttr("shadowOffsetX",c.x*v),this.setAttr("shadowOffsetY",c.y*_)}}class Oc extends Ui{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore(
1)}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const l=e.getStrokeScaleEnabled();if(!l){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(e);var i=e.hitStrokeWidth(),s=i==="auto"?e.strokeWidth():i;this.setAttr("lineWidth",s),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),l||this.restore()}}}var Ti;function Dc(){if(Ti)return Ti;var o=k.createCanvasElement(),e=o.getContext("2d");return Ti=function(){var n=Y._global.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/i}(),k.releaseCanvas(o),Ti}class Wi{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=e||{},i=n.pixelRatio||Y.pixelRatio||Dc();this.pixelRatio=i,this._canvas=k.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(e){var n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";var n=this.pixelRatio,i=this.getContext()._context;i.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";var n=this.pixelRatio,i=this.getContext()._context;i.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch(i){try{return this._canvas.toDataURL()}catch(s){return k.error("Unable to get data URL. "+s.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}x.addGetterSetter(Wi,"pixelRatio",void 0,b());class Xr extends Wi{constructor(e={width:0,height:0}){super(e),this.context=new Ic(this),this.setSize(e.width,e.height)}}class Os extends Wi{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new Oc(this),this.setSize(e.width,e.height)}}const ce={get isDragging(){var o=!1;return ce._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(o=!0)}),o},justDragged:!1,get node(){var o;return ce._dragElements.forEach(e=>{o=e.node}),o},_dragElements:new Map,_drag(o){const e=[];ce._dragElements.forEach((n,i)=>{const{node:s}=n,l=s.getStage();l.setPointersPositions(o),n.pointerId===void 0&&(n.pointerId=k._getFirstPointerId(o));const u=l._changedPointerPositions.find(p=>p.id===n.pointerId);if(u){if(n.dragStatus!=="dragging"){var c=s.dragDistance(),f=Math.max(Math.abs(u.x-n.startPointerPos.x),Math.abs(u.y-n.startPointerPos.y));if(f<c||(s.startDrag({evt:o}),!s.isDragging()))return}s._setDragPosition(o,n),e.push(s)}}),e.forEach(n=>{n.fire("dragmove",{type:"dragmove",target:n,evt:o},!0)})},_endDragBefore(o){const e=[];ce._dragElements.forEach(n=>{const{node:i}=n,s=i.getStage();if(o&&s.setPointersPositions(o),!s._changedPointerPositions.find(c=>c.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(ce.justDragged=!0,Y._mouseListenClick=!1,Y._touchListenClick=!1,Y._pointerListenClick=!1,n.dragStatus="stopped");const u=n.node.getLayer()||n.node instanceof Y.Stage&&n.node;u&&e.indexOf(u)===-1&&e.push(u)}),e.forEach(n=>{n.draw()})},_endDragAfter(o){ce._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:o},!0),e.dragStatus!=="dragging"&&ce._dragElements.delete(n)})}};Y.isBrowser&&(window.addEventListener("mouseup",ce._endDragBefore,!0),window.addEventListener("touchend",ce._endDragBefore,!0),window.addEventListener("mousemove",ce._drag),window.addEventListener("touchmove",ce._drag),window.addEventListener("mouseup",ce._endDragAfter,!1),window.addEventListener("touchend",ce._endDragAfter,!1));var bi="absoluteOpacity",Ri="allEventListeners",Yt="absoluteTransform",Gl="absoluteScale",xr="canvas",Gc="Change",zc="children",bc="konva",ws="listening",zl="mou
1seenter",bl="mouseleave",Fl="set",jl="Shape",Fi=" ",Bl="stage",sr="transform",Fc="Stage",Cs="visible",jc=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Fi);let Bc=1;class z{constructor(e){this._id=Bc++,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(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===sr||e===Yt)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){var i=this._cache.get(e),s=e===sr||e===Yt,l=i===void 0||s&&i.dirty===!0;return l&&(i=n.call(this),this._cache.set(e,i)),i}_calculate(e,n,i){if(!this._attachedDepsListeners.get(e)){const s=n.map(l=>l+"Change.konva").join(Fi);this.on(s,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,i)}_getCanvasCache(){return this._cache.get(xr)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===Yt&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(xr)){const{scene:e,filter:n,hit:i}=this._cache.get(xr);k.releaseCanvas(e,n,i),this._cache.delete(xr)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var n=e||{},i={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(i=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()}));var s=Math.ceil(n.width||i.width),l=Math.ceil(n.height||i.height),u=n.pixelRatio,c=n.x===void 0?Math.floor(i.x):n.x,f=n.y===void 0?Math.floor(i.y):n.y,p=n.offset||0,v=n.drawBorder||!1,_=n.hitCanvasPixelRatio||1;if(!s||!l){k.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}s+=p*2+1,l+=p*2+1,c-=p,f-=p;var y=new Xr({pixelRatio:u,width:s,height:l}),w=new Xr({pixelRatio:u,width:0,height:0}),S=new Os({pixelRatio:_,width:s,height:l}),N=y.getContext(),E=S.getContext();return S.isCache=!0,y.isCache=!0,this._cache.delete(xr),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(y.getContext()._context.imageSmoothingEnabled=!1,w.getContext()._context.imageSmoothingEnabled=!1),N.save(),E.save(),N.translate(-c,-f),E.translate(-c,-f),this._isUnderCache=!0,this._clearSelfAndDescendantCache(bi),this._clearSelfAndDescendantCache(Gl),this.drawScene(y,this),this.drawHit(S,this),this._isUnderCache=!1,N.restore(),E.restore(),v&&(N.save(),N.beginPath(),N.rect(0,0,s,l),N.closePath(),N.setAttr("strokeStyle","red"),N.setAttr("lineWidth",5),N.stroke(),N.restore()),this._cache.set(xr,{scene:y,filter:w,hit:S,x:c,y:f}),this._requestDraw(),this}isCached(){return this._cache.has(xr)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){var i=[{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}],s,l,u,c,f=this.getAbsoluteTransform(n);return i.forEach(function(p){var v=f.point(p);s===void 0&&(s=u=v.x,l=c=v.y),s=Math.min(s,v.x),l=Math.min(l,v.y),u=Math.max(u,v.x),c=Math.max(c,v.y)}),{x:s,y:l,width:u-s,height:c-l}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);var i=this._getCachedSceneCanvas(),s=i.pixelRatio;e.drawImage(i._canvas,0,0,i.width/s,i.height/s),e.restore()}_drawCachedHitCanvas(e){var n=this._getCanvasCache(),i=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(i._canvas,0,0,i.width/i.pixelRatio,i.height/i.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e=this.filters(),n=this._getCanvasCache(),i=n.scene,s=n.filter,l=s.getContext(),u,c,f,p;if(e){if(!this._filterUpToDate){var v=i.pixelRatio;s.setSize(i.width/i.pixelRatio,i.height/i.pixelRatio);try{for(u=e.length,l.clear(),l.drawImage(i._canvas,0,0,i.getWidth()/v,i.getHeight()/v),c=l.getImageData(0,0,s.getWidth(),s.getHeight()),f=0;f<u;f++){if(p=e[f],typeof p!="function"){k.error("Filter should be type of function, but got "+typeof p+" instead. Please check correct filters");continue}p.call(this,c),l.putImageData(c,0,0)}}catch(_){k.error("Unable to apply filter. "+_.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return s}return i}on(e,n){if(this._cache&&this._cache.delete(Ri),arguments.length===3)return this._delegate.apply(this,arguments);var i=e.split(Fi),s=i.length,l,u,c,f,p;for(l=0;l<s;l++)u=i[l],c=u.split("."),f=c[0],p=c[1]||"",this.eventListeners[f]||(this.eventListeners[f]=[]),this.eventListeners[f].push({name:p,handler:n});return this}off(e,n){var i=(e||"").split(Fi),s=i.length,l,u,c,f,p,v;if(this._cache&&this._cache.delete(Ri),!e)for(u in this.eventListeners)this._off(u);for(l=0;l<s;l++)if(c=i[l],f=c.split("."),p=f[0],v=f[1],p)this.eventListeners[p]&&this._off(p,v,n);else for(u in this.eventListeners)this._off(u,v,n);return this}
1dispatchEvent(e){var n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(i){n.call(this,i.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,i){var s=this;this.on(e,function(l){for(var u=l.target.findAncestors(n,!0,s),c=0;c<u.length;c++)l=k.cloneObject(l),l.currentTarget=u[c],i.call(u[c],l)})}remove(){return this.isDragging()&&this.stopDrag(),ce._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(Yt),this._clearSelfAndDescendantCache(bi),this._clearSelfAndDescendantCache(Gl),this._clearSelfAndDescendantCache(Bl),this._clearSelfAndDescendantCache(Cs),this._clearSelfAndDescendantCache(ws)}_remove(){this._clearCaches();var e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){var n="get"+k._capitalize(e);return k._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){for(var e=this.getParent(),n=[];e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{var n,i;if(!e)return this;for(n in e)n!==zc&&(i=Fl+k._capitalize(n),k._isFunction(this[i])?this[i](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(ws,this._isListening)}_isListening(e){if(!this.listening())return!1;const i=this.getParent();return i&&i!==e&&this!==e?i._isListening(e):!0}isVisible(){return this._getCache(Cs,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const i=this.getParent();return i&&i!==e&&this!==e?i._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);var i=this.getLayer(),s=!1;ce._dragElements.forEach(u=>{u.dragStatus==="dragging"&&(u.node.nodeType==="Stage"||u.node.getLayer()===i)&&(s=!0)});var l=!n&&!Y.hitOnDragEnabled&&s;return this.isListening()&&this.isVisible()&&!l}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e=this.getDepth(),n=this,i=0,s,l,u,c;function f(p){for(s=[],l=p.length,u=0;u<l;u++)c=p[u],i++,c.nodeType!==jl&&(s=s.concat(c.getChildren().slice())),c._id===n._id&&(u=l);s.length>0&&s[0].getDepth()<=e&&f(s)}return n.nodeType!==Fc&&f(n.getStage().getChildren()),i}getDepth(){for(var e=0,n=this.parent;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(sr),this._clearSelfAndDescendantCache(Yt)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var e=this.getStage().getPointerPosition();if(!e)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(e)}getAbsolutePosition(e){let n=!1,i=this.parent;for(;i;){if(i.isCached()){n=!0;break}i=i.parent}n&&!e&&(e=!0);var s=this.getAbsoluteTransform(e).getMatrix(),l=new ot,u=this.offset();return l.m=s.slice(),l.translate(u.x,u.y),l.getTranslation()}setAbsolutePosition(e){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(sr);var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(n),this.setPosition({x:e.x,y:e.y}),this._clearCache(sr),this._clearSelfAndDescendantCache(Yt),this}_setTransform(e){var n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){var e={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,e}move(e){var n=e.x,i=e.y,s=this.x(),l=this.y();return n!==void 0&&(s+=n),i!==void 0&&(l+=i),this.setPosition({x:s,y:l}),this}_eachAncestorReverse(e,n){var i=[],s=this.getParent(),l,u;if(!(n&&n._id===this._id)){for(i.unshift(this);s&&(!n||s._id!==n._id);)i.unshift(s),s=s.parent;for(l=i.length,u=0;u<l;u++)e(i[u])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return k.warn("Node has no parent. moveToTop function is ignored."),!1;var e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return k.warn("Node has no parent. moveUp function is ignored."),!1;var e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return k.warn("Node has no parent. moveDown function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return k.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return k.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&k.warn("Unexpected value "+e+" 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 n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(bi,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e={},n=this.getAttrs(),i,s,l,u,c;e.attrs={};for(i in n)s=n[i],c=k.isObject(s)&&!k._isPlainObject(s)&&!k._isArray(s),!c&&(l=typeof this[i]=="function"&&this[i],delete n[i],u=l?l.call(this):null,n[i]=s,u!==s&&(e.attrs[i]=s));return e.className=this.getClassName(),k._prepareToStringify(e)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,i){var s=[];n&&this._isMatch(e)&&s.push(this);for(var l=this.parent;l;){if(l===i)return s;l._isMatch(e)&&s.push(l),l=l.parent}return s}isAncestorOf(e){return!1}
1findAncestor(e,n,i){return this.findAncestors(e,n,i)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);var n=e.replace(/ /g,"").split(","),i=n.length,s,l;for(s=0;s<i;s++)if(l=n[s],k.isValidSelector(l)||(k.warn('Selector "'+l+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),k.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),k.warn("Konva is awesome, right?")),l.charAt(0)==="#"){if(this.id()===l.slice(1))return!0}else if(l.charAt(0)==="."){if(this.hasName(l.slice(1)))return!0}else if(this.className===l||this.nodeType===l)return!0;return!1}getLayer(){var e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(Bl,this._getStage)}_getStage(){var e=this.getParent();if(e)return e.getStage()}fire(e,n={},i){return n.target=n.target||this,i?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(Yt,this._getAbsoluteTransform)}_getAbsoluteTransform(e){var n;if(e)return n=new ot,this._eachAncestorReverse(function(s){var l=s.transformsEnabled();l==="all"?n.multiply(s.getTransform()):l==="position"&&n.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},e),n;n=this._cache.get(Yt)||new ot,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();var i=this.transformsEnabled();if(i==="all")n.multiply(this.getTransform());else if(i==="position"){const s=this.attrs.x||0,l=this.attrs.y||0,u=this.attrs.offsetX||0,c=this.attrs.offsetY||0;n.translate(s-u,l-c)}return n.dirty=!1,n}getAbsoluteScale(e){for(var n=this;n;)n._isUnderCache&&(e=n),n=n.getParent();const s=this.getAbsoluteTransform(e).decompose();return{x:s.scaleX,y:s.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(sr,this._getTransform)}_getTransform(){var e,n,i=this._cache.get(sr)||new ot;i.reset();var s=this.x(),l=this.y(),u=Y.getAngle(this.rotation()),c=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,f=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,p=this.attrs.skewX||0,v=this.attrs.skewY||0,_=this.attrs.offsetX||0,y=this.attrs.offsetY||0;return(s!==0||l!==0)&&i.translate(s,l),u!==0&&i.rotate(u),(p!==0||v!==0)&&i.skew(p,v),(c!==1||f!==1)&&i.scale(c,f),(_!==0||y!==0)&&i.translate(-1*_,-1*y),i.dirty=!1,i}clone(e){var n=k.cloneObject(this.attrs),i,s,l,u,c;for(i in e)n[i]=e[i];var f=new this.constructor(n);for(i in this.eventListeners)for(s=this.eventListeners[i],l=s.length,u=0;u<l;u++)c=s[u],c.name.indexOf(bc)<0&&(f.eventListeners[i]||(f.eventListeners[i]=[]),f.eventListeners[i].push(c));return f}_toKonvaCanvas(e){e=e||{};var n=this.getClientRect(),i=this.getStage(),s=e.x!==void 0?e.x:Math.floor(n.x),l=e.y!==void 0?e.y:Math.floor(n.y),u=e.pixelRatio||1,c=new Xr({width:e.width||Math.ceil(n.width)||(i?i.width():0),height:e.height||Math.ceil(n.height)||(i?i.height():0),pixelRatio:u}),f=c.getContext();return e.imageSmoothingEnabled===!1&&(f._context.imageSmoothingEnabled=!1),f.save(),(s||l)&&f.translate(-1*s,-1*l),this.drawScene(c),f.restore(),c}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};var n=e.mimeType||null,i=e.quality||null,s=this._toKonvaCanvas(e).toDataURL(n,i);return e.callback&&e.callback(s),s}toImage(e){return new Promise((n,i)=>{try{const s=e==null?void 0:e.callback;s&&delete e.callback,k._urlToImage(this.toDataURL(e),function(l){n(l),s==null||s(l)})}catch(s){i(s)}})}toBlob(e){return new Promise((n,i)=>{try{const s=e==null?void 0:e.callback;s&&delete e.callback,this.toCanvas(e).toBlob(l=>{n(l),s==null||s(l)})}catch(s){i(s)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Y.dragDistance}_off(e,n,i){var s=this.eventListeners[e],l,u,c;for(l=0;l<s.length;l++)if(u=s[l].name,c=s[l].handler,(u!=="konva"||n==="konva")&&(!n||u===n)&&(!i||i===c)){if(s.splice(l,1),s.length===0){delete this.eventListeners[e];break}l--}}_fireChangeEvent(e,n,i){this._fire(e+Gc,{oldVal:n,newVal:i})}addName(e){if(!this.hasName(e)){var n=this.name(),i=n?n+" "+e:e;this.name(i)}return this}hasName(e){if(!e)return!1;const n=this.name();if(!n)return!1;var i=(n||"").split(/\s/g);return i.indexOf(e)!==-1}removeName(e){var n=(this.name()||"").split(/\s/g),i=n.indexOf(e);return i!==-1&&(n.splice(i,1),this.name(n.join(" "))),this}setAttr(e,n){var i=this[Fl+k._capitalize(e)];return k._isFunction(i)?i.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Y.autoDrawEnabled){const e=this.getLayer()||this.get
1Stage();e==null||e.batchDraw()}}_setAttr(e,n){var i=this.attrs[e];i===n&&!k.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,i,n),this._requestDraw())}_setComponentAttr(e,n,i){var s;i!==void 0&&(s=this.attrs[e],s||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=i,this._fireChangeEvent(e,s,i))}_fireAndBubble(e,n,i){n&&this.nodeType===jl&&(n.target=this);var s=(e===zl||e===bl)&&(i&&(this===i||this.isAncestorOf&&this.isAncestorOf(i))||this.nodeType==="Stage"&&!i);if(!s){this._fire(e,n);var l=(e===zl||e===bl)&&i&&i.isAncestorOf&&i.isAncestorOf(this)&&!i.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!l&&(i&&i.parent?this._fireAndBubble.call(this.parent,e,n,i):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){let n=this._cache.get(Ri);if(!n){n={};let s=Object.getPrototypeOf(this);for(;s;){if(!s.eventListeners){s=Object.getPrototypeOf(s);continue}for(var i in s.eventListeners){const l=s.eventListeners[i],u=n[i]||[];n[i]=l.concat(u)}s=Object.getPrototypeOf(s)}this._cache.set(Ri,n)}return n[e]}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const i=this._getProtoListeners(e);if(i)for(var s=0;s<i.length;s++)i[s].handler.call(this,n);const l=this.eventListeners[e];if(l)for(var s=0;s<l.length;s++)l[s].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){var n=e?e.pointerId:void 0,i=this.getStage(),s=this.getAbsolutePosition(),l=i._getPointerById(n)||i._changedPointerPositions[0]||s;ce._dragElements.set(this._id,{node:this,startPointerPos:l,offset:{x:l.x-s.x,y:l.y-s.y},dragStatus:"ready",pointerId:n})}startDrag(e,n=!0){ce._dragElements.has(this._id)||this._createDragElement(e);const i=ce._dragElements.get(this._id);i.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:e&&e.evt},n)}_setDragPosition(e,n){const i=this.getStage()._getPointerById(n.pointerId);if(i){var s={x:i.x-n.offset.x,y:i.y-n.offset.y},l=this.dragBoundFunc();if(l!==void 0){const u=l.call(this,s,e);u?s=u:k.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==s.x||this._lastPos.y!==s.y)&&(this.setAbsolutePosition(s),this._requestDraw()),this._lastPos=s}}stopDrag(e){const n=ce._dragElements.get(this._id);n&&(n.dragStatus="stopped"),ce._endDragBefore(e),ce._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=ce._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){var n=e.evt.button!==void 0,i=!n||Y.dragButtons.indexOf(e.evt.button)>=0;if(i&&!this.isDragging()){var s=!1;ce._dragElements.forEach(l=>{this.isAncestorOf(l.node)&&(s=!0)}),s||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage();if(!e)return;const n=ce._dragElements.get(this._id),i=n&&n.dragStatus==="dragging",s=n&&n.dragStatus==="ready";
1i?this.stopDrag():s&&ce._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const i={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return k.haveIntersection(i,this.getClientRect())}static create(e,n){return k._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){var i=z.prototype.getClassName.call(e),s=e.children,l,u,c;n&&(e.attrs.container=n),Y[i]||(k.warn('Can not find a node with class name "'+i+'". Fallback to "Shape".'),i="Shape");const f=Y[i];if(l=new f(e.attrs),s)for(u=s.length,c=0;c<u;c++)l.add(z._createNode(s[c]));return l}}z.prototype.nodeType="Node";z.prototype._attrsAffectingSize=[];z.prototype.eventListeners={};z.prototype.on.call(z.prototype,jc,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(sr),this._clearSelfAndDescendantCache(Yt)});z.prototype.on.call(z.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(Cs)});z.prototype.on.call(z.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(ws)});z.prototype.on.call(z.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(bi)});const Se=x.addGetterSetter;Se(z,"zIndex");Se(z,"absolutePosition");Se(z,"position");Se(z,"x",0,b());Se(z,"y",0,b());Se(z,"globalCompositeOperation","source-over",qr());Se(z,"opacity",1,b());Se(z,"name","",qr());Se(z,"id","",qr());Se(z,"rotation",0,b());x.addComponentsGetterSetter(z,"scale",["x","y"]);Se(z,"scaleX",1,b());Se(z,"scaleY",1,b());x.addComponentsGetterSetter(z,"skew",["x","y"]);Se(z,"skewX",0,b());Se(z,"skewY",0,b());x.addComponentsGetterSetter(z,"offset",["x","y"]);Se(z,"offsetX",0,b());Se(z,"offsetY",0,b());Se(z,"dragDistance",null,b());Se(z,"width",0,b());Se(z,"height",0,b());Se(z,"listening",!0,Tt());Se(z,"preventDefault",!0,Tt());Se(z,"filters",null,function(o){return this._filterUpToDate=!1,o});Se(z,"visible",!0,Tt());Se(z,"transformsEnabled","all",qr());Se(z,"size");Se(z,"dragBoundFunc");Se(z,"draggable",!1,Tt());x.backCompat(z,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class lt extends z{constructor(){super(...arguments),this.children=[]}getChildren(e){if(!e)return this.children||[];const n=this.children||[];var i=[];return n.forEach(function(s){e(s)&&i.push(s)}),i}hasChildren(){return this.getChildren().length>0}
1removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(var n=0;n<e.length;n++)this.add(e[n]);return this}const i=e[0];return i.getParent()?(i.moveTo(this),this):(this._validateAdd(i),i.index=this.getChildren().length,i.parent=this,i._clearCaches(),this.getChildren().push(i),this._fire("add",{child:i}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){var n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){var i=[];return this._descendants(s=>{const l=s._isMatch(e);return l&&i.push(s),!!(l&&n)}),i}_descendants(e){let n=!1;const i=this.getChildren();for(const s of i){if(n=e(s),n)return!0;if(s.hasChildren()&&(n=s._descendants(e),n))return!0}return!1}toObject(){var e=z.prototype.toObject.call(this);
1return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){for(var n=e.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){var n=z.prototype.clone.call(this,e);return this.getChildren().forEach(function(i){n.add(i.clone())}),n}getAllIntersections(e){var n=[];return this.find("Shape").forEach(function(i){i.isVisible()&&i.intersects(e)&&n.push(i)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(i){i._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,i){n.index=i}),this._requestDraw()}drawScene(e,n){var i=this.getLayer(),s=e||i&&i.getCanvas(),l=s&&s.getContext(),u=this._getCanvasCache(),c=u&&u.scene,f=s&&s.isCache;if(!this.isVisible()&&!f)return this;if(c){l.save();var p=this.getAbsoluteTransform(n).getMatrix();l.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedSceneCanvas(l),l.restore()}else this._drawChildren("drawScene",s,n);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;var i=this.getLayer(),s=e||i&&i.hitCanvas,l=s&&s.getContext(),u=this._getCanvasCache(),c=u&&u.hit;if(c){l.save();var f=this.getAbsoluteTransform(n).getMatrix();l.transform(f[0],f[1],f[2],f[3],f[4],f[5]),this._drawCachedHitCanvas(l),l.restore()}else this._drawChildren("drawHit",s,n);return this}_drawChildren(e,n,i){var s,l=n&&n.getContext(),u=this.clipWidth(),c=this.clipHeight(),f=this.clipFunc(),p=u&&c||f;const v=i===this;if(p){l.save();var _=this.getAbsoluteTransform(i),y=_.getMatrix();if(l.transform(y[0],y[1],y[2],y[3],y[4],y[5]),l.beginPath(),f)f.call(this,l,this);else{var w=this.clipX(),S=this.clipY();l.rect(w,S,u,c)}l.clip(),y=_.copy().invert().getMatrix(),l.transform(y[0],y[1],y[2],y[3],y[4],y[5])}var N=!v&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";N&&(l.save(),l._applyGlobalCompositeOperation(this)),(s=this.children)===null||s===void 0||s.forEach(function(E){E[e](n,i)}),N&&l.restore(),p&&l.restore()}getClientRect(e){var n;e=e||{};var i=e.skipTransform,s=e.relativeTo,l,u,c,f,p={x:1/0,y:1/0,width:0,height:0},v=this;(n=this.children)===null||n===void 0||n.forEach(function(N){if(N.visible()){var E=N.getClientRect({relativeTo:v,skipShadow:e.skipShadow,skipStroke:e.skipStroke});E.width===0&&E.height===0||(l===void 0?(l=E.x,u=E.y,c=E.x+E.width,f=E.y+E.height):(l=Math.min(l,E.x),u=Math.min(u,E.y),c=Math.max(c,E.x+E.width),f=Math.max(f,E.y+E.height)))}});for(var _=this.find("Shape"),y=!1,w=0;w<_.length;w++){var S=_[w];if(S._isVisible(this)){y=!0;break}}return y&&l!==void 0?p={x:l,y:u,width:c-l,height:f-u}:p={x:0,y:0,width:0,height:0},i?p:this._transformedRect(p,s)}}x.addComponentsGetterSetter(lt,"clip",["x","y","width","height"]);x.addGetterSetter(lt,"clipX",void 0,b());x.addGetterSetter(lt,"clipY",void 0,b());x.addGetterSetter(lt,"clipWidth",void 0,b());x.addGetterSetter(lt,"clipHeight",void 0,b());x.addGetterSetter(lt,"clipFunc");const Nn=new Map,Sh=Y._global.PointerEvent!==void 0;function ds(o){return Nn.get(o)}function Ds(o){return{evt:o,pointerId:o.pointerId}}function xh(o,e){return Nn.get(o)===e}function wh(o,e){Tn(o),e.getStage()&&(Nn.set(o,e),Sh&&e._fire("gotpointercapture",Ds(new PointerEvent("gotpointercapture"))))}function Tn(o,e){const n=Nn.get(o);if(!n)return;const i=n.getStage();i&&i.content,Nn.delete(o),Sh&&n._fire("lostpointercapture",Ds(new PointerEvent("lostpointercapture")))}var Hc="Stage",Uc="string",Hl="px",Wc="mouseout",Ch="mouseleave",Ph="mouseover",kh="mouseenter",Eh="mousemove",Th="mousedown",Rh="mouseup",wn="pointermove",Cn="pointerdown",Wr="pointerup",Pn="pointercancel",Yc="lostpointercapture",Ai="pointerout",Ni="pointerleave",Mi="pointerover",Li="pointerenter",Ps="contextmenu",Ah="touchstart",Nh="touchend",Mh="touchmove",Lh="touchcancel",ks="wheel",Xc=5,Vc=[[kh,"_pointerenter"],[Th,"_pointerdown"],[Eh,"_pointermove"],[Rh,"_pointerup"],[Ch,"_pointerleave"],[Ah,"_pointerdown"],[Mh,"_pointermove"],[Nh,"_pointerup"],[Lh,"_pointercancel"],[Ph,"_pointerover"],[ks,"_wheel"],[Ps,"_contextmenu"],[Cn,"_pointerdown"],[wn,"_pointermove"],[Wr,"_pointerup"],[Pn,"_pointercancel"],[Yc,"_lostpointercapture"]];const cs={mouse:{[Ai]:Wc,[Ni]:Ch,[Mi]:Ph,[Li]:kh,[wn]:Eh,[Cn]:Th,[Wr]:Rh,[Pn]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[Ai]:"touchout",[Ni]:"touchleave",[Mi]:"touchover",[Li]:"touchenter",[wn]:Mh,[Cn]:Ah,[Wr]:Nh,[Pn]:Lh,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[Ai]:Ai,[Ni]:Ni,[Mi]:Mi,[Li]:Li,[wn]:wn,[Cn]:Cn,[Wr]:Wr,[Pn]:Pn,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},kn=o=>o.indexOf("pointer")>=0?"pointer":o.indexOf("touch")>=0?"touch":"mouse",Hr=o=>{const e=kn(o);if(e==="pointer")return Y.pointerEventsEnabled&&cs.pointer;if(e==="touch")return cs.touch;if(e==="mouse")return cs.mouse};function Ul(o={}){return(o.clipFunc||o.clipWidth||o.clipHeight)&&k.warn("Stage does not support clipping. Please use clip for Layers or Groups."),o}const qc="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);",ji=[];let Yi=class extends lt{constructor(e){super(Ul(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),ji.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{Ul(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",i=e.getType()==="FastLayer";n||i||k.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===Uc){if(e.charAt(0)==="."){var n=e.slice(1);e=document.getElementsByClassName(n)[0]}else{var i;e.charAt(0)!=="#"?i=e:i=e.slice(1),e=document.getElementById(i)}if(!e)throw"Can not find container in document with id "+i}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var e=this.children,n=e.length,i;for(i=0;i<n;i++)e[i].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),lt.prototype.clone.call(this,e)}destroy(){super.destroy();var e=this.content;e&&k._isInDocument(e)&&this.container().removeChild(e);var n=ji.indexOf(this);return n>-1&&ji.splice(n,1),k.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(k.warn(qc),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e=e||{},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();var n=new Xr({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),i=n.getContext()._context,s=this.children;
1return(e.x||e.y)&&i.translate(-1*e.x,-1*e.y),s.forEach(function(l){if(l.isVisible()){var u=l._toKonvaCanvas(e);i.drawImage(u._canvas,e.x,e.y,u.getWidth()/u.getPixelRatio(),u.getHeight()/u.getPixelRatio())}}),n}getIntersection(e){if(!e)return null;var n=this.children,i=n.length,s=i-1,l;for(l=s;l>=0;l--){const u=n[l].getIntersection(e);if(u)return u}return null}_resizeDOM(){var e=this.width(),n=this.height();this.content&&(this.content.style.width=e+Hl,this.content.style.height=n+Hl),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(i=>{i.setSize({width:e,height:n}),i.draw()})}add(e,...n){if(arguments.length>1){for(var i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);var s=this.children.length;return s>Xc&&k.warn("The stage has "+s+" 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."),e.setSize({width:this.width(),height:this.height()}),e.draw(),Y.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return xh(e,this)}setPointerCapture(e){wh(e,this)}releaseCapture(e){Tn(e)}getLayers(){return this.children}_bindContentEvents(){Y.isBrowser&&Vc.forEach(([e,n])=>{this.content.addEventListener(e,i=>{this[n](i)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Hr(e.type);this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Hr(e.type);this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Hr(e.type),i=kn(e.type);if(n){this.setPointersPositions(e);var s=this._getTargetShape(i),l=!ce.isDragging||Y.hitOnDragEnabled;s&&l?(s._fireAndBubble(n.pointerout,{evt:e}),s._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[i+"targetShape"]=null):l&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(e){const n=Hr(e.type),i=kn(e.type);if(n){this.setPointersPositions(e);var s=!1;this._changedPointerPositions.forEach(l=>{var u=this.getIntersection(l);if(ce.justDragged=!1,Y["_"+i+"ListenClick"]=!0,!(u&&u.isListening()))return;Y.capturePointerEventsEnabled&&u.setPointerCapture(l.id),this[i+"ClickStartShape"]=u,u._fireAndBubble(n.pointerdown,{evt:e,pointerId:l.id}),s=!0;const f=e.type.indexOf("touch")>=0;u.preventDefault()&&e.cancelable&&f&&e.preventDefault()}),s||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(e){const n=Hr(e.type),i=kn(e.type);if(!n)return;ce.isDragging&&ce.node.preventDefault()&&e.cancelable&&e.preventDefault(),this.setPointersPositions(e);var s=!ce.isDragging||Y.hitOnDragEnabled;if(!s)return;var l={};let u=!1;var c=this._getTargetShape(i);this._changedPointerPositions.forEach(f=>{const p=ds(f.id)||this.getIntersection(f),v=f.id,_={evt:e,pointerId:v};var y=c!==p;if(y&&c&&(c._fireAndBubble(n.pointerout,Object.assign({},_),p),c._fireAndBubble(n.pointerleave,Object.assign({},_),p)),p){if(l[p._id])return;l[p._id]=!0}p&&p.isListening()?(u=!0,y&&(p._fireAndBubble(n.pointerover,Object.assign({},_),c),p._fireAndBubble(n.pointerenter,Object.assign({},_),c),this[i+"targetShape"]=p),p._fireAndBubble(n.pointermove,Object.assign({},_))):c&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:v}),this[i+"targetShape"]=null)}),u||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Hr(e.type),i=kn(e.type);if(!n)return;this.setPointersPositions(e);const s=this[i+"ClickStartShape"],l=this[i+"ClickEndShape"];var u={};let c=!1;this._changedPointerPositions.forEach(f=>{const p=ds(f.id)||this.getIntersection(f);if(p){if(p.releaseCapture(f.id),u[p._id])return;u[p._id]=!0}const v=f.id,_={evt:e,pointerId:v};let y=!1;Y["_"+i+"InDblClickWindow"]?(y=!0,clearTimeout(this[i+"DblTimeout"])):ce.justDragged||(Y["_"+i+"InDblClickWindow"]=!0,clearTimeout(this[i+"DblTimeout"])),this[i+"DblTimeout"]=setTimeout(function(){Y["_"+i+"InDblClickWindow"]=!1}
1,Y.dblClickWindow),p&&p.isListening()?(c=!0,this[i+"ClickEndShape"]=p,p._fireAndBubble(n.pointerup,Object.assign({},_)),Y["_"+i+"ListenClick"]&&s&&s===p&&(p._fireAndBubble(n.pointerclick,Object.assign({},_)),y&&l&&l===p&&p._fireAndBubble(n.pointerdblclick,Object.assign({},_)))):(this[i+"ClickEndShape"]=null,Y["_"+i+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:v}),y&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:v}))}),c||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Y["_"+i+"ListenClick"]=!1,e.cancelable&&i!=="touch"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Ps,{evt:e}):this._fire(Ps,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);var n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(ks,{evt:e}):this._fire(ks,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=ds(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Wr,Ds(e)),Tn(e.pointerId)}_lostpointercapture(e){Tn(e.pointerId)}setPointersPositions(e){var n=this._getContentPosition(),i=null,s=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,l=>{this._pointerPositions.push({id:l.identifier,x:(l.clientX-n.left)/n.scaleX,y:(l.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,l=>{this._changedPointerPositions.push({id:l.identifier,x:(l.clientX-n.left)/n.scaleX,y:(l.clientY-n.top)/n.scaleY})})):(i=(e.clientX-n.left)/n.scaleX,s=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:i,y:s},this._pointerPositions=[{x:i,y:s,id:k._getFirstPointerId(e)}],this._changedPointerPositions=[{x:i,y:s,id:k._getFirstPointerId(e)}])}_setPointerPosition(e){k.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new Xr({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Os({pixelRatio:1,width:this.width(),height:this.height()}),!!Y.isBrowser){var e=this.container();if(!e)throw"Stage has no container. A container is required.";e.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"),e.appendChild(this.content),this._resizeDOM()}}cache(){return k.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}
1batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};Yi.prototype.nodeType=Hc;Ae(Yi);x.addGetterSetter(Yi,"container");var Ih="hasShadow",Oh="shadowRGBA",Dh="patternImage",Gh="linearGradient",zh="radialGradient";let Ii;function fs(){return Ii||(Ii=k.createCanvasElement().getContext("2d"),Ii)}const Rn={};function Qc(o){o.fill()}function Kc(o){o.stroke()}function Jc(o){o.fill()}function Zc(o){o.stroke()}function $c(){this._clearCache(Ih)}function ef(){this._clearCache(Oh)}function tf(){this._clearCache(Dh)}function rf(){this._clearCache(Gh)}function nf(){this._clearCache(zh)}class O extends z{constructor(e){super(e);let n;for(;n=k.getRandomColor(),!(n&&!(n in Rn)););this.colorKey=n,Rn[n]=this}getContext(){return k.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return k.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(Ih,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(Dh,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var e=fs();const n=e.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const i=new ot;i.translate(this.fillPatternX(),this.fillPatternY()),i.rotate(Y.getAngle(this.fillPatternRotation())),i.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),i.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const s=i.getMatrix(),l=typeof DOMMatrix>"u"?{a:s[0],b:s[1],c:s[2],d:s[3],e:s[4],f:s[5]}:new DOMMatrix(s);n.setTransform(l)}return n}}_getLinearGradient(){return this._getCache(Gh,this.__getLinearGradient)}__getLinearGradient(){var e=this.fillLinearGradientColorStops();if(e){for(var n=fs(),i=this.fillLinearGradientStartPoint(),s=this.fillLinearGradientEndPoint(),l=n.createLinearGradient(i.x,i.y,s.x,s.y),u=0;u<e.length;u+=2)l.addColorStop(e[u],e[u+1]);return l}}_getRadialGradient(){return this._getCache(zh,this.__getRadialGradient)}__getRadialGradient(){var e=this.fillRadialGradientColorStops();if(e){for(var n=fs(),i=this.fillRadialGradientStartPoint(),s=this.fillRadialGradientEndPoint(),l=n.createRadialGradient(i.x,i.y,this.fillRadialGradientStartRadius(),s.x,s.y,this.fillRadialGradientEndRadius()),u=0;u<e.length;u+=2)l.addColorStop(e[u],e[u+1]);return l}}getShadowRGBA(){return this._getCache(Oh,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var e=k.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.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(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){var n=this.getStage(),i=n.bufferHitCanvas,s;return i.getContext().clear(),this.drawHit(i,null,!0),s=i.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data,s[3]>0}destroy(){return z.prototype.destroy.call(this),delete Rn[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!this.getStage()||!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const s=e||this.hasFill(),l=this.hasStroke(),u=this.getAbsoluteOpacity()!==1;if(s&&l&&u)return!0;const c=this.hasShadow(),f=this.shadowForStrokeEnabled();return!!(s&&l&&c&&f)}setStrokeHitEnabled(e){k.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){const n=e.skipTransform,i=e.relativeTo,s=this.getSelfRect(),u=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,c=s.width+u,f=s.height+u,p=!e.skipShadow&&this.hasShadow(),v=p?this.shadowOffsetX():0,_=p?this.shadowOffsetY():0,y=c+Math.abs(v),w=f+Math.abs(_),S=p&&this.shadowBlur()||0,N=y+S*2,E=w+S*2,D={width:N,height:E,x:-(u/2+S)+Math.min(v,0)+s.x,y:-(u/2+S)+Math.min(_,0)+s.y};return n?D:this._transformedRect(D,i)}drawScene(e,n){var i=this.getLayer(),s=e||i.getCanvas(),l=s.getContext(),u=this._getCanvasCache(),c=this.getSceneFunc(),f=this.hasShadow(),p,v,_,y=s.isCache,w=n===this;if(!this.isVisible()&&!w)return this;if(u){l.save();var S=this.getAbsoluteTransform(n).getMatrix();return l.transform(S[0],S[1],S[2],S[3],S[4],S[5]),this._drawCachedSceneCanvas(l),l.restore(
1),this}if(!c)return this;if(l.save(),this._useBufferCanvas()&&!y){p=this.getStage(),v=p.bufferCanvas,_=v.getContext(),_.clear(),_.save(),_._applyLineJoin(this);var N=this.getAbsoluteTransform(n).getMatrix();_.transform(N[0],N[1],N[2],N[3],N[4],N[5]),c.call(this,_,this),_.restore();var E=v.pixelRatio;f&&l._applyShadow(this),l._applyOpacity(this),l._applyGlobalCompositeOperation(this),l.drawImage(v._canvas,0,0,v.width/E,v.height/E)}else{if(l._applyLineJoin(this),!w){var N=this.getAbsoluteTransform(n).getMatrix();l.transform(N[0],N[1],N[2],N[3],N[4],N[5]),l._applyOpacity(this),l._applyGlobalCompositeOperation(this)}f&&l._applyShadow(this),c.call(this,l,this)}return l.restore(),this}drawHit(e,n,i=!1){if(!this.shouldDrawHit(n,i))return this;var s=this.getLayer(),l=e||s.hitCanvas,u=l&&l.getContext(),c=this.hitFunc()||this.sceneFunc(),f=this._getCanvasCache(),p=f&&f.hit;if(this.colorKey||k.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()"),p){u.save();var v=this.getAbsoluteTransform(n).getMatrix();return u.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedHitCanvas(u),u.restore(),this}if(!c)return this;if(u.save(),u._applyLineJoin(this),!(this===n)){var y=this.getAbsoluteTransform(n).getMatrix();u.transform(y[0],y[1],y[2],y[3],y[4],y[5])}return c.call(this,u,this),u.restore(),this}drawHitFromCache(e=0){var n=this._getCanvasCache(),i=this._getCachedSceneCanvas(),s=n.hit,l=s.getContext(),u=s.getWidth(),c=s.getHeight(),f,p,v,_,y,w;l.clear(),l.drawImage(i._canvas,0,0,u,c);try{for(f=l.getImageData(0,0,u,c),p=f.data,v=p.length,_=k._hexToRgb(this.colorKey),y=0;y<v;y+=4)w=p[y+3],w>e?(p[y]=_.r,p[y+1]=_.g,p[y+2]=_.b,p[y+3]=255):p[y+3]=0;l.putImageData(f,0,0)}catch(S){k.error("Unable to draw hit graph from cached scene canvas. "+S.message)}return this}hasPointerCapture(e){return xh(e,this)}setPointerCapture(e){wh(e,this)}releaseCapture(e){Tn(e)}}O.prototype._fillFunc=Qc;O.prototype._strokeFunc=Kc;O.prototype._fillFuncHit=Jc;O.prototype._strokeFuncHit=Zc;O.prototype._centroid=!1;O.prototype.nodeType="Shape";Ae(O);O.prototype.eventListeners={};O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",$c);O.prototype.on.call(O.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",ef);O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",tf);O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",rf);O.prototype.on.call(O.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",nf);x.addGetterSetter(O,"stroke",void 0,_h());x.addGetterSetter(O,"strokeWidth",2,b());x.addGetterSetter(O,"fillAfterStrokeEnabled",!1);x.addGetterSetter(O,"hitStrokeWidth","auto",Is());x.addGetterSetter(O,"strokeHitEnabled",!0,Tt());x.addGetterSetter(O,"perfectDrawEnabled",!0,Tt());x.addGetterSetter(O,"shadowForStrokeEnabled",!0,Tt());x.addGetterSetter(O,"lineJoin");x.addGetterSetter(O,"lineCap");x.addGetterSetter(O,"sceneFunc");x.addGetterSetter(O,"hitFunc");x.addGetterSetter(O,"dash");x.addGetterSetter(O,"dashOffset",0,b());x.addGetterSetter(O,"shadowColor",void 0,qr());x.addGetterSetter(O,"shadowBlur",0,b());x.addGetterSetter(O,"shadowOpacity",1,b());x.addComponentsGetterSetter(O,"shadowOffset",["x","y"]);x.addGetterSetter(O,"shadowOffsetX",0,b());x.addGetterSetter(O,"shadowOffsetY",0,b());x.addGetterSetter(O,"fillPatternImage");x.addGetterSetter(O,"fill",void 0,_h());x.addGetterSetter(O,"fillPatternX",0,b());x.addGetterSetter(O,"fillPatternY",0,b());x.addGetterSetter(O,"fillLinearGradientColorStops");x.addGetterSetter(O,"strokeLinearGradientColorStops");x.addGetterSetter(O,"fillRadialGradientStartRadius",0);x.addGetterSetter(O,"fillRadialGradientEndRadius",0);x.addGetterSetter(O,"fillRadialGradientColorStops");x.addGetterSetter(O,"fillPatternRepeat","repeat");x.addGetterSetter(O,"fillEnabled",!0);x.addGetterSetter(O,"strokeEnabled",!0);x.addGetterSetter(O,"shadowEnabled",!0);x.addGetterSetter(O,"dashEnabled",!0);x.addGetterSetter(O,"strokeScaleEnabled",!0);x.addGetterSetter(O,"fillPriority","color");x.addComponentsGetterSetter(O,"fillPatternOffset",["x","y"]);x.addGetterSetter(O,"fillPatternOffsetX",0,b());x.addGetterSetter(O,"fillPatternOffsetY",0,b());x.addComponentsGetterSetter(O,"fillPatternScale",["x","y"]);x.addGetterSetter(O,"fillPatternScaleX",1,b());x.addGetterSetter(O,"fillPatternScaleY",1,b());x.addComponentsGetterSetter(O,"fillLinearGradientStartPoint",["x","y"]);x.addComponentsGetterSetter(O,"strokeLinearGradientStartPoint",["x","y"]);x.addGetterSetter(O,"fillLinearGradientStartPointX",0);x.addGetterSetter(O,"strokeLinearGradientStartPointX",0);x.addGetterSetter(O,"fillLinearGradientStartPointY",0);x.addGetterSetter(O,"strokeLinearGradientStartPointY",0);x.addComponentsGetterSetter(O,"fillLinearGradientEndPoint",["x","y"]);x.addComponentsGetterSetter(O,"strokeLinearGradientEndPoint",["x","y"]);x.addGetterSetter(O,"fillLinearGradientEndPointX",0);x.addGetterSetter(O,"strokeLinearGradientEndPointX",0);x.addGetterSetter(O,"fillLinearGradientEndPointY",0);x.addGetterSetter(O,"strokeLinearGradientEndPointY",0);x.addComponentsGetterSetter(O,"fillRadialGradientStartPoint",["x","y"]);x.addGetterSetter(O,"fillRadialGradientStartPointX",0);x.addGetterSetter(O,"fillRadialGradientStartPointY",0);x.addComponentsGetterSetter(O,"fillRadialGradientEndPoint",["x","y"]);x.addGetterSetter(O,"fillRadialGradientEndPointX",0);x.addGetterSetter(O,"fillRadialGradientEndPointY",0);x.addGetterSetter(O,"fillPatternRotation",0);x.backCompat(O,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});var af="#",sf="beforeDraw",of="draw",bh=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],lf=bh.length;let Cr=class extends lt{constructor(e){super(e),this.canvas=new Xr,this.hitCanvas=new Os({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(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){z.prototype.moveToTop.call(this);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var e=z.prototype.moveUp.call(this);if(!e)return!1;var n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(z.prototype.moveDown.call(this)){var e=this.getStage();if(e){var n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(z.prototype.moveToBottom.call(this)){var e=this.getStage();if(e){var n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var e=this.getNativeCanvasElement();return z.prototype.remove.call(this),e&&e.parentNode&&k._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){var n=e.getType();n!=="Group"&&n!=="Shape"&&k.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e=e||{},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),z.prototype._toKonvaCanvas.call(this,e)}_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(){k.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){k.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,k.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var n=1,i=!1;;){for(let s=0;s<lf;s++){const l=bh[s],u=this._getIntersection({x:e.x+l.x*n,y:e.y+l.y*n}),c=u.shape;if(c)return c;if(i=!!u.antialiased,!u.antialiased)break}if(i)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,i=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,s=i[3];if(s===255){const l=k._rgbToHex(i[0],i[1],i[2]),u=Rn[af+l];return u?{shape:u}:{antialiased:!0}}else if(s>0)return{antialiased:!0};return{}}drawScene(e,n){var i=this.getLayer(),s=e||i&&i.getCanvas();return this._fire(sf,{node:this}),this.clearBeforeDraw()&&s.getContext().clear(),lt.prototype.drawScene.call(this,s,n),this._fire(of,{node:this}),this}drawHit(e,n){var i=this.getLayer(),s=e||i&&i.hitCanvas;return i&&i.clearBeforeDraw()&&i.getHitCanvas().getContext().clear(),lt.prototype.drawHit.call(this,s,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){k.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return k.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var e=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return k.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};Cr.prototype.nodeType="Layer";Ae(Cr);x.addGetterSetter(Cr,"imageSmoothingEnabled",!0);x.addGetterSetter(Cr,"clearBeforeDraw",!0);x.addGetterSetter(Cr,"hitGraphEnabled",!0,Tt());class Gs extends Cr{constructor(e){super(e),this.listening(!1),k.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Gs.prototype.nodeType="FastLayer";Ae(Gs);class Vr extends lt{_validateAdd(e){var n=e.getType();n!=="Group"&&n!=="Shape"&&k.throw("You may only add groups and shapes to groups.")}}Vr.prototype.nodeType="Group";Ae(Vr);var gs=function(){return Yr.performance&&Yr.performance.now?function(){return Yr.performance.now()}:function(){return new Date().getTime()}}();class yt{constructor(e,n){this.id=yt.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:gs(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){var n=[];return e?e.length>0?n=e:n=[e]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(e){var n=this.layers,i=n.length,s;for(s=0;s<i;s++)if(n[s]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){var e=yt,n=e.animations,i=n.length,s;for(s=0;s<i;s++)if(n[s].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=gs(),yt._addAnimation(this),this}stop(){return yt._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){var n=e.id,i=this.animations,s=i.length,l;for(l=0;l<s;l++)if(i[l].id===n){this.animations.splice(l,1);break}}static _runFrames(){var e={},n=this.animations,i,s,l,u,c,f,p,v,_;for(u=0;
1u<n.length;u++)if(i=n[u],s=i.layers,l=i.func,i._updateFrameObject(gs()),f=s.length,l?_=l.call(i,i.frame)!==!1:_=!0,!!_)for(c=0;c<f;c++)p=s[c],p._id!==void 0&&(e[p._id]=p);for(v in e)e.hasOwnProperty(v)&&e[v].batchDraw()}static _animationLoop(){var e=yt;e.animations.length?(e._runFrames(),k.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,k.requestAnimFrame(this._animationLoop))}}yt.animations=[];yt.animIdCounter=0;yt.animRunning=!1;var hf={node:1,duration:1,easing:1,onFinish:1,yoyo:1},uf=1,Wl=2,Yl=3,df=0,Xl=["fill","stroke","shadowColor"];class cf{constructor(e,n,i,s,l,u,c){this.prop=e,this.propFunc=n,this.begin=s,this._pos=s,this.duration=u,this._change=0,this.prevPos=0,this.yoyo=c,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=i,this._change=l-this.begin,this.pause()}fire(e){var n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=Wl,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=Yl,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,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 e=this.getTimer()-this._startTime;this.state===Wl?this.setTime(e):this.state===Yl&&this.setTime(this.duration-e)}pause(){this.state=uf,this.fire("onPause")}getTimer(){return new Date().getTime()}}class Ie{constructor(e){var n=this,i=e.node,s=i._id,l,u=e.easing||An.Linear,c=!!e.yoyo,f;typeof e.duration>"u"?l=.3:e.duration===0?l=.001:l=e.duration,this.node=i,this._id=df++;var p=i.getLayer()||(i instanceof Y.Stage?i.getLayers():null);p||k.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new yt(function(){n.tween.onEnterFrame()},p),this.tween=new cf(f,function(v){n._tweenFunc(v)},u,0,1,l*1e3,c),this._addListeners(),Ie.attrs[s]||(Ie.attrs[s]={}),Ie.attrs[s][this._id]||(Ie.attrs[s][this._id]={}),Ie.tweens[s]||(Ie.tweens[s]={});for(f in e)hf[f]===void 0&&this._addAttr(f,e[f]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){var i=this.node,s=i._id,l,u,c,f,p,v,_,y;if(c=Ie.tweens[s][e],c&&delete Ie.attrs[s][c][e],l=i.getAttr(e),k._isArray(n))if(u=[],p=Math.max(n.length,l.length),e==="points"&&n.length!==l.length&&(n.length>l.length?(_=l,l=k._prepareArrayForTween(l,n,i.closed())):(v=n,n=k._prepareArrayForTween(n,l,i.closed()))),e.indexOf("fill")===0)for(f=0;f<p;f++)if(f%2===0)u.push(n[f]-l[f]);else{var w=k.colorToRGBA(l[f]);y=k.colorToRGBA(n[f]),l[f]=w,u.push({r:y.r-w.r,g:y.g-w.g,b:y.b-w.b,a:y.a-w.a})}else for(f=0;f<p;f++)u.push(n[f]-l[f]);else Xl.indexOf(e)!==-1?(l=k.colorToRGBA(l),y=k.colorToRGBA(n),u={r:y.r-l.r,g:y.g-l.g,b:y.b-l.b,a:y.a-l.a}):u=n-l;Ie.attrs[s][this._id][e]={start:l,diff:u,end:n,trueEnd:v,trueStart:_},Ie.tweens[s][e]=this._id}_tweenFunc(e){var n=this.node,i=Ie.attrs[n._id][this._id],s,l,u,c,f,p,v,_;for(s in i){if(l=i[s],u=l.start,c=l.diff,_=l.end,k._isArray(u))if(f=[],v=Math.max(u.length,_.length),s.indexOf("fill")===0)for(p=0;p<v;p++)p%2===0?f.push((u[p]||0)+c[p]*e):f.push("rgba("+Math.round(u[p].r+c[p].r*e)+","+Math.round(u[p].g+c[p].g*e)+","+Math.round(u[p].b+c[p].b*e)+","+(u[p].a+c[p].a*e)+")");else for(p=0;p<v;p++)f.push((u[p]||0)+c[p]*e);else Xl.indexOf(s)!==-1?f="rgba("+Math.round(u.r+c.r*e)+","+Math.round(u.g+c.g*e)+","+Math.round(u.b+c.b*e)+","+(u.a+c.a*e)+")":f=u+c*e;n.setAttr(s,f)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var e=this.node,n=Ie.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var e=this.node,n=Ie.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.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(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var e=this.node._id,n=this._id,i=Ie.tweens[e],s;this.pause();for(s in i)delete Ie.tweens[e][s];delete Ie.attrs[e][n]}}Ie.attrs={};Ie.tweens={};z.prototype.to=function(o){var e=o.onFinish;o.node=this,o.onFinish=function(){this.destroy(),e&&e()};var n=new Ie(o);n.play()};const An={BackEaseIn(o,e,n,i){var s=1.70158;return n*(o/=i)*o*((s+1)*o-s)+e},BackEaseOut(o,e,n,i){var s=1.70158;return n*((o=o/i-1)*o*((s+1)*o+s)+1)+e},BackEaseInOut(o,e,n,i){var s=1.70158;return(o/=i/2)<1?n/2*(o*o*(((s*=1.525)+1)*o-s))+e:n/2*((o-=2)*o*(((s*=1.525)+1)*o+s)+2)+e},ElasticEaseIn(o,e,n,i,s,l){var u=0;return o===0?e:(o/=i)===1?e+n:(l||(l=i*.3),!s||s<Math.abs(n)?(s=n,u=l/4):u=l/(2*Math.PI)*Math.asin(n/s),-(s*Math.pow(2,10*(o-=1))*Math.sin((o*i-u)*(2*Math.PI)/l))+e)},ElasticEaseOut(o,e,n,i,s,l){var u=0;return o===0?e:(o/=i)===1?e+n:(l||(l=i*.3),!s||s<Math.abs(n)?(s=n,u=l/4):u=l/(2*Math.PI)*Math.asin(n/s),s*Math.pow(2,-10*o)*Math.sin((o*i-u)*(2*Math.PI)/l)+n+e)},ElasticEaseInOut(o,e,n,i,s,l){var u=0;return o===0?e:(o/=i/2)===2?e+n:(l||(l=i*(.3*1.5)),!s||s<Math.abs(n)?(s=n,u=l/4):u=l/(2*Math.PI)*Math.asin(n/s),o<1?-.5*(s*Math.pow(2,10*(o-=1))*Math.sin((o*i-u)*(2*Math.PI)/l))+e:s*Math.pow(2,-10*(o-=1))*Math.sin((o*i-u)*(2*Math.PI)/l)*.5+n+e)},BounceEaseOut(o,e,n,i){return(o/=i)<1/2.75?n*(7.5625*o*o)+e:o<2/2.75?n*(7.5625*(o-=1.5/2.75)*o+.75)+e:o<2.5/2.75?n*(7.5625*(o-=2.25/2.75)*o+.9375)+e:n*(7.5625*(o-=2.625/2.75)*o+.984375)+e},BounceEaseIn(o,e,n,i){return n-An.BounceEaseOut(i-o,0,n,i)+e},BounceEaseInOut(o,e,n,i){return o<i/2?An.BounceEaseIn(o*2,0,n,i)*.5+e:An.BounceEaseOut(o*2-i,0,n,i)*.5+n*.5+e},EaseIn(o,e,n,i){return n*(o/=i)*o+e},EaseOut(o,e,n,i){return-n*(o/=i)*(o-2)+e},EaseInOut(o,e,n,i){return(o/=i/2)<1?n/2*o*o+e:-n/2*(--o*(o-2)-1)+e},StrongEaseIn(o,e,n,i){return n*(o/=i)*o*o*o*o+e},StrongEaseOut(o,e,n,i){return n*((o=o/i-1)*o*o*o*o+1)+e},StrongEaseInOut(o,e,n,i){return(o/=i/2)<1?n/2*o*o*o*o*o+e:n/2*((o-=2)*o*o*o*o+2)+e},Linear(o,e,n,i){return n*o/i+e}},wr=k._assign(Y,{Util:k,Transform:ot,Node:z,Container:lt,Stage:Yi,stages:ji,Layer:Cr,FastLayer:Gs,Group:Vr,DD:ce,Shape:O,shapes:Rn,Animation:yt,Tween:Ie,Easings:An,Context:Ui,Canvas:Wi});class Xt extends O{_sceneFunc(e){var n=Y.getAngle(this.angle()),i=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,i),e.arc(0,0,this.innerRadius(),n,0,!i),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),i=this.clockwise(),s=Y.getAngle(i?360-this.angle():this.angle()),l=Math.cos(Math.min(s,Math.PI)),u=1,c=Math.sin(Math.min(Math.max(Math.PI,s),3*Math.PI/2)),f=Math.sin(Math.min(s,Math.PI/2)),p=l*(l>0?e:n),v=u*n,_=c*(c>0?e:n),y=f*(f>0?n:e);return{x:p,y:i?-1*y:_,width:v-p,height:y-_}}}Xt.prototype._centroid=!0;Xt.prototype.className="Arc";Xt.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ae(Xt);x.addGetterSetter(Xt,"innerRadius",0,b());x.addGetterSetter(Xt,"outerRadius",0,b());x.addGetterSetter(Xt,"angle",0,b());x.addGetterSetter(Xt,"clockwise",!1,Tt());function Es(o,e,n,i,s,l,u){var c=Math.sqrt(Math.pow(n-o,2)+Math.pow(i-e,2)),f=Math.sqrt(Math.pow(s-n,2)+Math.pow(l-i,2)),p=u*c/(c+f),v=u*f/(c+f),_=n-p*(s-o),y=i-p*(l-e),w=n+v*(s-o),S=i+v*(l-e);return[_,y,w,S]}function Vl(o,e){var n=o.length,i=[],s,l;for(s=2;s<n-2;s+=2)l=Es(o[s-2],o[s-1],o[s],o[s+1],o[s+2],o[s+3],e),!isNaN(l[0])&&(i.push(l[0]),i.push(l[1]),i.push(o[s]),i.push(o[s+1]),i.push(l[2]),i.push(l[3]));return i}class Vt extends O{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){var n=this.points(),i=n.length,s=this.tension(),l=this.closed(),u=this.bezier(),c,f,p;if(i){if(e.beginPath(),e.moveTo(n[0],n[1]),s!==0&&i>4){for(c=this.getTensionPoints(),f=c.length,p=l?0:4,l||e.quadraticCurveTo(c[0],c[1],c[2],c[3]);p<f-2;)e.bezierCurveTo(c[p++],c[p++],c[p++],c[p++],c[p++],c[p++]);
1l||e.quadraticCurveTo(c[f-2],c[f-1],n[i-2],n[i-1])}else if(u)for(p=2;p<i;)e.bezierCurveTo(n[p++],n[p++],n[p++],n[p++],n[p++],n[p++]);else for(p=2;p<i;p+=2)e.lineTo(n[p],n[p+1]);l?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():Vl(this.points(),this.tension())}_getTensionPointsClosed(){var e=this.points(),n=e.length,i=this.tension(),s=Es(e[n-2],e[n-1],e[0],e[1],e[2],e[3],i),l=Es(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],i),u=Vl(e,i),c=[s[2],s[3]].concat(u).concat([l[0],l[1],e[n-2],e[n-1],l[2],l[3],s[0],s[1],e[0],e[1]]);return c}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:e=this.points();for(var n=e[0],i=e[0],s=e[1],l=e[1],u,c,f=0;f<e.length/2;f++)u=e[f*2],c=e[f*2+1],n=Math.min(n,u),i=Math.max(i,u),s=Math.min(s,c),l=Math.max(l,c);return{x:n,y:s,width:i-n,height:l-s}}}Vt.prototype.className="Line";Vt.prototype._attrsAffectingSize=["points","bezier","tension"];Ae(Vt);x.addGetterSetter(Vt,"closed",!1);x.addGetterSetter(Vt,"bezier",!1);x.addGetterSetter(Vt,"tension",0,b());x.addGetterSetter(Vt,"points",[],xc());class ye extends O{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this.dataArray=ye.parsePathData(this.data()),this.pathLength=0;for(var n=0;n<this.dataArray.length;++n)this.pathLength+=this.dataArray[n].pathLength;this.on("dataChange.konva",function(){this.dataArray=ye.parsePathData(this.data()),this.pathLength=0;for(var i=0;i<this.dataArray.length;++i)this.pathLength+=this.dataArray[i].pathLength})}_sceneFunc(e){var n=this.dataArray;e.beginPath();for(var i=!1,s=0;s<n.length;s++){var l=n[s].command,u=n[s].points;switch(l){case"L":e.lineTo(u[0],u[1]);break;case"M":e.moveTo(u[0],u[1]);break;case"C":e.bezierCurveTo(u[0],u[1],u[2],u[3],u[4],u[5]);break;case"Q":e.quadraticCurveTo(u[0],u[1],u[2],u[3]);break;case"A":var c=u[0],f=u[1],p=u[2],v=u[3],_=u[4],y=u[5],w=u[6],S=u[7],N=p>v?p:v,E=p>v?1:p/v,D=p>v?v/p:1;e.translate(c,f),e.rotate(w),e.scale(E,D),e.arc(0,0,N,_,_+y,1-S),e.scale(1/E,1/D),e.rotate(-w),e.translate(-c,-f);break;case"z":i=!0,e.closePath();break}}!i&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(p){if(p.command==="A"){var v=p.points[4],_=p.points[5],y=p.points[4]+_,w=Math.PI/180;if(Math.abs(v-y)<w&&(w=Math.abs(v-y)),_<0)for(let S=v-w;S>y;S-=w){const N=ye.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],S,0);e.push(N.x,N.y)}else for(let S=v+w;S<y;S+=w){const N=ye.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],S,0);e.push(N.x,N.y)}}else if(p.command==="C")for(let S=0;S<=1;S+=.01){const N=ye.getPointOnCubicBezier(S,p.start.x,p.start.y,p.points[0],p.points[1],p.points[2],p.points[3],p.points[4],p.points[5]);e.push(N.x,N.y)}else e=e.concat(p.points)});for(var n=e[0],i=e[0],s=e[1],l=e[1],u,c,f=0;f<e.length/2;f++)u=e[f*2],c=e[f*2+1],isNaN(u)||(n=Math.min(n,u),i=Math.max(i,u)),isNaN(c)||(s=Math.min(s,c),l=Math.max(l,c));return{x:n,y:s,width:i-n,height:l-s}}getLength(){return this.pathLength}getPointAtLength(e){var n,i=0,s=this.dataArray.length;if(!s)return null;for(;i<s&&e>this.dataArray[i].pathLength;)e-=this.dataArray[i].pathLength,++i;if(i===s)return n=this.dataArray[i-1].points.slice(-2),{x:n[0],y:n[1]};if(e<.01)return n=this.dataArray[i].points.slice(0,2),{x:n[0],y:n[1]};var l=this.dataArray[i],u=l.points;switch(l.command){case"L":return ye.getPointOnLine(e,l.start.x,l.start.y,u[0],u[1]);case"C":return ye.getPointOnCubicBezier(e/l.pathLength,l.start.x,l.start.y,u[0],u[1],u[2],u[3],u[4],u[5]);case"Q":return ye.getPointOnQuadraticBezier(e/l.pathLength,l.start.x,l.start.y,u[0],u[1],u[2],u[3]);case"A":var c=u[0],f=u[1],p=u[2],v=u[3],_=u[4],y=u[5],w=u[6];return _+=y*e/l.pathLength,ye.getPointOnEllipticalArc(c,f,p,v,_,w)}return null}static getLineLength(e,n,i,s){return Math.sqrt((i-e)*(i-e)+(s-n)*(s-n))}static getPointOnLine(e,n,i,s,l,u,c){u===void 0&&(u=n),c===void 0&&(c=i);var f=(l-i)/(s-n+1e-8),p=Math.sqrt(e*e/(1+f*f));s<n&&(p*=-1);var v=f*p,_;if(s===n)_={x:u,y:c+v};else if((c-i)/(u-n+1e-8)===f)_={x:u+p,y:c+v};else{var y,w,S=this.getLineLength(n,i,s,l),N=(u-n)*(s-n)+(c-i)*(l-i);N=N/(S*S),y=n+N*(s-n),w=i+N*(l-i);var E=this.getLineLength(u,c,y,w),D=Math.sqrt(e*e-E*E);p=Math.sqrt(D*D/(1+f*f)),s<n&&(p*=-1),v=f*p,_={x:y+p,y:w+v}}return _}static getPointOnCubicBezier(e,n,i,s,l,u,c,f,p){function v(E){return E*E*E}function _(E){return 3*E*E*(1-E)}function y(E){return 3*E*(1-E)*(1-E)}function w(E){return(1-E)*(1-E)*(1-E)}var S=f*v(e)+u*_(e)+s*y(e)+n*w(e),N=p*v(e)+c*_(e)+l*y(e)+i*w(e);return{x:S,y:N}}static getPointOnQuadraticBezier(e,n,i,s,l,u,c){function f(w){return w*w}function p(w){return 2*w*(1-w)}function v(w){return(1-w)*(1-w)}var _=u*f(e)+s*p(e)+n*v(e),y=c*f(e)+l*p(e)+i*v(e);return{x:_,y}}static getPointOnEllipticalArc(e,n,i,s,l,u){var c=Math.cos(u),f=Math.sin(u),p={x:i*Math.cos(l),y:s*Math.sin(l)};return{x:e+(p.x*c-p.y*f),y:n+(p.x*f+p.y*c)}}static parsePathData(e){if(!e)return[];var n=e,i=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(var s=0;s<i.length;s++)n=n.replace(new RegExp(i[s],"g"),"|"+i[s]);var l=n.split("|"),u=[],c=[],f=0,p=0,v=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,_;for(s=1;s<l.length;s++){var y=l[s],w=y.charAt(0);for(y=y.slice(1),c.length=0;_=v.exec(y);)c.push(_[0]);for(var S=[],N=0,E=c.length;N<E;N++){if(c[N]==="00"){S.push(0,0);continue}var D=parseFloat(c[N]);isNaN(D)?S.push(0):S.push(D)}for(;S.length>0&&!isNaN(S[0]);
1){var I=null,L=[],F=f,X=p,j,q,U,Q,J,K,re,$,fe,Z;switch(w){case"l":f+=S.shift(),p+=S.shift(),I="L",L.push(f,p);break;case"L":f=S.shift(),p=S.shift(),L.push(f,p);break;case"m":var te=S.shift(),ge=S.shift();if(f+=te,p+=ge,I="M",u.length>2&&u[u.length-1].command==="z"){for(var pe=u.length-2;pe>=0;pe--)if(u[pe].command==="M"){f=u[pe].points[0]+te,p=u[pe].points[1]+ge;break}}L.push(f,p),w="l";break;case"M":f=S.shift(),p=S.shift(),I="M",L.push(f,p),w="L";break;case"h":f+=S.shift(),I="L",L.push(f,p);break;case"H":f=S.shift(),I="L",L.push(f,p);break;case"v":p+=S.shift(),I="L",L.push(f,p);break;case"V":p=S.shift(),I="L",L.push(f,p);break;case"C":L.push(S.shift(),S.shift(),S.shift(),S.shift()),f=S.shift(),p=S.shift(),L.push(f,p);break;case"c":L.push(f+S.shift(),p+S.shift(),f+S.shift(),p+S.shift()),f+=S.shift(),p+=S.shift(),I="C",L.push(f,p);break;case"S":q=f,U=p,j=u[u.length-1],j.command==="C"&&(q=f+(f-j.points[2]),U=p+(p-j.points[3])),L.push(q,U,S.shift(),S.shift()),f=S.shift(),p=S.shift(),I="C",L.push(f,p);break;case"s":q=f,U=p,j=u[u.length-1],j.command==="C"&&(q=f+(f-j.points[2]),U=p+(p-j.points[3])),L.push(q,U,f+S.shift(),p+S.shift()),f+=S.shift(),p+=S.shift(),I="C",L.push(f,p);break;case"Q":L.push(S.shift(),S.shift()),f=S.shift(),p=S.shift(),L.push(f,p);break;case"q":L.push(f+S.shift(),p+S.shift()),f+=S.shift(),p+=S.shift(),I="Q",L.push(f,p);break;case"T":q=f,U=p,j=u[u.length-1],j.command==="Q"&&(q=f+(f-j.points[0]),U=p+(p-j.points[1])),f=S.shift(),p=S.shift(),I="Q",L.push(q,U,f,p);break;case"t":q=f,U=p,j=u[u.length-1],j.command==="Q"&&(q=f+(f-j.points[0]),U=p+(p-j.points[1])),f+=S.shift(),p+=S.shift(),I="Q",L.push(q,U,f,p);break;case"A":Q=S.shift(),J=S.shift(),K=S.shift(),re=S.shift(),$=S.shift(),fe=f,Z=p,f=S.shift(),p=S.shift(),I="A",L=this.convertEndpointToCenterParameterization(fe,Z,f,p,re,$,Q,J,K);break;case"a":Q=S.shift(),J=S.shift(),K=S.shift(),re=S.shift(),$=S.shift(),fe=f,Z=p,f+=S.shift(),p+=S.shift(),I="A",L=this.convertEndpointToCenterParameterization(fe,Z,f,p,re,$,Q,J,K);break}u.push({command:I||w,points:L,start:{x:F,y:X},pathLength:this.calcLength(F,X,I||w,L)})}(w==="z"||w==="Z")&&u.push({command:"z",points:[],start:void 0,pathLength:0})}return u}static calcLength(e,n,i,s){var l,u,c,f,p=ye;switch(i){case"L":return p.getLineLength(e,n,s[0],s[1]);case"C":for(l=0,u=p.getPointOnCubicBezier(0,e,n,s[0],s[1],s[2],s[3],s[4],s[5]),f=.01;f<=1;f+=.01)c=p.getPointOnCubicBezier(f,e,n,s[0],s[1],s[2],s[3],s[4],s[5]),l+=p.getLineLength(u.x,u.y,c.x,c.y),u=c;return l;case"Q":for(l=0,u=p.getPointOnQuadraticBezier(0,e,n,s[0],s[1],s[2],s[3]),f=.01;f<=1;f+=.01)c=p.getPointOnQuadraticBezier(f,e,n,s[0],s[1],s[2],s[3]),l+=p.getLineLength(u.x,u.y,c.x,c.y),u=c;return l;case"A":l=0;var v=s[4],_=s[5],y=s[4]+_,w=Math.PI/180;if(Math.abs(v-y)<w&&(w=Math.abs(v-y)),u=p.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],v,0),_<0)for(f=v-w;f>y;f-=w)c=p.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],f,0),l+=p.getLineLength(u.x,u.y,c.x,c.y),u=c;else for(f=v+w;f<y;f+=w)c=p.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],f,0),l+=p.getLineLength(u.x,u.y,c.x,c.y),u=c;return c=p.getPointOnEllipticalArc(s[0],s[1],s[2],s[3],y,0),l+=p.getLineLength(u.x,u.y,c.x,c.y),l}return 0}static convertEndpointToCenterParameterization(e,n,i,s,l,u,c,f,p){var v=p*(Math.PI/180),_=Math.cos(v)*(e-i)/2+Math.sin(v)*(n-s)/2,y=-1*Math.sin(v)*(e-i)/2+Math.cos(v)*(n-s)/2,w=_*_/(c*c)+y*y/(f*f);w>1&&(c*=Math.sqrt(w),f*=Math.sqrt(w));var S=Math.sqrt((c*c*(f*f)-c*c*(y*y)-f*f*(_*_))/(c*c*(y*y)+f*f*(_*_)));l===u&&(S*=-1),isNaN(S)&&(S=0);var N=S*c*y/f,E=S*-f*_/c,D=(e+i)/2+Math.cos(v)*N-Math.sin(v)*E,I=(n+s)/2+Math.sin(v)*N+Math.cos(v)*E,L=function(J){return Math.sqrt(J[0]*J[0]+J[1]*J[1])},F=function(J,K){return(J[0]*K[0]+J[1]*K[1])/(L(J)*L(K))},X=function(J,K){return(J[0]*K[1]<J[1]*K[0]?-1:1)*Math.acos(F(J,K))},j=X([1,0],[(_-N)/c,(y-E)/f]),q=[(_-N)/c,(y-E)/f],U=[(-1*_-N)/c,(-1*y-E)/f],Q=X(q,U);return F(q,U)<=-1&&(Q=Math.PI),F(q,U)>=1&&(Q=0),u===0&&Q>0&&(Q=Q-2*Math.PI),u===1&&Q<0&&(Q=Q+2*Math.PI),[D,I,c,f,j,Q,v,u]}}ye.prototype.className="Path";ye.prototype._attrsAffectingSize=["data"];Ae(ye);x.addGetterSetter(ye,"data");class Pr extends Vt{_sceneFunc(e){super._sceneFunc(e);var n=Math.PI*2,i=this.points(),s=i,l=this.tension()!==0&&i.length>4;l&&(s=this.getTensionPoints());var u=this.pointerLength(),c=i.length,f,p;if(l){const y=[s[s.length-4],s[s.length-3],s[s.length-2],s[s.length-1],i[c-2],i[c-1]],w=ye.calcLength(s[s.length-4],s[s.length-3],"C",y),S=ye.getPointOnQuadraticBezier(Math.min(1,1-u/w),y[0],y[1],y[2],y[3],y[4],y[5]);f=i[c-2]-S.x,p=i[c-1]-S.y}else f=i[c-2]-i[c-4],p=i[c-1]-i[c-3];var v=(Math.atan2(p,f)+n)%n,_=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(i[c-2],i[c-1]),e.rotate(v),e.moveTo(0,0),e.lineTo(-u,_/2),e.lineTo(-u,-_/2),e.closePath(),e.restore(
1),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(i[0],i[1]),l?(f=(s[0]+s[2])/2-i[0],p=(s[1]+s[3])/2-i[1]):(f=i[2]-i[0],p=i[3]-i[1]),e.rotate((Math.atan2(-p,-f)+n)%n),e.moveTo(0,0),e.lineTo(-u,_/2),e.lineTo(-u,-_/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}}Pr.prototype.className="Arrow";Ae(Pr);x.addGetterSetter(Pr,"pointerLength",10,b());x.addGetterSetter(Pr,"pointerWidth",10,b());x.addGetterSetter(Pr,"pointerAtBeginning",!1);x.addGetterSetter(Pr,"pointerAtEnding",!0);class Qr extends O{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Qr.prototype._centroid=!0;Qr.prototype.className="Circle";Qr.prototype._attrsAffectingSize=["radius"];Ae(Qr);x.addGetterSetter(Qr,"radius",0,b());class lr extends O{_sceneFunc(e){var n=this.radiusX(),i=this.radiusY();e.beginPath(),e.save(),n!==i&&e.scale(1,i/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}lr.prototype.className="Ellipse";lr.prototype._centroid=!0;lr.prototype._attrsAffectingSize=["radiusX","radiusY"];Ae(lr);x.addComponentsGetterSetter(lr,"radius",["x","y"]);x.addGetterSetter(lr,"radiusX",0,b());x.addGetterSetter(lr,"radiusY",0,b());let Gt=class Fh extends O{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),i=this.getHeight(),s=this.cornerRadius(),l=this.attrs.image;let u;if(l){const c=this.attrs.cropWidth,f=this.attrs.cropHeight;c&&f?u=[l,this.cropX(),this.cropY(),c,f,0,0,n,i]:u=[l,0,0,n,i]}(this.hasFill()||this.hasStroke()||s)&&(e.beginPath(),s?k.drawRoundedRectPath(e,n,i,s):e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)),l&&(s&&e.clip(),e.drawImage.apply(e,u))}_hitFunc(e){var n=this.width(),i=this.height(),s=this.cornerRadius();e.beginPath(),s?k.drawRoundedRectPath(e,n,i,s):e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,i=null){var s=k.createImageElement();s.onload=function(){var l=new Fh({image:s});n(l)},s.onerror=i,s.crossOrigin="Anonymous",s.src=e}};Gt.prototype.className="Image";Ae(Gt);x.addGetterSetter(Gt,"cornerRadius",0,Ls(4));x.addGetterSetter(Gt,"image");x.addComponentsGetterSetter(Gt,"crop",["x","y","width","height"]);x.addGetterSetter(Gt,"cropX",0,b());x.addGetterSetter(Gt,"cropY",0,b());x.addGetterSetter(Gt,"cropWidth",0,b());x.addGetterSetter(Gt,"cropHeight",0,b());var jh=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],ff="Change.konva",gf="none",Ts="up",Rs="right",As="down",Ns="left",pf=jh.length;class zs extends Vr{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var n=this,i,s=function(){n._sync()};for(i=0;i<pf;i++)e.on(jh[i]+ff,s)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var e=this.getText(),n=this.getTag(),i,s,l,u,c,f,p;if(e&&n){switch(i=e.width(),s=e.height(),l=n.pointerDirection(),u=n.pointerWidth(),p=n.pointerHeight(),c=0,f=0,l){case Ts:c=i/2,f=-1*p;break;case Rs:c=i+u,f=s/2;break;case As:c=i/2,f=s+p;break;case Ns:c=-1*u,f=s/2;break}n.setAttrs({x:-1*c,y:-1*f,width:i,height:s}),e.setAttrs({x:-1*c,y:-1*f})}}}zs.prototype.className="Label";Ae(zs);class kr extends O{_sceneFunc(e){var n=this.width(),i=this.height(),s=this.pointerDirection(),l=this.pointerWidth(),u=this.pointerHeight(),c=this.cornerRadius();let f=0,p=0,v=0,_=0;typeof c=="number"?f=p=v=_=Math.min(c,n/2,i/2):(f=Math.min(c[0]||0,n/2,i/2),p=Math.min(c[1]||0,n/2,i/2),_=Math.min(c[2]||0,n/2,i/2),v=Math.min(c[3]||0,n/2,i/2)),e.beginPath(),e.moveTo(f,0),s===Ts&&(e.lineTo((n-l)/2,0),e.lineTo(n/2,-1*u),e.lineTo((n+l)/2,0)),e.lineTo(n-p,0),e.arc(n-p,p,p,Math.PI*3/2,0,!1),s===Rs&&(e.lineTo(n,(i-u)/2),e.lineTo(n+l,i/2),e.lineTo(n,(i+u)/2)),e.lineTo(n,i-_),e.arc(n-_,i-_,_,0,Math.PI/2,!1),s===As&&(e.lineTo((n+l)/2,i),e.lineTo(n/2,i+u),e.lineTo((n-l)/2,i)),e.lineTo(v,i),e.arc(v,i-v,v,Math.PI/2,Math.PI,!1),s===Ns&&(e.lineTo(0,(i+u)/2),e.lineTo(-1*l,i/2),e.lineTo(0,(i-u)/2)),e.lineTo(0,f),e.arc(f,f,f,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){var e=0,n=0,i=this.pointerWidth(),s=this.pointerHeight(),l=this.pointerDirection(),u=this.width(),c=this.height();return l===Ts?(n-=s,c+=s):l===As?c+=s:l===Ns?(e-=i*1.5,u+=i):l===Rs&&(u+=i*1.5),{x:e,y:n,width:u,height:c}}}kr.prototype.className="Tag";Ae(kr);x.addGetterSetter(kr,"pointerDirection",gf);x.addGetterSetter(kr,"pointerWidth",0,b());x.addGetterSetter(kr,"pointerHeight",0,b());x.addGetterSetter(kr,"cornerRadius",0,Ls(4));class Mn extends O{_sceneFunc(e){var n=this.cornerRadius(),i=this.width(),s=this.height();e.beginPath(),n?k.drawRoundedRectPath(e,i,s,n):e.rect(0,0,i,s),e.closePath(),e.fillStrokeShape(this)}}Mn.prototype.className="Rect";Ae(Mn);x.addGetterSetter(Mn,"cornerRadius",0,Ls(4));class Er extends O{_sceneFunc(e){const n=this._getPoints();e.beginPath(),e.moveTo(n[0].x,n[0].y);for(var i=1;i<n.length;i++)e.lineTo(n[i].x,n[i].y);e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,i=[];for(var s=0;s<e;
1s++)i.push({x:n*Math.sin(s*2*Math.PI/e),y:-1*n*Math.cos(s*2*Math.PI/e)});return i}getSelfRect(){const e=this._getPoints();var n=e[0].x,i=e[0].y,s=e[0].x,l=e[0].y;return e.forEach(u=>{n=Math.min(n,u.x),i=Math.max(i,u.x),s=Math.min(s,u.y),l=Math.max(l,u.y)}),{x:n,y:s,width:i-n,height:l-s}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Er.prototype.className="RegularPolygon";Er.prototype._centroid=!0;Er.prototype._attrsAffectingSize=["radius"];Ae(Er);x.addGetterSetter(Er,"radius",0,b());x.addGetterSetter(Er,"sides",0,b());var ql=Math.PI*2;class Tr extends O{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,ql,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),ql,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Tr.prototype.className="Ring";Tr.prototype._centroid=!0;Tr.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ae(Tr);x.addGetterSetter(Tr,"innerRadius",0,b());x.addGetterSetter(Tr,"outerRadius",0,b());class zt extends O{constructor(e){super(e),this._updated=!0,this.anim=new yt(()=>{var n=this._updated;return this._updated=!1,n}),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(e){var n=this.animation(),i=this.frameIndex(),s=i*4,l=this.animations()[n],u=this.frameOffsets(),c=l[s+0],f=l[s+1],p=l[s+2],v=l[s+3],_=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,p,v),e.closePath(),e.fillStrokeShape(this)),_)if(u){var y=u[n],w=i*2;e.drawImage(_,c,f,p,v,y[w+0],y[w+1],p,v)}else e.drawImage(_,c,f,p,v,0,0,p,v)}_hitFunc(e){var n=this.animation(),i=this.frameIndex(),s=i*4,l=this.animations()[n],u=this.frameOffsets(),c=l[s+2],f=l[s+3];if(e.beginPath(),u){var p=u[n],v=i*2;e.rect(p[v+0],p[v+1],c,f)}else e.rect(0,0,c,f);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),n=this.animation(),i=this.animations(),s=i[n],l=s.length/4;e<l-1?this.frameIndex(e+1):this.frameIndex(0)}}zt.prototype.className="Sprite";Ae(zt);x.addGetterSetter(zt,"animation");x.addGetterSetter(zt,"animations");x.addGetterSetter(zt,"frameOffsets");x.addGetterSetter(zt,"image");x.addGetterSetter(zt,"frameIndex",0,b());x.addGetterSetter(zt,"frameRate",17,b());x.backCompat(zt,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class hr extends O{_sceneFunc(e){var n=this.innerRadius(),i=this.outerRadius(),s=this.numPoints();e.beginPath(),e.moveTo(0,0-i);for(var l=1;l<s*2;l++){var u=l%2===0?i:n,c=u*Math.sin(l*Math.PI/s),f=-1*u*Math.cos(l*Math.PI/s);e.lineTo(c,f)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}hr.prototype.className="Star";hr.prototype._centroid=!0;hr.prototype._attrsAffectingSize=["innerRadius","outerRadius"];Ae(hr);x.addGetterSetter(hr,"numPoints",5,b());x.addGetterSetter(hr,"innerRadius",0,b());x.addGetterSetter(hr,"outerRadius",0,b());function Bh(o){return Array.from(o)}var Ur="auto",vf="center",Sn="justify",mf="Change.konva",yf="2d",Ql="-",Hh="left",_f="text",Sf="Text",xf="top",wf="bottom",Kl="middle",Uh="normal",Cf="px ",Oi=" ",Pf="right",kf="word",Ef="char",Jl="none",ps="…",Wh=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Tf=Wh.length;function Rf(o){return o.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,i=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!i&&(e='"'.concat(e,'"')),e}).join(", ")}var Di;function vs(){return Di||(Di=k.createCanvasElement().getContext(yf),Di)}function Af(o){o.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Nf(o){o.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Mf(o){return o=o||{},!o.fillLinearGradientColorStops&&!o.fillRadialGradientColorStops&&!o.fillPatternImage&&(o.fill=o.fill||"black"),o}let Re=class extends O{constructor(e){super(Mf(e)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<Tf;n++)this.on(Wh[n]+mf,this._setTextData);this._setTextData()}_sceneFunc(e){var n=this.textArr,i=n.length;if(this.text()){var s=this.padding(),l=this.fontSize(),u=this.lineHeight()*l,c=this.verticalAlign(),f=0,p=this.align(),v=this.getWidth(),_=this.letterSpacing(),y=this.fill(),w=this.textDecoration(),S=w.indexOf("underline")!==-1,N=w.indexOf("line-through")!==-1,E,D=0,D=u/2,I=0,L=0;for(e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",Kl),e.setAttr("textAlign",Hh),c===Kl?f=(this.getHeight()-i*u-s*2)/2:c===wf&&(f=this.getHeight()-i*u-s*2),e.translate(s,f+s),E=0;E<i;E++){var I=0,L=0,F=n[E],X=F.text,j=F.width,q=F.lastInParagraph,U,Q,J;if(e.save(),p===Pf?I+=v-j-s*2:p===vf&&(I+=(v-j-s*2)/2),S){e.save(),e.beginPath(),e.moveTo(I,D+L+Math.round(l/2)),U=X.split(" ").length-1,Q=U===0,J=p===Sn&&!q?v-s*2:j,e.lineTo(I+Math.round(J),D+L+Math.round(l/2)),e.lineWidth=l/15;const te=this._getLinearGradient();
1e.strokeStyle=te||y,e.stroke(),e.restore()}if(N){e.save(),e.beginPath(),e.moveTo(I,D+L),U=X.split(" ").length-1,Q=U===0,J=p===Sn&&q&&!Q?v-s*2:j,e.lineTo(I+Math.round(J),D+L),e.lineWidth=l/15;const te=this._getLinearGradient();e.strokeStyle=te||y,e.stroke(),e.restore()}if(_!==0||p===Sn){U=X.split(" ").length-1;for(var K=Bh(X),re=0;re<K.length;re++){var $=K[re];$===" "&&!q&&p===Sn&&(I+=(v-s*2-j)/U),this._partialTextX=I,this._partialTextY=D+L,this._partialText=$,e.fillStrokeShape(this),I+=this.measureSize($).width+_}}else this._partialTextX=I,this._partialTextY=D+L,this._partialText=X,e.fillStrokeShape(this);e.restore(),i>1&&(D+=u)}}}_hitFunc(e){var n=this.getWidth(),i=this.getHeight();e.beginPath(),e.rect(0,0,n,i),e.closePath(),e.fillStrokeShape(this)}setText(e){var n=k._isString(e)?e:e==null?"":e+"";return this._setAttr(_f,n),this}getWidth(){var e=this.attrs.width===Ur||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===Ur||this.attrs.height===void 0;return e?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return k.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n=vs(),i=this.fontSize(),s;return n.save(),n.font=this._getContextFont(),s=n.measureText(e),n.restore(),{width:s.width,height:i}}_getContextFont(){return this.fontStyle()+Oi+this.fontVariant()+Oi+(this.fontSize()+Cf)+Rf(this.fontFamily())}_addTextLine(e){this.align()===Sn&&(e=e.trim());var i=this._getTextWidth(e);return this.textArr.push({text:e,width:i,lastInParagraph:!1})}_getTextWidth(e){var n=this.letterSpacing(),i=e.length;return vs().measureText(e).width+(i?n*(i-1):0)}_setTextData(){var e=this.text().split("\n"),n=+this.fontSize(),i=0,s=this.lineHeight()*n,l=this.attrs.width,u=this.attrs.height,c=l!==Ur&&l!==void 0,f=u!==Ur&&u!==void 0,p=this.padding(),v=l-p*2,_=u-p*2,y=0,w=this.wrap(),S=w!==Jl,N=w!==Ef&&S,E=this.ellipsis();this.textArr=[],vs().font=this._getContextFont();for(var D=E?this._getTextWidth(ps):0,I=0,L=e.length;I<L;++I){var F=e[I],X=this._getTextWidth(F);if(c&&X>v)for(;F.length>0;){for(var j=0,q=F.length,U="",Q=0;j<q;){var J=j+q>>>1,K=F.slice(0,J+1),re=this._getTextWidth(K)+D;re<=v?(j=J+1,U=K,Q=re):q=J}if(U){if(N){var $,fe=F[U.length],Z=fe===Oi||fe===Ql;Z&&Q<=v?$=U.length:$=Math.max(U.lastIndexOf(Oi),U.lastIndexOf(Ql))+1,$>0&&(j=$,U=U.slice(0,j),Q=this._getTextWidth(U))}U=U.trimRight(),this._addTextLine(U),i=Math.max(i,Q),y+=s;var te=this._shouldHandleEllipsis(y);if(te){this._tryToAddEllipsisToLastLine();break}if(F=F.slice(j),F=F.trimLeft(),F.length>0&&(X=this._getTextWidth(F),X<=v)){this._addTextLine(F),y+=s,i=Math.max(i,X);break}}else break}else this._addTextLine(F),y+=s,i=Math.max(i,X),this._shouldHandleEllipsis(y)&&I<L-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),f&&y+s>_)break}this.textHeight=n,this.textWidth=i}_shouldHandleEllipsis(e){var n=+this.fontSize(),i=this.lineHeight()*n,s=this.attrs.height,l=s!==Ur&&s!==void 0,u=this.padding(),c=s-u*2,f=this.wrap(),p=f!==Jl;return!p||l&&e+i>c}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,n=e!==Ur&&e!==void 0,i=this.padding(),s=e-i*2,l=this.ellipsis(),u=this.textArr[this.textArr.length-1];if(!(!u||!l)){if(n){var c=this._getTextWidth(u.text+ps)<s;c||(u.text=u.text.slice(0,u.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(u.text+ps)}}getStrokeScaleEnabled(){return!0}};Re.prototype._fillFunc=Af;Re.prototype._strokeFunc=Nf;Re.prototype.className=Sf;Re.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];Ae(Re);x.overWriteSetter(Re,"width",Is());x.overWriteSetter(Re,"height",Is());x.addGetterSetter(Re,"fontFamily","Arial");x.addGetterSetter(Re,"fontSize",12,b());x.addGetterSetter(Re,"fontStyle",Uh);x.addGetterSetter(Re,"fontVariant",Uh);x.addGetterSetter(Re,"padding",0,b());x.addGetterSetter(Re,"align",Hh);x.addGetterSetter(Re,"verticalAlign",xf);x.addGetterSetter(Re,"lineHeight",1,b());x.addGetterSetter(Re,"wrap",kf);x.addGetterSetter(Re,"ellipsis",!1,Tt());x.addGetterSetter(Re,"letterSpacing",0,b());x.addGetterSetter(Re,"text","",qr());x.addGetterSetter(Re,"textDecoration","");var Lf="",Yh="normal";function Xh(o){o.fillText(this.partialText,0,0)}function Vh(o){o.strokeText(this.partialText,0,0)}class be extends O{constructor(e){super(e),this.dummyCanvas=k.createCanvasElement(),this.dataArray=[],this.dataArray=ye.parsePathData(this.attrs.data),this.on("dataChange.konva",function(){this.dataArray=ye.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(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var n=this.textDecoration(),i=this.fill(),s=this.fontSize(),l=this.glyphInfo;n==="underline"&&e.beginPath();for(var u=0;u<l.length;u++){e.save();var c=l[u].p0;e.translate(c.x,c.y),e.rotate(l[u].rotation),this.partialText=l[u].text,e.fillStrokeShape(this),n==="underline"&&(u===0&&e.moveTo(0,s/2+1),e.lineTo(s,s/2+1)),e.restore()}n==="underline"&&(e.strokeStyle=i,e.lineWidth=s/20,e.stroke()),e.restore()}_hitFunc(e){e.beginPath();var n=this.glyphInfo;if(n.length>=1){var i=n[0].p0;e.moveTo(i.x,i.y)}for(var s=0;s<n.length;s++){var l=n[s].p1;e.lineTo(l.x,l.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return k.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return Re.prototype.setText.call(this,e)}_getContextFont(){return Re.prototype._getContextFont.call(this)}_getTextSize(e){var n=this.dummyCanvas,i=n.getContext("2d");i.save(),i.font=this._getContextFont();var s=i.measureText(e);return i.restore(),{width:s.width,height:parseInt(this.attrs.fontSize,10)}}_setTextData(){var e=this,n=this._getTextSize(this.attrs.text),i=this.letterSpacing(),s=this.align(),l=this.kerningFunc();this.textWidth=n.width,this.textHeight=n.height;var u=Math.max(this.textWidth+((this.attrs.text||"").length-1)*i,0);this.glyphInfo=[];for(var c=0,f=0;f<e.dataArray.length;f++)e.dataArray[f].pathLength>0&&(c+=e.dataArray[f].pathLength);var p=0;s==="center"&&(p=Math.max(0,c/2-u/2)),s==="right"&&(p=Math.max(0,c-u));for(var v=Bh(this.text()),_=this.text().split(" ").length-1,y,w,S,N=-1,E=0,D=function(){E=0;for(var re=e.dataArray,$=N+1;$<re.length;$++){if(re[$].pathLength>0)return N=$,re[$];re[$].command==="M"&&(y={x:re[$].points[0],y:re[$].points[1]})}return{}},I=function(re){var $=e._getTextSize(re).width+i;re===" "&&s==="justify"&&($+=(c-u)/_);var fe=0,Z=0;for(w=void 0;Math.abs($-fe)/$>.01&&Z<20;){Z++;for(var te=fe;S===void 0;)S=D(),S&&te+S.pathLength<$&&(te+=S.pathLength,S=void 0);if(Object.keys(S).length===0||y===void 0)return;var ge=!1;switch(S.command){case"L":ye.getLineLength(y.x,y.y,S.points[0],S.points[1])>$?w=ye.getPointOnLine($,y.x,y.y,S.points[0],S.points[1],y.x,y.y):S=void 0;break;case"A":var pe=S.points[4],Ne=S.points[5],se=S.points[4]+Ne;E===0?E=pe+1e-8:$>fe?E+=Math.PI/180*Ne/Math.abs(Ne):E-=Math.PI/360*Ne/Math.abs(Ne),(Ne<0&&E<se||Ne>=0&&E>se)&&(E=se,ge=!0),w=ye.getPointOnEllipticalArc(S.points[0],S.points[1],S.points[2],S.points[3],E,S.points[6]);break;case"C":E===0?$>S.pathLength?E=1e-8:E=$/S.pathLength:$>fe?E+=($-fe)/S.pathLength/2:E=Math.max(E-(fe-$)/S.pathLength/2,0),E>1&&(E=1,ge=!0),w=ye.getPointOnCubicBezier(E,S.start.x,S.start.y,S.points[0],S.points[1],S.points[2],S.points[3],S.points[4],S.points[5]);break;case"Q":E===0?E=$/S.pathLength:$>fe?E+=($-fe)/S.pathLength:E-=(fe-$)/S.pathLength,E>1&&(E=1,ge=!0),w=ye.getPointOnQuadraticBezier(E,S.start.x,S.start.y,S.points[0],S.points[1],S.points[2],S.points[3]);break}w!==void 0&&(fe=ye.getLineLength(y.x,y.y,w.x,w.y)),ge&&(ge=!1,S=void 0)}},L="C",F=e._getTextSize(L).width+i,X=p/F-1,j=0;j<X&&(I(L),!(y===void 0||w===void 0));j++)y=w;for(var q=0;q<v.length&&(I(v[q]),!(y===void 0||w===void 0));q++){var U=ye.getLineLength(y.x,y.y,w.x,w.y),Q=0;if(l)try{Q=l(v[q-1],v[q])*this.fontSize()}catch(re){Q=0}y.x+=Q,w.x+=Q,this.textWidth+=Q;var J=ye.getPointOnLine(Q+U/2,y.x,y.y,w.x,w.y),K=Math.atan2(w.y-y.y,w.x-y.x);this.glyphInfo.push({transposeX:J.x,transposeY:J.y,text:v[q],rotation:K,p0:y,p1:w}),y=w}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var e=[];this.glyphInfo.forEach(function(v){e.push(v.p0.x),e.push(v.p0.y),e.push(v.p1.x),e.push(v.p1.y)});for(var n=e[0]||0,i=e[0]||0,s=e[1]||0,l=e[1]||0,u,c,f=0;f<e.length/2;f++)u=e[f*2],c=e[f*2+1],n=Math.min(n,u),i=Math.max(i,u),s=Math.min(s,c),l=Math.max(l,c);var p=this.fontSize();return{x:n-p/2,y:s-p/2,width:i-n+p,height:l-s+p}}destroy(){return k.releaseCanvas(this.dummyCanvas),super.destroy()}}be.prototype._fillFunc=Xh;be.prototype._strokeFunc=Vh;be.prototype._fillFuncHit=Xh;be.prototype._strokeFuncHit=Vh;be.prototype.className="TextPath";be.prototype._attrsAffectingSize=["text","fontSize","data"];Ae(be);x.addGetterSetter(be,"data");x.addGetterSetter(be,"fontFamily","Arial");x.addGetterSetter(be,"fontSize",12,b());x.addGetterSetter(be,"fontStyle",Yh);x.addGetterSetter(be,"align","left");x.addGetterSetter(be,"letterSpacing",0,b());x.addGetterSetter(be,"textBaseline","middle");x.addGetterSetter(be,"fontVariant",Yh);x.addGetterSetter(be,"text",Lf);x.addGetterSetter(be,"textDecoration",null);x.addGetterSetter(be,"kerningFunc",null);var qh="tr-konva",If=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange"].map(o=>o+".".concat(qh)).join(" "),Zl="nodesRect",Of=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Df={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Gf="ontouchstart"in Y._global;function zf(o,e){if(o==="rotater")return"crosshair";e+=k.degToRad(Df[o]||0);var n=(k.radToDeg(e)%360+360)%360;return k._inRange(n,315+22.5,360)||k._inRange(n,0,22.5)?"ns-resize":k._inRange(n,45-22.5,45+22.5)?"nesw-resize":k._inRange(n,90-22.5,90+22.5)?"ew-resize":k._inRange(n,135-22.5,135+22.5)?"nwse-resize":k._inRange(n,180-22.5,180+22.5)?"ns-resize":k._inRange(n,225-22.5,225+22.5)?"nesw-resize":k._inRange(n,270-22.5,270+22.5)?"ew-resize":k._inRange(n,315-22.5,315+22.5)?"nwse-resize":(k.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var Hi=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function bf(o){return{x:o.x+o.width/2*Math.cos(o.rotation)+o.height/2*Math.sin(-o.rotation),y:o.y+o.height/2*Math.cos(o.rotation)+o.width/2*Math.sin(o.rotation)}}
1function Qh(o,e,n){const i=n.x+(o.x-n.x)*Math.cos(e)-(o.y-n.y)*Math.sin(e),s=n.y+(o.x-n.x)*Math.sin(e)+(o.y-n.y)*Math.cos(e);return Object.assign(Object.assign({},o),{rotation:o.rotation+e,x:i,y:s})}function Ff(o,e){const n=bf(o);return Qh(o,e,n)}function jf(o,e,n){let i=e;for(let s=0;s<o.length;s++){const l=Y.getAngle(o[s]),u=Math.abs(l-e)%(Math.PI*2);Math.min(u,Math.PI*2-u)<n&&(i=l)}return i}let me=class extends Vr{constructor(e){super(e),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(If,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return k.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return qh+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(s=>s.isAncestorOf(this)?(k.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(s=>{const l=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},u=s._attrsAffectingSize.map(c=>c+"Change."+this._getEventNamespace()).join(" ");s.on(u,l),s.on(Of.map(c=>c+".".concat(this._getEventNamespace())).join(" "),l),s.on("absoluteTransformChange.".concat(this._getEventNamespace()),l),this._proxyDrag(s)}),this._resetTransformCache();var i=!!this.findOne(".top-left");return i&&this.update(),this}_proxyDrag(e){let n;e.on("dragstart.".concat(this._getEventNamespace()),i=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(i,!1)}),e.on("dragmove.".concat(this._getEventNamespace()),i=>{if(!n)return;const s=e.getAbsolutePosition(),l=s.x-n.x,u=s.y-n.y;this.nodes().forEach(c=>{if(c===e||c.isDragging())return;const f=c.getAbsolutePosition();c.setAbsolutePosition({x:f.x+l,y:f.y+u}),c.startDrag(i)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(Zl),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(Zl,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),i){var s=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),l=e.getAbsoluteScale(i),u=e.getAbsolutePosition(i),c=s.x*l.x-e.offsetX()*l.x,f=s.y*l.y-e.offsetY()*l.y;const p=(Y.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:u.x+c*Math.cos(p)+f*Math.sin(-p),y:u.y+f*Math.cos(p)+c*Math.sin(p),width:s.width*l.x,height:s.height*l.y,rotation:p};return Qh(v,-Y.getAngle(n),{x:0,y:0})}__getNodeRect(){var e=this.getNode();if(!e)return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(p=>{const v=p.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var _=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],y=p.getAbsoluteTransform();_.forEach(function(w){var S=y.point(w);n.push(S)})});const i=new ot;i.rotate(-Y.getAngle(this.rotation()));var s,l,u,c;n.forEach(function(p){var v=i.point(p);s===void 0&&(s=u=v.x,l=c=v.y),s=Math.min(s,v.x),l=Math.min(l,v.y),u=Math.max(u,v.x),c=Math.max(c,v.y)}),i.invert();const f=i.point({x:s,y:l});return{x:f.x,y:f.y,width:u-s,height:c-l,rotation:Y.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(),Hi.forEach((function(e){this._createAnchor(e)}).bind(this)),this._createAnchor("rotater")}_createAnchor(e){var n=new Mn({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Gf?10:"auto"}),i=this;n.on("mousedown touchstart",function(s){i._handleMouseDown(s)}),n.on("dragstart",s=>
1{n.stopDrag(),s.cancelBubble=!0}),n.on("dragend",s=>{s.cancelBubble=!0}),n.on("mouseenter",()=>{var s=Y.getAngle(this.rotation()),l=zf(e,s);n.getStage().content&&(n.getStage().content.style.cursor=l),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var e=new O({name:"back",width:0,height:0,draggable:!0,sceneFunc(n){var i=this.getParent(),s=i.padding();n.beginPath(),n.rect(-s,-s,this.width()+s*2,this.height()+s*2),n.moveTo(this.width()/2,-s),i.rotateEnabled()&&n.lineTo(this.width()/2,-i.rotateAnchorOffset()*k._sign(this.height())-s),n.fillStrokeShape(this)},hitFunc:(n,i)=>{if(this.shouldOverdrawWholeArea()){var s=this.padding();n.beginPath(),n.rect(-s,-s,i.width()+s*2,i.height()+s*2),n.fillStrokeShape(i)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){this._movingAnchorName=e.target.name().split(" ")[0];var n=this._getNodeRect(),i=n.width,s=n.height,l=Math.sqrt(Math.pow(i,2)+Math.pow(s,2));this.sin=Math.abs(s/l),this.cos=Math.abs(i/l),typeof window<"u"&&(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 u=e.target.getAbsolutePosition(),c=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:c.x-u.x,y:c.y-u.y},this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(f=>{f._fire("transformstart",{evt:e.evt,target:f})})}_handleMouseMove(e){var n,i,s,l=this.findOne("."+this._movingAnchorName),u=l.getStage();u.setPointersPositions(e);const c=u.getPointerPosition();let f={x:c.x-this._anchorDragOffset.x,y:c.y-this._anchorDragOffset.y};const p=l.getAbsolutePosition();this.anchorDragBoundFunc()&&(f=this.anchorDragBoundFunc()(p,f,e)),l.setAbsolutePosition(f);const v=l.getAbsolutePosition();if(!(p.x===v.x&&p.y===v.y)){if(this._movingAnchorName==="rotater"){var _=this._getNodeRect();n=l.x()-_.width/2,i=-l.y()+_.height/2;let re=Math.atan2(-i,n)+Math.PI/2;_.height<0&&(re-=Math.PI);var y=Y.getAngle(this.rotation());const $=y+re,fe=Y.getAngle(this.rotationSnapTolerance()),te=jf(this.rotationSnaps(),$,fe)-_.rotation,ge=Ff(_,te);this._fitNodesInto(ge,e);return}var w=this.keepRatio()||e.shiftKey,I=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(w){var S=I?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};s=Math.sqrt(Math.pow(S.x-l.x(),2)+Math.pow(S.y-l.y(),2));var N=this.findOne(".top-left").x()>S.x?-1:1,E=this.findOne(".top-left").y()>S.y?-1:1;n=s*this.cos*N,i=s*this.sin*E,this.findOne(".top-left").x(S.x-n),this.findOne(".top-left").y(S.y-i)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(l.y());else if(this._movingAnchorName==="top-right"){if(w){var S=I?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};s=Math.sqrt(Math.pow(l.x()-S.x,2)+Math.pow(S.y-l.y(),2));var N=this.findOne(".top-right").x()<S.x?-1:1,E=this.findOne(".top-right").y()>S.y?-1:1;n=s*this.cos*N,i=s*this.sin*E,this.findOne(".top-right").x(S.x+n),this.findOne(".top-right").y(S.y-i)}var D=l.position();this.findOne(".top-left").y(D.y),this.findOne(".bottom-right").x(D.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(l.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(l.x());else if(this._movingAnchorName==="bottom-left"){if(w){var S=I?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};s=Math.sqrt(Math.pow(S.x-l.x(),2)+Math.pow(l.y()-S.y,2));var N=S.x<l.x()?-1:1,E=l.y()<S.y?-1:1;n=s*this.cos*N,i=s*this.sin*E,l.x(S.x-n),l.y(S.y+i)}D=l.position(),this.findOne(".top-left").x(D.x),this.findOne(".bottom-right").y(D.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(l.y());else if(this._movingAnchorName==="bottom-right"){if(w){var S=I?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};s=Math.sqrt(Math.pow(l.x()-S.x,2)+Math.pow(l.y()-S.y,2));var N=this.findOne(".bottom-right").x()<S.x?-1:1,E=this.findOne(".bottom-right").y()<S.y?-1:1;n=s*this.cos*N,i=s*this.sin*E,this.findOne(".bottom-right").x(S.x+n),this.findOne(".bottom-right").y(S.y+i)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var I=this.centeredScaling()||e.altKey;if(I){var L=this.findOne(".top-left"),F=this.findOne(".bottom-right"),X=L.x(),j=L.y(),q=this.getWidth()-F.x(),U=this.getHeight()-F.y();F.move({x:-X,y:-j}),L.move({x:q,y:U})}var Q=this.findOne(".top-left").getAbsolutePosition();n=Q.x,i=Q.y;var J=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),K=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:i,width:J,height:K,rotation:Y.getAngle(this.rotation())},e)}}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));var n=this.getNode();this._fire("transformend",{evt:e,target:n}
1),n&&this._nodes.forEach(i=>{i._fire("transformend",{evt:e,target:i})}),this._movingAnchorName=null}}_fitNodesInto(e,n){var i=this._getNodeRect();const s=1;if(k._inRange(e.width,-this.padding()*2-s,s)){this.update();return}if(k._inRange(e.height,-this.padding()*2-s,s)){this.update();return}const l=this.flipEnabled();var u=new ot;if(u.rotate(Y.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=u.point({x:-this.padding()*2,y:0});if(e.x+=_.x,e.y+=_.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,!l){this.update();return}}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=u.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.width+=this.padding()*2,!l){this.update();return}}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=u.point({x:0,y:-this.padding()*2});if(e.x+=_.x,e.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2,!l){this.update();return}}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=u.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2,!l){this.update();return}}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(i,e);_?e=_:k.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const c=1e7,f=new ot;f.translate(i.x,i.y),f.rotate(i.rotation),f.scale(i.width/c,i.height/c);const p=new ot;p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.width/c,e.height/c);const v=p.multiply(f.invert());this._nodes.forEach(_=>{var y;const w=_.getParent().getAbsoluteTransform(),S=_.getTransform().copy();S.translate(_.offsetX(),_.offsetY());const N=new ot;N.multiply(w.copy().invert()).multiply(v).multiply(w).multiply(S);const E=N.decompose();_.setAttrs(E),this._fire("transform",{evt:n,target:_}),_._fire("transform",{evt:n,target:_}),(y=_.getLayer())===null||y===void 0||y.batchDraw()}),this.rotation(k._getRotation(e.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e,n=this._getNodeRect();this.rotation(k._getRotation(n.rotation));var i=n.width,s=n.height,l=this.enabledAnchors(),u=this.resizeEnabled(),c=this.padding(),f=this.anchorSize();this.find("._anchor").forEach(p=>{p.setAttrs({width:f,height:f,offsetX:f/2,offsetY:f/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:f/2+c,offsetY:f/2+c,visible:u&&l.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:i/2,y:0,offsetY:f/2+c,visible:u&&l.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:i,y:0,offsetX:f/2-c,offsetY:f/2+c,visible:u&&l.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:s/2,offsetX:f/2+c,visible:u&&l.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:i,y:s/2,offsetX:f/2-c,visible:u&&l.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:s,offsetX:f/2+c,offsetY:f/2-c,visible:u&&l.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:i/2,y:s,offsetY:f/2-c,visible:u&&l.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:i,y:s,offsetX:f/2-c,offsetY:f/2-c,visible:u&&l.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:i/2,y:-this.rotateAnchorOffset()*k._sign(s)-c,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:i,height:s,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var e=this.findOne("."+this._movingAnchorName);
1e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Vr.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return z.prototype.toObject.call(this)}clone(e){var n=z.prototype.clone.call(this,e);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};function Bf(o){return o instanceof Array||k.warn("enabledAnchors value should be an array"),o instanceof Array&&o.forEach(function(e){Hi.indexOf(e)===-1&&k.warn("Unknown anchor name: "+e+". Available names are: "+Hi.join(", "))}),o||[]}me.prototype.className="Transformer";Ae(me);x.addGetterSetter(me,"enabledAnchors",Hi,Bf);x.addGetterSetter(me,"flipEnabled",!0,Tt());x.addGetterSetter(me,"resizeEnabled",!0);x.addGetterSetter(me,"anchorSize",10,b());x.addGetterSetter(me,"rotateEnabled",!0);x.addGetterSetter(me,"rotationSnaps",[]);x.addGetterSetter(me,"rotateAnchorOffset",50,b());x.addGetterSetter(me,"rotationSnapTolerance",5,b());x.addGetterSetter(me,"borderEnabled",!0);x.addGetterSetter(me,"anchorStroke","rgb(0, 161, 255)");x.addGetterSetter(me,"anchorStrokeWidth",1,b());x.addGetterSetter(me,"anchorFill","white");x.addGetterSetter(me,"anchorCornerRadius",0,b());x.addGetterSetter(me,"borderStroke","rgb(0, 161, 255)");x.addGetterSetter(me,"borderStrokeWidth",1,b());x.addGetterSetter(me,"borderDash");x.addGetterSetter(me,"keepRatio",!0);x.addGetterSetter(me,"centeredScaling",!1);x.addGetterSetter(me,"ignoreStroke",!1);x.addGetterSetter(me,"padding",0,b());x.addGetterSetter(me,"node");x.addGetterSetter(me,"nodes");x.addGetterSetter(me,"boundBoxFunc");x.addGetterSetter(me,"anchorDragBoundFunc");x.addGetterSetter(me,"shouldOverdrawWholeArea",!1);x.addGetterSetter(me,"useSingleNodeRotation",!0);x.backCompat(me,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledH
1andlers:"enabledAnchors"});class qt extends O{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Y.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}qt.prototype.className="Wedge";qt.prototype._centroid=!0;qt.prototype._attrsAffectingSize=["radius"];Ae(qt);x.addGetterSetter(qt,"radius",0,b());x.addGetterSetter(qt,"angle",0,b());x.addGetterSetter(qt,"clockwise",!1);x.backCompat(qt,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function $l(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Hf=[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],Uf=[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 Wf(o,e){var n=o.data,i=o.width,s=o.height,l,u,c,f,p,v,_,y,w,S,N,E,D,I,L,F,X,j,q,U,Q,J,K,re,$=e+e+1,fe=i-1,Z=s-1,te=e+1,ge=te*(te+1)/2,pe=new $l,Ne=null,se=pe,ve=null,Me=null,_t=Hf[e],St=Uf[e];for(c=1;c<$;c++)se=se.next=new $l,c===te&&(Ne=se);for(se.next=pe,_=v=0,u=0;u<s;u++){for(F=X=j=q=y=w=S=N=0,E=te*(U=n[v]),D=te*(Q=n[v+1]),I=te*(J=n[v+2]),L=te*(K=n[v+3]),y+=ge*U,w+=ge*Q,S+=ge*J,N+=ge*K,se=pe,c=0;c<te;c++)se.r=U,se.g=Q,se.b=J,se.a=K,se=se.next;for(c=1;c<te;c++)f=v+((fe<c?fe:c)<<2),y+=(se.r=U=n[f])*(re=te-c),w+=(se.g=Q=n[f+1])*re,S+=(se.b=J=n[f+2])*re,N+=(se.a=K=n[f+3])*re,F+=U,X+=Q,j+=J,q+=K,se=se.next;for(ve=pe,Me=Ne,l=0;l<i;l++)n[v+3]=K=N*_t>>St,K!==0?(K=255/K,n[v]=(y*_t>>St)*K,n[v+1]=(w*_t>>St)*K,n[v+2]=(S*_t>>St)*K):n[v]=n[v+1]=n[v+2]=0,y-=E,w-=D,S-=I,N-=L,E-=ve.r,D-=ve.g,I-=ve.b,L-=ve.a,f=_+((f=l+e+1)<fe?f:fe)<<2,F+=ve.r=n[f],X+=ve.g=n[f+1],j+=ve.b=n[f+2],q+=ve.a=n[f+3],y+=F,w+=X,S+=j,N+=q,ve=ve.next,E+=U=Me.r,D+=Q=Me.g,I+=J=Me.b,L+=K=Me.a,F-=U,X-=Q,j-=J,q-=K,Me=Me.next,v+=4;_+=i}for(l=0;l<i;l++){for(X=j=q=F=w=S=N=y=0,v=l<<2,E=te*(U=n[v]),D=te*(Q=n[v+1]),I=te*(J=n[v+2]),L=te*(K=n[v+3]),y+=ge*U,w+=ge*Q,S+=ge*J,N+=ge*K,se=pe,c=0;c<te;c++)se.r=U,se.g=Q,se.b=J,se.a=K,se=se.next;for(p=i,c=1;c<=e;c++)v=p+l<<2,y+=(se.r=U=n[v])*(re=te-c),w+=(se.g=Q=n[v+1])*re,S+=(se.b=J=n[v+2])*re,N+=(se.a=K=n[v+3])*re,F+=U,X+=Q,j+=J,q+=K,se=se.next,c<Z&&(p+=i);for(v=l,ve=pe,Me=Ne,u=0;u<s;u++)f=v<<2,n[f+3]=K=N*_t>>St,K>0?(K=255/K,n[f]=(y*_t>>St)*K,n[f+1]=(w*_t>>St)*K,n[f+2]=(S*_t>>St)*K):n[f]=n[f+1]=n[f+2]=0,y-=E,w-=D,S-=I,N-=L,E-=ve.r,D-=ve.g,I-=ve.b,L-=ve.a,f=l+((f=u+te)<Z?f:Z)*i<<2,y+=F+=ve.r=n[f],w+=X+=ve.g=n[f+1],S+=j+=ve.b=n[f+2],N+=q+=ve.a=n[f+3],ve=ve.next,E+=U=Me.r,D+=Q=Me.g,I+=J=Me.b,L+=K=Me.a,F-=U,X-=Q,j-=J,q-=K,Me=Me.next,v+=i}}const Yf=function(e){var n=Math.round(this.blurRadius());n>0&&Wf(e,n)};x.addGetterSetter(z,"blurRadius",0,b(),x.afterSetFilter);const Xf=function(o){var e=this.brightness()*255,n=o.data,i=n.length,s;for(s=0;s<i;s+=4)n[s]+=e,n[s+1]+=e,n[s+2]+=e};x.addGetterSetter(z,"brightness",0,b(),x.afterSetFilter);const Vf=function(o){var e=Math.pow((this.contrast()+100)/100,2),n=o.data,i=n.length,s=150,l=150,u=150,c;for(c=0;c<i;c+=4)s=n[c],l=n[c+1],u=n[c+2],s/=255,s-=.5,s*=e,s+=.5,s*=255,l/=255,l-=.5,l*=e,l+=.5,l*=255,u/=255,u-=.5,u*=e,u+=.5,u*=255,s=s<0?0:s>255?255:s,l=l<0?0:l>255?255:l,u=u<0?0:u>255?255:u,n[c]=s,n[c+1]=l,n[c+2]=u};x.addGetterSetter(z,"contrast",0,b(),x.afterSetFilter);const qf=function(o){var e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,i=this.embossDirection(),s=this.embossBlend(),l=0,u=0,c=o.data,f=o.width,p=o.height,v=f*4,_=p;switch(i){case"top-left":l=-1,u=-1;break;case"top":l=-1,u=0;break;case"top-right":l=-1,u=1;break;case"right":l=0,u=1;break;case"bottom-right":l=1,u=1;break;case"bottom":l=1,u=0;break;case"bottom-left":l=1,u=-1;break;case"left":l=0,u=-1;break;default:k.error("Unknown emboss direction: "+i)}do{var y=(_-1)*v,w=l;_+w<1&&(w=0),_+w>p&&(w=0);var S=(_-1+w)*f*4,N=f;do{var E=y+(N-1)*4,D=u;N+D<1&&(D=0),N+D>f&&(D=0);var I=S+(N-1+D)*4,L=c[E]-c[I],F=c[E+1]-c[I+1],X=c[E+2]-c[I+2],j=L,q=j>0?j:-j,U=F>0?F:-F,Q=X>0?X:-X;if(U>q&&(j=F),Q>q&&(j=X),j*=e,s){var J=c[E]+j,K=c[E+1]+j,re=c[E+2]+j;c[E]=J>255?255:J<0?0:J,c[E+1]=K>255?255:K<0?0:K,c[E+2]=re>255?255:re<0?0:re}else{var $=n-j;$<0?$=0:$>255&&($=255),c[E]=c[E+1]=c[E+2]=$}}while(--N)}while(--_)};x.addGetterSetter(z,"embossStrength",.5,b(),x.afterSetFilter);x.addGetterSetter(z,"embossWhiteLevel",.5,b(),x.afterSetFilter);x.addGetterSetter(z,"embossDirection","top-left",null,x.afterSetFilter);x.addGetterSetter(z,"embossBlend",!1,null,x.afterSetFilter);function ms(o,e,n,i,s){var l=n-e,u=s-i,c;return l===0?i+u/2:u===0?i:(c=(o-e)/l,c=u*c+i,c)}const Qf=function(o){var e=o.data,n=e.length,i=e[0],s=i,l,u=e[1],c=u,f,p=e[2],v=p,_,y,w=this.enhance();if(w!==0){for(y=0;y<n;y+=4)l=e[y+0],l<i?i=l:l>s&&(s=l),f=e[y+1],f<u?u=f:f>c&&(c=f),_=e[y+2],_<p?p=_:_>v&&(v=_);s===i&&(s=255,i=0),c===u&&(c=255,u=0),v===p&&(v=255,p=0);var S,N,E,D,I,L,F,X,j;for(w>0?(N=s+w*(255-s),E=i-w*(i-0),I=c+w*(255-c),L=u-w*(u-0),X=v+w*(255-v),j=p-w*(p-0)):(S=(s+i)*.5,N=s+w*(s-S),E=i+w*(i-S),D=(c+u)*.5,I=c+w*(c-D),L=u+w*(u-D),F=(v+p)*.5,X=v+w*(v-F),j=p+w*(p-F)),y=0;y<n;y+=4)e[y+0]=ms(e[y+0],i,s,E,N),e[y+1]=ms(e[y+1],u,c,L,I),e[y+2]=ms(e[y+2],p,v,j,X)}};x.addGetterSetter(z,"enhance",0,b(),x.afterSetFilter);const Kf=function(o){var e=o.data,n=e.length,i,s;for(i=0;i<n;i+=4)s=.34*e[i]+.5*e[i+1]+.16*e[i+2],e[i]=s,e[i+1]=s,e[i+2]=s};x.addGetterSetter(z,"hue",0,b(),x.afterSetFilter);x.addGetterSetter(z,"saturation",0,b(),x.afterSetFilter);x.addGetterSetter(z,"luminance",0,b(),x.afterSetFilter);const Jf=function(o){var e=o.data,n=e.length,i=1,s=Math.pow(2,this.saturation()),l=Math.abs(this.hue()+360)%360,u=this.luminance()*127,c,f=i*s*Math.cos(l*Math.PI/180),p=i*s*Math.sin(l*Math.PI/180),v=.299*i+.701*f+.167*p,_=.587*i-.587*f+.33*p,y=.114*i-.114*f-.497*p,w=.299*i-.299*f-.328*p,S=.587*i+.413*f+.035*p,N=.114*i-.114*f+.293*p,E=.299*i-.3*f+1.25*p,D=.587*i-.586*f-1.05*p,I=.114*i+.886*f-.2*p,L,F,X,j;for(c=0;c<n;c+=4)L=e[c+0],F=e[c+1],X=e[c+2],j=e[c+3],e[c+0]=v*L+_*F+y*X+u,e[c+1]=w*L+S*F+N*X+u,e[c+2]=E*L+D*F+I*X+u,e[c+3]=j},Zf=function(o){var e=o.data,n=e.length,i=Math.pow(2,this.value()),s=Math.pow(2,this.saturation()),l=Math.abs(this.hue()+360)%360,u,c=i*s*Math.cos(l*Math.PI/180),f=i*s*Math.sin(l*Math.PI/180),p=.299*i+.701*c+.167*f,v=.587*i-.587*c+.33*f,_=.114*i-.114*c-.497*f,y=.299*i-.299*c-.328*f,w=.587*i+.413*c+.035*f,S=.114*i-.114*c+.293*f,N=.299*i-.3*c+1.25*f,E=.587*i-.586*c-1.05*f,D=.114*i+.886*c-.2*f,I,L,F,X;for(u=0;
1u<n;u+=4)I=e[u+0],L=e[u+1],F=e[u+2],X=e[u+3],e[u+0]=p*I+v*L+_*F,e[u+1]=y*I+w*L+S*F,e[u+2]=N*I+E*L+D*F,e[u+3]=X};x.addGetterSetter(z,"hue",0,b(),x.afterSetFilter);x.addGetterSetter(z,"saturation",0,b(),x.afterSetFilter);x.addGetterSetter(z,"value",0,b(),x.afterSetFilter);const $f=function(o){var e=o.data,n=e.length,i;for(i=0;i<n;i+=4)e[i]=255-e[i],e[i+1]=255-e[i+1],e[i+2]=255-e[i+2]};var eg=function(o,e,n){var i=o.data,s=e.data,l=o.width,u=o.height,c=n.polarCenterX||l/2,f=n.polarCenterY||u/2,p,v,_,y=0,w=0,S=0,N=0,E,D=Math.sqrt(c*c+f*f);v=l-c,_=u-f,E=Math.sqrt(v*v+_*_),D=E>D?E:D;var I=u,L=l,F,X,j=360/L*Math.PI/180,q,U;for(X=0;X<L;X+=1)for(q=Math.sin(X*j),U=Math.cos(X*j),F=0;F<I;F+=1)v=Math.floor(c+D*F/I*U),_=Math.floor(f+D*F/I*q),p=(_*l+v)*4,y=i[p+0],w=i[p+1],S=i[p+2],N=i[p+3],p=(X+F*l)*4,s[p+0]=y,s[p+1]=w,s[p+2]=S,s[p+3]=N},tg=function(o,e,n){var i=o.data,s=e.data,l=o.width,u=o.height,c=n.polarCenterX||l/2,f=n.polarCenterY||u/2,p,v,_,y,w,S=0,N=0,E=0,D=0,I,L=Math.sqrt(c*c+f*f);v=l-c,_=u-f,I=Math.sqrt(v*v+_*_),L=I>L?I:L;var F=u,X=l,j,q,U=0,Q,J;for(v=0;v<l;v+=1)for(_=0;_<u;_+=1)y=v-c,w=_-f,j=Math.sqrt(y*y+w*w)*F/L,q=(Math.atan2(w,y)*180/Math.PI+360+U)%360,q=q*X/360,Q=Math.floor(q),J=Math.floor(j),p=(J*l+Q)*4,S=i[p+0],N=i[p+1],E=i[p+2],D=i[p+3],p=(_*l+v)*4,s[p+0]=S,s[p+1]=N,s[p+2]=E,s[p+3]=D};const rg=function(o){var e=o.width,n=o.height,i,s,l,u,c,f,p,v,_,y,w=Math.round(this.kaleidoscopePower()),S=Math.round(this.kaleidoscopeAngle()),N=Math.floor(e*(S%360)/360);if(!(w<1)){var E=k.createCanvasElement();E.width=e,E.height=n;var D=E.getContext("2d").getImageData(0,0,e,n);k.releaseCanvas(E),eg(o,D,{polarCenterX:e/2,polarCenterY:n/2});for(var I=e/Math.pow(2,w);I<=8;)I=I*2,w-=1;I=Math.ceil(I);var L=I,F=0,X=L,j=1;for(N+I>e&&(F=L,X=0,j=-1),s=0;s<n;s+=1)for(i=F;i!==X;i+=j)l=Math.round(i+N)%e,_=(e*s+l)*4,c=D.data[_+0],f=D.data[_+1],p=D.data[_+2],v=D.data[_+3],y=(e*s+i)*4,D.data[y+0]=c,D.data[y+1]=f,D.data[y+2]=p,D.data[y+3]=v;for(s=0;s<n;s+=1)for(L=Math.floor(I),u=0;u<w;u+=1){for(i=0;i<L+1;i+=1)_=(e*s+i)*4,c=D.data[_+0],f=D.data[_+1],p=D.data[_+2],v=D.data[_+3],y=(e*s+L*2-i-1)*4,D.data[y+0]=c,D.data[y+1]=f,D.data[y+2]=p,D.data[y+3]=v;L*=2}tg(D,o,{})}};x.addGetterSetter(z,"kaleidoscopePower",2,b(),x.afterSetFilter);x.addGetterSetter(z,"kaleidoscopeAngle",0,b(),x.afterSetFilter);function Gi(o,e,n){var i=(n*o.width+e)*4,s=[];return s.push(o.data[i++],o.data[i++],o.data[i++],o.data[i++]),s}function xn(o,e){return Math.sqrt(Math.pow(o[0]-e[0],2)+Math.pow(o[1]-e[1],2)+Math.pow(o[2]-e[2],2))}function ng(o){for(var e=[0,0,0],n=0;n<o.length;n++)e[0]+=o[n][0],e[1]+=o[n][1],e[2]+=o[n][2];return e[0]/=o.length,e[1]/=o.length,e[2]/=o.length,e}function ig(o,e){var n=Gi(o,0,0),i=Gi(o,o.width-1,0),s=Gi(o,0,o.height-1),l=Gi(o,o.width-1,o.height-1),u=e||10;if(xn(n,i)<u&&xn(i,l)<u&&xn(l,s)<u&&xn(s,n)<u){for(var c=ng([i,n,l,s]),f=[],p=0;p<o.width*o.height;p++){var v=xn(c,[o.data[p*4],o.data[p*4+1],o.data[p*4+2]]);f[p]=v<u?0:255}return f}}function ag(o,e){for(var n=0;n<o.width*o.height;n++)o.data[4*n+3]=e[n]}function sg(o,e,n){for(var i=[1,1,1,1,0,1,1,1,1],s=Math.round(Math.sqrt(i.length)),l=Math.floor(s/2),u=[],c=0;c<n;c++)for(var f=0;f<e;f++){for(var p=c*e+f,v=0,_=0;_<s;_++)for(var y=0;y<s;y++){var w=c+_-l,S=f+y-l;if(w>=0&&w<n&&S>=0&&S<e){var N=w*e+S,E=i[_*s+y];v+=o[N]*E}}u[p]=v===255*8?255:0}return u}function og(o,e,n){for(var i=[1,1,1,1,1,1,1,1,1],s=Math.round(Math.sqrt(i.length)),l=Math.floor(s/2),u=[],c=0;c<n;c++)for(var f=0;f<e;f++){for(var p=c*e+f,v=0,_=0;_<s;_++)for(var y=0;y<s;y++){var w=c+_-l,S=f+y-l;if(w>=0&&w<n&&S>=0&&S<e){var N=w*e+S,E=i[_*s+y];v+=o[N]*E}}u[p]=v>=255*4?255:0}return u}function lg(o,e,n){for(var i=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],s=Math.round(Math.sqrt(i.length)),l=Math.floor(s/2),u=[],c=0;c<n;c++)for(var f=0;f<e;f++){for(var p=c*e+f,v=0,_=0;_<s;_++)for(var y=0;y<s;y++){var w=c+_-l,S=f+y-l;if(w>=0&&w<n&&S>=0&&S<e){var N=w*e+S,E=i[_*s+y];v+=o[N]*E}}u[p]=v}return u}const hg=function(o){var e=this.threshold(),n=ig(o,e);return n&&(n=sg(n,o.width,o.height),n=og(n,o.width,o.height),n=lg(n,o.width,o.height),ag(o,n)),o};x.addGetterSetter(z,"threshold",0,b(),x.afterSetFilter);const ug=function(o){var e=this.noise()*255,n=o.data,i=n.length,s=e/2,l;for(l=0;l<i;l+=4)n[l+0]+=s-2*s*Math.random(),n[l+1]+=s-2*s*Math.random(),n[l+2]+=s-2*s*Math.random()};x.addGetterSetter(z,"noise",.2,b(),x.afterSetFilter);const dg=function(o){var e=Math.ceil(this.pixelSize()),n=o.width,i=o.height,s,l,u,c,f,p,v,_=Math.ceil(n/e),y=Math.ceil(i/e),w,S,N,E,D,I,L,F=o.data;if(e<=0){k.error("pixelSize value can not be <= 0");return}for(D=0;D<_;D+=1)for(I=0;I<y;I+=1){for(c=0,f=0,p=0,v=0,w=D*e,S=w+e,N=I*e,E=N+e,L=0,s=w;s<S;s+=1)if(!(s>=n))for(l=N;l<E;l+=1)l>=i||(u=(n*l+s)*4,c+=F[u+0],f+=F[u+1],p+=F[u+2],v+=F[u+3],L+=1);for(c=c/L,f=f/L,p=p/L,v=v/L,s=w;s<S;s+=1)if(!(s>=n))for(l=N;l<E;l+=1)l>=i||(u=(n*l+s)*4,F[u+0]=c,F[u+1]=f,F[u+2]=p,F[u+3]=v)}};x.addGetterSetter(z,"pixelSize",8,b(),x.afterSetFilter);const cg=function(o){var e=Math.round(this.levels()*254)+1,n=o.data,i=n.length,s=255/e,l;for(l=0;l<i;l+=1)n[l]=Math.floor(n[l]/s)*s};x.addGetterSetter(z,"levels",.5,b(),x.afterSetFilter);const fg=function(o){var e=o.data,n=e.length,i=this.red(),s=this.green(),l=this.blue(),u,c;for(u=0;
vendor: 8,503 bytes, lines 1-9
1u<n;u+=4)c=(.34*e[u]+.5*e[u+1]+.16*e[u+2])/255,e[u]=c*i,e[u+1]=c*s,e[u+2]=c*l,e[u+3]=e[u+3]};x.addGetterSetter(z,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});x.addGetterSetter(z,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});x.addGetterSetter(z,"blue",0,yh,x.afterSetFilter);const gg=function(o){var e=o.data,n=e.length,i=this.red(),s=this.green(),l=this.blue(),u=this.alpha(),c,f;for(c=0;c<n;c+=4)f=1-u,e[c]=i*u+e[c]*f,e[c+1]=s*u+e[c+1]*f,e[c+2]=l*u+e[c+2]*f};x.addGetterSetter(z,"red",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});x.addGetterSetter(z,"green",0,function(o){return this._filterUpToDate=!1,o>255?255:o<0?0:Math.round(o)});x.addGetterSetter(z,"blue",0,yh,x.afterSetFilter);x.addGetterSetter(z,"alpha",1,function(o){return this._filterUpToDate=!1,o>1?1:o<0?0:o});const pg=function(o){var e=o.data,n=e.length,i,s,l,u;for(i=0;i<n;i+=4)s=e[i+0],l=e[i+1],u=e[i+2],e[i+0]=Math.min(255,s*.393+l*.769+u*.189),e[i+1]=Math.min(255,s*.349+l*.686+u*.168),e[i+2]=Math.min(255,s*.272+l*.534+u*.131)},vg=function(o){var e=o.data,n=o.width,i=o.height,s=n*4,l=i;do{var u=(l-1)*s,c=n;do{var f=u+(c-1)*4,p=e[f],v=e[f+1],_=e[f+2];p>127&&(p=255-p),v>127&&(v=255-v),_>127&&(_=255-_),e[f]=p,e[f+1]=v,e[f+2]=_}while(--c)}while(--l)},mg=function(o){var e=this.threshold()*255,n=o.data,i=n.length,s;for(s=0;s<i;s+=1)n[s]=n[s]<e?0:255};x.addGetterSetter(z,"threshold",.5,b(),x.afterSetFilter);wr.Util._assign(wr,{Arc:Xt,Arrow:Pr,Circle:Qr,Ellipse:lr,Image:Gt,Label:zs,Tag:kr,Line:Vt,Path:ye,Rect:Mn,RegularPolygon:Er,Ring:Tr,Sprite:zt,Star:hr,Text:Re,TextPath:be,Transformer:me,Wedge:qt,Filters:{Blur:Yf,Brighten:Xf,Contrast:Vf,Emboss:qf,Enhance:Qf,Grayscale:Kf,HSL:Jf,HSV:Zf,Invert:$f,Kaleidoscope:rg,Mask:hg,Noise:ug,Pixelate:dg,Posterize:cg,RGB:fg,RGBA:gg,Sepia:pg,Solarize:vg,Threshold:mg}});var ys={exports:{}};/**
2 * @license React
3 * react-reconciler.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var _s,eh;function yg(){return eh||(eh=1,_s=function(e){var n={},i=Wd(),s=ph(),l=Object.assign;function u(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,a=1;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+t+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var c=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),p=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),S=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),X=Symbol.iterator;function j(t){return t===null||typeof t!="object"?null:(t=X&&t[X]||t["@@iterator"],typeof t=="function"?t:null)}function q(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case v:return"Fragment";case p:return"Portal";case y:return"Profiler";case _:return"StrictMode";case E:return"Suspense";case D:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case S:return(t.displayName||"Context")+".Consumer";case w:return(t._context.displayName||"Context")+".Provider";case N:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case I:return r=t.displayName||null,r!==null?r:q(t.type)||"Memo";case L:r=t._payload,t=t._init;try{return q(t(r))}catch(a){}}return null}function U(t){var r=t.type;switch(t.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(r);case 8:return r===_?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function Q(t){var r=t,a=t;if(t.alternate)for(;r.return;)r=r.return;else{t=r;do r=t,(r.flags&4098)!==0&&(a=r.return),t=r.return;while(t)}return r.tag===3?a:null}function J(t){if(Q(t)!==t)throw Error(u(188))}function K(t){var r=t.alternate;if(!r){if(r=Q(t),r===null)throw Error(u(188));return r!==t?null:t}for(var a=t,h=r;;){var d=a.return;if(d===null)break;var g=d.alternate;if(g===null){if(h=d.return,h!==null){a=h;continue}break}if(d.child===g.child){for(g=d.child;g;){if(g===a)return J(d),t;if(g===h)return J(d),r;g=g.sibling}throw Error(u(188))}if(a.return!==h.return)a=d,h=g;else{for(var m=!1,C=d.child;C;){if(C===a){m=!0,a=d,h=g;break}if(C===h){m=!0,h=d,a=g;break}C=C.sibling}if(!m){for(C=g.child;C;){if(C===a){m=!0,a=g,h=d;break}if(C===h){m=!0,h=g,a=d;break}C=C.sibling}if(!m)throw Error(u(189))}}if(a.alternate!==h)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?t:r}function re(t){return t=K(t),t!==null?$(t):null}function $(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var r=$(t);if(r!==null)return r;t=t.sibling}return null}function fe(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){if(t.tag!==4){var r=fe(t);if(r!==null)return r}t=t.sibling}return null}var Z=Array.isArray,te=e.getPublicInstance,ge=e.getRootHostContext,pe=e.getChildHostContext,Ne=e.prepareForCommit,se=e.resetAfterCommit,ve=e.createInstance,Me=e.appendInitialChild,_t=e.finalizeInitialChildren,St=e.prepareUpdate,Vi=e.shouldSetTextContent,Bs=e.createTextInstance,Hs=e.scheduleTimeout,iu=e.cancelTimeout,qi=e.noTimeout,Ln=e.isPrimaryRenderer,it=e.supportsMutation,In=e.supportsPersistence,ht=e.supportsHydration,au=e.getInstanceFromNode,su=e.preparePortalMount,ou=e.getCurrentEventPriority,lu=e.detachDeletedInstance,hu=e.supportsMicrotasks,uu=e.scheduleMicrotask,Kr=e.supportsTestSelectors,du=e.findFiberRoot,cu=e.getBoundingRect,fu=e.getTextContent,Jr=e.isHiddenSubtree,gu=e.matchAccessibilityRole,pu=e.setFocusIfFocusable,vu=e.setupIntersectionObserver,mu=e.appendChild,yu=e.appendChildToContainer,_u=e.commitTextUpdate,Su=e.commitMount,xu=e.commitUpdate,wu=e.insertBefore,Cu=e.insertInContainerBefore,Pu=e.removeChild,ku=e.removeChildFromContainer,Us=e.resetTextContent,Eu=e.hideInstance,Tu=e.hideTextInstance,Ru=e.unhideInstance,Au=e.unhideTextInstance,Nu=e.clearContainer,Mu=e.cloneInstance,Ws=e.createContainerChildSet,Ys=e.appendChildToContainerChildSet,Lu=e.finalizeContainerChildren,Qi=e.replaceContainerChildren,Xs=e.cloneHiddenInstance,Vs=e.cloneHiddenTextInstance,Iu=e.canHydrateInstance,Ou=e.canHydrateTextInstance,Du=e.canHydrateSuspenseInstance,qs=e.isSuspenseInstancePending,Ki=e.isSuspenseInstanceFallback,Gu=e.getSuspenseInstanceFallbackErrorDetails,zu=e.registerSuspenseInstanceRetry,On=e.getNextHydratableSibling,bu=e.getFirstHydratableChild,Fu=e.getFirstHydratableChildWithinContainer,ju=e.getFirstHydratableChildWithinSuspenseInstance,Bu=e.hydrateInstance,Hu=e.hydrateTextInstance,Uu=e.hydrateSuspenseInstance,Wu=e.getNextHydratableInstanceAfterSuspenseInstance,Yu=e.commitHydratedContainer,Xu=e.commitHydratedSuspenseInstance,Vu=e.clearSuspenseBoundary,qu=e.clearSuspenseBoundaryFromContainer,Qu=e.shouldDeleteUnhydratedTailInstances,Ku=e.didNotMatchHydratedContainerTextInstance,Ju=e.didNotMatchHydratedTextInstance,Ji;function Zr(t){if(Ji===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);Ji=r&&r[1]||""}return"\n"+Ji+t}var Zi=!1;function $i(t,r){if(!t||Zi)return"";Zi=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(G){var h=G}Reflect.construct(t,[],r)}else{try{r.call()}catch(G){h=G}t.call(r.prototype)}else{try{throw Error()}catch(G){h=G}t()}}
vendor: 4,905 bytes, line 9
9catch(G){if(G&&h&&typeof G.stack=="string"){for(var d=G.stack.split("\n"),g=h.stack.split("\n"),m=d.length-1,C=g.length-1;1<=m&&0<=C&&d[m]!==g[C];)C--;for(;1<=m&&0<=C;m--,C--)if(d[m]!==g[C]){if(m!==1||C!==1)do if(m--,C--,0>C||d[m]!==g[C]){var A="\n"+d[m].replace(" at new "," at ");return t.displayName&&A.includes("<anonymous>")&&(A=A.replace("<anonymous>",t.displayName)),A}while(1<=m&&0<=C);break}}}finally{Zi=!1,Error.prepareStackTrace=a}return(t=t?t.displayName||t.name:"")?Zr(t):""}var Zu=Object.prototype.hasOwnProperty,ea=[],Rr=-1;function Qt(t){return{current:t}}function we(t){0>Rr||(t.current=ea[Rr],ea[Rr]=null,Rr--)}function xe(t,r){Rr++,ea[Rr]=t.current,t.current=r}var Kt={},Ye=Qt(Kt),Ze=Qt(!1),dr=Kt;function Ar(t,r){var a=t.type.contextTypes;if(!a)return Kt;var h=t.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===r)return h.__reactInternalMemoizedMaskedChildContext;var d={},g;for(g in a)d[g]=r[g];return h&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=d),d}function $e(t){return t=t.childContextTypes,t!=null}function Dn(){we(Ze),we(Ye)}function Qs(t,r,a){if(Ye.current!==Kt)throw Error(u(168));xe(Ye,r),xe(Ze,a)}function Ks(t,r,a){var h=t.stateNode;if(r=r.childContextTypes,typeof h.getChildContext!="function")return a;h=h.getChildContext();for(var d in h)if(!(d in r))throw Error(u(108,U(t)||"Unknown",d));return l({},a,h)}function Gn(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Kt,dr=Ye.current,xe(Ye,t),xe(Ze,Ze.current),!0}function Js(t,r,a){var h=t.stateNode;if(!h)throw Error(u(169));a?(t=Ks(t,r,dr),h.__reactInternalMemoizedMergedChildContext=t,we(Ze),we(Ye),xe(Ye,t)):we(Ze),xe(Ze,a)}var xt=Math.clz32?Math.clz32:td,$u=Math.log,ed=Math.LN2;function td(t){return t>>>=0,t===0?32:31-($u(t)/ed|0)|0}var zn=64,bn=4194304;function $r(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Fn(t,r){var a=t.pendingLanes;if(a===0)return 0;var h=0,d=t.suspendedLanes,g=t.pingedLanes,m=a&268435455;if(m!==0){var C=m&~d;C!==0?h=$r(C):(g&=m,g!==0&&(h=$r(g)))}else m=a&~d,m!==0?h=$r(m):g!==0&&(h=$r(g));if(h===0)return 0;if(r!==0&&r!==h&&(r&d)===0&&(d=h&-h,g=r&-r,d>=g||d===16&&(g&4194240)!==0))return r;if((h&4)!==0&&(h|=a&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=h;0<r;)a=31-xt(r),d=1<<a,h|=t[a],r&=~d;return h}function rd(t,r){switch(t){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function nd(t,r){for(var a=t.suspendedLanes,h=t.pingedLanes,d=t.expirationTimes,g=t.pendingLanes;0<g;){var m=31-xt(g),C=1<<m,A=d[m];A===-1?((C&a)===0||(C&h)!==0)&&(d[m]=rd(C,r)):A<=r&&(t.expiredLanes|=C),g&=~C}}function ta(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Zs(){var t=zn;return zn<<=1,(zn&4194240)===0&&(zn=64),t}function ra(t){for(var r=[],a=0;31>a;a++)r.push(t);return r}function en(t,r,a){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-xt(r),t[r]=a}function id(t,r){var a=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var h=t.eventTimes;for(t=t.expirationTimes;0<a;){var d=31-xt(a),g=1<<d;r[d]=0,h[d]=-1,t[d]=-1,a&=~g}}function na(t,r){var a=t.entangledLanes|=r;for(t=t.entanglements;a;){var h=31-xt(a),d=1<<h;d&r|t[h]&r&&(t[h]|=r),a&=~d}}var he=0;function $s(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var ia=s.unstable_scheduleCallback,eo=s.unstable_cancelCallback,ad=s.unstable_shouldYield,sd=s.unstable_requestPaint,Fe=s.unstable_now,aa=s.unstable_ImmediatePriority,od=s.unstable_UserBlockingPriority,sa=s.unstable_NormalPriority,ld=s.unstable_IdlePriority,jn=null,Rt=null;function hd(t){if(Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(jn,t,void 0,(t.current.flags&128)===128)}catch(r){}}function ud(t,r){return t===r&&(t!==0||1/t===1/r)||t!==t&&r!==r}var wt=typeof Object.is=="function"?Object.is:ud,bt=null,Bn=!1,oa=!1;function to(t){bt===null?bt=[t]:bt.push(t)}function dd(t){Bn=!0,to(t)}
vendor: 4,758 bytes, line 9
9function At(){if(!oa&&bt!==null){oa=!0;var t=0,r=he;try{var a=bt;for(he=1;t<a.length;t++){var h=a[t];do h=h(!0);while(h!==null)}bt=null,Bn=!1}catch(d){throw bt!==null&&(bt=bt.slice(t+1)),ia(aa,At),d}finally{he=r,oa=!1}}return null}var Nr=[],Mr=0,Hn=null,Un=0,ut=[],dt=0,cr=null,Ft=1,jt="";function fr(t,r){Nr[Mr++]=Un,Nr[Mr++]=Hn,Hn=t,Un=r}function ro(t,r,a){ut[dt++]=Ft,ut[dt++]=jt,ut[dt++]=cr,cr=t;var h=Ft;t=jt;var d=32-xt(h)-1;h&=~(1<<d),a+=1;var g=32-xt(r)+d;if(30<g){var m=d-d%5;g=(h&(1<<m)-1).toString(32),h>>=m,d-=m,Ft=1<<32-xt(r)+d|a<<d|h,jt=g+t}else Ft=1<<g|a<<d|h,jt=t}function la(t){t.return!==null&&(fr(t,1),ro(t,1,0))}function ha(t){for(;t===Hn;)Hn=Nr[--Mr],Nr[Mr]=null,Un=Nr[--Mr],Nr[Mr]=null;for(;t===cr;)cr=ut[--dt],ut[dt]=null,jt=ut[--dt],ut[dt]=null,Ft=ut[--dt],ut[dt]=null}var at=null,ct=null,Pe=!1,tn=!1,Ct=null;function no(t,r){var a=mt(5,null,null,0);a.elementType="DELETED",a.stateNode=r,a.return=t,r=t.deletions,r===null?(t.deletions=[a],t.flags|=16):r.push(a)}function io(t,r){switch(t.tag){case 5:return r=Iu(r,t.type,t.pendingProps),r!==null?(t.stateNode=r,at=t,ct=bu(r),!0):!1;case 6:return r=Ou(r,t.pendingProps),r!==null?(t.stateNode=r,at=t,ct=null,!0):!1;case 13:if(r=Du(r),r!==null){var a=cr!==null?{id:Ft,overflow:jt}:null;return t.memoizedState={dehydrated:r,treeContext:a,retryLane:1073741824},a=mt(18,null,null,0),a.stateNode=r,a.return=t,t.child=a,at=t,ct=null,!0}return!1;default:return!1}}function ua(t){return(t.mode&1)!==0&&(t.flags&128)===0}function da(t){if(Pe){var r=ct;if(r){var a=r;if(!io(t,r)){if(ua(t))throw Error(u(418));r=On(a);var h=at;r&&io(t,r)?no(h,a):(t.flags=t.flags&-4097|2,Pe=!1,at=t)}}else{if(ua(t))throw Error(u(418));t.flags=t.flags&-4097|2,Pe=!1,at=t}}}function ao(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;at=t}function Wn(t){if(!ht||t!==at)return!1;if(!Pe)return ao(t),Pe=!0,!1;if(t.tag!==3&&(t.tag!==5||Qu(t.type)&&!Vi(t.type,t.memoizedProps))){var r=ct;if(r){if(ua(t))throw so(),Error(u(418));for(;r;)no(t,r),r=On(r)}}if(ao(t),t.tag===13){if(!ht)throw Error(u(316));if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));ct=Wu(t)}else ct=at?On(t.stateNode):null;return!0}function so(){for(var t=ct;t;)t=On(t)}function Lr(){ht&&(ct=at=null,tn=Pe=!1)}function ca(t){Ct===null?Ct=[t]:Ct.push(t)}var cd=c.ReactCurrentBatchConfig;function Yn(t,r){if(wt(t,r))return!0;if(typeof t!="object"||t===null||typeof r!="object"||r===null)return!1;var a=Object.keys(t),h=Object.keys(r);if(a.length!==h.length)return!1;for(h=0;h<a.length;h++){var d=a[h];if(!Zu.call(r,d)||!wt(t[d],r[d]))return!1}return!0}function fd(t){switch(t.tag){case 5:return Zr(t.type);case 16:return Zr("Lazy");case 13:return Zr("Suspense");case 19:return Zr("SuspenseList");case 0:case 2:case 15:return t=$i(t.type,!1),t;case 11:return t=$i(t.type.render,!1),t;case 1:return t=$i(t.type,!0),t;default:return""}}function Pt(t,r){if(t&&t.defaultProps){r=l({},r),t=t.defaultProps;for(var a in t)r[a]===void 0&&(r[a]=t[a]);return r}return r}var Xn=Qt(null),Vn=null,Ir=null,fa=null;function ga(){fa=Ir=Vn=null}function oo(t,r,a){Ln?(xe(Xn,r._currentValue),r._currentValue=a):(xe(Xn,r._currentValue2),r._currentValue2=a)}function pa(t){var r=Xn.current;we(Xn),Ln?t._currentValue=r:t._currentValue2=r}function va(t,r,a){for(;t!==null;){var h=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,h!==null&&(h.childLanes|=r)):h!==null&&(h.childLanes&r)!==r&&(h.childLanes|=r),t===a)break;t=t.return}}function Or(t,r){Vn=t,fa=Ir=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(et=!0),t.firstContext=null)}function ft(t){var r=Ln?t._currentValue:t._currentValue2;if(fa!==t)if(t={context:t,memoizedValue:r,next:null},Ir===null){if(Vn===null)throw Error(u(308));Ir=t,Vn.dependencies={lanes:0,firstContext:t}}else Ir=Ir.next=t;return r}var gr=null;function ma(t){gr===null?gr=[t]:gr.push(t)}function lo(t,r,a,h){var d=r.interleaved;return d===null?(a.next=a,ma(r)):(a.next=d.next,d.next=a),r.interleaved=a,Nt(t,h)}function Nt(t,r){t.lanes|=r;var a=t.alternate;for(a!==null&&(a.lanes|=r),a=t,t=t.return;t!==null;)t.childLanes|=r,a=t.alternate,a!==null&&(a.childLanes|=r),a=t,t=t.return;return a.tag===3?a.stateNode:null}var Jt=!1;function ya(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ho(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Bt(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Zt(t,r,a){var h=t.updateQueue;if(h===null)return null;if(h=h.shared,(le&2)!==0){var d=h.pending;
vendor: 10,586 bytes, line 9
9return d===null?r.next=r:(r.next=d.next,d.next=r),h.pending=r,Nt(t,a)}return d=h.interleaved,d===null?(r.next=r,ma(h)):(r.next=d.next,d.next=r),h.interleaved=r,Nt(t,a)}function qn(t,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194240)!==0)){var h=r.lanes;h&=t.pendingLanes,a|=h,r.lanes=a,na(t,a)}}function uo(t,r){var a=t.updateQueue,h=t.alternate;if(h!==null&&(h=h.updateQueue,a===h)){var d=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var m={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};g===null?d=g=m:g=g.next=m,a=a.next}while(a!==null);g===null?d=g=r:g=g.next=r}else d=g=r;a={baseState:h.baseState,firstBaseUpdate:d,lastBaseUpdate:g,shared:h.shared,effects:h.effects},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=r:t.next=r,a.lastBaseUpdate=r}function Qn(t,r,a,h){var d=t.updateQueue;Jt=!1;var g=d.firstBaseUpdate,m=d.lastBaseUpdate,C=d.shared.pending;if(C!==null){d.shared.pending=null;var A=C,G=A.next;A.next=null,m===null?g=G:m.next=G,m=A;var V=t.alternate;V!==null&&(V=V.updateQueue,C=V.lastBaseUpdate,C!==m&&(C===null?V.firstBaseUpdate=G:C.next=G,V.lastBaseUpdate=A))}if(g!==null){var ne=d.baseState;m=0,V=G=A=null,C=g;do{var B=C.lane,Ce=C.eventTime;if((h&B)===B){V!==null&&(V=V.next={eventTime:Ce,lane:0,tag:C.tag,payload:C.payload,callback:C.callback,next:null});e:{var _e=t,nt=C;switch(B=r,Ce=a,nt.tag){case 1:if(_e=nt.payload,typeof _e=="function"){ne=_e.call(Ce,ne,B);break e}ne=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=nt.payload,B=typeof _e=="function"?_e.call(Ce,ne,B):_e,B==null)break e;ne=l({},ne,B);break e;case 2:Jt=!0}}C.callback!==null&&C.lane!==0&&(t.flags|=64,B=d.effects,B===null?d.effects=[C]:B.push(C))}else Ce={eventTime:Ce,lane:B,tag:C.tag,payload:C.payload,callback:C.callback,next:null},V===null?(G=V=Ce,A=ne):V=V.next=Ce,m|=B;if(C=C.next,C===null){if(C=d.shared.pending,C===null)break;B=C,C=B.next,B.next=null,d.lastBaseUpdate=B,d.shared.pending=null}}while(!0);if(V===null&&(A=ne),d.baseState=A,d.firstBaseUpdate=G,d.lastBaseUpdate=V,r=d.shared.interleaved,r!==null){d=r;do m|=d.lane,d=d.next;while(d!==r)}else g===null&&(d.shared.lanes=0);vr|=m,t.lanes=m,t.memoizedState=ne}}function co(t,r,a){if(t=r.effects,r.effects=null,t!==null)for(r=0;r<t.length;r++){var h=t[r],d=h.callback;if(d!==null){if(h.callback=null,h=a,typeof d!="function")throw Error(u(191,d));d.call(h)}}}var fo=new i.Component().refs;function _a(t,r,a,h){r=t.memoizedState,a=a(h,r),a=a==null?r:l({},r,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Kn={isMounted:function(t){return(t=t._reactInternals)?Q(t)===t:!1},enqueueSetState:function(t,r,a){t=t._reactInternals;var h=Qe(),d=tr(t),g=Bt(h,d);g.payload=r,a!=null&&(g.callback=a),r=Zt(t,g,d),r!==null&&(vt(r,t,d,h),qn(r,t,d))},enqueueReplaceState:function(t,r,a){t=t._reactInternals;var h=Qe(),d=tr(t),g=Bt(h,d);g.tag=1,g.payload=r,a!=null&&(g.callback=a),r=Zt(t,g,d),r!==null&&(vt(r,t,d,h),qn(r,t,d))},enqueueForceUpdate:function(t,r){t=t._reactInternals;var a=Qe(),h=tr(t),d=Bt(a,h);d.tag=2,r!=null&&(d.callback=r),r=Zt(t,d,h),r!==null&&(vt(r,t,h,a),qn(r,t,h))}};function go(t,r,a,h,d,g,m){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(h,g,m):r.prototype&&r.prototype.isPureReactComponent?!Yn(a,h)||!Yn(d,g):!0}function po(t,r,a){var h=!1,d=Kt,g=r.contextType;return typeof g=="object"&&g!==null?g=ft(g):(d=$e(r)?dr:Ye.current,h=r.contextTypes,g=(h=h!=null)?Ar(t,d):Kt),r=new r(a,g),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Kn,t.stateNode=r,r._reactInternals=t,h&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=d,t.__reactInternalMemoizedMaskedChildContext=g),r}function vo(t,r,a,h){t=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,h),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,h),r.state!==t&&Kn.enqueueReplaceState(r,r.state,null)}function Sa(t,r,a,h){var d=t.stateNode;d.props=a,d.state=t.memoizedState,d.refs=fo,ya(t);var g=r.contextType;typeof g=="object"&&g!==null?d.context=ft(g):(g=$e(r)?dr:Ye.current,d.context=Ar(t,g)),d.state=t.memoizedState,g=r.getDerivedStateFromProps,typeof g=="function"&&(_a(t,r,g,a),d.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(r=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),r!==d.state&&Kn.enqueueReplaceState(d,d.state,null),Qn(t,a,d,h),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308)}function rn(t,r,a){if(t=a.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(u(309));var h=a.stateNode}if(!h)throw Error(u(147,t));var d=h,g=""+t;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===g?r.ref:(r=function(m){var C=d.refs;C===fo&&(C=d.refs={}),m===null?delete C[g]:C[g]=m},r._stringRef=g,r)}if(typeof t!="string")throw Error(u(284));if(!a._owner)throw Error(u(290,t))}return t}function Jn(t,r){throw t=Object.prototype.toString.call(r),Error(u(31,t==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":t))}function mo(t){var r=t._init;return r(t._payload)}function yo(t){function r(R,P){if(t){var M=R.deletions;M===null?(R.deletions=[P],R.flags|=16):M.push(P)}}function a(R,P){if(!t)return null;for(;P!==null;)r(R,P),P=P.sibling;return null}function h(R,P){for(R=new Map;P!==null;)P.key!==null?R.set(P.key,P):R.set(P.index,P),P=P.sibling;return R}function d(R,P){return R=nr(R,P),R.index=0,R.sibling=null,R}function g(R,P,M){return R.index=M,t?(M=R.alternate,M!==null?(M=M.index,M<P?(R.flags|=2,P):M):(R.flags|=2,P)):(R.flags|=1048576,P)}function m(R){return t&&R.alternate===null&&(R.flags|=2),R}function C(R,P,M,H){return P===null||P.tag!==6?(P=os(M,R.mode,H),P.return=R,P):(P=d(P,M),P.return=R,P)}function A(R,P,M,H){var ee=M.type;return ee===v?V(R,P,M.props.children,H,M.key):P!==null&&(P.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===L&&mo(ee)===P.type)?(H=d(P,M.props),H.ref=rn(R,P,M),H.return=R,H):(H=Ci(M.type,M.key,M.props,null,R.mode,H),H.ref=rn(R,P,M),H.return=R,H)}function G(R,P,M,H){return P===null||P.tag!==4||P.stateNode.containerInfo!==M.containerInfo||P.stateNode.implementation!==M.implementation?(P=ls(M,R.mode,H),P.return=R,P):(P=d(P,M.children||[]),P.return=R,P)}function V(R,P,M,H,ee){return P===null||P.tag!==7?(P=Sr(M,R.mode,H,ee),P.return=R,P):(P=d(P,M),P.return=R,P)}function ne(R,P,M){if(typeof P=="string"&&P!==""||typeof P=="number")return P=os(""+P,R.mode,M),P.return=R,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case f:return M=Ci(P.type,P.key,P.props,null,R.mode,M),M.ref=rn(R,null,P),M.return=R,M;case p:return P=ls(P,R.mode,M),P.return=R,P;case L:var H=P._init;return ne(R,H(P._payload),M)}if(Z(P)||j(P))return P=Sr(P,R.mode,M,null),P.return=R,P;Jn(R,P)}return null}function B(R,P,M,H){var ee=P!==null?P.key:null;if(typeof M=="string"&&M!==""||typeof M=="number")return ee!==null?null:C(R,P,""+M,H);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case f:return M.key===ee?A(R,P,M,H):null;case p:return M.key===ee?G(R,P,M,H):null;case L:return ee=M._init,B(R,P,ee(M._payload),H)}if(Z(M)||j(M))return ee!==null?null:V(R,P,M,H,null);Jn(R,M)}return null}function Ce(R,P,M,H,ee){if(typeof H=="string"&&H!==""||typeof H=="number")return R=R.get(M)||null,C(P,R,""+H,ee);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case f:return R=R.get(H.key===null?M:H.key)||null,A(P,R,H,ee);case p:return R=R.get(H.key===null?M:H.key)||null,G(P,R,H,ee);case L:var oe=H._init;return Ce(R,P,M,oe(H._payload),ee)}if(Z(H)||j(H))return R=R.get(M)||null,V(P,R,H,ee,null);Jn(P,H)}return null}function _e(R,P,M,H){for(var ee=null,oe=null,ie=P,ue=P=0,He=null;ie!==null&&ue<M.length;ue++){ie.index>ue?(He=ie,ie=null):He=ie.sibling;var de=B(R,ie,M[ue],H);if(de===null){ie===null&&(ie=He);break}t&&ie&&de.alternate===null&&r(R,ie),P=g(de,P,ue),oe===null?ee=de:oe.sibling=de,oe=de,ie=He}if(ue===M.length)return a(R,ie),Pe&&fr(R,ue),ee;if(ie===null){for(;ue<M.length;ue++)ie=ne(R,M[ue],H),ie!==null&&(P=g(ie,P,ue),oe===null?ee=ie:oe.sibling=ie,oe=ie);return Pe&&fr(R,ue),ee}for(ie=h(R,ie);ue<M.length;ue++)He=Ce(ie,R,ue,M[ue],H),He!==null&&(t&&He.alternate!==null&&ie.delete(He.key===null?ue:He.key),P=g(He,P,ue),oe===null?ee=He:oe.sibling=He,oe=He);return t&&ie.forEach(function(ir){return r(R,ir)}),Pe&&fr(R,ue),ee}function nt(R,P,M,H){var ee=j(M);if(typeof ee!="function")throw Error(u(150));if(M=ee.call(M),M==null)throw Error(u(151));for(var oe=ee=null,ie=P,ue=P=0,He=null,de=M.next();ie!==null&&!de.done;ue++,de=M.next()){ie.index>ue?(He=ie,ie=null):He=ie.sibling;var ir=B(R,ie,de.value,H);if(ir===null){ie===null&&(ie=He);break}t&&ie&&ir.alternate===null&&r(R,ie),P=g(ir,P,ue),oe===null?ee=ir:oe.sibling=ir,oe=ir,ie=He}if(de.done)return a(R,ie),Pe&&fr(R,ue),ee;if(ie===null){for(;!de.done;ue++,de=M.next())de=ne(R,de.value,H),de!==null&&(P=g(de,P,ue),oe===null?ee=de:oe.sibling=de,oe=de);return Pe&&fr(R,ue),ee}for(ie=h(R,ie);!de.done;ue++,de=M.next())de=Ce(ie,R,ue,de.value,H),de!==null&&(t&&de.alternate!==null&&ie.delete(de.key===null?ue:de.key),P=g(de,P,ue),oe===null?ee=de:oe.sibling=de,oe=de);return t&&ie.forEach(function(Ud){return r(R,Ud)}),Pe&&fr(R,ue),ee}function Wt(R,P,M,H){if(typeof M=="object"&&M!==null&&M.type===v&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case f:e:{for(var ee=M.key,oe=P;oe!==null;){if(oe.key===ee){if(ee=M.type,ee===v){if(oe.tag===7){a(R,oe.sibling),P=d(oe,M.props.children),P.return=R,R=P;break e}}else if(oe.elementType===ee||typeof ee=="object"&&ee!==null&&ee.$$typeof===L&&mo(ee)===oe.type){a(R,oe.sibling),P=d(oe,M.props),P.ref=rn(R,oe,M),P.return=R,R=P;break e}a(R,oe);break}else r(R,oe);oe=oe.sibling}M.type===v?(P=Sr(M.props.children,R.mode,H,M.key),P.return=R,R=P):(H=Ci(M.type,M.key,M.props,null,R.mode,H),H.ref=rn(R,P,M),H.return=R,R=H)}return m(R);case p:e:{for(oe=M.key;P!==null;){if(P.key===oe)if(P.tag===4&&P.stateNode.containerInfo===M.containerInfo&&P.stateNode.implementation===M.implementation){a(R,P.sibling),P=d(P,M.children||[]),P.return=R,R=P;break e}else{a(R,P);break}else r(R,P);P=P.sibling}P=ls(M,R.mode,H),P.return=R,R=P}return m(R);case L:return oe=M._init,Wt(R,P,oe(M._payload),H)}if(Z(M))return _e(R,P,M,H);if(j(M))return nt(R,P,M,H);Jn(R,M)}
vendor: 4,667 bytes, line 9
9return typeof M=="string"&&M!==""||typeof M=="number"?(M=""+M,P!==null&&P.tag===6?(a(R,P.sibling),P=d(P,M),P.return=R,R=P):(a(R,P),P=os(M,R.mode,H),P.return=R,R=P),m(R)):a(R,P)}return Wt}var Dr=yo(!0),_o=yo(!1),nn={},gt=Qt(nn),an=Qt(nn),Gr=Qt(nn);function Mt(t){if(t===nn)throw Error(u(174));return t}function xa(t,r){xe(Gr,r),xe(an,t),xe(gt,nn),t=ge(r),we(gt),xe(gt,t)}function zr(){we(gt),we(an),we(Gr)}function So(t){var r=Mt(Gr.current),a=Mt(gt.current);r=pe(a,t.type,r),a!==r&&(xe(an,t),xe(gt,r))}function wa(t){an.current===t&&(we(gt),we(an))}var Ee=Qt(0);function Zn(t){for(var r=t;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||qs(a)||Ki(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ca=[];function Pa(){for(var t=0;t<Ca.length;t++){var r=Ca[t];Ln?r._workInProgressVersionPrimary=null:r._workInProgressVersionSecondary=null}Ca.length=0}var $n=c.ReactCurrentDispatcher,ka=c.ReactCurrentBatchConfig,pr=0,Te=null,Ge=null,je=null,ei=!1,sn=!1,on=0,gd=0;function Xe(){throw Error(u(321))}function Ea(t,r){if(r===null)return!1;for(var a=0;a<r.length&&a<t.length;a++)if(!wt(t[a],r[a]))return!1;return!0}function Ta(t,r,a,h,d,g){if(pr=g,Te=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,$n.current=t===null||t.memoizedState===null?yd:_d,t=a(h,d),sn){g=0;do{if(sn=!1,on=0,25<=g)throw Error(u(301));g+=1,je=Ge=null,r.updateQueue=null,$n.current=Sd,t=a(h,d)}while(sn)}if($n.current=ni,r=Ge!==null&&Ge.next!==null,pr=0,je=Ge=Te=null,ei=!1,r)throw Error(u(300));return t}function Ra(){var t=on!==0;return on=0,t}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?Te.memoizedState=je=t:je=je.next=t,je}function pt(){if(Ge===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=Ge.next;var r=je===null?Te.memoizedState:je.next;if(r!==null)je=r,Ge=t;else{if(t===null)throw Error(u(310));Ge=t,t={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},je===null?Te.memoizedState=je=t:je=je.next=t}return je}function ln(t,r){return typeof r=="function"?r(t):r}function Aa(t){var r=pt(),a=r.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=t;var h=Ge,d=h.baseQueue,g=a.pending;if(g!==null){if(d!==null){var m=d.next;d.next=g.next,g.next=m}h.baseQueue=d=g,a.pending=null}if(d!==null){g=d.next,h=h.baseState;var C=m=null,A=null,G=g;do{var V=G.lane;if((pr&V)===V)A!==null&&(A=A.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),h=G.hasEagerState?G.eagerState:t(h,G.action);else{var ne={lane:V,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};A===null?(C=A=ne,m=h):A=A.next=ne,Te.lanes|=V,vr|=V}G=G.next}while(G!==null&&G!==g);A===null?m=h:A.next=C,wt(h,r.memoizedState)||(et=!0),r.memoizedState=h,r.baseState=m,r.baseQueue=A,a.lastRenderedState=h}if(t=a.interleaved,t!==null){d=t;do g=d.lane,Te.lanes|=g,vr|=g,d=d.next;while(d!==t)}else d===null&&(a.lanes=0);return[r.memoizedState,a.dispatch]}function Na(t){var r=pt(),a=r.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=t;var h=a.dispatch,d=a.pending,g=r.memoizedState;if(d!==null){a.pending=null;var m=d=d.next;do g=t(g,m.action),m=m.next;while(m!==d);wt(g,r.memoizedState)||(et=!0),r.memoizedState=g,r.baseQueue===null&&(r.baseState=g),a.lastRenderedState=g}return[g,h]}function xo(){}function wo(t,r){var a=Te,h=pt(),d=r(),g=!wt(h.memoizedState,d);if(g&&(h.memoizedState=d,et=!0),h=h.queue,Ma(ko.bind(null,a,h,t),[t]),h.getSnapshot!==r||g||je!==null&&je.memoizedState.tag&1){if(a.flags|=2048,hn(9,Po.bind(null,a,h,d,r),void 0,null),Be===null)throw Error(u(349));(pr&30)!==0||Co(a,r,d)}return d}function Co(t,r,a){t.flags|=16384,t={getSnapshot:r,value:a},r=Te.updateQueue,r===null?(r={lastEffect:null,stores:null},Te.updateQueue=r,r.stores=[t]):(a=r.stores,a===null?r.stores=[t]:a.push(t))}function Po(t,r,a,h){r.value=a,r.getSnapshot=h,Eo(r)&&To(t)}function ko(t,r,a){return a(function(){Eo(r)&&To(t)})}function Eo(t){var r=t.getSnapshot;t=t.value;try{var a=r();return!wt(t,a)}catch(h){return!0}}function To(t){var r=Nt(t,1);r!==null&&vt(r,t,1,-1)}function Ro(t){var r=Lt();return typeof t=="function"&&(t=t()),r.memoizedState=r.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ln,lastRenderedState:t},r.queue=t,t=t.dispatch=md.bind(null,Te,t),[r.memoizedState,t]}
vendor: 11,523 bytes, line 9
9function hn(t,r,a,h){return t={tag:t,create:r,destroy:a,deps:h,next:null},r=Te.updateQueue,r===null?(r={lastEffect:null,stores:null},Te.updateQueue=r,r.lastEffect=t.next=t):(a=r.lastEffect,a===null?r.lastEffect=t.next=t:(h=a.next,a.next=t,t.next=h,r.lastEffect=t)),t}function Ao(){return pt().memoizedState}function ti(t,r,a,h){var d=Lt();Te.flags|=t,d.memoizedState=hn(1|r,a,void 0,h===void 0?null:h)}function ri(t,r,a,h){var d=pt();h=h===void 0?null:h;var g=void 0;if(Ge!==null){var m=Ge.memoizedState;if(g=m.destroy,h!==null&&Ea(h,m.deps)){d.memoizedState=hn(r,a,g,h);return}}Te.flags|=t,d.memoizedState=hn(1|r,a,g,h)}function No(t,r){return ti(8390656,8,t,r)}function Ma(t,r){return ri(2048,8,t,r)}function Mo(t,r){return ri(4,2,t,r)}function Lo(t,r){return ri(4,4,t,r)}function Io(t,r){if(typeof r=="function")return t=t(),r(t),function(){r(null)};if(r!=null)return t=t(),r.current=t,function(){r.current=null}}function Oo(t,r,a){return a=a!=null?a.concat([t]):null,ri(4,4,Io.bind(null,r,t),a)}function La(){}function Do(t,r){var a=pt();r=r===void 0?null:r;var h=a.memoizedState;return h!==null&&r!==null&&Ea(r,h[1])?h[0]:(a.memoizedState=[t,r],t)}function Go(t,r){var a=pt();r=r===void 0?null:r;var h=a.memoizedState;return h!==null&&r!==null&&Ea(r,h[1])?h[0]:(t=t(),a.memoizedState=[t,r],t)}function zo(t,r,a){return(pr&21)===0?(t.baseState&&(t.baseState=!1,et=!0),t.memoizedState=a):(wt(a,r)||(a=Zs(),Te.lanes|=a,vr|=a,t.baseState=!0),r)}function pd(t,r){var a=he;he=a!==0&&4>a?a:4,t(!0);var h=ka.transition;ka.transition={};try{t(!1),r()}finally{he=a,ka.transition=h}}function bo(){return pt().memoizedState}function vd(t,r,a){var h=tr(t);if(a={lane:h,action:a,hasEagerState:!1,eagerState:null,next:null},Fo(t))jo(r,a);else if(a=lo(t,r,a,h),a!==null){var d=Qe();vt(a,t,h,d),Bo(a,r,h)}}function md(t,r,a){var h=tr(t),d={lane:h,action:a,hasEagerState:!1,eagerState:null,next:null};if(Fo(t))jo(r,d);else{var g=t.alternate;if(t.lanes===0&&(g===null||g.lanes===0)&&(g=r.lastRenderedReducer,g!==null))try{var m=r.lastRenderedState,C=g(m,a);if(d.hasEagerState=!0,d.eagerState=C,wt(C,m)){var A=r.interleaved;A===null?(d.next=d,ma(r)):(d.next=A.next,A.next=d),r.interleaved=d;return}}catch(G){}finally{}a=lo(t,r,d,h),a!==null&&(d=Qe(),vt(a,t,h,d),Bo(a,r,h))}}function Fo(t){var r=t.alternate;return t===Te||r!==null&&r===Te}function jo(t,r){sn=ei=!0;var a=t.pending;a===null?r.next=r:(r.next=a.next,a.next=r),t.pending=r}function Bo(t,r,a){if((a&4194240)!==0){var h=r.lanes;h&=t.pendingLanes,a|=h,r.lanes=a,na(t,a)}}var ni={readContext:ft,useCallback:Xe,useContext:Xe,useEffect:Xe,useImperativeHandle:Xe,useInsertionEffect:Xe,useLayoutEffect:Xe,useMemo:Xe,useReducer:Xe,useRef:Xe,useState:Xe,useDebugValue:Xe,useDeferredValue:Xe,useTransition:Xe,useMutableSource:Xe,useSyncExternalStore:Xe,useId:Xe,unstable_isNewReconciler:!1},yd={readContext:ft,useCallback:function(t,r){return Lt().memoizedState=[t,r===void 0?null:r],t},useContext:ft,useEffect:No,useImperativeHandle:function(t,r,a){return a=a!=null?a.concat([t]):null,ti(4194308,4,Io.bind(null,r,t),a)},useLayoutEffect:function(t,r){return ti(4194308,4,t,r)},useInsertionEffect:function(t,r){return ti(4,2,t,r)},useMemo:function(t,r){var a=Lt();return r=r===void 0?null:r,t=t(),a.memoizedState=[t,r],t},useReducer:function(t,r,a){var h=Lt();return r=a!==void 0?a(r):r,h.memoizedState=h.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},h.queue=t,t=t.dispatch=vd.bind(null,Te,t),[h.memoizedState,t]},useRef:function(t){var r=Lt();return t={current:t},r.memoizedState=t},useState:Ro,useDebugValue:La,useDeferredValue:function(t){return Lt().memoizedState=t},useTransition:function(){var t=Ro(!1),r=t[0];return t=pd.bind(null,t[1]),Lt().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,a){var h=Te,d=Lt();if(Pe){if(a===void 0)throw Error(u(407));a=a()}else{if(a=r(),Be===null)throw Error(u(349));(pr&30)!==0||Co(h,r,a)}d.memoizedState=a;var g={value:a,getSnapshot:r};return d.queue=g,No(ko.bind(null,h,g,t),[t]),h.flags|=2048,hn(9,Po.bind(null,h,g,a,r),void 0,null),a},useId:function(){var t=Lt(),r=Be.identifierPrefix;if(Pe){var a=jt,h=Ft;a=(h&~(1<<32-xt(h)-1)).toString(32)+a,r=":"+r+"R"+a,a=on++,0<a&&(r+="H"+a.toString(32)),r+=":"}else a=gd++,r=":"+r+"r"+a.toString(32)+":";return t.memoizedState=r},unstable_isNewReconciler:!1},_d={readContext:ft,useCallback:Do,useContext:ft,useEffect:Ma,useImperativeHandle:Oo,useInsertionEffect:Mo,useLayoutEffect:Lo,useMemo:Go,useReducer:Aa,useRef:Ao,useState:function(){return Aa(ln)},useDebugValue:La,useDeferredValue:function(t){var r=pt();return zo(r,Ge.memoizedState,t)},useTransition:function(){var t=Aa(ln)[0],r=pt().memoizedState;return[t,r]},useMutableSource:xo,useSyncExternalStore:wo,useId:bo,unstable_isNewReconciler:!1},Sd={readContext:ft,useCallback:Do,useContext:ft,useEffect:Ma,useImperativeHandle:Oo,useInsertionEffect:Mo,useLayoutEffect:Lo,useMemo:Go,useReducer:Na,useRef:Ao,useState:function(){return Na(ln)},useDebugValue:La,useDeferredValue:function(t){var r=pt();return Ge===null?r.memoizedState=t:zo(r,Ge.memoizedState,t)},useTransition:function(){var t=Na(ln)[0],r=pt().memoizedState;return[t,r]},useMutableSource:xo,useSyncExternalStore:wo,useId:bo,unstable_isNewReconciler:!1};function br(t,r){try{var a="",h=r;do a+=fd(h),h=h.return;while(h);var d=a}catch(g){d="\nError generating stack: "+g.message+"\n"+g.stack}return{value:t,source:r,stack:d,digest:null}}function Ia(t,r,a){return{value:t,source:null,stack:a!=null?a:null,digest:r!=null?r:null}}function Oa(t,r){try{console.error(r.value)}catch(a){setTimeout(function(){throw a})}}var xd=typeof WeakMap=="function"?WeakMap:Map;function Ho(t,r,a){a=Bt(-1,a),a.tag=3,a.payload={element:null};var h=r.value;return a.callback=function(){mi||(mi=!0,es=h),Oa(t,r)},a}function Uo(t,r,a){a=Bt(-1,a),a.tag=3;var h=t.type.getDerivedStateFromError;if(typeof h=="function"){var d=r.value;a.payload=function(){return h(d)},a.callback=function(){Oa(t,r)}}var g=t.stateNode;return g!==null&&typeof g.componentDidCatch=="function"&&(a.callback=function(){Oa(t,r),typeof h!="function"&&($t===null?$t=new Set([this]):$t.add(this));var m=r.stack;this.componentDidCatch(r.value,{componentStack:m!==null?m:""})}),a}function Wo(t,r,a){var h=t.pingCache;if(h===null){h=t.pingCache=new xd;var d=new Set;h.set(r,d)}else d=h.get(r),d===void 0&&(d=new Set,h.set(r,d));d.has(a)||(d.add(a),t=Dd.bind(null,t,r,a),r.then(t,t))}function Yo(t){do{var r;if((r=t.tag===13)&&(r=t.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return t;t=t.return}while(t!==null);return null}function Xo(t,r,a,h,d){return(t.mode&1)===0?(t===r?t.flags|=65536:(t.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(r=Bt(-1,1),r.tag=2,Zt(a,r,1))),a.lanes|=1),t):(t.flags|=65536,t.lanes=d,t)}var wd=c.ReactCurrentOwner,et=!1;function Ke(t,r,a,h){r.child=t===null?_o(r,null,a,h):Dr(r,t.child,a,h)}function Vo(t,r,a,h,d){a=a.render;var g=r.ref;return Or(r,d),h=Ta(t,r,a,h,g,d),a=Ra(),t!==null&&!et?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~d,Ht(t,r,d)):(Pe&&a&&la(r),r.flags|=1,Ke(t,r,h,d),r.child)}function qo(t,r,a,h,d){if(t===null){var g=a.type;return typeof g=="function"&&!ss(g)&&g.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(r.tag=15,r.type=g,Qo(t,r,g,h,d)):(t=Ci(a.type,null,h,r,r.mode,d),t.ref=r.ref,t.return=r,r.child=t)}if(g=t.child,(t.lanes&d)===0){var m=g.memoizedProps;if(a=a.compare,a=a!==null?a:Yn,a(m,h)&&t.ref===r.ref)return Ht(t,r,d)}return r.flags|=1,t=nr(g,h),t.ref=r.ref,t.return=r,r.child=t}function Qo(t,r,a,h,d){if(t!==null){var g=t.memoizedProps;if(Yn(g,h)&&t.ref===r.ref)if(et=!1,r.pendingProps=h=g,(t.lanes&d)!==0)(t.flags&131072)!==0&&(et=!0);else return r.lanes=t.lanes,Ht(t,r,d)}return Da(t,r,a,h,d)}function Ko(t,r,a){var h=r.pendingProps,d=h.children,g=t!==null?t.memoizedState:null;if(h.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},xe(jr,st),st|=a;else{if((a&1073741824)===0)return t=g!==null?g.baseLanes|a:a,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:t,cachePool:null,transitions:null},r.updateQueue=null,xe(jr,st),st|=t,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=g!==null?g.baseLanes:a,xe(jr,st),st|=h}else g!==null?(h=g.baseLanes|a,r.memoizedState=null):h=a,xe(jr,st),st|=h;return Ke(t,r,d,a),r.child}function Jo(t,r){var a=r.ref;(t===null&&a!==null||t!==null&&t.ref!==a)&&(r.flags|=512,r.flags|=2097152)}function Da(t,r,a,h,d){var g=$e(a)?dr:Ye.current;return g=Ar(r,g),Or(r,d),a=Ta(t,r,a,h,g,d),h=Ra(),t!==null&&!et?(r.updateQueue=t.updateQueue,r.flags&=-2053,t.lanes&=~d,Ht(t,r,d)):(Pe&&h&&la(r),r.flags|=1,Ke(t,r,a,d),r.child)}function Zo(t,r,a,h,d){if($e(a)){var g=!0;Gn(r)}else g=!1;if(Or(r,d),r.stateNode===null)ai(t,r),po(r,a,h),Sa(r,a,h,d),h=!0;else if(t===null){var m=r.stateNode,C=r.memoizedProps;m.props=C;var A=m.context,G=a.contextType;typeof G=="object"&&G!==null?G=ft(G):(G=$e(a)?dr:Ye.current,G=Ar(r,G));var V=a.getDerivedStateFromProps,ne=typeof V=="function"||typeof m.getSnapshotBeforeUpdate=="function";ne||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(C!==h||A!==G)&&vo(r,m,h,G),Jt=!1;var B=r.memoizedState;m.state=B,Qn(r,h,m,d),A=r.memoizedState,C!==h||B!==A||Ze.current||Jt?(typeof V=="function"&&(_a(r,a,V,h),A=r.memoizedState),(C=Jt||go(r,a,C,h,B,A,G))?(ne||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=h,r.memoizedState=A),m.props=h,m.state=A,m.context=G,h=C):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),h=!1)}else{m=r.stateNode,ho(t,r),C=r.memoizedProps,G=r.type===r.elementType?C:Pt(r.type,C),m.props=G,ne=r.pendingProps,B=m.context,A=a.contextType,typeof A=="object"&&A!==null?A=ft(A):(A=$e(a)?dr:Ye.current,A=Ar(r,A));var Ce=a.getDerivedStateFromProps;(V=typeof Ce=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(C!==ne||B!==A)&&vo(r,m,h,A),Jt=!1,B=r.memoizedState,m.state=B,Qn(r,h,m,d);var _e=r.memoizedState;C!==ne||B!==_e||Ze.current||Jt?(typeof Ce=="function"&&(_a(r,a,Ce,h),_e=r.memoizedState),(G=Jt||go(r,a,G,h,B,_e,A)||!1)?(V||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(h,_e,A),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(h,_e,A)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||C===t.memoizedProps&&B===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&B===t.memoizedState||(r.flags|=1024),r.memoizedProps=h,r.memoizedState=_e),m.props=h,m.state=_e,m.context=A,h=G):(typeof m.componentDidUpdate!="function"||C===t.memoizedProps&&B===t.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||C===t.memoizedProps&&B===t.memoizedState||(r.flags|=1024),h=!1)}return Ga(t,r,a,h,g,d)}function Ga(t,r,a,h,d,g){Jo(t,r);var m=(r.flags&128)!==0;
vendor: 5,495 bytes, line 9
9if(!h&&!m)return d&&Js(r,a,!1),Ht(t,r,g);h=r.stateNode,wd.current=r;var C=m&&typeof a.getDerivedStateFromError!="function"?null:h.render();return r.flags|=1,t!==null&&m?(r.child=Dr(r,t.child,null,g),r.child=Dr(r,null,C,g)):Ke(t,r,C,g),r.memoizedState=h.state,d&&Js(r,a,!0),r.child}function $o(t){var r=t.stateNode;r.pendingContext?Qs(t,r.pendingContext,r.pendingContext!==r.context):r.context&&Qs(t,r.context,!1),xa(t,r.containerInfo)}function el(t,r,a,h,d){return Lr(),ca(d),r.flags|=256,Ke(t,r,a,h),r.child}var za={dehydrated:null,treeContext:null,retryLane:0};function ba(t){return{baseLanes:t,cachePool:null,transitions:null}}function tl(t,r,a){var h=r.pendingProps,d=Ee.current,g=!1,m=(r.flags&128)!==0,C;if((C=m)||(C=t!==null&&t.memoizedState===null?!1:(d&2)!==0),C?(g=!0,r.flags&=-129):(t===null||t.memoizedState!==null)&&(d|=1),xe(Ee,d&1),t===null)return da(r),t=r.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((r.mode&1)===0?r.lanes=1:Ki(t)?r.lanes=8:r.lanes=1073741824,null):(m=h.children,t=h.fallback,g?(h=r.mode,g=r.child,m={mode:"hidden",children:m},(h&1)===0&&g!==null?(g.childLanes=0,g.pendingProps=m):g=Pi(m,h,0,null),t=Sr(t,h,a,null),g.return=r,t.return=r,g.sibling=t,r.child=g,r.child.memoizedState=ba(a),r.memoizedState=za,t):Fa(r,m));if(d=t.memoizedState,d!==null&&(C=d.dehydrated,C!==null))return Cd(t,r,m,h,C,d,a);if(g){g=h.fallback,m=r.mode,d=t.child,C=d.sibling;var A={mode:"hidden",children:h.children};return(m&1)===0&&r.child!==d?(h=r.child,h.childLanes=0,h.pendingProps=A,r.deletions=null):(h=nr(d,A),h.subtreeFlags=d.subtreeFlags&14680064),C!==null?g=nr(C,g):(g=Sr(g,m,a,null),g.flags|=2),g.return=r,h.return=r,h.sibling=g,r.child=h,h=g,g=r.child,m=t.child.memoizedState,m=m===null?ba(a):{baseLanes:m.baseLanes|a,cachePool:null,transitions:m.transitions},g.memoizedState=m,g.childLanes=t.childLanes&~a,r.memoizedState=za,h}return g=t.child,t=g.sibling,h=nr(g,{mode:"visible",children:h.children}),(r.mode&1)===0&&(h.lanes=a),h.return=r,h.sibling=null,t!==null&&(a=r.deletions,a===null?(r.deletions=[t],r.flags|=16):a.push(t)),r.child=h,r.memoizedState=null,h}function Fa(t,r){return r=Pi({mode:"visible",children:r},t.mode,0,null),r.return=t,t.child=r}function ii(t,r,a,h){return h!==null&&ca(h),Dr(r,t.child,null,a),t=Fa(r,r.pendingProps.children),t.flags|=2,r.memoizedState=null,t}function Cd(t,r,a,h,d,g,m){if(a)return r.flags&256?(r.flags&=-257,h=Ia(Error(u(422))),ii(t,r,m,h)):r.memoizedState!==null?(r.child=t.child,r.flags|=128,null):(g=h.fallback,d=r.mode,h=Pi({mode:"visible",children:h.children},d,0,null),g=Sr(g,d,m,null),g.flags|=2,h.return=r,g.return=r,h.sibling=g,r.child=h,(r.mode&1)!==0&&Dr(r,t.child,null,m),r.child.memoizedState=ba(m),r.memoizedState=za,g);if((r.mode&1)===0)return ii(t,r,m,null);if(Ki(d))return h=Gu(d).digest,g=Error(u(419)),h=Ia(g,h,void 0),ii(t,r,m,h);if(a=(m&t.childLanes)!==0,et||a){if(h=Be,h!==null){switch(m&-m){case 4:d=2;break;case 16:d=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:d=32;break;case 536870912:d=268435456;break;default:d=0}d=(d&(h.suspendedLanes|m))!==0?0:d,d!==0&&d!==g.retryLane&&(g.retryLane=d,Nt(t,d),vt(h,t,d,-1))}return as(),h=Ia(Error(u(421))),ii(t,r,m,h)}return qs(d)?(r.flags|=128,r.child=t.child,r=Gd.bind(null,t),zu(d,r),null):(t=g.treeContext,ht&&(ct=ju(d),at=r,Pe=!0,Ct=null,tn=!1,t!==null&&(ut[dt++]=Ft,ut[dt++]=jt,ut[dt++]=cr,Ft=t.id,jt=t.overflow,cr=r)),r=Fa(r,h.children),r.flags|=4096,r)}function rl(t,r,a){t.lanes|=r;var h=t.alternate;h!==null&&(h.lanes|=r),va(t.return,r,a)}function ja(t,r,a,h,d){var g=t.memoizedState;g===null?t.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:h,tail:a,tailMode:d}:(g.isBackwards=r,g.rendering=null,g.renderingStartTime=0,g.last=h,g.tail=a,g.tailMode=d)}function nl(t,r,a){var h=r.pendingProps,d=h.revealOrder,g=h.tail;if(Ke(t,r,h.children,a),h=Ee.current,(h&2)!==0)h=h&1|2,r.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=r.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&rl(t,a,r);else if(t.tag===19)rl(t,a,r);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===r)break e;for(;t.sibling===null;){if(t.return===null||t.return===r)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}h&=1}if(xe(Ee,h),(r.mode&1)===0)r.memoizedState=null;else switch(d){case"forwards":for(a=r.child,d=null;a!==null;)t=a.alternate,t!==null&&Zn(t)===null&&(d=a),a=a.sibling;a=d,a===null?(d=r.child,r.child=null):(d=a.sibling,a.sibling=null),ja(r,!1,d,a,g);break;case"backwards":for(a=null,d=r.child,r.child=null;d!==null;){if(t=d.alternate,t!==null&&Zn(t)===null){r.child=d;break}t=d.sibling,d.sibling=a,a=d,d=t}ja(r,!0,a,null,g);break;case"together":ja(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function ai(t,r){(r.mode&1)===0&&t!==null&&(t.alternate=null,r.alternate=null,r.flags|=2)}function Ht(t,r,a){if(t!==null&&(r.dependencies=t.dependencies),vr|=r.lanes,(a&r.childLanes)===0)return null;if(t!==null&&r.child!==t.child)throw Error(u(153));if(r.child!==null){for(t=r.child,a=nr(t,t.pendingProps),r.child=a,a.return=r;t.sibling!==null;)t=t.sibling,a=a.sibling=nr(t,t.pendingProps),a.return=r;a.sibling=null}return r.child}function Pd(t,r,a){switch(r.tag){case 3:$o(r),Lr();break;case 5:So(r);break;case 1:$e(r.type)&&Gn(r);break;case 4:xa(r,r.stateNode.containerInfo);break;
vendor: 4,369 bytes, line 9
9case 10:oo(r,r.type._context,r.memoizedProps.value);break;case 13:var h=r.memoizedState;if(h!==null)return h.dehydrated!==null?(xe(Ee,Ee.current&1),r.flags|=128,null):(a&r.child.childLanes)!==0?tl(t,r,a):(xe(Ee,Ee.current&1),t=Ht(t,r,a),t!==null?t.sibling:null);xe(Ee,Ee.current&1);break;case 19:if(h=(a&r.childLanes)!==0,(t.flags&128)!==0){if(h)return nl(t,r,a);r.flags|=128}var d=r.memoizedState;if(d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),xe(Ee,Ee.current),h)break;return null;case 22:case 23:return r.lanes=0,Ko(t,r,a)}return Ht(t,r,a)}function It(t){t.flags|=4}function il(t,r){if(t!==null&&t.child===r.child)return!0;if((r.flags&16)!==0)return!1;for(t=r.child;t!==null;){if((t.flags&12854)!==0||(t.subtreeFlags&12854)!==0)return!1;t=t.sibling}return!0}var un,dn,si,oi;if(it)un=function(t,r){for(var a=r.child;a!==null;){if(a.tag===5||a.tag===6)Me(t,a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break;for(;a.sibling===null;){if(a.return===null||a.return===r)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},dn=function(){},si=function(t,r,a,h,d){if(t=t.memoizedProps,t!==h){var g=r.stateNode,m=Mt(gt.current);a=St(g,a,t,h,d,m),(r.updateQueue=a)&&It(r)}},oi=function(t,r,a,h){a!==h&&It(r)};else if(In){un=function(t,r,a,h){for(var d=r.child;d!==null;){if(d.tag===5){var g=d.stateNode;a&&h&&(g=Xs(g,d.type,d.memoizedProps,d)),Me(t,g)}else if(d.tag===6)g=d.stateNode,a&&h&&(g=Vs(g,d.memoizedProps,d)),Me(t,g);else if(d.tag!==4){if(d.tag===22&&d.memoizedState!==null)g=d.child,g!==null&&(g.return=d),un(t,d,!0,!0);else if(d.child!==null){d.child.return=d,d=d.child;continue}}if(d===r)break;for(;d.sibling===null;){if(d.return===null||d.return===r)return;d=d.return}d.sibling.return=d.return,d=d.sibling}};var al=function(t,r,a,h){for(var d=r.child;d!==null;){if(d.tag===5){var g=d.stateNode;a&&h&&(g=Xs(g,d.type,d.memoizedProps,d)),Ys(t,g)}else if(d.tag===6)g=d.stateNode,a&&h&&(g=Vs(g,d.memoizedProps,d)),Ys(t,g);else if(d.tag!==4){if(d.tag===22&&d.memoizedState!==null)g=d.child,g!==null&&(g.return=d),al(t,d,!0,!0);else if(d.child!==null){d.child.return=d,d=d.child;continue}}if(d===r)break;for(;d.sibling===null;){if(d.return===null||d.return===r)return;d=d.return}d.sibling.return=d.return,d=d.sibling}};dn=function(t,r){var a=r.stateNode;if(!il(t,r)){t=a.containerInfo;var h=Ws(t);al(h,r,!1,!1),a.pendingChildren=h,It(r),Lu(t,h)}},si=function(t,r,a,h,d){var g=t.stateNode,m=t.memoizedProps;if((t=il(t,r))&&m===h)r.stateNode=g;else{var C=r.stateNode,A=Mt(gt.current),G=null;m!==h&&(G=St(C,a,m,h,d,A)),t&&G===null?r.stateNode=g:(g=Mu(g,G,a,m,h,r,t,C),_t(g,a,h,d,A)&&It(r),r.stateNode=g,t?It(r):un(g,r,!1,!1))}},oi=function(t,r,a,h){a!==h?(t=Mt(Gr.current),a=Mt(gt.current),r.stateNode=Bs(h,t,a,r),It(r)):r.stateNode=t.stateNode}}else dn=function(){},si=function(){},oi=function(){};function cn(t,r){if(!Pe)switch(t.tailMode){case"hidden":r=t.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var h=null;a!==null;)a.alternate!==null&&(h=a),a=a.sibling;h===null?r||t.tail===null?t.tail=null:t.tail.sibling=null:h.sibling=null}}function Ve(t){var r=t.alternate!==null&&t.alternate.child===t.child,a=0,h=0;if(r)for(var d=t.child;d!==null;)a|=d.lanes|d.childLanes,h|=d.subtreeFlags&14680064,h|=d.flags&14680064,d.return=t,d=d.sibling;else for(d=t.child;d!==null;)a|=d.lanes|d.childLanes,h|=d.subtreeFlags,h|=d.flags,d.return=t,d=d.sibling;return t.subtreeFlags|=h,t.childLanes=a,r}function kd(t,r,a){var h=r.pendingProps;switch(ha(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(r),null;case 1:return $e(r.type)&&Dn(),Ve(r),null;case 3:return a=r.stateNode,zr(),we(Ze),we(Ye),Pa(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(Wn(r)?It(r):t===null||t.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Ct!==null&&(ns(Ct),Ct=null))),dn(t,r),Ve(r),null;case 5:wa(r),a=Mt(Gr.current);var d=r.type;if(t!==null&&r.stateNode!=null)si(t,r,d,h,a),t.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!h){if(r.stateNode===null)throw Error(u(166));return Ve(r),null}if(t=Mt(gt.current),Wn(r)){if(!ht)throw Error(u(175));t=Bu(r.stateNode,r.type,r.memoizedProps,a,t,r,!tn),r.updateQueue=t,t!==null&&It(r)}
vendor: 4,575 bytes, line 9
9else{var g=ve(d,h,a,t,r);un(g,r,!1,!1),r.stateNode=g,_t(g,d,h,a,t)&&It(r)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return Ve(r),null;case 6:if(t&&r.stateNode!=null)oi(t,r,t.memoizedProps,h);else{if(typeof h!="string"&&r.stateNode===null)throw Error(u(166));if(t=Mt(Gr.current),a=Mt(gt.current),Wn(r)){if(!ht)throw Error(u(176));if(t=r.stateNode,a=r.memoizedProps,(h=Hu(t,a,r,!tn))&&(d=at,d!==null))switch(d.tag){case 3:Ku(d.stateNode.containerInfo,t,a,(d.mode&1)!==0);break;case 5:Ju(d.type,d.memoizedProps,d.stateNode,t,a,(d.mode&1)!==0)}h&&It(r)}else r.stateNode=Bs(h,t,a,r)}return Ve(r),null;case 13:if(we(Ee),h=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Pe&&ct!==null&&(r.mode&1)!==0&&(r.flags&128)===0)so(),Lr(),r.flags|=98560,d=!1;else if(d=Wn(r),h!==null&&h.dehydrated!==null){if(t===null){if(!d)throw Error(u(318));if(!ht)throw Error(u(344));if(d=r.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(u(317));Uu(d,r)}else Lr(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Ve(r),d=!1}else Ct!==null&&(ns(Ct),Ct=null),d=!0;if(!d)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=a,r):(a=h!==null,a!==(t!==null&&t.memoizedState!==null)&&a&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(Ee.current&1)!==0?ze===0&&(ze=3):as())),r.updateQueue!==null&&(r.flags|=4),Ve(r),null);case 4:return zr(),dn(t,r),t===null&&su(r.stateNode.containerInfo),Ve(r),null;case 10:return pa(r.type._context),Ve(r),null;case 17:return $e(r.type)&&Dn(),Ve(r),null;case 19:if(we(Ee),d=r.memoizedState,d===null)return Ve(r),null;if(h=(r.flags&128)!==0,g=d.rendering,g===null)if(h)cn(d,!1);else{if(ze!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(g=Zn(t),g!==null){for(r.flags|=128,cn(d,!1),t=g.updateQueue,t!==null&&(r.updateQueue=t,r.flags|=4),r.subtreeFlags=0,t=a,a=r.child;a!==null;)h=a,d=t,h.flags&=14680066,g=h.alternate,g===null?(h.childLanes=0,h.lanes=d,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=g.childLanes,h.lanes=g.lanes,h.child=g.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=g.memoizedProps,h.memoizedState=g.memoizedState,h.updateQueue=g.updateQueue,h.type=g.type,d=g.dependencies,h.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),a=a.sibling;return xe(Ee,Ee.current&1|2),r.child}t=t.sibling}d.tail!==null&&Fe()>$a&&(r.flags|=128,h=!0,cn(d,!1),r.lanes=4194304)}else{if(!h)if(t=Zn(g),t!==null){if(r.flags|=128,h=!0,t=t.updateQueue,t!==null&&(r.updateQueue=t,r.flags|=4),cn(d,!0),d.tail===null&&d.tailMode==="hidden"&&!g.alternate&&!Pe)return Ve(r),null}else 2*Fe()-d.renderingStartTime>$a&&a!==1073741824&&(r.flags|=128,h=!0,cn(d,!1),r.lanes=4194304);d.isBackwards?(g.sibling=r.child,r.child=g):(t=d.last,t!==null?t.sibling=g:r.child=g,d.last=g)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=Fe(),r.sibling=null,t=Ee.current,xe(Ee,h?t&1|2:t&1),r):(Ve(r),null);case 22:case 23:return is(),a=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==a&&(r.flags|=8192),a&&(r.mode&1)!==0?(st&1073741824)!==0&&(Ve(r),it&&r.subtreeFlags&6&&(r.flags|=8192)):Ve(r),null;case 24:return null;case 25:return null}throw Error(u(156,r.tag))}function Ed(t,r){switch(ha(r),r.tag){case 1:return $e(r.type)&&Dn(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return zr(),we(Ze),we(Ye),Pa(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return wa(r),null;case 13:if(we(Ee),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(u(340));Lr()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return we(Ee),null;case 4:return zr(),null;case 10:return pa(r.type._context),null;case 22:case 23:return is(),null;case 24:return null;default:return null}}var li=!1,qe=!1,Td=typeof WeakSet=="function"?WeakSet:Set,W=null;function Fr(t,r){var a=t.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(h){ke(t,r,h)}else a.current=null}function Ba(t,r,a){try{a()}catch(h){ke(t,r,h)}}var sl=!1;function Rd(t,r){for(Ne(t.containerInfo),W=r;W!==null;)if(t=W,r=t.child,(t.subtreeFlags&1028)!==0&&r!==null)r.return=t,W=r;else for(;W!==null;){t=W;try{var a=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(a!==null){var h=a.memoizedProps,d=a.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?h:Pt(t.type,h),d);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:it&&Nu(t.stateNode.containerInfo);break;
9case 5:case 6:case 4:case 17:break;default:throw Error(u(163))}}catch(C){ke(t,t.return,C)}if(r=t.sibling,r!==null){r.return=t.return,W=r;break}W=t.return}return a=sl,sl=!1,a}function fn(t,r,a){var h=r.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var d=h=h.next;do{if((d.tag&t)===t){var g=d.destroy;d.destroy=void 0,g!==void 0&&Ba(r,a,g)}d=d.next}while(d!==h)}}function hi(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&t)===t){var h=a.create;a.destroy=h()}a=a.next}while(a!==r)}}function Ha(t){var r=t.ref;if(r!==null){var a=t.stateNode;switch(t.tag){case 5:t=te(a);break;default:t=a}typeof r=="function"?r(t):r.current=t}}function ol(t){var r=t.alternate;r!==null&&(t.alternate=null,ol(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&lu(r)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ll(t){return t.tag===5||t.tag===3||t.tag===4}function hl(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ll(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ua(t,r,a){var h=t.tag;if(h===5||h===6)t=t.stateNode,r?Cu(a,t,r):yu(a,t);else if(h!==4&&(t=t.child,t!==null))for(Ua(t,r,a),t=t.sibling;t!==null;)Ua(t,r,a),t=t.sibling}function Wa(t,r,a){var h=t.tag;if(h===5||h===6)t=t.stateNode,r?wu(a,t,r):mu(a,t);else if(h!==4&&(t=t.child,t!==null))for(Wa(t,r,a),t=t.sibling;t!==null;)Wa(t,r,a),t=t.sibling}var Ue=null,kt=!1;function Ot(t,r,a){for(a=a.child;a!==null;)Ya(t,r,a),a=a.sibling}function Ya(t,r,a){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(jn,a)}catch(C){}switch(a.tag){case 5:qe||Fr(a,r);case 6:if(it){var h=Ue,d=kt;Ue=null,Ot(t,r,a),Ue=h,kt=d,Ue!==null&&(kt?ku(Ue,a.stateNode):Pu(Ue,a.stateNode))}else Ot(t,r,a);break;case 18:it&&Ue!==null&&(kt?qu(Ue,a.stateNode):Vu(Ue,a.stateNode));break;case 4:it?(h=Ue,d=kt,Ue=a.stateNode.containerInfo,kt=!0,Ot(t,r,a),Ue=h,kt=d):(In&&(h=a.stateNode.containerInfo,d=Ws(h),Qi(h,d)),Ot(t,r,a));break;case 0:case 11:case 14:case 15:if(!qe&&(h=a.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){d=h=h.next;do{var g=d,m=g.destroy;g=g.tag,m!==void 0&&((g&2)!==0||(g&4)!==0)&&Ba(a,r,m),d=d.next}while(d!==h)}Ot(t,r,a);break;case 1:if(!qe&&(Fr(a,r),h=a.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=a.memoizedProps,h.state=a.memoizedState,h.componentWillUnmount()}catch(C){ke(a,r,C)}Ot(t,r,a);break;case 21:Ot(t,r,a);break;case 22:a.mode&1?(qe=(h=qe)||a.memoizedState!==null,Ot(t,r,a),qe=h):Ot(t,r,a);break;default:Ot(t,r,a)}}function ul(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var a=t.stateNode;a===null&&(a=t.stateNode=new Td),r.forEach(function(h){var d=zd.bind(null,t,h);a.has(h)||(a.add(h),h.then(d,d))})}}function Et(t,r){var a=r.deletions;if(a!==null)for(var h=0;h<a.length;h++){var d=a[h];try{var g=t,m=r;if(it){var C=m;e:for(;C!==null;){switch(C.tag){case 5:Ue=C.stateNode,kt=!1;break e;case 3:Ue=C.stateNode.containerInfo,kt=!0;break e;case 4:Ue=C.stateNode.containerInfo,kt=!0;break e}C=C.return}if(Ue===null)throw Error(u(160));Ya(g,m,d),Ue=null,kt=!1}else Ya(g,m,d);var A=d.alternate;A!==null&&(A.return=null),d.return=null}catch(G){ke(d,r,G)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)dl(r,t),r=r.sibling}function dl(t,r){var a=t.alternate,h=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(Et(r,t),Dt(t),h&4){try{fn(3,t,t.return),hi(3,t)}catch(B){ke(t,t.return,B)}try{fn(5,t,t.return)}catch(B){ke(t,t.return,B)}}break;case 1:Et(r,t),Dt(t),h&512&&a!==null&&Fr(a,a.return);break;case 5:if(Et(r,t),Dt(t),h&512&&a!==null&&Fr(a,a.return),it){if(t.flags&32){var d=t.stateNode;try{Us(d)}catch(B){ke(t,t.return,B)}}if(h&4&&(d=t.stateNode,d!=null)){var g=t.memoizedProps;if(a=a!==null?a.memoizedProps:g,h=t.type,r=t.updateQueue,t.updateQueue=null,r!==null)try{xu(d,r,h,a,g,t)}catch(B){ke(t,t.return,B)}}}break;case 6:if(Et(r,t),Dt(t),h&4&&it){if(t.stateNode===null)throw Error(u(162));d=t.stateNode,g=t.memoizedProps,a=a!==null?a.memoizedProps:g;try{_u(d,a,g)}catch(B){ke(t,t.return,B)}}break;case 3:if(Et(r,t),Dt(t),h&4){if(it&&ht&&a!==null&&a.memoizedState.isDehydrated)try{Yu(r.containerInfo)}catch(B){ke(t,t.return,B)}if(In){d=r.containerInfo,g=r.pendingChildren;try{Qi(d,g)}catch(B){ke(t,t.return,B)}}}break;case 4:if(Et(r,t),Dt(t),h&4&&In){g=t.stateNode,d=g.containerInfo,g=g.pendingChildren;try{Qi(d,g)}catch(B){ke(t,t.return,B)}}break;case 13:Et(r,t),Dt(t),d=t.child,d.flags&8192&&(g=d.memoizedState!==null,d.stateNode.isHidden=g,!g||d.alternate!==null&&d.alternate.memoizedState!==null||(Za=Fe())),h&4&&ul(t);break;case 22:var m=a!==null&&a.memoizedState!==null;if(t.mode&1?(qe=(a=qe)||m,Et(r,t),qe=a):Et(r,t),Dt(t),h&8192){if(a=t.memoizedState!==null,(t.stateNode.isHidden=a)&&!m&&(t.mode&1)!==0)for(W=t,h=t.child;h!==null;){for(r=W=h;W!==null;){m=W;var C=m.child;switch(m.tag){case 0:case 11:case 14:case 15:fn(4,m,m.return);break;case 1:Fr(m,m.return);var A=m.stateNode;if(typeof A.componentWillUnmount=="function"){var G=m,V=m.return;try{var ne=G;A.props=ne.memoizedProps,A.state=ne.memoizedState,A.componentWillUnmount()}catch(B){ke(G,V,B)}}break;case 5:Fr(m,m.return);break;case 22:if(m.memoizedState!==null){gl(r);continue}}C!==null?(C.return=m,W=C):gl(r)}h=h.sibling}if(it){e:if(h=null,it)for(r=t;;){if(r.tag===5){if(h===null){h=r;try{d=r.stateNode,a?Eu(d):Ru(r.stateNode,r.memoizedProps)}catch(B){ke(t,t.return,B)}}}else if(r.tag===6){if(h===null)try{g=r.stateNode,a?Tu(g):Au(g,r.memoizedProps)}catch(B){ke(t,t.return,B)}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===t)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;h===r&&(h=null),r=r.return}h===r&&(h=null),r.sibling.return=r.return,r=r.sibling}}}break;case 19:Et(r,t),Dt(t),h&4&&ul(t);break;case 21:break;default:Et(r,t),Dt(t)}}function Dt(t){var r=t.flags;if(r&2){try{if(it){e:{for(var a=t.return;a!==null;){if(ll(a)){var h=a;break e}a=a.return}throw Error(u(160))}switch(h.tag){case 5:var d=h.stateNode;h.flags&32&&(Us(d),h.flags&=-33);var g=hl(t);Wa(t,g,d);break;case 3:case 4:var m=h.stateNode.containerInfo,C=hl(t);Ua(t,C,m);break;default:throw Error(u(161))}}}catch(A){ke(t,t.return,A)}t.flags&=-3}r&4096&&(t.flags&=-4097)}function Ad(t,r,a){W=t,cl(t)}function cl(t,r,a){for(var h=(t.mode&1)!==0;W!==null;){var d=W,g=d.child;if(d.tag===22&&h){var m=d.memoizedState!==null||li;
vendor: 4,613 bytes, line 9
9if(!m){var C=d.alternate,A=C!==null&&C.memoizedState!==null||qe;C=li;var G=qe;if(li=m,(qe=A)&&!G)for(W=d;W!==null;)m=W,A=m.child,m.tag===22&&m.memoizedState!==null?pl(d):A!==null?(A.return=m,W=A):pl(d);for(;g!==null;)W=g,cl(g),g=g.sibling;W=d,li=C,qe=G}fl(t)}else(d.subtreeFlags&8772)!==0&&g!==null?(g.return=d,W=g):fl(t)}}function fl(t){for(;W!==null;){var r=W;if((r.flags&8772)!==0){var a=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:qe||hi(5,r);break;case 1:var h=r.stateNode;if(r.flags&4&&!qe)if(a===null)h.componentDidMount();else{var d=r.elementType===r.type?a.memoizedProps:Pt(r.type,a.memoizedProps);h.componentDidUpdate(d,a.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var g=r.updateQueue;g!==null&&co(r,g,h);break;case 3:var m=r.updateQueue;if(m!==null){if(a=null,r.child!==null)switch(r.child.tag){case 5:a=te(r.child.stateNode);break;case 1:a=r.child.stateNode}co(r,m,a)}break;case 5:var C=r.stateNode;a===null&&r.flags&4&&Su(C,r.type,r.memoizedProps,r);break;case 6:break;case 4:break;case 12:break;case 13:if(ht&&r.memoizedState===null){var A=r.alternate;if(A!==null){var G=A.memoizedState;if(G!==null){var V=G.dehydrated;V!==null&&Xu(V)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(u(163))}qe||r.flags&512&&Ha(r)}catch(ne){ke(r,r.return,ne)}}if(r===t){W=null;break}if(a=r.sibling,a!==null){a.return=r.return,W=a;break}W=r.return}}function gl(t){for(;W!==null;){var r=W;if(r===t){W=null;break}var a=r.sibling;if(a!==null){a.return=r.return,W=a;break}W=r.return}}function pl(t){for(;W!==null;){var r=W;try{switch(r.tag){case 0:case 11:case 15:var a=r.return;try{hi(4,r)}catch(A){ke(r,a,A)}break;case 1:var h=r.stateNode;if(typeof h.componentDidMount=="function"){var d=r.return;try{h.componentDidMount()}catch(A){ke(r,d,A)}}var g=r.return;try{Ha(r)}catch(A){ke(r,g,A)}break;case 5:var m=r.return;try{Ha(r)}catch(A){ke(r,m,A)}}}catch(A){ke(r,r.return,A)}if(r===t){W=null;break}var C=r.sibling;if(C!==null){C.return=r.return,W=C;break}W=r.return}}var ui=0,di=1,ci=2,fi=3,gi=4;if(typeof Symbol=="function"&&Symbol.for){var gn=Symbol.for;ui=gn("selector.component"),di=gn("selector.has_pseudo_class"),ci=gn("selector.role"),fi=gn("selector.test_id"),gi=gn("selector.text")}function Xa(t){var r=au(t);if(r!=null){if(typeof r.memoizedProps["data-testname"]!="string")throw Error(u(364));return r}if(t=du(t),t===null)throw Error(u(362));return t.stateNode.current}function Va(t,r){switch(r.$$typeof){case ui:if(t.type===r.value)return!0;break;case di:e:{r=r.value,t=[t,0];for(var a=0;a<t.length;){var h=t[a++],d=t[a++],g=r[d];if(h.tag!==5||!Jr(h)){for(;g!=null&&Va(h,g);)d++,g=r[d];if(d===r.length){r=!0;break e}else for(h=h.child;h!==null;)t.push(h,d),h=h.sibling}}r=!1}return r;case ci:if(t.tag===5&&gu(t.stateNode,r.value))return!0;break;case gi:if((t.tag===5||t.tag===6)&&(t=fu(t),t!==null&&0<=t.indexOf(r.value)))return!0;break;case fi:if(t.tag===5&&(t=t.memoizedProps["data-testname"],typeof t=="string"&&t.toLowerCase()===r.value.toLowerCase()))return!0;break;default:throw Error(u(365))}return!1}function qa(t){switch(t.$$typeof){case ui:return"<"+(q(t.value)||"Unknown")+">";case di:return":has("+(qa(t)||"")+")";case ci:return'[role="'+t.value+'"]';case gi:return'"'+t.value+'"';case fi:return'[data-testname="'+t.value+'"]';default:throw Error(u(365))}}function vl(t,r){var a=[];t=[t,0];for(var h=0;h<t.length;){var d=t[h++],g=t[h++],m=r[g];if(d.tag!==5||!Jr(d)){for(;m!=null&&Va(d,m);)g++,m=r[g];if(g===r.length)a.push(d);else for(d=d.child;d!==null;)t.push(d,g),d=d.sibling}}return a}function Qa(t,r){if(!Kr)throw Error(u(363));t=Xa(t),t=vl(t,r),r=[],t=Array.from(t);for(var a=0;a<t.length;){var h=t[a++];if(h.tag===5)Jr(h)||r.push(h.stateNode);else for(h=h.child;h!==null;)t.push(h),h=h.sibling}return r}var Nd=Math.ceil,pi=c.ReactCurrentDispatcher,Ka=c.ReactCurrentOwner,Le=c.ReactCurrentBatchConfig,le=0,Be=null,Oe=null,We=0,st=0,jr=Qt(0),ze=0,pn=null,vr=0,vi=0,Ja=0,vn=null,tt=null,Za=0,$a=1/0,Ut=null;function Br(){$a=Fe()+500}var mi=!1,es=null,$t=null,yi=!1,er=null,_i=0,mn=0,ts=null,Si=-1,xi=0;function Qe(){return(le&6)!==0?Fe():Si!==-1?Si:Si=Fe()}function tr(t){return(t.mode&1)===0?1:(le&2)!==0&&We!==0?We&-We:cd.transition!==null?(xi===0&&(xi=Zs()),xi):(t=he,t!==0?t:ou())}function vt(t,r,a,h){if(50<mn)throw mn=0,ts=null,Error(u(185));en(t,a,h),((le&2)===0||t!==Be)&&(t===Be&&((le&2)===0&&(vi|=a),ze===4&&rr(t,We)),rt(t,h),a===1&&le===0&&(r.mode&1)===0&&(Br(),Bn&&At()))}function rt(t,r){var a=t.callbackNode;nd(t,r);var h=Fn(t,t===Be?We:0);if(h===0)a!==null&&eo(a),t.callbackNode=null,t.callbackPriority=0;
vendor: 6,075 bytes, line 9
9else if(r=h&-h,t.callbackPriority!==r){if(a!=null&&eo(a),r===1)t.tag===0?dd(yl.bind(null,t)):to(yl.bind(null,t)),hu?uu(function(){(le&6)===0&&At()}):ia(aa,At),a=null;else{switch($s(h)){case 1:a=aa;break;case 4:a=od;break;case 16:a=sa;break;case 536870912:a=ld;break;default:a=sa}a=Tl(a,ml.bind(null,t))}t.callbackPriority=r,t.callbackNode=a}}function ml(t,r){if(Si=-1,xi=0,(le&6)!==0)throw Error(u(327));var a=t.callbackNode;if(_r()&&t.callbackNode!==a)return null;var h=Fn(t,t===Be?We:0);if(h===0)return null;if((h&30)!==0||(h&t.expiredLanes)!==0||r)r=wi(t,h);else{r=h;var d=le;le|=2;var g=xl();(Be!==t||We!==r)&&(Ut=null,Br(),mr(t,r));do try{Id();break}catch(C){Sl(t,C)}while(!0);ga(),pi.current=g,le=d,Oe!==null?r=0:(Be=null,We=0,r=ze)}if(r!==0){if(r===2&&(d=ta(t),d!==0&&(h=d,r=rs(t,d))),r===1)throw a=pn,mr(t,0),rr(t,h),rt(t,Fe()),a;if(r===6)rr(t,h);else{if(d=t.current.alternate,(h&30)===0&&!Md(d)&&(r=wi(t,h),r===2&&(g=ta(t),g!==0&&(h=g,r=rs(t,g))),r===1))throw a=pn,mr(t,0),rr(t,h),rt(t,Fe()),a;switch(t.finishedWork=d,t.finishedLanes=h,r){case 0:case 1:throw Error(u(345));case 2:yr(t,tt,Ut);break;case 3:if(rr(t,h),(h&130023424)===h&&(r=Za+500-Fe(),10<r)){if(Fn(t,0)!==0)break;if(d=t.suspendedLanes,(d&h)!==h){Qe(),t.pingedLanes|=t.suspendedLanes&d;break}t.timeoutHandle=Hs(yr.bind(null,t,tt,Ut),r);break}yr(t,tt,Ut);break;case 4:if(rr(t,h),(h&4194240)===h)break;for(r=t.eventTimes,d=-1;0<h;){var m=31-xt(h);g=1<<m,m=r[m],m>d&&(d=m),h&=~g}if(h=d,h=Fe()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*Nd(h/1960))-h,10<h){t.timeoutHandle=Hs(yr.bind(null,t,tt,Ut),h);break}yr(t,tt,Ut);break;case 5:yr(t,tt,Ut);break;default:throw Error(u(329))}}}return rt(t,Fe()),t.callbackNode===a?ml.bind(null,t):null}function rs(t,r){var a=vn;return t.current.memoizedState.isDehydrated&&(mr(t,r).flags|=256),t=wi(t,r),t!==2&&(r=tt,tt=a,r!==null&&ns(r)),t}function ns(t){tt===null?tt=t:tt.push.apply(tt,t)}function Md(t){for(var r=t;;){if(r.flags&16384){var a=r.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var h=0;h<a.length;h++){var d=a[h],g=d.getSnapshot;d=d.value;try{if(!wt(g(),d))return!1}catch(m){return!1}}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function rr(t,r){for(r&=~Ja,r&=~vi,t.suspendedLanes|=r,t.pingedLanes&=~r,t=t.expirationTimes;0<r;){var a=31-xt(r),h=1<<a;t[a]=-1,r&=~h}}function yl(t){if((le&6)!==0)throw Error(u(327));_r();var r=Fn(t,0);if((r&1)===0)return rt(t,Fe()),null;var a=wi(t,r);if(t.tag!==0&&a===2){var h=ta(t);h!==0&&(r=h,a=rs(t,h))}if(a===1)throw a=pn,mr(t,0),rr(t,r),rt(t,Fe()),a;if(a===6)throw Error(u(345));return t.finishedWork=t.current.alternate,t.finishedLanes=r,yr(t,tt,Ut),rt(t,Fe()),null}function _l(t){er!==null&&er.tag===0&&(le&6)===0&&_r();var r=le;le|=1;var a=Le.transition,h=he;try{if(Le.transition=null,he=1,t)return t()}finally{he=h,Le.transition=a,le=r,(le&6)===0&&At()}}function is(){st=jr.current,we(jr)}function mr(t,r){t.finishedWork=null,t.finishedLanes=0;var a=t.timeoutHandle;if(a!==qi&&(t.timeoutHandle=qi,iu(a)),Oe!==null)for(a=Oe.return;a!==null;){var h=a;switch(ha(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Dn();break;case 3:zr(),we(Ze),we(Ye),Pa();break;case 5:wa(h);break;case 4:zr();break;case 13:we(Ee);break;case 19:we(Ee);break;case 10:pa(h.type._context);break;case 22:case 23:is()}a=a.return}if(Be=t,Oe=t=nr(t.current,null),We=st=r,ze=0,pn=null,Ja=vi=vr=0,tt=vn=null,gr!==null){for(r=0;r<gr.length;r++)if(a=gr[r],h=a.interleaved,h!==null){a.interleaved=null;var d=h.next,g=a.pending;if(g!==null){var m=g.next;g.next=d,h.next=m}a.pending=h}gr=null}return t}function Sl(t,r){do{var a=Oe;try{if(ga(),$n.current=ni,ei){for(var h=Te.memoizedState;h!==null;){var d=h.queue;d!==null&&(d.pending=null),h=h.next}ei=!1}if(pr=0,je=Ge=Te=null,sn=!1,on=0,Ka.current=null,a===null||a.return===null){ze=1,pn=r,Oe=null;break}e:{var g=t,m=a.return,C=a,A=r;if(r=We,C.flags|=32768,A!==null&&typeof A=="object"&&typeof A.then=="function"){var G=A,V=C,ne=V.tag;if((V.mode&1)===0&&(ne===0||ne===11||ne===15)){var B=V.alternate;B?(V.updateQueue=B.updateQueue,V.memoizedState=B.memoizedState,V.lanes=B.lanes):(V.updateQueue=null,V.memoizedState=null)}var Ce=Yo(m);if(Ce!==null){Ce.flags&=-257,Xo(Ce,m,C,g,r),Ce.mode&1&&Wo(g,G,r),r=Ce,A=G;var _e=r.updateQueue;if(_e===null){var nt=new Set;nt.add(A),r.updateQueue=nt}else _e.add(A);break e}else{if((r&1)===0){Wo(g,G,r),as();break e}A=Error(u(426))}}else if(Pe&&C.mode&1){var Wt=Yo(m);if(Wt!==null){(Wt.flags&65536)===0&&(Wt.flags|=256),Xo(Wt,m,C,g,r),ca(br(A,C));break e}}g=A=br(A,C),ze!==4&&(ze=2),vn===null?vn=[g]:vn.push(g),g=m;do{switch(g.tag){case 3:g.flags|=65536,r&=-r,g.lanes|=r;var R=Ho(g,A,r);uo(g,R);break e;case 1:C=A;var P=g.type,M=g.stateNode;if((g.flags&128)===0&&(typeof P.getDerivedStateFromError=="function"||M!==null&&typeof M.componentDidCatch=="function"&&($t===null||!$t.has(M)))){g.flags|=65536,r&=-r,g.lanes|=r;var H=Uo(g,C,r);uo(g,H);break e}}g=g.return}while(g!==null)}Cl(a)}catch(ee){r=ee,Oe===a&&a!==null&&(Oe=a=a.return);continue}break}while(!0)}function xl(){var t=pi.current;return pi.current=ni,t===null?ni:t}function as(){(ze===0||ze===3||ze===2)&&(ze=4),Be===null||(vr&268435455)===0&&(vi&268435455)===0||rr(Be,We)}function wi(t,r){var a=le;le|=2;var h=xl();(Be!==t||We!==r)&&(Ut=null,mr(t,r));do try{Ld();break}catch(d){Sl(t,d)}while(!0);if(ga(),le=a,pi.current=h,Oe!==null)throw Error(u(261));return Be=null,We=0,ze}function Ld(){for(;Oe!==null;)wl(Oe)}function Id(){for(;Oe!==null&&!ad();)wl(Oe)}function wl(t){var r=El(t.alternate,t,st);t.memoizedProps=t.pendingProps,r===null?Cl(t):Oe=r,Ka.current=null}function Cl(t){var r=t;do{var a=r.alternate;if(t=r.return,(r.flags&32768)===0){if(a=kd(a,r,st),a!==null){Oe=a;return}}else{if(a=Ed(a,r),a!==null){a.flags&=32767,Oe=a;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{ze=6,Oe=null;return}}if(r=r.sibling,r!==null){Oe=r;return}Oe=r=t}while(r!==null);ze===0&&(ze=5)}
vendor: 7,024 bytes, line 9
9function yr(t,r,a){var h=he,d=Le.transition;try{Le.transition=null,he=1,Od(t,r,a,h)}finally{Le.transition=d,he=h}return null}function Od(t,r,a,h){do _r();while(er!==null);if((le&6)!==0)throw Error(u(327));a=t.finishedWork;var d=t.finishedLanes;if(a===null)return null;if(t.finishedWork=null,t.finishedLanes=0,a===t.current)throw Error(u(177));t.callbackNode=null,t.callbackPriority=0;var g=a.lanes|a.childLanes;if(id(t,g),t===Be&&(Oe=Be=null,We=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||yi||(yi=!0,Tl(sa,function(){return _r(),null})),g=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||g){g=Le.transition,Le.transition=null;var m=he;he=1;var C=le;le|=4,Ka.current=null,Rd(t,a),dl(a,t),se(t.containerInfo),t.current=a,Ad(a),sd(),le=C,he=m,Le.transition=g}else t.current=a;if(yi&&(yi=!1,er=t,_i=d),g=t.pendingLanes,g===0&&($t=null),hd(a.stateNode),rt(t,Fe()),r!==null)for(h=t.onRecoverableError,a=0;a<r.length;a++)d=r[a],h(d.value,{componentStack:d.stack,digest:d.digest});if(mi)throw mi=!1,t=es,es=null,t;return(_i&1)!==0&&t.tag!==0&&_r(),g=t.pendingLanes,(g&1)!==0?t===ts?mn++:(mn=0,ts=t):mn=0,At(),null}function _r(){if(er!==null){var t=$s(_i),r=Le.transition,a=he;try{if(Le.transition=null,he=16>t?16:t,er===null)var h=!1;else{if(t=er,er=null,_i=0,(le&6)!==0)throw Error(u(331));var d=le;for(le|=4,W=t.current;W!==null;){var g=W,m=g.child;if((W.flags&16)!==0){var C=g.deletions;if(C!==null){for(var A=0;A<C.length;A++){var G=C[A];for(W=G;W!==null;){var V=W;switch(V.tag){case 0:case 11:case 15:fn(8,V,g)}var ne=V.child;if(ne!==null)ne.return=V,W=ne;else for(;W!==null;){V=W;var B=V.sibling,Ce=V.return;if(ol(V),V===G){W=null;break}if(B!==null){B.return=Ce,W=B;break}W=Ce}}}var _e=g.alternate;if(_e!==null){var nt=_e.child;if(nt!==null){_e.child=null;do{var Wt=nt.sibling;nt.sibling=null,nt=Wt}while(nt!==null)}}W=g}}if((g.subtreeFlags&2064)!==0&&m!==null)m.return=g,W=m;else e:for(;W!==null;){if(g=W,(g.flags&2048)!==0)switch(g.tag){case 0:case 11:case 15:fn(9,g,g.return)}var R=g.sibling;if(R!==null){R.return=g.return,W=R;break e}W=g.return}}var P=t.current;for(W=P;W!==null;){m=W;var M=m.child;if((m.subtreeFlags&2064)!==0&&M!==null)M.return=m,W=M;else e:for(m=P;W!==null;){if(C=W,(C.flags&2048)!==0)try{switch(C.tag){case 0:case 11:case 15:hi(9,C)}}catch(ee){ke(C,C.return,ee)}if(C===m){W=null;break e}var H=C.sibling;if(H!==null){H.return=C.return,W=H;break e}W=C.return}}if(le=d,At(),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(jn,t)}catch(ee){}h=!0}return h}finally{he=a,Le.transition=r}}return!1}function Pl(t,r,a){r=br(a,r),r=Ho(t,r,1),t=Zt(t,r,1),r=Qe(),t!==null&&(en(t,1,r),rt(t,r))}function ke(t,r,a){if(t.tag===3)Pl(t,t,a);else for(;r!==null;){if(r.tag===3){Pl(r,t,a);break}else if(r.tag===1){var h=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&($t===null||!$t.has(h))){t=br(a,t),t=Uo(r,t,1),r=Zt(r,t,1),t=Qe(),r!==null&&(en(r,1,t),rt(r,t));break}}r=r.return}}function Dd(t,r,a){var h=t.pingCache;h!==null&&h.delete(r),r=Qe(),t.pingedLanes|=t.suspendedLanes&a,Be===t&&(We&a)===a&&(ze===4||ze===3&&(We&130023424)===We&&500>Fe()-Za?mr(t,0):Ja|=a),rt(t,r)}function kl(t,r){r===0&&((t.mode&1)===0?r=1:(r=bn,bn<<=1,(bn&130023424)===0&&(bn=4194304)));var a=Qe();t=Nt(t,r),t!==null&&(en(t,r,a),rt(t,a))}function Gd(t){var r=t.memoizedState,a=0;r!==null&&(a=r.retryLane),kl(t,a)}function zd(t,r){var a=0;switch(t.tag){case 13:var h=t.stateNode,d=t.memoizedState;d!==null&&(a=d.retryLane);break;case 19:h=t.stateNode;break;default:throw Error(u(314))}h!==null&&h.delete(r),kl(t,a)}var El;El=function(t,r,a){if(t!==null)if(t.memoizedProps!==r.pendingProps||Ze.current)et=!0;else{if((t.lanes&a)===0&&(r.flags&128)===0)return et=!1,Pd(t,r,a);et=(t.flags&131072)!==0}else et=!1,Pe&&(r.flags&1048576)!==0&&ro(r,Un,r.index);switch(r.lanes=0,r.tag){case 2:var h=r.type;ai(t,r),t=r.pendingProps;var d=Ar(r,Ye.current);Or(r,a),d=Ta(null,r,h,t,d,a);var g=Ra();return r.flags|=1,typeof d=="object"&&d!==null&&typeof d.render=="function"&&d.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,$e(h)?(g=!0,Gn(r)):g=!1,r.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,ya(r),d.updater=Kn,r.stateNode=d,d._reactInternals=r,Sa(r,h,t,a),r=Ga(null,r,h,!0,g,a)):(r.tag=0,Pe&&g&&la(r),Ke(null,r,d,a),r=r.child),r;case 16:h=r.elementType;e:{switch(ai(t,r),t=r.pendingProps,d=h._init,h=d(h._payload),r.type=h,d=r.tag=Fd(h),t=Pt(h,t),d){case 0:r=Da(null,r,h,t,a);break e;case 1:r=Zo(null,r,h,t,a);break e;case 11:r=Vo(null,r,h,t,a);break e;case 14:r=qo(null,r,h,Pt(h.type,t),a);break e}throw Error(u(306,h,""))}return r;case 0:return h=r.type,d=r.pendingProps,d=r.elementType===h?d:Pt(h,d),Da(t,r,h,d,a);case 1:return h=r.type,d=r.pendingProps,d=r.elementType===h?d:Pt(h,d),Zo(t,r,h,d,a);case 3:e:{if($o(r),t===null)throw Error(u(387));h=r.pendingProps,g=r.memoizedState,d=g.element,ho(t,r),Qn(r,h,null,a);var m=r.memoizedState;if(h=m.element,ht&&g.isDehydrated)if(g={element:h,isDehydrated:!1,cache:m.cache,pendingSuspenseBoundaries:m.pendingSuspenseBoundaries,transitions:m.transitions},r.updateQueue.baseState=g,r.memoizedState=g,r.flags&256){d=br(Error(u(423)),r),r=el(t,r,h,a,d);break e}else if(h!==d){d=br(Error(u(424)),r),r=el(t,r,h,a,d);break e}else for(ht&&(ct=Fu(r.stateNode.containerInfo),at=r,Pe=!0,Ct=null,tn=!1),a=_o(r,null,h,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Lr(),h===d){r=Ht(t,r,a);break e}Ke(t,r,h,a)}r=r.child}return r;case 5:return So(r),t===null&&da(r),h=r.type,d=r.pendingProps,g=t!==null?t.memoizedProps:null,m=d.children,Vi(h,d)?m=null:g!==null&&Vi(h,g)&&(r.flags|=32),Jo(t,r),Ke(t,r,m,a),r.child;case 6:return t===null&&da(r),null;case 13:return tl(t,r,a);case 4:return xa(r,r.stateNode.containerInfo),h=r.pendingProps,t===null?r.child=Dr(r,null,h,a):Ke(t,r,h,a),r.child;case 11:return h=r.type,d=r.pendingProps,d=r.elementType===h?d:Pt(h,d),Vo(t,r,h,d,a);case 7:return Ke(t,r,r.pendingProps,a),r.child;case 8:return Ke(t,r,r.pendingProps.children,a),r.child;case 12:return Ke(t,r,r.pendingProps.children,a),r.child;case 10:e:{if(h=r.type._context,d=r.pendingProps,g=r.memoizedProps,m=d.value,oo(r,h,m),g!==null)if(wt(g.value,m)){if(g.children===d.children&&!Ze.current){r=Ht(t,r,a);break e}}else for(g=r.child,g!==null&&(g.return=r);g!==null;){var C=g.dependencies;if(C!==null){m=g.child;for(var A=C.firstContext;A!==null;){if(A.context===h){if(g.tag===1){A=Bt(-1,a&-a),A.tag=2;var G=g.updateQueue;if(G!==null){G=G.shared;var V=G.pending;V===null?A.next=A:(A.next=V.next,V.next=A),G.pending=A}}g.lanes|=a,A=g.alternate,A!==null&&(A.lanes|=a),va(g.return,a,r),C.lanes|=a;break}A=A.next}}else if(g.tag===10)m=g.type===r.type?null:g.child;else if(g.tag===18){if(m=g.return,m===null)throw Error(u(341));m.lanes|=a,C=m.alternate,C!==null&&(C.lanes|=a),va(m,a,r),m=g.sibling}else m=g.child;if(m!==null)m.return=g;else for(m=g;m!==null;){if(m===r){m=null;break}if(g=m.sibling,g!==null){g.return=m.return,m=g;break}m=m.return}g=m}Ke(t,r,d.children,a),r=r.child}return r;
vendor: 8,818 bytes, line 9
9case 9:return d=r.type,h=r.pendingProps.children,Or(r,a),d=ft(d),h=h(d),r.flags|=1,Ke(t,r,h,a),r.child;case 14:return h=r.type,d=Pt(h,r.pendingProps),d=Pt(h.type,d),qo(t,r,h,d,a);case 15:return Qo(t,r,r.type,r.pendingProps,a);case 17:return h=r.type,d=r.pendingProps,d=r.elementType===h?d:Pt(h,d),ai(t,r),r.tag=1,$e(h)?(t=!0,Gn(r)):t=!1,Or(r,a),po(r,h,d),Sa(r,h,d,a),Ga(null,r,h,!0,t,a);case 19:return nl(t,r,a);case 22:return Ko(t,r,a)}throw Error(u(156,r.tag))};function Tl(t,r){return ia(t,r)}function bd(t,r,a,h){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mt(t,r,a,h){return new bd(t,r,a,h)}function ss(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Fd(t){if(typeof t=="function")return ss(t)?1:0;if(t!=null){if(t=t.$$typeof,t===N)return 11;if(t===I)return 14}return 2}function nr(t,r){var a=t.alternate;return a===null?(a=mt(t.tag,r,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=r,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&14680064,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,r=t.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a}function Ci(t,r,a,h,d,g){var m=2;if(h=t,typeof t=="function")ss(t)&&(m=1);else if(typeof t=="string")m=5;else e:switch(t){case v:return Sr(a.children,d,g,r);case _:m=8,d|=8;break;case y:return t=mt(12,a,r,d|2),t.elementType=y,t.lanes=g,t;case E:return t=mt(13,a,r,d),t.elementType=E,t.lanes=g,t;case D:return t=mt(19,a,r,d),t.elementType=D,t.lanes=g,t;case F:return Pi(a,d,g,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case w:m=10;break e;case S:m=9;break e;case N:m=11;break e;case I:m=14;break e;case L:m=16,h=null;break e}throw Error(u(130,t==null?t:typeof t,""))}return r=mt(m,a,r,d),r.elementType=t,r.type=h,r.lanes=g,r}function Sr(t,r,a,h){return t=mt(7,t,h,r),t.lanes=a,t}function Pi(t,r,a,h){return t=mt(22,t,h,r),t.elementType=F,t.lanes=a,t.stateNode={isHidden:!1},t}function os(t,r,a){return t=mt(6,t,null,r),t.lanes=a,t}function ls(t,r,a){return r=mt(4,t.children!==null?t.children:[],t.key,r),r.lanes=a,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function jd(t,r,a,h,d){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=qi,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ra(0),this.expirationTimes=ra(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ra(0),this.identifierPrefix=h,this.onRecoverableError=d,ht&&(this.mutableSourceEagerHydrationData=null)}function Rl(t,r,a,h,d,g,m,C,A){return t=new jd(t,r,a,C,A),r===1?(r=1,g===!0&&(r|=8)):r=0,g=mt(3,null,null,r),t.current=g,g.stateNode=t,g.memoizedState={element:h,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},ya(g),t}function Al(t){if(!t)return Kt;t=t._reactInternals;e:{if(Q(t)!==t||t.tag!==1)throw Error(u(170));var r=t;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if($e(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(u(171))}if(t.tag===1){var a=t.type;if($e(a))return Ks(t,a,r)}return r}function Nl(t){var r=t._reactInternals;if(r===void 0)throw typeof t.render=="function"?Error(u(188)):(t=Object.keys(t).join(","),Error(u(268,t)));return t=re(r),t===null?null:t.stateNode}function Ml(t,r){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<r?a:r}}function ki(t,r){Ml(t,r),(t=t.alternate)&&Ml(t,r)}function Bd(t){return t=re(t),t===null?null:t.stateNode}function Hd(){return null}return n.attemptContinuousHydration=function(t){if(t.tag===13){var r=Nt(t,134217728);if(r!==null){var a=Qe();vt(r,t,134217728,a)}ki(t,134217728)}},n.attemptDiscreteHydration=function(t){if(t.tag===13){var r=Nt(t,1);if(r!==null){var a=Qe();vt(r,t,1,a)}ki(t,1)}},n.attemptHydrationAtCurrentPriority=function(t){if(t.tag===13){var r=tr(t),a=Nt(t,r);if(a!==null){var h=Qe();vt(a,t,r,h)}ki(t,r)}},n.attemptSynchronousHydration=function(t){switch(t.tag){case 3:var r=t.stateNode;if(r.current.memoizedState.isDehydrated){var a=$r(r.pendingLanes);a!==0&&(na(r,a|1),rt(r,Fe()),(le&6)===0&&(Br(),At()))}break;case 13:_l(function(){var h=Nt(t,1);if(h!==null){var d=Qe();vt(h,t,1,d)}}),ki(t,1)}},n.batchedUpdates=function(t,r){var a=le;le|=1;try{return t(r)}finally{le=a,le===0&&(Br(),Bn&&At())}},n.createComponentSelector=function(t){return{$$typeof:ui,value:t}},n.createContainer=function(t,r,a,h,d,g,m){return Rl(t,r,!1,null,a,h,d,g,m)},n.createHasPseudoClassSelector=function(t){return{$$typeof:di,value:t}},n.createHydrationContainer=function(t,r,a,h,d,g,m,C,A){return t=Rl(a,h,!0,t,d,g,m,C,A),t.context=Al(null),a=t.current,h=Qe(),d=tr(a),g=Bt(h,d),g.callback=r!=null?r:null,Zt(a,g,d),t.current.lanes=d,en(t,d,h),rt(t,h),t},n.createPortal=function(t,r,a){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:p,key:h==null?null:""+h,children:t,containerInfo:r,implementation:a}},n.createRoleSelector=function(t){return{$$typeof:ci,value:t}},n.createTestNameSelector=function(t){return{$$typeof:fi,value:t}},n.createTextSelector=function(t){return{$$typeof:gi,value:t}},n.deferredUpdates=function(t){var r=he,a=Le.transition;try{return Le.transition=null,he=16,t()}finally{he=r,Le.transition=a}},n.discreteUpdates=function(t,r,a,h,d){var g=he,m=Le.transition;try{return Le.transition=null,he=1,t(r,a,h,d)}finally{he=g,Le.transition=m,le===0&&Br()}},n.findAllNodes=Qa,n.findBoundingRects=function(t,r){if(!Kr)throw Error(u(363));r=Qa(t,r),t=[];for(var a=0;a<r.length;a++)t.push(cu(r[a]));for(r=t.length-1;0<r;r--){a=t[r];for(var h=a.x,d=h+a.width,g=a.y,m=g+a.height,C=r-1;0<=C;C--)if(r!==C){var A=t[C],G=A.x,V=G+A.width,ne=A.y,B=ne+A.height;if(h>=G&&g>=ne&&d<=V&&m<=B){t.splice(r,1);break}else if(h!==G||a.width!==A.width||B<g||ne>m){if(!(g!==ne||a.height!==A.height||V<h||G>d)){G>h&&(A.width+=G-h,A.x=h),V<d&&(A.width=d-G),t.splice(r,1);break}}else{ne>g&&(A.height+=ne-g,A.y=g),B<m&&(A.height=m-ne),t.splice(r,1);break}}}return t},n.findHostInstance=Nl,n.findHostInstanceWithNoPortals=function(t){return t=K(t),t=t!==null?fe(t):null,t===null?null:t.stateNode},n.findHostInstanceWithWarning=function(t){return Nl(t)},n.flushControlled=function(t){var r=le;le|=1;var a=Le.transition,h=he;try{Le.transition=null,he=1,t()}finally{he=h,Le.transition=a,le=r,le===0&&(Br(),At())}},n.flushPassiveEffects=_r,n.flushSync=_l,n.focusWithin=function(t,r){if(!Kr)throw Error(u(363));for(t=Xa(t),r=vl(t,r),r=Array.from(r),t=0;t<r.length;){var a=r[t++];if(!Jr(a)){if(a.tag===5&&pu(a.stateNode))return!0;for(a=a.child;a!==null;)r.push(a),a=a.sibling}}return!1},n.getCurrentUpdatePriority=function(){return he},n.getFindAllNodesFailureDescription=function(t,r){if(!Kr)throw Error(u(363));var a=0,h=[];t=[Xa(t),0];for(var d=0;d<t.length;){var g=t[d++],m=t[d++],C=r[m];if((g.tag!==5||!Jr(g))&&(Va(g,C)&&(h.push(qa(C)),m++,m>a&&(a=m)),m<r.length))for(g=g.child;g!==null;)t.push(g,m),g=g.sibling}if(a<r.length){for(t=[];a<r.length;a++)t.push(qa(r[a]));return"findAllNodes was able to match part of the selector:\n  "+(h.join(" > ")+"\n\nNo matching component was found for:\n  ")+t.join(" > ")}return null},n.getPublicRootInstance=function(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return te(t.child.stateNode);default:return t.child.stateNode}},n.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,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:c.ReactCurrentDispatcher,findHostInstanceByFiber:Bd,findFiberByHostInstance:t.findFiberByHostInstance||Hd,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")t=!1;else{var r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r.isDisabled||!r.supportsFiber)t=!0;
9else{try{jn=r.inject(t),Rt=r}catch(a){}t=!!r.checkDCE}}return t},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(t,r,a,h){if(!Kr)throw Error(u(363));t=Qa(t,r);var d=vu(t,a,h).disconnect;return{disconnect:function(){d()}}},n.registerMutableSourceForHydration=function(t,r){var a=r._getVersion;a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a)},n.runWithPriority=function(t,r){var a=he;try{return he=t,r()}finally{he=a}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(t,r,a,h){var d=r.current,g=Qe(),m=tr(d);return a=Al(a),r.context===null?r.context=a:r.pendingContext=a,r=Bt(g,m),r.payload={element:t},h=h===void 0?null:h,h!==null&&(r.callback=h),t=Zt(d,r,m),t!==null&&(vt(t,d,m,g),qn(t,d,m)),m},n}),_s}var th;function _g(){return th||(th=1,ys.exports=yg()),ys.exports}var Sg=_g();const xg=Yd(Sg);var Ss={exports:{}},ar={};/**
10 * @license React
11 * react-reconciler-constants.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var rh;function wg(){return rh||(rh=1,ar.ConcurrentRoot=1,ar.ContinuousEventPriority=4,ar.DefaultEventPriority=16,ar.DiscreteEventPriority=1,ar.IdleEventPriority=536870912,ar.LegacyRoot=0),ar}var nh;function Cg(){return nh||(nh=1,Ss.exports=wg()),Ss.exports}var Kh=Cg();const ih={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let ah=!1,sh=!1;const bs=".react-konva-event",Pg="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",kg='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',Eg={};function Xi(o,e,n=Eg){if(!ah&&"zIndex"in e&&(console.warn(kg),ah=!0),!sh&&e.draggable){var i=e.x!==void 0||e.y!==void 0,s=e.onDragEnd||e.onDragMove;i&&!s&&(console.warn(Pg),sh=!0)}for(var l in n)if(!ih[l]){var u=l.slice(0,2)==="on",c=n[l]!==e[l];if(u&&c){var f=l.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),o.off(f,n[l])}var p=!e.hasOwnProperty(l);p&&o.setAttr(l,void 0)}var v=e._useStrictMode,_={},y=!1;const w={};for(var l in e)if(!ih[l]){var u=l.slice(0,2)==="on",S=n[l]!==e[l];if(u&&S){var f=l.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e[l]&&(w[f]=e[l])}!u&&(e[l]!==n[l]||v&&e[l]!==o.getAttr(l))&&(y=!0,_[l]=e[l])}y&&(o.setAttrs(_),ur(o));for(var f in w)o.on(f+bs,w[f])}function ur(o){if(!Y.autoDrawEnabled){var e=o.getLayer()||o.getStage();e&&e.batchDraw()}}var xs=ph();const Jh={},Tg={};wr.Node.prototype._applyProps=Xi;function Rg(o,e){if(typeof e=="string"){console.error("Do not use plain text as child of Konva.Node. You are using text: ".concat(e));return}o.add(e),ur(o)}function Ag(o,e,n){let i=wr[o];i||(console.error("Konva has no node with the type ".concat(o,'. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/').concat(o,'"  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')),i=wr.Group);const s={},l={};for(var u in e){var c=u.slice(0,2)==="on";c?l[u]=e[u]:s[u]=e[u]}const f=new i(s);return Xi(f,l),f}function Ng(o,e,n){console.error('Text components are not supported for now in ReactKonva. Your text is: "'.concat(o,'"'))}function Mg(o,e,n){return!1}function Lg(o){return o}function Ig(){return null}function Og(){return null}function Dg(o,e,n,i){return Tg}function Gg(){}function zg(o){}function bg(o,e){return!1}function Fg(){return Jh}function jg(){return Jh}const Bg=setTimeout,Hg=clearTimeout,Ug=-1;function Wg(o,e){return!1}const Yg=!1,Xg=!0,Vg=!0;function qg(o,e){e.parent===o?e.moveToTop():o.add(e),ur(o)}function Qg(o,e){e.parent===o?e.moveToTop():o.add(e),ur(o)}function Zh(o,e,n){e._remove(),o.add(e),e.setZIndex(n.getZIndex()),ur(o)}function Kg(o,e,n){Zh(o,e,n)}function Jg(o,e){e.destroy(),e.off(bs),ur(o)}function Zg(o,e){e.destroy(),e.off(bs),ur(o)}function $g(o,e,n){console.error('Text components are not yet supported in ReactKonva. You text is: "'.concat(n,'"'))}function ep(o,e,n){}function tp(o,e,n,i,s){Xi(o,s,i)}function rp(o){o.hide(),ur(o)}function np(o){}function ip(o,e){(e.visible==null||e.visible)&&o.show()}function ap(o,e){}function sp(o){}function op(){}const lp=()=>Kh.DefaultEventPriority,hp=Object.freeze(Object.defineProperty({__proto__:null,appendChild:qg,appendChildToContainer:Qg,appendInitialChild:Rg,cancelTimeout:Hg,clearContainer:sp,commitMount:ep,commitTextUpdate:$g,commitUpdate:tp,createInstance:Ag,createTextInstance:Ng,detachDeletedInstance:op,finalizeInitialChildren:Mg,getChildHostContext:jg,getCurrentEventPriority:lp,getPublicInstance:Lg,getRootHostContext:Fg,hideInstance:rp,hideTextInstance:np,idlePriority:xs.unstable_IdlePriority,insertBefore:Zh,insertInContainerBefore:Kg,isPrimaryRenderer:Yg,noTimeout:Ug,now:xs.unstable_now,prepareForCommit:Ig,preparePortalMount:Og,prepareUpdate:Dg,removeChild:Jg,removeChildFromContainer:Zg,resetAfterCommit:Gg,resetTextContent:zg,run:xs.unstable_runWithPriority,scheduleTimeout:Bg,shouldDeprioritizeSubtree:bg,shouldSetTextContent:Wg,supportsMutation:Vg,unhideInstance:ip,unhideTextInstance:ap,warnsIfNotActing:Xg},Symbol.toStringTag,{value:"Module"}));var up=Object.defineProperty,dp=Object.defineProperties,cp=Object.getOwnPropertyDescriptors,oh=Object.getOwnPropertySymbols,fp=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable,lh=(o,e,n)=>e in o?up(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,hh=(o,e)=>{for(var n in e||(e={}))fp.call(e,n)&&lh(o,n,e[n]);if(oh)for(var n of oh(e))gp.call(e,n)&&lh(o,n,e[n]);return o},pp=(o,e)=>dp(o,cp(e)),uh,dh;typeof window<"u"&&((uh=window.document)!=null&&uh.createElement||((dh=window.navigator)==null?void 0:dh.product)==="ReactNative")?ae.useLayoutEffect:ae.useEffect;function $h(o,e,n){if(!o)return;if(n(o)===!0)return o;let i=o.child;for(;i;){const s=$h(i,e,n);if(s)return s;i=i.sibling}}function eu(o){try{return Object.defineProperties(o,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch(e){return o}}const ch=console.error;console.error=function(){const o=[...arguments].join("");if(o!=null&&o.startsWith("Warning:")&&o.includes("useContext")){console.error=ch;return}return ch.apply(this,arguments)};const Fs=eu(ae.createContext(null));class tu extends ae.Component{render(){return ae.createElement(Fs.Provider,{value:this._reactInternals},this.props.children)}}function vp(){const o=ae.useContext(Fs);if(o===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=ae.useId();return ae.useMemo(()=>{for(const i of[o,o==null?void 0:o.alternate]){if(!i)continue;const s=$h(i,!1,l=>{let u=l.memoizedState;for(;u;){if(u.memoizedState===e)return!0;u=u.next}});if(s)return s}},[o,e])}function mp(){const o=vp(),[e]=ae.useState(()=>new Map);e.clear();let n=o;for(;n;){if(n.type&&typeof n.type=="object"){const s=n.type._context===void 0&&n.type.Provider===n.type?n.type:n.type._context;s&&s!==Fs&&!e.has(s)&&e.set(s,ae.useContext(eu(s)))}n=n.return}return e}function yp(){const o=mp();return ae.useMemo(()=>Array.from(o.keys()).reduce((e,n)=>i=>ae.createElement(e,null,ae.createElement(n.Provider,pp(hh({},i),{value:o.get(n)}))),e=>ae.createElement(tu,hh({},e))),[o])}function _p(o){const e=Je.useRef({});return Je.useLayoutEffect(()=>{e.current=o}),Je.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const Sp=o=>{const e=Je.useRef(),n=Je.useRef(),i=Je.useRef(),s=_p(o),l=yp(),u=c=>{const{forwardedRef:f}=o;f&&(typeof f=="function"?f(c):f.current=c)};return Je.useLayoutEffect(()=>
17(n.current=new wr.Stage({width:o.width,height:o.height,container:e.current}),u(n.current),i.current=En.createContainer(n.current,Kh.LegacyRoot,!1,null),En.updateContainer(Je.createElement(l,{},o.children),i.current),()=>{wr.isBrowser&&(u(null),En.updateContainer(null,i.current,null),n.current.destroy())}),[]),Je.useLayoutEffect(()=>{u(n.current),Xi(n.current,o,s),En.updateContainer(Je.createElement(l,{},o.children),i.current,null)}),Je.createElement("div",{ref:e,id:o.id,accessKey:o.accessKey,className:o.className,role:o.role,style:o.style,tabIndex:o.tabIndex,title:o.title})},xp="Layer",ru="Image",wp="Text",nu="Transformer",En=xg(hp);En.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:Je.version,rendererPackageName:"react-konva"});const Cp=Je.forwardRef((o,e)=>Je.createElement(tu,{},Je.createElement(Sp,{...o,forwardedRef:e})));function Pp(){const[o,e]=ae.useState({stageScale:1,stageX:0,stageY:0});function n(i){i.evt.preventDefault();const s=1.1,l=i.target.getStage(),u=l.scaleX(),c={x:l.getPointerPosition().x/u-l.x()/u,y:l.getPointerPosition().y/u-l.y()/u},f=i.evt.deltaY>0?u*s:u/s;e({stageScale:f,stageX:-(c.x-l.getPointerPosition().x/f)*f,stageY:-(c.y-l.getPointerPosition().y/f)*f})}return[n,o]}function kp(o){return new Promise(e=>{const n=new Image;n.onload=function(){e(n)},n.src=o})}function Ep(o){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="",i,s,l,u,c,f,p,v=0;v<o.length;)i=o[v++],s=v<o.length?o[v++]:Number.NaN,l=v<o.length?o[v++]:Number.NaN,u=i>>2,c=(i&3)<<4|s>>4,f=(s&15)<<2|l>>6,p=l&63,isNaN(s)?f=p=64:isNaN(l)&&(p=64),n+=e.charAt(u)+e.charAt(c)+e.charAt(f)+e.charAt(p);return n}function Tp(o){var e=new Uint8Array(o);return Ep(e)}const js={name:"John Doe",first_name:"John",last_name:"Doe",coupon:"JOHN10OFF",ref_code:"john",ref_link:"https://yourstore.com/?ref=john"};function Rp({data:o,onChange:e}){const n=s=>l=>{e({[s]:l.target.type==="number"?Number(l.target.value):l.target.value})};function i(s){e({width:Number(s.target.value),height:Number(s.target.value)})}return T.jsxs("div",{children:[T.jsx(De,{label:"Text",children:T.jsx("input",{type:"text",value:o.text,onChange:n("text"),className:"form-control"})}),T.jsx(De,{label:"Size",children:T.jsx("input",{type:"number",value:o.width,onChange:i,className:"form-control"})}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-md-6",children:T.jsx(De,{label:"Position X",children:T.jsx("input",{type:"number",value:o.x,onChange:n("x"),className:"form-control"})})}),T.jsx("div",{className:"col-md-6",children:T.jsx(De,{label:"Position Y",children:T.jsx("input",{type:"number",value:o.y,onChange:n("y"),className:"form-control"})})})]}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-md-6",children:T.jsx(De,{label:"Color",children:T.jsx(Bi,{color:o.color,onChange:s=>e({color:s})})})}),T.jsx("div",{className:"col-md-6",children:T.jsx(De,{label:"Background",children:T.jsx(Bi,{asRGBA:!0,color:o.background,onChange:s=>e({background:s})})})})]}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-md-6",children:T.jsx(De,{label:"Rotation",children:T.jsx("input",{type:"number",value:o.rotation,onChange:n("rotation"),className:"form-control"})})}),T.jsx("div",{className:"col-md-6",children:T.jsx(De,{label:"Margin",children:T.jsx("input",{type:"number",value:o.margin,onChange:n("margin"),className:"form-control"})})})]})]})}function Ap({data:o,onChange:e}){const n=i=>s=>{e({[i]:s.target.type==="number"?Number(s.target.value):s.target.value})};return T.jsxs("div",{children:[T.jsx(De,{label:"Text",children:T.jsx("input",{type:"text",value:o.text,onChange:n("text"),className:"form-control"})}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Position X",children:T.jsx("input",{type:"number",value:o.x,onChange:n("x"),className:"form-control"})})}),T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Position Y",children:T.jsx("input",{type:"number",value:o.y,onChange:n("y"),className:"form-control"})})})]}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Rotation",children:T.jsx("input",{type:"number",value:o.rotation,onChange:n("rotation"),className:"form-control"})})}),T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Font Size",children:T.jsx("input",{type:"number",value:o.fontSize,onChange:n("fontSize"),className:"form-control"})})})]}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Fill",children:T.jsx(Bi,{color:o.fill,onChange:i=>e({fill:i})})})}),T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Stroke",children:T.jsx(Bi,{color:o.stroke,onChange:i=>e({stroke:i})})})})]}),T.jsxs("div",{className:"row",children:[T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Stroke Width",children:T.jsx("input",{type:"number",value:o.strokeWidth,onChange:n("strokeWidth"),className:"form-control"})})}),T.jsx("div",{className:"col-6",children:T.jsx(De,{label:"Opacity",children:T.jsx("input",{type:"number",value:o.opacity,min:0,max:1,step:.
1701,onChange:n("opacity"),className:"form-control"})})})]})]})}function Np({item:o,isSelected:e,onSelect:n,onChange:i}){const s=ae.useRef(),l=ae.useRef();ae.useEffect(()=>{e&&(l.current.nodes([s.current]),l.current.getLayer().batchDraw())},[e]);const u=ae.useMemo(()=>{try{return vh.render(o.text,js)}catch(c){return o.text}},[o.text]);return T.jsxs(T.Fragment,{children:[T.jsx(wp,{onClick:n,onTap:n,ref:s,draggable:!0,onDragEnd:c=>{i({x:c.target.x(),y:c.target.y()})},onTransform:c=>{const f=s.current,p=f.scaleX(),v=f.scaleY();f.scaleX(1),f.scaleY(1),i({x:f.x(),y:f.y(),width:Math.max(5,f.width()*p),height:Math.max(f.height()*v),rotation:f.rotation()})},y:o.y,rotation:o.rotation,fontSize:o.fontSize,fontFamily:o.fontFamily,fill:o.fill,fillAfterStrokeEnabled:o.fillAfterStrokeEnabled,fontStyle:o.fontStyle,width:o.width,height:o.height,textDecoration:o.textDecoration,strokeWidth:o.strokeWidth,stroke:o.stroke,scaleX:o.scaleX,scaleY:o.scaleY,opacity:o.opacity,x:o.x,text:u},o.id),e&&T.jsx(nu,{ref:l,boundBoxFunc:(c,f)=>f.width<5||f.height<5?c:f})]})}
17function Mp({item:o,onSelect:e,onChange:n,isSelected:i}){const[s,l]=ae.useState(null),u=ae.useRef(),c=ae.useRef();ae.useEffect(()=>{i&&(c.current.nodes([u.current]),c.current.getLayer().batchDraw())},[i]);const f=ae.useMemo(()=>{try{return vh.render(o.text,js)}catch(p){return o.text}},[o.text]);return ae.useEffect(()=>{sc.toDataURL(f,{width:o.width,margin:o.margin,color:{dark:o.color,light:o.background}}).then(p=>{const v=new Image;v.src=p,v.onload=function(){l(v)}})},[f,o]),T.jsxs(T.Fragment,{children:[T.jsx(ru,{onClick:e,onTap:e,ref:u,draggable:!0,onDragEnd:p=>{n({x:p.target.x(),y:p.target.y()})},onTransform:p=>{const v=u.current,_=v.scaleX(),y=v.scaleY();v.scaleX(1),v.scaleY(1),n({x:v.x(),y:v.y(),width:Math.max(5,v.width()*_),height:Math.max(v.height()*y),rotation:v.rotation()})},image:s,x:o.x,width:o.width,height:o.height,y:o.y,rotation:o.rotation}),i&&T.jsx(nu,{ref:c,boundBoxFunc:(p,v)=>v.width<5||v.height<5?p:v})]})}function Lp({visible:o,onClose:e,baseImage:n,nodes:i}){const[s,l]=ae.useState(null),[u,c]=ae.useState(!1);return ae.useEffect(()=>{o&&(c(!0),l(null),mh.post("http://localhost:8081/dynamic-image",{baseImageUrl:n.src,overlayComponents:i,renderObject:js},{responseType:"arraybuffer"}).then(({data:f})=>{c(!1),l("data:image/png;base64,"+Tp(f))}))},[o,n,i]),T.jsx(Xd,{visible:o,onClose:e,title:"Image Preview",children:u?T.jsx("div",{style:{width:"100%",height:500},className:"d-flex align-items-center justify-content-center",children:T.jsx(Ms,{})}):T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"border bg-light-subtle",children:T.jsx("img",{src:s,alt:"rendered image",style:{objectFit:"contain",width:"100%",height:500}})}),T.jsx("div",{className:"mt-2 text-center",children:T.jsx("a",{href:s,className:"btn btn-primary",download:"goaffpro-dynamic-image-preview.png",children:"Download"})})]})})}const fh=ic("qwertyuiopasdfghjklzxcvbnm",8),Ip={text:Ap,qrcode:Rp},Op={text:Np,qrcode:Mp};function Kp(o){const{media_id:e}=Vd(),n=qd(Z=>!!Number(Z.settings.subscription)),[i,s]=ae.useState(!1),[l,u]=ae.useState(!1),[c,f]=ae.useState([]),[p,v]=Pp(),[_,y]=ae.useState([]),[w,S]=ae.useState({}),[N,E]=ae.useState(null);ae.useEffect(()=>{if(!e)return null;s(!0),zi().get("/v1/admin/creatives",{params:{fields:"id,url,metadata,size,width,height,name,type",id:e}}).then(({data:Z})=>Z.creatives).then(Z=>{const te=Z[0];if(te){const{url:ge,width:pe,height:Ne,size:se,metadata:ve}=te;S({src:ge,width:pe,height:Ne,size:se}),y(ve?ve.nodes:[])}s(!1)})},[e]);const D=ae.useRef();Qd(D,()=>q(null)),ae.useEffect(()=>{w.image||(w.dataUrl||w.src)&&kp(w.dataUrl||w.src).then(Z=>{E(Z)})},[w]);const[I,L,F]=ae.useMemo(()=>N?[N.width,N.height,1]:[0,0,1],[N]);async function X(Z){Z&&(Z.preventDefault(),Z.stopPropagation()),u(!0);const{width:te,height:ge,src:pe,size:Ne,filename:se}=w,ve=_.length>0?"dynamic":"static";e?await zi().patch("/v1/admin/creatives/"+e,{width:te,height:ge,url:pe,filename:se,size:Ne,type:ve,metadata:_.length>0?{nodes:_}:null}).then(({data:Me})=>Me):await zi().post("/v1/admin/creatives",{width:te,height:ge,url:pe,filename:se,size:Ne,type:ve,metadata:_.length>0?{nodes:_}:null}).then(({data:Me})=>Me),u(!1)}const[j,q]=ae.useState(null),U=Z=>te=>{y(ge=>ge.map(pe=>pe.id===Z?{...pe,...te}:pe))};function Q(){y(Z=>[...Z,{id:fh(),type:"text",text:"",fontSize:16,fill:"#000000",rotation:0,opacity:1,fontFamily:"verdana",fillAfterStrokeEnabled:!0,x:0,y:0}])}function J(){y(Z=>[...Z,{id:fh(),type:"qrcode",text:"{{{ref_link}}}",width:200,height:200,background:"#00000000",margin:0,rotation:0,opacity:1,color:"#000000",x:0,y:0}])}const[K,re]=ae.useState(!1),[$,fe]=ae.useState(!1);return i?T.jsx("div",{className:"container-fluid min-vh-100 d-flex align-items-center justify-content-center",children:T.jsx(Ms,{})}):T.jsxs("div",{className:"container-fluid min-vh-100 d-flex flex-column",children:[T.jsx("div",{className:"mt-2 mb-1",children:T.jsx(Kd,{})}),T.jsxs("div",{className:"d-flex align-items-center justify-content-between border-bottom mb-3 pb-2",children:[T.jsxs("div",{children:[T.jsx("h3",{className:"m-0",children:"Dynamic Images"}),T.jsx("p",{className:"text-muted",children:"Personalize your creatives for individual affiliates by using dynamic tags"})]}),T.jsxs("div",{children:[T.jsx("button",{className:"btn btn-light btn-sm mr-2",onClick:()=>re(!0),children:"Download Preview"}),T.jsx(Jd,{loading:l,className:"btn btn-primary btn-sm",onClick:X,children:"Save"})]}),T.jsx(Lp,{baseImage:w,visible:K,onClose:()=>re(!1),nodes:_})]}),n?null:T.jsxs("p",{className:"alert alert-danger text-center",children:["Dynamic images are only available for premium subscribers. ",T.jsx(Ll,{className:"alert-link",to:"/subscriptions",children:"Upgrade here"})]}),T.jsxs("div",{className:"row flex-fill",children:[T.jsxs("div",{className:"col-3",style:{overflowY:"auto"},children:[T.jsx("h5",{children:"Editor"}),T.jsx(De,{label:"Base Image",children:T.jsx(Dp,{data:w,onChange:Z=>{S(te=>({...te,...Z}))}})}),T.jsxs(De,{label:"Elements",children:[_.length===0?T.jsx("p",{className:"text-center",children:"Choose an element to add below"}):null,_.map(Z=>{const te=Ip[Z.type],ge=c.indexOf(Z.id)===-1;return T.jsxs("div",{className:"card mb-2",children:[T.jsxs("div",{className:"card-header d-flex align-items-center justify-content-between",onClick:()=>f(pe=>pe.indexOf(Z.id)>
17-1?pe.filter(Ne=>Z.id!==Ne):[...pe,Z.id]),children:[T.jsx(jp,{type:Z.type}),ge?T.jsx(Zd,{className:"text-secondary",style:{fontSize:16}}):T.jsx($d,{className:"text-secondary",style:{fontSize:16}})]}),ge?T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"card-body",children:T.jsx(te,{data:Z,onChange:U(Z.id)},Z.id)}),T.jsx("div",{className:"card-footer",children:T.jsx("button",{className:"btn p-0 text-danger text-center btn-link",onClick:()=>y(pe=>pe.filter(({id:Ne})=>Ne!==Z.id)),children:"Delete"})})]}):null]},Z.id)})]}),T.jsx(De,{label:"Add new elements",children:T.jsxs("div",{className:"d-flex flex-wrap",children:[T.jsx("button",{className:"btn border p-2 m-1",onClick:Q,children:T.jsx(ec,{className:"text-secondary display-4"})}),T.jsx("button",{className:"btn border p-2 m-1",onClick:J,children:T.jsx(tc,{className:"text-secondary display-4"})})]})}),T.jsx("hr",{}),T.jsx("button",{className:"btn w-100 btn-link text-center",onClick:()=>fe(!0),children:"See list of dynamic tags"}),T.jsx("hr",{}),T.jsxs("div",{className:"p-2 bg-light-subtle text-muted rounded border",children:["Got feedback or suggestions ? Want more options/elements ? Please ",T.jsx(Ll,{to:"/contact?body=Dynamic images",children:"let us know"})]})]}),T.jsxs("div",{className:"col-9",children:[T.jsxs("div",{className:"d-flex align-items-center justify-content-between",children:[T.jsx("h5",{children:"Preview"}),T.jsx("small",{className:"text-muted ml-2",children:"Note: Use mousewheel to zoom in/out and click to hold and drag the image around"})]}),N?T.jsx("div",{style:{overflow:"hidden"},className:"p-2 border bg-light-subtle",ref:D,children:T.jsx(Cp,{onWheel:p,scaleX:v.stageScale,scaleY:v.stageScale,x:v.stageX,y:v.stageY,width:I,draggable:!0,height:L,children:T.jsxs(xp,{children:[T.jsx(ru,{image:N,x:0,y:0,scaleX:F,scaleY:F}),_.map(Z=>{const te=Op[Z.type];return T.jsx(te,{item:Z,onChange:U(Z.id),isSelected:j===Z.id,onSelect:()=>q(Z.id)},Z.id)})]})})}):T.jsx("p",{className:"alert alert-info",children:"Upload an image to start editing"})]})]}),$&&T.jsx(zp,{close:()=>fe(!1)})]})}function Dp({data:o,onChange:e}){const[n,i]=ae.useState(!1),s=ae.useCallback(f=>{const p=f[0];console.log(p),i(!0),Promise.all([Fp(p).then(({width:v,height:_,dataUrl:y})=>{e({width:v,height:_,dataUrl:y,size:p.size,mimetype:p.type,filename:p.name})}),bp(p).then(v=>{e({src:v})})]).then(()=>{i(!1)})},[e]),{getRootProps:l,getInputProps:u,isDragActive:c}=ac({onDrop:s,accept:"image/png,image/jpg,image/jpeg",multiple:!1});return T.jsxs("div",{...l(),className:"border bg-light-subtle",children:[T.jsx("input",{...u()}),T.jsxs("div",{className:"d-flex align-items-center justify-content-center position-relative",style:{height:200},children:[n&&T.jsx("div",{className:"position-absolute d-flex align-items-center justify-content-center",style:{background:"rgba(255,255,255,0.4)",height:200,width:"100%"},children:T.jsx(Ms,{})}),o.dataUrl||o.src?T.jsx("img",{src:o.dataUrl||o.src,style:{height:200,objectFit:"contain",width:"100%"},alt:"Base image"}):T.jsx(T.Fragment,{children:T.jsx("span",{className:"text-center d-block p-2",children:"Drag 'n' drop some files here, or click to select files"})})]})]})}const gh={name:"Affiliate's name",first_name:"First name",last_name:"Last name",ref_link:"Referral link",ref_code:"Referral code",coupon:"Coupon code of the affiliate",facebook:"Facebook URL of the affiliate",twitter:"Twitter handle of the affiliate",instagram:"Instagram",pinterest:"Pinterest"},Gp=["ref_link"];function zp({close:o}){return T.jsxs("div",{style:{padding:16,position:"fixed",bottom:0,right:0,width:"100%",maxWidth:600,height:600,backgroundColor:"white",overflowY:"scroll",boxShadow:"0px 0px 18px 0px #cccccc"},children:[T.jsx("h4",{children:"Available Variables"}),T.jsx("hr",{}),T.jsx("ul",{className:"list-group list-group-flush",children:Object.keys(gh).map(e=>{const n=Gp.indexOf(e)>-1?"{{{".concat(e,"}}}"):"{{".concat(e,"}}");return T.jsxs("li",{className:"list-group-item d-flex align-items-center justify-content-between",children:[T.jsx(rc,{text:n,className:"btn",copyBtnText:n}),T.jsx("span",{children:gh[e]})]})})}),T.jsx("span",{style:{position:"absolute",right:5,top:5},children:T.jsx("button",{className:"btn btn-light rounded-circle",style:{width:48,height:48},onClick:o,children:T.jsx(nc,{})})})]})}async function bp(o){const{url:e,fields:n}=await zi().post("/v1/admin/creatives/preSignedUrl",{name:o.name}).then(({data:s})=>s);console.log(n,e);const i=new FormData;
17return Object.keys(n).forEach(s=>{i.append(s,n[s])}),i.append("content-type",o.type),i.append("file",o),mh.post(e,i).then(()=>"https://creatives.goaffpro.com/".concat(n.key))}function Fp(o){return new Promise((e,n)=>{const i=new FileReader;i.onload=s=>{const l=new Image;l.src=i.result,l.onload=function(){e({dataUrl:i.result,width:l.width,height:l.height})}},i.readAsDataURL(o)})}function jp({type:o}){switch(o){case"text":return"Text";case"qrcode":return"QRCode";default:return"N/A"}}export{Kp as default};

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.