=r||(o=(n*i+a)*4,s+=x[o+0],c+=x[o+1],d+=x[o+2],h+=x[o+3],f+=1);for(s=s/f,c=c/f,d=d/f,h=h/f,a=m;a=n))for(i=w;i=r||(o=(n*i+a)*4,x[o+0]=s,x[o+1]=c,x[o+2]=d,x[o+3]=h)}};eg.Pixelate=eB,Fx.Factory.addGetterSetter($z.Node,"pixelSize",8,(0,Jz.getNumberValidator)(),Fx.Factory.afterSetFilter);var tg={};Object.defineProperty(tg,"__esModule",{value:!0}),tg.Posterize=void 0;const zx=dt,tB=dn,nB=Be,rB=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,a=255/t,i;for(i=0;i255?255:e<0?0:Math.round(e)}),hf.Factory.addGetterSetter(s4.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),hf.Factory.addGetterSetter(s4.Node,"blue",0,aB.RGBComponent,hf.Factory.afterSetFilter);var rg={};Object.defineProperty(rg,"__esModule",{value:!0}),rg.RGBA=void 0;const rh=dt,ff=dn,oB=Be,sB=function(e){var t=e.data,n=t.length,r=this.red(),a=this.green(),i=this.blue(),o=this.alpha(),s,c;for(s=0;s255?255:e<0?0:Math.round(e)}),rh.Factory.addGetterSetter(ff.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)}),rh.Factory.addGetterSetter(ff.Node,"blue",0,oB.RGBComponent,rh.Factory.afterSetFilter),rh.Factory.addGetterSetter(ff.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var ag={};Object.defineProperty(ag,"__esModule",{value:!0}),ag.Sepia=void 0;const lB=function(e){var t=e.data,n=t.length,r,a,i,o;for(r=0;r127&&(d=255-d),h>127&&(h=255-h),b>127&&(b=255-b),t[c]=d,t[c+1]=h,t[c+2]=b}while(--s)}while(--i)};ig.Solarize=cB;var og={};Object.defineProperty(og,"__esModule",{value:!0}),og.Threshold=void 0;const Bx=dt,uB=dn,dB=Be,hB=function(e){var t=this.threshold()*255,n=e.data,r=n.length,a;for(a=0;a=0;d--){var h=c[d];if(h&&h.nodeType===1&&h.hasAttribute(Zu))return h}}(n),i=a!==void 0?a.nextSibling:null;r.setAttribute(Zu,"active"),r.setAttribute("data-styled-version","5.3.11");var o=rD();return o&&r.setAttribute("nonce",o),n.insertBefore(r,i),r},aD=function(){function e(n){var r=this.element=MP(n);r.appendChild(document.createTextNode("")),this.sheet=function(a){if(a.sheet)return a.sheet;for(var i=document.styleSheets,o=0,s=i.length;o=0){var a=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(a,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n0&&(b+=y+",")}),i+=""+d+h+'{content:"'+b+`"}/*!sc*/
+`}}}return i}(this)},e}(),lD=/(a)(d)/gi,Aw=function(e){return String.fromCharCode(e+(e>25?39:97))};function uy(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Aw(t%52)+n;return(Aw(t%52)+n).replace(lD,"$1-$2")}var Eu=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},TP=function(e){return Eu(5381,e)};function IP(e){for(var t=0;t>>0);if(!n.hasNameForId(a,s)){var c=r(o,"."+s,void 0,a);n.insertRules(a,s,c)}i.push(s),this.staticRulesId=s}else{for(var d=this.rules.length,h=Eu(this.baseHash,r.hash),b="",y=0;y>>0);if(!n.hasNameForId(a,E)){var C=r(b,"."+E,void 0,a);n.insertRules(a,E,C)}i.push(E)}}return i.join(" ")},e}(),dD=/^\s*\/\/.*$/gm,hD=[":","[",".","#"];function fD(e){var t,n,r,a,i=Rs,o=i.options,s=o===void 0?Rs:o,c=i.plugins,d=c===void 0?w2:c,h=new MN(s),b=[],y=function(w){function E(C){if(C)try{w(C+"}")}catch{}}return function(C,_,f,x,k,M,j,P,D,I){switch(C){case 1:if(D===0&&_.charCodeAt(0)===64)return w(_+";"),"";break;case 2:if(P===0)return _+"/*|*/";break;case 3:switch(P){case 102:case 112:return w(f[0]+_),"";default:return _+(I===0?"/*|*/":"")}case-2:_.split("/*|*/}").forEach(E)}}}(function(w){b.push(w)}),m=function(w,E,C){return E===0&&hD.indexOf(C[n.length])!==-1||C.match(a)?w:"."+t};function p(w,E,C,_){_===void 0&&(_="&");var f=w.replace(dD,""),x=E&&C?C+" "+E+" { "+f+" }":f;return t=_,n=E,r=new RegExp("\\"+n+"\\b","g"),a=new RegExp("(\\"+n+"\\b){2,}"),h(C||!E?"":E,x)}return h.use([].concat(d,[function(w,E,C){w===2&&C.length&&C[0].lastIndexOf(n)>0&&(C[0]=C[0].replace(r,m))},y,function(w){if(w===-2){var E=b;return b=[],E}}])),p.hash=d.length?d.reduce(function(w,E){return E.name||ac(15),Eu(w,E.name)},5381).toString():"",p}var AP=v.createContext();AP.Consumer;var LP=v.createContext(),pD=(LP.Consumer,new C2),dy=fD();function jP(){return U.useContext(AP)||pD}function NP(){return U.useContext(LP)||dy}var DP=function(){function e(t,n){var r=this;this.inject=function(a,i){i===void 0&&(i=dy);var o=r.name+i.hash;a.hasNameForId(r.id,o)||a.insertRules(r.id,o,i(r.rules,o,"@keyframes"))},this.toString=function(){return ac(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=dy),this.name+t.hash},e}(),gD=/([A-Z])/,mD=/([A-Z])/g,vD=/^ms-/,yD=function(e){return"-"+e.toLowerCase()};function Lw(e){return gD.test(e)?e.replace(mD,yD).replace(vD,"-ms-"):e}var jw=function(e){return e==null||e===!1||e===""};function ic(e,t,n,r){if(Array.isArray(e)){for(var a,i=[],o=0,s=e.length;o1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,wD=/(^-|-$)/g;function M5(e){return e.replace(bD,"-").replace(wD,"")}var J6=function(e){return uy(TP(e)>>>0)};function Y1(e){return typeof e=="string"&&!0}var hy=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},xD=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function CD(e,t,n){var r=e[n];hy(t)&&hy(r)?FP(r,t):e[n]=t}function FP(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(I[P]=M[P]);return I}(t,["componentId"]),k=f&&f+"-"+(Y1(_)?_:M5(Tw(_)));return zP(_,hi({},x,{attrs:y,componentId:k}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(_){this._foldedDefaultProps=r?FP({},e.defaultProps,_):_}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),a&&YN(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var Z=function(e){return function t(n,r,a){if(a===void 0&&(a=Rs),!kP.isValidElementType(r))return ac(1,String(r));var i=function(){return n(r,a,X.apply(void 0,arguments))};return i.withConfig=function(o){return t(n,r,hi({},a,{},o))},i.attrs=function(o){return t(n,r,hi({},a,{attrs:Array.prototype.concat(a.attrs,o).filter(Boolean)}))},i}(zP,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Z[e]=Z(e)});var _D=function(){function e(n,r){this.rules=n,this.componentId=r,this.isStatic=IP(n),C2.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(n,r,a,i){var o=i(ic(this.rules,r,a,i).join(""),""),s=this.componentId+n;a.insertRules(s,s,o)},t.removeStyles=function(n,r){r.clearRules(this.componentId+n)},t.renderStyles=function(n,r,a,i){n>2&&C2.registerId(this.componentId+n),this.removeStyles(n,a),this.createStyles(n,r,a,i)},e}();function gm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r-1}function yd(V,re){var pe=this.__data__,Re=yc(pe,V);return Re<0?(++this.size,pe.push([V,re])):pe[Re][1]=re,this}ca.prototype.clear=vd,ca.prototype.delete=qi,ca.prototype.get=Un,ca.prototype.has=Gr,ca.prototype.set=yd;function Bo(V){var re=-1,pe=V==null?0:V.length;for(this.clear();++re1?pe[vt-1]:void 0,Ct=vt>2?pe[2]:void 0;for(Ht=V.length>3&&typeof Ht=="function"?(vt--,Ht):void 0,Ct&&Km(pe[0],pe[1],Ct)&&(Ht=vt<3?void 0:Ht,vt=1),re=Object(re);++Re-1&&V%1==0&&V0){if(++re>=a)return arguments[0]}else re=0;return V.apply(void 0,arguments)}}function Sd(V){if(V!=null){try{return gt.call(V)}catch{}try{return V+""}catch{}}return""}function Ei(V,re){return V===re||V!==V&&re!==re}var _d=bc(function(){return arguments}())?bc:function(V){return sn(V)&&mt.call(V,"callee")&&!Et.call(V,"callee")},al=Array.isArray;function bt(V){return V!=null&&H0(V.length)&&!_c(V)}function B0(V){return sn(V)&&bt(V)}var Sc=sa||Qm;function _c(V){if(!$i(V))return!1;var re=Go(V);return re==m||re==p||re==d||re==f}function H0(V){return typeof V=="number"&&V>-1&&V%1==0&&V<=o}function $i(V){var re=typeof V;return V!=null&&(re=="object"||re=="function")}function sn(V){return V!=null&&typeof V=="object"}function kd(V){if(!sn(V)||Go(V)!=_)return!1;var re=qe(V);if(re===null)return!0;var pe=mt.call(re,"constructor")&&re.constructor;return typeof pe=="function"&&pe instanceof pe&>.call(pe)==Tn}var G0=le?Se(le):wd;function Ed(V){return yr(V,U0(V))}function U0(V){return bt(V)?Wm(V):Uo(V)}var kc=wc(function(V,re,pe){qa(V,re,pe)});function Oa(V){return function(){return V}}function V0(V){return V}function Qm(){return!1}e.exports=kc}(Ap,Ap.exports);var ED=Ap.exports;const OD=uc(ED);var fl=function(e,t){return e.reduce(function(n,r){return Object.assign(n,T({},r,t))},{})};function fy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1?t-1:0),r=1;r1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0,r=n||1e6,a=+e;return Math.min(Math.max(t,a),r)}function I5(e,t,n,r,a){return(e-t)*(a-r)/(n-t)+r}var r8=function(e){return e.replaceAll(/[^\d,]/gi,"").split(",").map(function(t){return+t})},Lp=function(e){return e?[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]:[0,0,0]},HP=function(e){return e.toString(16).padStart(2,"0")},GP=function(){for(var e=arguments.length,t=new Array(e),n=0;n.5?b/(2-s-o):b/(s+o),s){case r:c=(a-i)/b+(a0&&arguments[0]!==void 0?arguments[0]:{};return e={},T(T(T(T(T(T(T(T(T(T(e,ke.LabelExtraSmall,Ce(Ce({},We),{},{fontSize:"10px",lineHeight:"12px"},t)),ke.LabelExtraSmallEmphasis,Ce(Ce({},We),{},{fontWeight:"Bold",fontSize:"10px",lineHeight:"12px"},t)),ke.LabelExtraSmallUp,Ce(Ce({},We),{},{fontSize:"11px",lineHeight:"12px"},t)),ke.LabelSmall,Ce(Ce({},We),{},{fontSize:"12px",lineHeight:"14px"},t)),ke.LabelSmallEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"12px",lineHeight:"14px"},t)),ke.LabelSmallUp,Ce(Ce({fontSize:"13px",lineHeight:"16px"},We),t)),ke.LabelSmallUpEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"13px",lineHeight:"16px"},t)),ke.LabelMedium,Ce(Ce({fontSize:"14px",lineHeight:"16px"},We),t)),ke.LabelMediumEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"14px",lineHeight:"16px"},t)),ke.LabelLarge,Ce(Ce({},We),{},{fontSize:"16px",lineHeight:"18px"},t)),T(T(T(T(T(T(T(T(T(e,ke.LabelLargeEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"16px",lineHeight:"18px"},t)),ke.LabelLargeUp,Ce(Ce({},We),{},{fontWeight:Jt.Regular,fontSize:"18px",lineHeight:"20px"},t)),ke.LabelExtraLargeEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"24px",lineHeight:"28px"},t)),ke.LabelExtraLarge,Ce(Ce({},We),{},{fontWeight:Jt.Regular,fontSize:"24px",lineHeight:"28px"},t)),ke.LabelXExtraLargeEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"32px",lineHeight:"36px"},t)),ke.LabelXExtraLarge,Ce(Ce({},We),{},{fontSize:"32px",lineHeight:"36px"},t)),ke.LabelXXExtraLargeEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"48px",lineHeight:"54px"},t)),ke.LabelXXExtraLarge,Ce(Ce({},We),{},{fontSize:"48px",lineHeight:"54px"},t)),ke.LabelXXXExtraLarge,Ce(Ce({},We),{},{fontSize:"60px",lineHeight:"68px"},t))},BD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(T(T(T(T(T(T({},ke.TextExtraSmall,Ce(Ce({},YP()[ke.LabelExtraSmallUp]),{},{lineHeight:"14px"},e)),ke.TextSmall,Ce(Ce({},We),{},{fontSize:"12px",lineHeight:"18px"},e)),ke.TextSmallUp,Ce(Ce({},We),{},{fontSize:"13px",lineHeight:"18px"},e)),ke.TextMedium,Ce(Ce({},We),{},{fontSize:"14px",lineHeight:"20px"},e)),ke.TextLarge,Ce(Ce({},We),{},{fontSize:"16px",lineHeight:"22px"},e)),ke.TextExtraLarge,Ce(Ce({},We),{},{fontSize:"18px",lineHeight:"26px"},e)),ke.TextXExtraLarge,Ce(Ce({},We),{},{fontSize:"28px",lineHeight:"40px"},e))},HD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(T(T(T(T(T(T(T(T(T({},ke.ButtonSmEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"12px",lineHeight:"14px"},e)),ke.ButtonSm,Ce(Ce({},We),{},{fontSize:"12px",lineHeight:"14px"},e)),ke.ButtonSmUpEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"13px",lineHeight:"16px"},e)),ke.ButtonSmUp,Ce(Ce({},We),{},{fontSize:"13px",lineHeight:"16px"},e)),ke.ButtonMdEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"14px",lineHeight:"16px"},e)),ke.ButtonMd,Ce(Ce({},We),{},{fontSize:"14px",lineHeight:"16px"},e)),ke.ButtonLgEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"16px",lineHeight:"18px"},e)),ke.ButtonLg,Ce(Ce({},We),{},{fontSize:"16px",lineHeight:"18px"},e)),ke.ButtonLgUpEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"18px",lineHeight:"20px"},e)),ke.ButtonLgUp,Ce(Ce({},We),{},{fontSize:"18px",lineHeight:"20px"},e))},GD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(T(T(T(T(T(T(T(T(T({},ke.LinkSmall,Ce(Ce({},We),{},{fontSize:"12px",lineHeight:"14px"},e)),ke.LinkSmallEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"12px",lineHeight:"14px"},e)),ke.LinkSmallUp,Ce(Ce({},We),{},{fontSize:"13px",lineHeight:"16px"},e)),ke.LinkSmallUpEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"13px",lineHeight:"16px"},e)),ke.LinkMedium,Ce(Ce({},We),{},{fontSize:"14px",lineHeight:"16px"},e)),ke.LinkMediumEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"14px",lineHeight:"16px"},e)),ke.LinkLarge,Ce(Ce({},We),{},{fontSize:"16px",lineHeight:"18px"},e)),ke.LinkLargeEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"16px",lineHeight:"18px"},e)),ke.LinkLargeUp,Ce(Ce({},We),{},{fontSize:"18px",lineHeight:"20px"},e)),ke.LinkLargeUpEmphasis,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"18px",lineHeight:"20px"},e))},UD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(T(T(T({},ke.InputSm,Ce(Ce({},We),{},{fontSize:"12px",lineHeight:"14px"},e)),ke.InputSmUp,Ce(Ce({},We),{},{fontSize:"13px",lineHeight:"16px"},e)),ke.InputMd,Ce(Ce({},We),{},{fontSize:"14px",lineHeight:"16px"},e)),ke.InputLg,Ce(Ce({},We),{},{fontSize:"16px",lineHeight:"18px"},e))},VD=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return T(T(T(T(T(T({},ke.TitleH6,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"12px",lineHeight:"18px"},e)),ke.TitleH5,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"14px",lineHeight:"21px"},e)),ke.TitleH4,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"16px",lineHeight:"24px"},e)),ke.TitleH3,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"18px",lineHeight:"27px"},e)),ke.TitleH2,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"20px",lineHeight:"30px"},e)),ke.TitleH1,Ce(Ce({},We),{},{fontWeight:Jt.Medium,fontSize:"28px",lineHeight:"42px"},e))},KP=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Ce(Ce({fontFamily:We.fontFamily,baseLineHeight:1.375},e),{},{font:Ce(Ce(Ce(Ce(Ce(Ce({},YP(e)),BD(e)),HD(e)),GD(e)),UD(e)),VD(e))})},WD=gm(["@keyframes spinner{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}.Menu-open{overflow:hidden;}.Modal-open{overflow:hidden;}"]),Yr,Ir=(Yr={},T(T(T(T(T(T(T(T(T(T(Yr,L.TextPrimary,"rgba(55, 65, 75, 1)"),L.TextSecondary,"rgba(118, 138, 159, 1)"),L.TextSecondaryInvert,"rgba(213, 216, 220, 1)"),L.TextPlaceholder,"rgba(169, 182, 194, 1)"),L.TextWarning,"rgba(196, 110, 0, 1)"),L.TextError,"rgba(185, 33, 46, 1)"),L.TextInfo,"rgba(35, 117, 171, 1)"),L.AccentPrimary,"rgba(104, 121, 235, 1)"),L.AccentPrimaryHover,"rgba(96, 111, 209, 1)"),L.AccentPrimaryActive,"rgba(73, 88, 188, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.AccentPrimaryDisabled,"rgba(233, 238, 242, 1)"),L.AccentSecondaryDisabled,"#F9FBFC"),L.AccentStateless,"rgba(104, 121, 235, 1)"),L.AccentStateless_0_4_Opacity,"rgba(104, 121, 235, 0.4)"),L.Accent_0_5_Opacity,"rgba(104, 121, 235, 0.05)"),L.Accent_1_2_Opacity,"rgba(104, 121, 235, 0.12)"),L.Accent_1_8_Opacity,"rgba(104, 121, 235, 0.18)"),L.Accent_2_8_Opacity,"rgba(104, 121, 235, 0.28)"),L.Accent_4_0_Opacity,"rgba(104, 121, 235, 0.4)"),L.BackgroundGrey,"rgba(216, 224, 232, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.BackgroundStateless,"rgba(255, 255, 255, 1)"),L.BackgroundActive,"rgba(243, 247, 250, 1)"),L.BackgroundBaseLight,"rgba(235, 239, 252, 1)"),L.BackgroundBaseMedium,"rgba(227, 231, 251, 1)"),L.BackgroundPrimary,"rgba(248, 250, 251, 1)"),L.BackgroundPrimaryLight,"rgba(243, 245, 247, 1)"),L.BackgroundPrimaryHover,"rgba(239, 243, 246, 1)"),L.BackgroundPrimaryActive,"rgba(93, 109, 126, 1)"),L.BackgroundPrimary_0_5_Opacity,"rgba(255, 255, 255, 0.500)"),L.BackgroundPrimaryStateless,"#CCD6DE"),T(T(T(T(T(T(T(T(T(T(Yr,L.BackgroundSecondary,"rgba(255, 255, 255, 1)"),L.BackgroundHover,"rgba(249, 251, 252, 1)"),L.BackgroundGreen,"rgba(237, 250, 244, 1)"),L.BackgroundGreenMedium,"rgba(227, 250, 239, 1)"),L.BackgroundBlue,"rgba(244, 249, 255, 1)"),L.BackgroundRed,"rgba(253, 244, 242, 1)"),L.BackgroundRedLight,"rgba(255, 245, 245, 1)"),L.BackgroundRedMedium,"rgba(247, 228, 230, 1)"),L.BackgroundOrange,"rgba(255, 249, 242, 1)"),L.BackgroundTooltip,"rgba(79, 98, 118, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.IconsPrimary,"rgba(118, 138, 159, 1)"),L.IconsPrimaryOpacity_0_6,"rgba(93, 109, 126, 0.600)"),L.IconsSecondary,"rgba(151, 166, 182, 1)"),L.IconsPlaceholder,"rgba(223, 231, 237, 1)"),L.IconsInvert,"rgba(255, 255, 255, 1)"),L.IconsMuted,"rgba(169, 182, 194, 1)"),L.IconsPrimaryHover,"rgba(79, 98, 118, 1)"),L.IconsSecondaryHover,"rgba(118, 138, 159, 1)"),L.ButtonPrimaryText,"rgba(255, 255, 255, 1)"),L.ButtonPrimaryText_0_6,"rgba(255, 255, 255, 0.6)"),T(T(T(T(T(T(T(T(T(T(Yr,L.ButtonPrimaryText_0_4,"rgba(255, 255, 255, 0.4)"),L.ButtonDisabledText,"rgba(169, 182, 194, 1)"),L.ButtonSecondaryText,"rgba(0, 0, 0, 1)"),L.LinkPrimary,"rgba(118, 138, 159, 1)"),L.LinkStateless,"rgba(118, 138, 159, 1)"),L.LinkHover,"rgba(79, 98, 118, 1)"),L.LinkActive,"rgba(55, 65, 75, 1)"),L.LinkPressed,"rgba(104, 121, 235, 1)"),L.LinkMuted,"rgba(169, 182, 194, 1)"),L.BordersPrimary,"rgba(204, 214, 222, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.BordersPrimaryHover,"rgba(104, 118, 134, 1)"),L.BordersSecondary,"rgba(236, 240, 243, 1)"),L.BordersStrong,"rgba(204, 214, 222, 1)"),L.BordersInvert,"rgba(85, 99, 115, 1)"),L.BorderHoverBottom,"rgba(104, 121, 235, 0.18)"),L.BorderActiveBottom,"#4958BC"),L.BorderPrimaryStateless,"rgba(204, 214, 222, 1)"),L.BordersDisabled,"rgba(73, 88, 188, 0.4)"),L.BordersButton,"rgba(151, 166, 182, 1)"),L.BordersItem,"rgba(226, 232, 236, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.BordersBaseLight,"rgba(211, 219, 250, 1)"),L.BordersBaseMedium,"rgba(164, 175, 227, 1)"),L.BordersGreen,"rgba(27, 161, 99, 0.22)"),L.BordersGreenMedium,"rgba(27, 161, 99, 0.4)"),L.BordersRed,"rgba(185, 33, 46, 0.4)"),L.ActiveSecondary,"#FFFFFF"),L.ActiveSecondaryHover,"rgba(104, 121, 235, 0.05)"),L.Error,"rgba(246, 61, 61, 1)"),L.Error_0_28_Opacity,"rgba(185, 33, 46, 0.28)"),L.Error_0_12_Opacity,"rgba(255, 86, 78, 0.1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.ErrorHover,"rgba(216, 46, 46, 1)"),L.ErrorActive,"rgba(185, 33, 46, 1)"),L.Success,"rgba(38, 193, 122, 1)"),L.SuccessHover,"rgba(30, 154, 98, 1)"),L.SuccessActive,"rgba(23, 116, 73, 1)"),L.Warning,"rgba(255, 172, 74, 1)"),L.WarningHover,"rgba(237, 145, 7, 1)"),L.WarningActive,"rgba(224, 135, 0, 1)"),L.Info,"rgba(41, 127, 184, 1)"),L.Modified,"rgba(165, 166, 246, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.Red,"rgba(219, 46, 50, 1)"),L.Orange,"rgba(255, 168, 0, 1)"),L.Salad,"rgba(143, 176, 33, 1)"),L.Green,"rgba(22, 160, 134, 1)"),L.Blue,"rgba(41, 127, 184, 1)"),L.Indigo,"rgba(91, 72, 162, 1)"),L.Violet,"rgba(141, 68, 173, 1)"),L.Pink,"rgba(211, 92, 158, 1)"),L.GradientRight,"linear-gradient(270deg, #FFFFFF 1.56%, rgba(255, 255, 255, 0.89) 52.4%, rgba(255, 255, 255, 0.532165) 76.04%, rgba(255, 255, 255, 0) 100%)"),L.Extra_0_3_Overlay,"rgba(79, 98, 118, 0.3)"),T(T(T(T(T(T(T(T(T(T(Yr,L.GradientRightActive,"linear-gradient(270deg, #F3F7FA 1.56%, #F3F7FA 52.4%, rgba(243, 247, 250, 0.53) 76.04%, rgba(243, 247, 250, 0) 100%)"),L.GradientRightHover,"linear-gradient(270deg, #F9FBFC 1.56%, #F9FBFC 52.4%, rgba(249, 251, 252, 0.53) 76.04%, rgba(249, 251, 252, 0) 100%)"),L.Extra_0_5_Overlay,"rgba(79, 98, 118, 0.5)"),L.Extra_0_7_Overlay,"rgba(79, 98, 118, 0.7)"),L.Extra_0_9_Overlay,"rgba(79, 98, 118, 0.9)"),L.Red_0_1_Overlay,"rgba(232, 91, 70, 0.1)"),L.Orange_0_1_Overlay,"rgba(250, 157, 47, 0.1)"),L.Accent_0_8_Overlay,"rgba(104, 121, 235, 0.08)"),L.Link,"rgba(250, 166, 68, 1)"),L.Camera,"rgba(73, 186, 224, 1)"),T(T(T(T(T(T(T(T(T(T(Yr,L.GoogleDrive,"rgba(81, 136, 238, 1)"),L.Dropbox,"rgba(17, 40, 124, 1)"),L.OneDrive,"rgba(40, 100, 186, 1)"),L.Device,"rgba(102, 73, 209, 1)"),L.Instagram,"rgba(244, 70, 154, 1)"),L.Unsplash,"rgba(173, 38, 220, 1)"),L.FreeImages,"rgba(16, 163, 135, 1)"),L.FreeIcons,"rgba(62, 207, 139, 1)"),L.Canvas,"rgba(36, 190, 202, 1)"),L.Box,"rgba(0, 97, 213, 1)"),T(T(T(T(T(T(T(Yr,L.ScreenCast,"rgba(48, 61, 78, 1)"),L.Tag,"#889AAC"),L.StatesErrorDisabledText,"rgba(185, 33, 46, 0.3)"),L.LightShadow,"rgba(146, 166, 188, 0.2)"),L.MediumShadow,"rgba(146, 166, 188, 0.24)"),L.LargeShadow,"rgba(146, 166, 188, 0.32)"),L.XLargeShadow,"rgba(146, 166, 188, 0.5)")),XD=Ir,D5,YD=(D5={},T(T(T(T(T(T(T(T(T(T(D5,qr.ShadowSm,"0px 1px 2px 0px rgba(146, 166, 188, 0.2)"),qr.ShadowMd," 0px 1px 4px 0px rgba(146, 166, 188, 0.24)"),qr.ShadowLg," 0px 2px 6px 0px rgba(146, 166, 188, 0.32)"),qr.ShadowXl," 0px 2px 6px 0px rgba(146, 166, 188, 0.5)"),qr.Label," 0px 1px 3px 0px rgba(77, 78, 78, 0.15)"),qr.Header," 0px 6px 10px 0px rgba(146, 166, 188, 0.2)"),qr.HeaderPopup," 0px 3px 7px 0px rgba(146, 166, 188, 0.16)"),qr.FooterPopup," 0px -4px 8px 0px rgba(208, 215, 220, 0.22)"),qr.LeftPanelMd," 6px 8px 12px 0px rgba(146, 166, 188, 0.14)"),qr.RightPanelMd,"-6px 8px 12px 0px rgba(146, 166, 188, 0.14)"),T(T(D5,qr.LeftPanelSm,"6px -4px 12px 0px rgba(146, 166, 188, 0.14)"),qr.RightPanelSm,"-6px -4px 12px 0px rgba(146, 166, 188, 0.14)")),KD=YD,Gw={keys:[Nn.Xs,Nn.Sm,Nn.Md,Nn.Lg,Nn.Xl],values:T(T(T(T(T(T(T({},Nn.Xs,0),Nn.Sm,576),Nn.Md,768),Nn.Lg,1084),Nn.Xl,1342),Nn.Xxl,1600),Nn.Xxxl,1920),classes:T(T(T(T(T(T(T({},Nn.Xs,".sfx-breakpoint-xs"),Nn.Sm,".sfx-breakpoint-sm"),Nn.Md,".sfx-breakpoint-md"),Nn.Lg,".sfx-breakpoint-lg"),Nn.Xl,".sfx-breakpoint-xl"),Nn.Xxl,".sfx-breakpoint-xxl"),Nn.Xxxl,".sfx-breakpoint-xxxl"),getBreakpointClass:function(){return""},up:function(){return""},down:function(){return""},between:function(){return""},only:function(){return""}},ZD=function(e){var t=e.values,n=t===void 0?Gw.values:t,r=e.classes,a=r===void 0?Gw.classes:r,i="px",o=Object.keys(n),s=function(y){var m=typeof n[y]=="number"?n[y]:y;return"@media (min-width:".concat(m).concat(i,")")},c=function(y){var m=n[y];return"@media (max-width:".concat(m).concat(i,")")},d=function(y,m){var p=o.indexOf(m);return"@media (min-width:".concat(n[y]).concat(i,") and (max-width:").concat(n[o[p]]).concat(i,")")},h=function(y){return o.indexOf(y)+1=n.xs&&y=n.sm&&y=n.md&&y=n.lg&&y=n.xl&&y=n.xxl&&y=n.xxxl?m?p(a.xxxl):a.xxxl:m?p(a.md):a.md};return{keys:o,values:n,classes:a,getBreakpointClass:b,up:s,down:c,between:d,only:h}};function Uw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function vs(e){for(var t=1;t{e.Konva[a.prototype.getClassName()]=a};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(ct);var Cn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=ct;class n{constructor(x=[1,0,0,1,0,0]){this.dirty=!1,this.m=x&&x.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 n(this.m)}copyInto(x){x.m[0]=this.m[0],x.m[1]=this.m[1],x.m[2]=this.m[2],x.m[3]=this.m[3],x.m[4]=this.m[4],x.m[5]=this.m[5]}point(x){var k=this.m;return{x:k[0]*x.x+k[2]*x.y+k[4],y:k[1]*x.x+k[3]*x.y+k[5]}}translate(x,k){return this.m[4]+=this.m[0]*x+this.m[2]*k,this.m[5]+=this.m[1]*x+this.m[3]*k,this}scale(x,k){return this.m[0]*=x,this.m[1]*=x,this.m[2]*=k,this.m[3]*=k,this}rotate(x){var k=Math.cos(x),M=Math.sin(x),j=this.m[0]*k+this.m[2]*M,P=this.m[1]*k+this.m[3]*M,D=this.m[0]*-M+this.m[2]*k,I=this.m[1]*-M+this.m[3]*k;return this.m[0]=j,this.m[1]=P,this.m[2]=D,this.m[3]=I,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(x,k){var M=this.m[0]+this.m[2]*k,j=this.m[1]+this.m[3]*k,P=this.m[2]+this.m[0]*x,D=this.m[3]+this.m[1]*x;return this.m[0]=M,this.m[1]=j,this.m[2]=P,this.m[3]=D,this}multiply(x){var k=this.m[0]*x.m[0]+this.m[2]*x.m[1],M=this.m[1]*x.m[0]+this.m[3]*x.m[1],j=this.m[0]*x.m[2]+this.m[2]*x.m[3],P=this.m[1]*x.m[2]+this.m[3]*x.m[3],D=this.m[0]*x.m[4]+this.m[2]*x.m[5]+this.m[4],I=this.m[1]*x.m[4]+this.m[3]*x.m[5]+this.m[5];return this.m[0]=k,this.m[1]=M,this.m[2]=j,this.m[3]=P,this.m[4]=D,this.m[5]=I,this}invert(){var x=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),k=this.m[3]*x,M=-this.m[1]*x,j=-this.m[2]*x,P=this.m[0]*x,D=x*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),I=x*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=k,this.m[1]=M,this.m[2]=j,this.m[3]=P,this.m[4]=D,this.m[5]=I,this}getMatrix(){return this.m}decompose(){var x=this.m[0],k=this.m[1],M=this.m[2],j=this.m[3],P=this.m[4],D=this.m[5],I=x*j-k*M;let R={x:P,y:D,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(x!=0||k!=0){var H=Math.sqrt(x*x+k*k);R.rotation=k>0?Math.acos(x/H):-Math.acos(x/H),R.scaleX=H,R.scaleY=I/H,R.skewX=(x*M+k*j)/I,R.skewY=0}else if(M!=0||j!=0){var B=Math.sqrt(M*M+j*j);R.rotation=Math.PI/2-(j>0?Math.acos(-M/B):-Math.acos(M/B)),R.scaleX=I/B,R.scaleY=B,R.skewX=0,R.skewY=(x*M+k*j)/I}return R.rotation=e.Util._getRotation(R.rotation),R}}e.Transform=n;var r="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",s=Math.PI/180,c=180/Math.PI,d="#",h="",b="0",y="Konva warning: ",m="Konva error: ",p="rgb(",w={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},E=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,C=[];const _=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(f){setTimeout(f,60)};e.Util={_isElement(f){return!!(f&&f.nodeType==1)},_isFunction(f){return!!(f&&f.constructor&&f.call&&f.apply)},_isPlainObject(f){return!!f&&f.constructor===Object},_isArray(f){return Object.prototype.toString.call(f)===r},_isNumber(f){return Object.prototype.toString.call(f)===a&&!isNaN(f)&&isFinite(f)},_isString(f){return Object.prototype.toString.call(f)===i},_isBoolean(f){return Object.prototype.toString.call(f)===o},isObject(f){return f instanceof Object},isValidSelector(f){if(typeof f!="string")return!1;var x=f[0];return x==="#"||x==="."||x===x.toUpperCase()},_sign(f){return f===0||f>0?1:-1},requestAnimFrame(f){C.push(f),C.length===1&&_(function(){const x=C;C=[],x.forEach(function(k){k()})})},createCanvasElement(){var f=document.createElement("canvas");try{f.style=f.style||{}}catch{}return f},createImageElement(){return document.createElement("img")},_isInDocument(f){for(;f=f.parentNode;)if(f==document)return!0;return!1},_urlToImage(f,x){var k=e.Util.createImageElement();k.onload=function(){x(k)},k.src=f},_rgbToHex(f,x,k){return((1<<24)+(f<<16)+(x<<8)+k).toString(16).slice(1)},_hexToRgb(f){f=f.replace(d,h);var x=parseInt(f,16);return{r:x>>16&255,g:x>>8&255,b:x&255}},getRandomColor(){for(var f=(Math.random()*16777215<<0).toString(16);f.length<6;)f=b+f;return d+f},getRGB(f){var x;return f in w?(x=w[f],{r:x[0],g:x[1],b:x[2]}):f[0]===d?this._hexToRgb(f.substring(1)):f.substr(0,4)===p?(x=E.exec(f.replace(/ /g,"")),{r:parseInt(x[1],10),g:parseInt(x[2],10),b:parseInt(x[3],10)}):{r:0,g:0,b:0}},colorToRGBA(f){return f=f||"black",e.Util._namedColorToRBA(f)||e.Util._hex3ColorToRGBA(f)||e.Util._hex4ColorToRGBA(f)||e.Util._hex6ColorToRGBA(f)||e.Util._hex8ColorToRGBA(f)||e.Util._rgbColorToRGBA(f)||e.Util._rgbaColorToRGBA(f)||e.Util._hslColorToRGBA(f)},_namedColorToRBA(f){var x=w[f.toLowerCase()];return x?{r:x[0],g:x[1],b:x[2],a:1}:null},_rgbColorToRGBA(f){if(f.indexOf("rgb(")===0){f=f.match(/rgb\(([^)]+)\)/)[1];var x=f.split(/ *, */).map(Number);return{r:x[0],g:x[1],b:x[2],a:1}}},_rgbaColorToRGBA(f){if(f.indexOf("rgba(")===0){f=f.match(/rgba\(([^)]+)\)/)[1];var x=f.split(/ *, */).map((k,M)=>k.slice(-1)==="%"?M===3?parseInt(k)/100:parseInt(k)/100*255:Number(k));return{r:x[0],g:x[1],b:x[2],a:x[3]}}},_hex8ColorToRGBA(f){if(f[0]==="#"&&f.length===9)return{r:parseInt(f.slice(1,3),16),g:parseInt(f.slice(3,5),16),b:parseInt(f.slice(5,7),16),a:parseInt(f.slice(7,9),16)/255}},_hex6ColorToRGBA(f){if(f[0]==="#"&&f.length===7)return{r:parseInt(f.slice(1,3),16),g:parseInt(f.slice(3,5),16),b:parseInt(f.slice(5,7),16),a:1}},_hex4ColorToRGBA(f){if(f[0]==="#"&&f.length===5)return{r:parseInt(f[1]+f[1],16),g:parseInt(f[2]+f[2],16),b:parseInt(f[3]+f[3],16),a:parseInt(f[4]+f[4],16)/255}},_hex3ColorToRGBA(f){if(f[0]==="#"&&f.length===4)return{r:parseInt(f[1]+f[1],16),g:parseInt(f[2]+f[2],16),b:parseInt(f[3]+f[3],16),a:1}},_hslColorToRGBA(f){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(f)){const[x,...k]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(f),M=Number(k[0])/360,j=Number(k[1])/100,P=Number(k[2])/100;let D,I,R;if(j===0)return R=P*255,{r:Math.round(R),g:Math.round(R),b:Math.round(R),a:1};P<.5?D=P*(1+j):D=P+j-P*j;const H=2*P-D,B=[0,0,0];for(let $=0;$<3;$++)I=M+1/3*-($-1),I<0&&I++,I>1&&I--,6*I<1?R=H+(D-H)*6*I:2*I<1?R=D:3*I<2?R=H+(D-H)*(2/3-I)*6:R=H,B[$]=R*255;return{r:Math.round(B[0]),g:Math.round(B[1]),b:Math.round(B[2]),a:1}}},haveIntersection(f,x){return!(x.x>f.x+f.width||x.x+x.widthf.y+f.height||x.y+x.height1?(D=k,I=M,R=(k-j)*(k-j)+(M-P)*(M-P)):(D=f+B*(k-f),I=x+B*(M-x),R=(D-j)*(D-j)+(I-P)*(I-P))}return[D,I,R]},_getProjectionToLine(f,x,k){var M=e.Util.cloneObject(f),j=Number.MAX_VALUE;return x.forEach(function(P,D){if(!(!k&&D===x.length-1)){var I=x[(D+1)%x.length],R=e.Util._getProjectionToSegment(P.x,P.y,I.x,I.y,f.x,f.y),H=R[0],B=R[1],$=R[2];$x.length){var D=x;x=f,f=D}for(M=0;M{x.width=0,x.height=0})},drawRoundedRectPath(f,x,k,M){let j=0,P=0,D=0,I=0;typeof M=="number"?j=P=D=I=Math.min(M,x/2,k/2):(j=Math.min(M[0]||0,x/2,k/2),P=Math.min(M[1]||0,x/2,k/2),I=Math.min(M[2]||0,x/2,k/2),D=Math.min(M[3]||0,x/2,k/2)),f.moveTo(j,0),f.lineTo(x-P,0),f.arc(x-P,P,P,Math.PI*3/2,0,!1),f.lineTo(x,k-I),f.arc(x-I,k-I,I,0,Math.PI/2,!1),f.lineTo(D,k),f.arc(D,k-D,D,Math.PI/2,Math.PI,!1),f.lineTo(0,j),f.arc(j,j,j,Math.PI,Math.PI*3/2,!1)}}})(Cn);var dn={},dt={},Be={};Object.defineProperty(Be,"__esModule",{value:!0}),Be.getComponentValidator=Be.getBooleanValidator=Be.getNumberArrayValidator=Be.getFunctionValidator=Be.getStringOrGradientValidator=Be.getStringValidator=Be.getNumberOrAutoValidator=Be.getNumberOrArrayOfNumbersValidator=Be.getNumberValidator=Be.alphaComponent=Be.RGBComponent=void 0;const Lo=ct,Pn=Cn;function jo(e){return Pn.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||Pn.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function JD(e){return e>255?255:e<0?0:Math.round(e)}Be.RGBComponent=JD;function eR(e){return e>1?1:e<1e-4?1e-4:e}Be.alphaComponent=eR;function tR(){if(Lo.Konva.isUnminified)return function(e,t){return Pn.Util._isNumber(e)||Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Be.getNumberValidator=tR;function nR(e){if(Lo.Konva.isUnminified)return function(t,n){let r=Pn.Util._isNumber(t),a=Pn.Util._isArray(t)&&t.length==e;return!r&&!a&&Pn.Util.warn(jo(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+e+")"),t}}Be.getNumberOrArrayOfNumbersValidator=nR;function rR(){if(Lo.Konva.isUnminified)return function(e,t){var n=Pn.Util._isNumber(e),r=e==="auto";return n||r||Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Be.getNumberOrAutoValidator=rR;function aR(){if(Lo.Konva.isUnminified)return function(e,t){return Pn.Util._isString(e)||Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Be.getStringValidator=aR;function iR(){if(Lo.Konva.isUnminified)return function(e,t){const n=Pn.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Be.getStringOrGradientValidator=iR;function oR(){if(Lo.Konva.isUnminified)return function(e,t){return Pn.Util._isFunction(e)||Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Be.getFunctionValidator=oR;function sR(){if(Lo.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(Pn.Util._isArray(e)?e.forEach(function(r){Pn.Util._isNumber(r)||Pn.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Be.getNumberArrayValidator=sR;function lR(){if(Lo.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||Pn.Util.warn(jo(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Be.getBooleanValidator=lR;function cR(e){if(Lo.Konva.isUnminified)return function(t,n){return t==null||Pn.Util.isObject(t)||Pn.Util.warn(jo(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Be.getComponentValidator=cR,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=Cn,n=Be;var r="get",a="set";e.Factory={addGetterSetter(i,o,s,c,d){e.Factory.addGetter(i,o,s),e.Factory.addSetter(i,o,c,d),e.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,s){var c=r+t.Util._capitalize(o);i.prototype[c]=i.prototype[c]||function(){var d=this.attrs[o];return d===void 0?s:d}},addSetter(i,o,s,c){var d=a+t.Util._capitalize(o);i.prototype[d]||e.Factory.overWriteSetter(i,o,s,c)},overWriteSetter(i,o,s,c){var d=a+t.Util._capitalize(o);i.prototype[d]=function(h){return s&&h!==void 0&&h!==null&&(h=s.call(this,h,o)),this._setAttr(o,h),c&&c.call(this),this}},addComponentsGetterSetter(i,o,s,c,d){var h=s.length,b=t.Util._capitalize,y=r+b(o),m=a+b(o),p,w;i.prototype[y]=function(){var C={};for(p=0;p{this._setAttr(o+b(x),void 0)}),this._fireChangeEvent(o,_,C),d&&d.call(this),this},e.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){var s=t.Util._capitalize(o),c=a+s,d=r+s;i.prototype[o]=function(){return arguments.length?(this[c](arguments[0]),this):this[d]()}},addDeprecatedGetterSetter(i,o,s,c){t.Util.error("Adding deprecated "+o);var d=r+t.Util._capitalize(o),h=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";i.prototype[d]=function(){t.Util.error(h);var b=this.attrs[o];return b===void 0?s:b},e.Factory.addSetter(i,o,c,function(){t.Util.error(h)}),e.Factory.addOverloadedGetterSetter(i,o)},backCompat(i,o){t.Util.each(o,function(s,c){var d=i.prototype[c],h=r+t.Util._capitalize(s),b=a+t.Util._capitalize(s);function y(){d.apply(this,arguments),t.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+c+'" instead.')}i.prototype[s]=y,i.prototype[h]=y,i.prototype[b]=y})},afterSetFilter(){this._filterUpToDate=!1}}}(dt);var fi={},Co={};Object.defineProperty(Co,"__esModule",{value:!0}),Co.HitContext=Co.SceneContext=Co.Context=void 0;const JP=Cn,uR=ct;function dR(e){var t=[],n=e.length,r=JP.Util,a,i;for(a=0;atypeof d=="number"?Math.floor(d):d)),a+=hR+c.join(Vw)+fR)):(a+=o.property,e||(a+=yR+o.val)),a+=mR;return a}clearTrace(){this.traceArr=[]}_trace(e){var t=this.traceArr,n;t.push(e),n=t.length,n>=wR&&t.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var t=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,t.getWidth()/t.pixelRatio,t.getHeight()/t.pixelRatio)}_applyLineCap(e){const t=e.attrs.lineCap;t&&this.setAttr("lineCap",t)}_applyOpacity(e){var t=e.getAbsoluteOpacity();t!==1&&this.setAttr("globalAlpha",t)}_applyLineJoin(e){const t=e.attrs.lineJoin;t&&this.setAttr("lineJoin",t)}setAttr(e,t){this._context[e]=t}arc(e,t,n,r,a,i){this._context.arc(e,t,n,r,a,i)}arcTo(e,t,n,r,a){this._context.arcTo(e,t,n,r,a)}beginPath(){this._context.beginPath()}bezierCurveTo(e,t,n,r,a,i){this._context.bezierCurveTo(e,t,n,r,a,i)}clearRect(e,t,n,r){this._context.clearRect(e,t,n,r)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,t){var n=arguments;if(n.length===2)return this._context.createImageData(e,t);if(n.length===1)return this._context.createImageData(e)}createLinearGradient(e,t,n,r){return this._context.createLinearGradient(e,t,n,r)}createPattern(e,t){return this._context.createPattern(e,t)}createRadialGradient(e,t,n,r,a,i){return this._context.createRadialGradient(e,t,n,r,a,i)}drawImage(e,t,n,r,a,i,o,s,c){var d=arguments,h=this._context;d.length===3?h.drawImage(e,t,n):d.length===5?h.drawImage(e,t,n,r,a):d.length===9&&h.drawImage(e,t,n,r,a,i,o,s,c)}ellipse(e,t,n,r,a,i,o,s){this._context.ellipse(e,t,n,r,a,i,o,s)}isPointInPath(e,t,n,r){return n?this._context.isPointInPath(n,e,t,r):this._context.isPointInPath(e,t,r)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,t,n,r){this._context.fillRect(e,t,n,r)}strokeRect(e,t,n,r){this._context.strokeRect(e,t,n,r)}fillText(e,t,n,r){r?this._context.fillText(e,t,n,r):this._context.fillText(e,t,n)}measureText(e){return this._context.measureText(e)}getImageData(e,t,n,r){return this._context.getImageData(e,t,n,r)}lineTo(e,t){this._context.lineTo(e,t)}moveTo(e,t){this._context.moveTo(e,t)}rect(e,t,n,r){this._context.rect(e,t,n,r)}roundRect(e,t,n,r,a){this._context.roundRect(e,t,n,r,a)}putImageData(e,t,n){this._context.putImageData(e,t,n)}quadraticCurveTo(e,t,n,r){this._context.quadraticCurveTo(e,t,n,r)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,t){this._context.scale(e,t)}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,t,n,r,a,i){this._context.setTransform(e,t,n,r,a,i)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,t,n,r){this._context.strokeText(e,t,n,r)}transform(e,t,n,r,a,i){this._context.transform(e,t,n,r,a,i)}translate(e,t){this._context.translate(e,t)}_enableTrace(){var e=this,t=Ww.length,n=this.setAttr,r,a,i=function(o){var s=e[o],c;e[o]=function(){return a=dR(Array.prototype.slice.call(arguments,0)),c=s.apply(e,arguments),e._trace({method:o,args:a}),c}};for(r=0;r{a.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(a=>{r=a.node}),r},_dragElements:new Map,_drag(r){const a=[];e.DD._dragElements.forEach((i,o)=>{const{node:s}=i,c=s.getStage();c.setPointersPositions(r),i.pointerId===void 0&&(i.pointerId=n.Util._getFirstPointerId(r));const d=c._changedPointerPositions.find(y=>y.id===i.pointerId);if(d){if(i.dragStatus!=="dragging"){var h=s.dragDistance(),b=Math.max(Math.abs(d.x-i.startPointerPos.x),Math.abs(d.y-i.startPointerPos.y));if(b{i.fire("dragmove",{type:"dragmove",target:i,evt:r},!0)})},_endDragBefore(r){const a=[];e.DD._dragElements.forEach(i=>{const{node:o}=i,s=o.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(d=>d.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,i.dragStatus="stopped");const c=i.node.getLayer()||i.node instanceof t.Konva.Stage&&i.node;c&&a.indexOf(c)===-1&&a.push(c)}),a.forEach(i=>{i.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((a,i)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:r},!0),a.dragStatus!=="dragging"&&e.DD._dragElements.delete(i)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(mm),Object.defineProperty(dn,"__esModule",{value:!0}),dn.Node=void 0;const wt=Cn,Sh=dt,Qd=fi,ts=ct,Da=mm,Ln=Be;var Np="absoluteOpacity",Q1="allEventListeners",go="absoluteTransform",Xw="absoluteScale",gl="canvas",PR="Change",MR="children",TR="konva",gy="listening",Yw="mouseenter",Kw="mouseleave",Zw="set",qw="Shape",Dp=" ",Qw="stage",ys="transform",IR="Stage",my="visible",AR=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Dp);let LR=1,rt=class vy{constructor(t){this._id=LR++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===ys||t===go)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),a=t===ys||t===go,i=r===void 0||a&&r.dirty===!0;return i&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const a=n.map(i=>i+"Change.konva").join(Dp);this.on(a,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(gl)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===go&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(gl)){const{scene:t,filter:n,hit:r}=this._cache.get(gl);wt.Util.releaseCanvas(t,n,r),this._cache.delete(gl)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var a=Math.ceil(n.width||r.width),i=Math.ceil(n.height||r.height),o=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,c=n.y===void 0?Math.floor(r.y):n.y,d=n.offset||0,h=n.drawBorder||!1,b=n.hitCanvasPixelRatio||1;if(!a||!i){wt.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const y=Math.abs(Math.round(r.x)-s)>.5?1:0,m=Math.abs(Math.round(r.y)-c)>.5?1:0;a+=d*2+y,i+=d*2+m,s-=d,c-=d;var p=new Qd.SceneCanvas({pixelRatio:o,width:a,height:i}),w=new Qd.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),E=new Qd.HitCanvas({pixelRatio:b,width:a,height:i}),C=p.getContext(),_=E.getContext();return E.isCache=!0,p.isCache=!0,this._cache.delete(gl),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(p.getContext()._context.imageSmoothingEnabled=!1,w.getContext()._context.imageSmoothingEnabled=!1),C.save(),_.save(),C.translate(-s,-c),_.translate(-s,-c),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Np),this._clearSelfAndDescendantCache(Xw),this.drawScene(p,this),this.drawHit(E,this),this._isUnderCache=!1,C.restore(),_.restore(),h&&(C.save(),C.beginPath(),C.rect(0,0,a,i),C.closePath(),C.setAttr("strokeStyle","red"),C.setAttr("lineWidth",5),C.stroke(),C.restore()),this._cache.set(gl,{scene:p,filter:w,hit:E,x:s,y:c}),this._requestDraw(),this}isCached(){return this._cache.has(gl)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],a=1/0,i=1/0,o=-1/0,s=-1/0,c=this.getAbsoluteTransform(n);return r.forEach(function(d){var h=c.point(d);a===void 0&&(a=o=h.x,i=s=h.y),a=Math.min(a,h.x),i=Math.min(i,h.y),o=Math.max(o,h.x),s=Math.max(s,h.y)}),{x:a,y:i,width:o-a,height:s-i}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),a=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/a,r.height/a),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,a=n.filter,i=a.getContext(),o,s,c,d;if(t){if(!this._filterUpToDate){var h=r.pixelRatio;a.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(o=t.length,i.clear(),i.drawImage(r._canvas,0,0,r.getWidth()/h,r.getHeight()/h),s=i.getImageData(0,0,a.getWidth(),a.getHeight()),c=0;c{var n,r;if(!t)return this;for(n in t)n!==MR&&(r=Zw+wt.Util._capitalize(n),wt.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(gy,this._isListening)}_isListening(t){if(!this.listening())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isListening(t):!0}isVisible(){return this._getCache(my,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const n=this.getParent();return n&&n!==t&&this!==t?n._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),a=!1;Da.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===r)&&(a=!0)});var i=!n&&!ts.Konva.hitOnDragEnabled&&(a||ts.Konva.isTransforming());return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,a,i,o,s;function c(h){for(a=[],i=h.length,o=0;o0&&a[0].getDepth()<=t&&c(a)}const d=this.getStage();return n.nodeType!==IR&&d&&c(d.getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(ys),this._clearSelfAndDescendantCache(go)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const t=this.getStage();if(!t)return null;var n=t.getPointerPosition();if(!n)return null;var r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var a=this.getAbsoluteTransform(t).getMatrix(),i=new wt.Transform,o=this.offset();return i.m=a.slice(),i.translate(o.x,o.y),i.getTranslation()}setAbsolutePosition(t){const{x:n,y:r,...a}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(ys);var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(t.x,t.y),t={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(a),this.setPosition({x:t.x,y:t.y}),this._clearCache(ys),this._clearSelfAndDescendantCache(go),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,t}move(t){var n=t.x,r=t.y,a=this.x(),i=this.y();return n!==void 0&&(a+=n),r!==void 0&&(i+=r),this.setPosition({x:a,y:i}),this}_eachAncestorReverse(t,n){var r=[],a=this.getParent(),i,o;if(!(n&&n._id===this._id)){for(r.unshift(this);a&&(!n||a._id!==n._id);)r.unshift(a),a=a.parent;for(i=r.length,o=0;o0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return wt.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return wt.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&wt.Util.warn("Unexpected value "+t+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Np,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t=this.getAttrs(),n,r,a,i,o;const s={attrs:{},className:this.getClassName()};for(n in t)r=t[n],o=wt.Util.isObject(r)&&!wt.Util._isPlainObject(r)&&!wt.Util._isArray(r),!o&&(a=typeof this[n]=="function"&&this[n],delete t[n],i=a?a.call(this):null,t[n]=r,i!==r&&(s.attrs[n]=r));return wt.Util._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var a=[];n&&this._isMatch(t)&&a.push(this);for(var i=this.parent;i;){if(i===r)return a;i._isMatch(t)&&a.push(i),i=i.parent}return a}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,a,i;for(a=0;a{try{const a=t?.callback;a&&delete t.callback,wt.Util._urlToImage(this.toDataURL(t),function(i){n(i),a?.(i)})}catch(a){r(a)}})}toBlob(t){return new Promise((n,r)=>{try{const a=t?.callback;a&&delete t.callback,this.toCanvas(t).toBlob(i=>{n(i),a?.(i)},t?.mimeType,t?.quality)}catch(a){r(a)}})}setSize(t){return this.width(t.width),this.height(t.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():ts.Konva.dragDistance}_off(t,n,r){var a=this.eventListeners[t],i,o,s;for(i=0;i=0;if(r&&!this.isDragging()){var a=!1;Da.DD._dragElements.forEach(i=>{this.isAncestorOf(i.node)&&(a=!0)}),a||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=Da.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",a=n&&n.dragStatus==="ready";r?this.stopDrag():a&&Da.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return wt.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return wt.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=vy.prototype.getClassName.call(t),a=t.children,i,o,s;n&&(t.attrs.container=n),ts.Konva[r]||(wt.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const c=ts.Konva[r];if(i=new c(t.attrs),a)for(o=a.length,s=0;s0}removeChildren(){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 t=0;t0?t[0]:void 0}_generalFind(e,t){var n=[];return this._descendants(r=>{const a=r._isMatch(e);return a&&n.push(r),!!(a&&t)}),n}_descendants(e){let t=!1;const n=this.getChildren();for(const r of n)if(t=e(r),t||r.hasChildren()&&(t=r._descendants(e),t))return!0;return!1}toObject(){var e=R5.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(t=>{e.children.push(t.toObject())}),e}isAncestorOf(e){for(var t=e.getParent();t;){if(t._id===this._id)return!0;t=t.getParent()}return!1}clone(e){var t=R5.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(n){t.add(n.clone())}),t}getAllIntersections(e){var t=[];return this.find("Shape").forEach(n=>{n.isVisible()&&n.intersects(e)&&t.push(n)}),t}_clearSelfAndDescendantCache(e){var t;super._clearSelfAndDescendantCache(e),!this.isCached()&&((t=this.children)===null||t===void 0||t.forEach(function(n){n._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(t,n){t.index=n}),this._requestDraw()}drawScene(e,t,n){var r=this.getLayer(),a=e||r&&r.getCanvas(),i=a&&a.getContext(),o=this._getCanvasCache(),s=o&&o.scene,c=a&&a.isCache;if(!this.isVisible()&&!c)return this;if(s){i.save();var d=this.getAbsoluteTransform(t).getMatrix();i.transform(d[0],d[1],d[2],d[3],d[4],d[5]),this._drawCachedSceneCanvas(i),i.restore()}else this._drawChildren("drawScene",a,t,n);return this}drawHit(e,t){if(!this.shouldDrawHit(t))return this;var n=this.getLayer(),r=e||n&&n.hitCanvas,a=r&&r.getContext(),i=this._getCanvasCache(),o=i&&i.hit;if(o){a.save();var s=this.getAbsoluteTransform(t).getMatrix();a.transform(s[0],s[1],s[2],s[3],s[4],s[5]),this._drawCachedHitCanvas(a),a.restore()}else this._drawChildren("drawHit",r,t);return this}_drawChildren(e,t,n,r){var a,i=t&&t.getContext(),o=this.clipWidth(),s=this.clipHeight(),c=this.clipFunc(),d=typeof o=="number"&&typeof s=="number"||c;const h=n===this;if(d){i.save();var b=this.getAbsoluteTransform(n),y=b.getMatrix();i.transform(y[0],y[1],y[2],y[3],y[4],y[5]),i.beginPath();let E;if(c)E=c.call(this,i,this);else{var m=this.clipX(),p=this.clipY();i.rect(m||0,p||0,o,s)}i.clip.apply(i,E),y=b.copy().invert().getMatrix(),i.transform(y[0],y[1],y[2],y[3],y[4],y[5])}var w=!h&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";w&&(i.save(),i._applyGlobalCompositeOperation(this)),(a=this.children)===null||a===void 0||a.forEach(function(E){E[e](t,n,r)}),w&&i.restore(),d&&i.restore()}getClientRect(e={}){var t,n=e.skipTransform,r=e.relativeTo,a,i,o,s,c={x:1/0,y:1/0,width:0,height:0},d=this;(t=this.children)===null||t===void 0||t.forEach(function(p){if(p.visible()){var w=p.getClientRect({relativeTo:d,skipShadow:e.skipShadow,skipStroke:e.skipStroke});w.width===0&&w.height===0||(a===void 0?(a=w.x,i=w.y,o=w.x+w.width,s=w.y+w.height):(a=Math.min(a,w.x),i=Math.min(i,w.y),o=Math.max(o,w.x+w.width),s=Math.max(s,w.y+w.height)))}});for(var h=this.find("Shape"),b=!1,y=0;yW.indexOf("pointer")>=0?"pointer":W.indexOf("touch")>=0?"touch":"mouse",J=W=>{const N=te(W);if(N==="pointer")return a.Konva.pointerEventsEnabled&&Q.pointer;if(N==="touch")return Q.touch;if(N==="mouse")return Q.mouse};function ee(W={}){return(W.clipFunc||W.clipWidth||W.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),W}const ie="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);";e.stages=[];class we extends r.Container{constructor(N){super(ee(N)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{ee(this.attrs)}),this._checkVisibility()}_validateAdd(N){const z=N.getType()==="Layer",ne=N.getType()==="FastLayer";z||ne||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const N=this.visible()?"":"none";this.content.style.display=N}setContainer(N){if(typeof N===h){if(N.charAt(0)==="."){var z=N.slice(1);N=document.getElementsByClassName(z)[0]}else{var ne;N.charAt(0)!=="#"?ne=N:ne=N.slice(1),N=document.getElementById(ne)}if(!N)throw"Can not find container in document with id "+ne}return this._setAttr("container",N),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),N.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var N=this.children,z=N.length,ne;for(ne=0;ne-1&&e.stages.splice(z,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const N=this._pointerPositions[0]||this._changedPointerPositions[0];return N?{x:N.x,y:N.y}:(t.Util.warn(ie),null)}_getPointerById(N){return this._pointerPositions.find(z=>z.id===N)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(N){N=N||{},N.x=N.x||0,N.y=N.y||0,N.width=N.width||this.width(),N.height=N.height||this.height();var z=new i.SceneCanvas({width:N.width,height:N.height,pixelRatio:N.pixelRatio||1}),ne=z.getContext()._context,de=this.children;return(N.x||N.y)&&ne.translate(-1*N.x,-1*N.y),de.forEach(function(ve){if(ve.isVisible()){var le=ve._toKonvaCanvas(N);ne.drawImage(le._canvas,N.x,N.y,le.getWidth()/le.getPixelRatio(),le.getHeight()/le.getPixelRatio())}}),z}getIntersection(N){if(!N)return null;var z=this.children,ne=z.length,de=ne-1,ve;for(ve=de;ve>=0;ve--){const le=z[ve].getIntersection(N);if(le)return le}return null}_resizeDOM(){var N=this.width(),z=this.height();this.content&&(this.content.style.width=N+b,this.content.style.height=z+b),this.bufferCanvas.setSize(N,z),this.bufferHitCanvas.setSize(N,z),this.children.forEach(ne=>{ne.setSize({width:N,height:z}),ne.draw()})}add(N,...z){if(arguments.length>1){for(var ne=0;neY&&t.Util.warn("The stage has "+de+" 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."),N.setSize({width:this.width(),height:this.height()}),N.draw(),a.Konva.isBrowser&&this.content.appendChild(N.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(N){return c.hasPointerCapture(N,this)}setPointerCapture(N){c.setPointerCapture(N,this)}releaseCapture(N){c.releaseCapture(N,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&he.forEach(([N,z])=>{this.content.addEventListener(N,ne=>{this[z](ne)},{passive:!1})})}_pointerenter(N){this.setPointersPositions(N);const z=J(N.type);z&&this._fire(z.pointerenter,{evt:N,target:this,currentTarget:this})}_pointerover(N){this.setPointersPositions(N);const z=J(N.type);z&&this._fire(z.pointerover,{evt:N,target:this,currentTarget:this})}_getTargetShape(N){let z=this[N+"targetShape"];return z&&!z.getStage()&&(z=null),z}_pointerleave(N){const z=J(N.type),ne=te(N.type);if(z){this.setPointersPositions(N);var de=this._getTargetShape(ne),ve=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;de&&ve?(de._fireAndBubble(z.pointerout,{evt:N}),de._fireAndBubble(z.pointerleave,{evt:N}),this._fire(z.pointerleave,{evt:N,target:this,currentTarget:this}),this[ne+"targetShape"]=null):ve&&(this._fire(z.pointerleave,{evt:N,target:this,currentTarget:this}),this._fire(z.pointerout,{evt:N,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(N){const z=J(N.type),ne=te(N.type);if(z){this.setPointersPositions(N);var de=!1;this._changedPointerPositions.forEach(ve=>{var le=this.getIntersection(ve);if(o.DD.justDragged=!1,a.Konva["_"+ne+"ListenClick"]=!0,!le||!le.isListening()){this[ne+"ClickStartShape"]=void 0;return}a.Konva.capturePointerEventsEnabled&&le.setPointerCapture(ve.id),this[ne+"ClickStartShape"]=le,le._fireAndBubble(z.pointerdown,{evt:N,pointerId:ve.id}),de=!0;const Ie=N.type.indexOf("touch")>=0;le.preventDefault()&&N.cancelable&&Ie&&N.preventDefault()}),de||this._fire(z.pointerdown,{evt:N,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(N){const z=J(N.type),ne=te(N.type);if(!z)return;a.Konva.isDragging()&&o.DD.node.preventDefault()&&N.cancelable&&N.preventDefault(),this.setPointersPositions(N);var de=!(a.Konva.isDragging()||a.Konva.isTransforming())||a.Konva.hitOnDragEnabled;if(!de)return;var ve={};let le=!1;var Ie=this._getTargetShape(ne);this._changedPointerPositions.forEach(ze=>{const Se=c.getCapturedShape(ze.id)||this.getIntersection(ze),De=ze.id,Me={evt:N,pointerId:De};var Xe=Ie!==Se;if(Xe&&Ie&&(Ie._fireAndBubble(z.pointerout,{...Me},Se),Ie._fireAndBubble(z.pointerleave,{...Me},Se)),Se){if(ve[Se._id])return;ve[Se._id]=!0}Se&&Se.isListening()?(le=!0,Xe&&(Se._fireAndBubble(z.pointerover,{...Me},Ie),Se._fireAndBubble(z.pointerenter,{...Me},Ie),this[ne+"targetShape"]=Se),Se._fireAndBubble(z.pointermove,{...Me})):Ie&&(this._fire(z.pointerover,{evt:N,target:this,currentTarget:this,pointerId:De}),this[ne+"targetShape"]=null)}),le||this._fire(z.pointermove,{evt:N,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(N){const z=J(N.type),ne=te(N.type);if(!z)return;this.setPointersPositions(N);const de=this[ne+"ClickStartShape"],ve=this[ne+"ClickEndShape"];var le={};let Ie=!1;this._changedPointerPositions.forEach(ze=>{const Se=c.getCapturedShape(ze.id)||this.getIntersection(ze);if(Se){if(Se.releaseCapture(ze.id),le[Se._id])return;le[Se._id]=!0}const De=ze.id,Me={evt:N,pointerId:De};let Xe=!1;a.Konva["_"+ne+"InDblClickWindow"]?(Xe=!0,clearTimeout(this[ne+"DblTimeout"])):o.DD.justDragged||(a.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){a.Konva["_"+ne+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Se&&Se.isListening()?(Ie=!0,this[ne+"ClickEndShape"]=Se,Se._fireAndBubble(z.pointerup,{...Me}),a.Konva["_"+ne+"ListenClick"]&&de&&de===Se&&(Se._fireAndBubble(z.pointerclick,{...Me}),Xe&&ve&&ve===Se&&Se._fireAndBubble(z.pointerdblclick,{...Me}))):(this[ne+"ClickEndShape"]=null,a.Konva["_"+ne+"ListenClick"]&&this._fire(z.pointerclick,{evt:N,target:this,currentTarget:this,pointerId:De}),Xe&&this._fire(z.pointerdblclick,{evt:N,target:this,currentTarget:this,pointerId:De}))}),Ie||this._fire(z.pointerup,{evt:N,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+ne+"ListenClick"]=!1,N.cancelable&&ne!=="touch"&&N.preventDefault()}_contextmenu(N){this.setPointersPositions(N);var z=this.getIntersection(this.getPointerPosition());z&&z.isListening()?z._fireAndBubble(H,{evt:N}):this._fire(H,{evt:N,target:this,currentTarget:this})}_wheel(N){this.setPointersPositions(N);var z=this.getIntersection(this.getPointerPosition());z&&z.isListening()?z._fireAndBubble(se,{evt:N}):this._fire(se,{evt:N,target:this,currentTarget:this})}_pointercancel(N){this.setPointersPositions(N);const z=c.getCapturedShape(N.pointerId)||this.getIntersection(this.getPointerPosition());z&&z._fireAndBubble(k,c.createEvent(N)),c.releaseCapture(N.pointerId)}_lostpointercapture(N){c.releaseCapture(N.pointerId)}setPointersPositions(N){var z=this._getContentPosition(),ne=null,de=null;N=N||window.event,N.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(N.touches,ve=>{this._pointerPositions.push({id:ve.identifier,x:(ve.clientX-z.left)/z.scaleX,y:(ve.clientY-z.top)/z.scaleY})}),Array.prototype.forEach.call(N.changedTouches||N.touches,ve=>{this._changedPointerPositions.push({id:ve.identifier,x:(ve.clientX-z.left)/z.scaleX,y:(ve.clientY-z.top)/z.scaleY})})):(ne=(N.clientX-z.left)/z.scaleX,de=(N.clientY-z.top)/z.scaleY,this.pointerPos={x:ne,y:de},this._pointerPositions=[{x:ne,y:de,id:t.Util._getFirstPointerId(N)}],this._changedPointerPositions=[{x:ne,y:de,id:t.Util._getFirstPointerId(N)}])}_setPointerPosition(N){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(N)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var N=this.content.getBoundingClientRect();return{top:N.top,left:N.left,scaleX:N.width/this.content.clientWidth||1,scaleY:N.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!a.Konva.isBrowser){var N=this.container();if(!N)throw"Stage has no container. A container is required.";N.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"),N.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(N){N.batchDraw()}),this}}e.Stage=we,we.prototype.nodeType=d,(0,s._registerNode)(we),n.Factory.addGetterSetter(we,"container"),a.Konva.isBrowser&&document.addEventListener("visibilitychange",()=>{e.stages.forEach(W=>{W.batchDraw()})})}(nM);var u0={},er={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=ct,n=Cn,r=dt,a=dn,i=Be,o=ct,s=va;var c="hasShadow",d="shadowRGBA",h="patternImage",b="linearGradient",y="radialGradient";let m;function p(){return m||(m=n.Util.createCanvasElement().getContext("2d"),m)}e.shapes={};function w(D){const I=this.attrs.fillRule;I?D.fill(I):D.fill()}function E(D){D.stroke()}function C(D){const I=this.attrs.fillRule;I?D.fill(I):D.fill()}function _(D){D.stroke()}function f(){this._clearCache(c)}function x(){this._clearCache(d)}function k(){this._clearCache(h)}function M(){this._clearCache(b)}function j(){this._clearCache(y)}class P extends a.Node{constructor(I){super(I);let R;for(;R=n.Util.getRandomColor(),!(R&&!(R in e.shapes)););this.colorKey=R,e.shapes[R]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.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(c,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(h,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var I=p();const R=I.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(R&&R.setTransform){const H=new n.Transform;H.translate(this.fillPatternX(),this.fillPatternY()),H.rotate(t.Konva.getAngle(this.fillPatternRotation())),H.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),H.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const B=H.getMatrix(),$=typeof DOMMatrix>"u"?{a:B[0],b:B[1],c:B[2],d:B[3],e:B[4],f:B[5]}:new DOMMatrix(B);R.setTransform($)}return R}}_getLinearGradient(){return this._getCache(b,this.__getLinearGradient)}__getLinearGradient(){var I=this.fillLinearGradientColorStops();if(I){for(var R=p(),H=this.fillLinearGradientStartPoint(),B=this.fillLinearGradientEndPoint(),$=R.createLinearGradient(H.x,H.y,B.x,B.y),q=0;qthis.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 I=this.hitStrokeWidth();return I==="auto"?this.hasStroke():this.strokeEnabled()&&!!I}intersects(I){var R=this.getStage();if(!R)return!1;const H=R.bufferHitCanvas;return H.getContext().clear(),this.drawHit(H,void 0,!0),H.context.getImageData(Math.round(I.x),Math.round(I.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(I){var R;if(!(!((R=this.attrs.perfectDrawEnabled)!==null&&R!==void 0)||R))return!1;const H=I||this.hasFill(),B=this.hasStroke(),$=this.getAbsoluteOpacity()!==1;if(H&&B&&$)return!0;const q=this.hasShadow(),K=this.shadowForStrokeEnabled();return!!(H&&B&&q&&K)}setStrokeHitEnabled(I){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),I?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var I=this.size();return{x:this._centroid?-I.width/2:0,y:this._centroid?-I.height/2:0,width:I.width,height:I.height}}getClientRect(I={}){let R=!1,H=this.getParent();for(;H;){if(H.isCached()){R=!0;break}H=H.getParent()}const B=I.skipTransform,$=I.relativeTo||R&&this.getStage()||void 0,q=this.getSelfRect(),K=!I.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,se=q.width+K,Y=q.height+K,he=!I.skipShadow&&this.hasShadow(),Q=he?this.shadowOffsetX():0,te=he?this.shadowOffsetY():0,J=se+Math.abs(Q),ee=Y+Math.abs(te),ie=he&&this.shadowBlur()||0,we=J+ie*2,W=ee+ie*2,N={width:we,height:W,x:-(K/2+ie)+Math.min(Q,0)+q.x,y:-(K/2+ie)+Math.min(te,0)+q.y};return B?N:this._transformedRect(N,$)}drawScene(I,R,H){var B=this.getLayer(),$=I||B.getCanvas(),q=$.getContext(),K=this._getCanvasCache(),se=this.getSceneFunc(),Y=this.hasShadow(),he,Q,te=$.isCache,J=R===this;if(!this.isVisible()&&!J)return this;if(K){q.save();var ee=this.getAbsoluteTransform(R).getMatrix();return q.transform(ee[0],ee[1],ee[2],ee[3],ee[4],ee[5]),this._drawCachedSceneCanvas(q),q.restore(),this}if(!se)return this;if(q.save(),this._useBufferCanvas()&&!te){he=this.getStage();const W=H||he.bufferCanvas;Q=W.getContext(),Q.clear(),Q.save(),Q._applyLineJoin(this);var ie=this.getAbsoluteTransform(R).getMatrix();Q.transform(ie[0],ie[1],ie[2],ie[3],ie[4],ie[5]),se.call(this,Q,this),Q.restore();var we=W.pixelRatio;Y&&q._applyShadow(this),q._applyOpacity(this),q._applyGlobalCompositeOperation(this),q.drawImage(W._canvas,0,0,W.width/we,W.height/we)}else{if(q._applyLineJoin(this),!J){var ie=this.getAbsoluteTransform(R).getMatrix();q.transform(ie[0],ie[1],ie[2],ie[3],ie[4],ie[5]),q._applyOpacity(this),q._applyGlobalCompositeOperation(this)}Y&&q._applyShadow(this),se.call(this,q,this)}return q.restore(),this}drawHit(I,R,H=!1){if(!this.shouldDrawHit(R,H))return this;var B=this.getLayer(),$=I||B.hitCanvas,q=$&&$.getContext(),K=this.hitFunc()||this.sceneFunc(),se=this._getCanvasCache(),Y=se&&se.hit;if(this.colorKey||n.Util.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()"),Y){q.save();var he=this.getAbsoluteTransform(R).getMatrix();return q.transform(he[0],he[1],he[2],he[3],he[4],he[5]),this._drawCachedHitCanvas(q),q.restore(),this}if(!K)return this;if(q.save(),q._applyLineJoin(this),this!==R){var Q=this.getAbsoluteTransform(R).getMatrix();q.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5])}return K.call(this,q,this),q.restore(),this}drawHitFromCache(I=0){var R=this._getCanvasCache(),H=this._getCachedSceneCanvas(),B=R.hit,$=B.getContext(),q=B.getWidth(),K=B.getHeight(),se,Y,he,Q,te,J;$.clear(),$.drawImage(H._canvas,0,0,q,K);try{for(se=$.getImageData(0,0,q,K),Y=se.data,he=Y.length,Q=n.Util._hexToRgb(this.colorKey),te=0;teI?(Y[te]=Q.r,Y[te+1]=Q.g,Y[te+2]=Q.b,Y[te+3]=255):Y[te+3]=0;$.putImageData(se,0,0)}catch(ee){n.Util.error("Unable to draw hit graph from cached scene canvas. "+ee.message)}return this}hasPointerCapture(I){return s.hasPointerCapture(I,this)}setPointerCapture(I){s.setPointerCapture(I,this)}releaseCapture(I){s.releaseCapture(I,this)}}e.Shape=P,P.prototype._fillFunc=w,P.prototype._strokeFunc=E,P.prototype._fillFuncHit=C,P.prototype._strokeFuncHit=_,P.prototype._centroid=!1,P.prototype.nodeType="Shape",(0,o._registerNode)(P),P.prototype.eventListeners={},P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",f),P.prototype.on.call(P.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",x),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",k),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",M),P.prototype.on.call(P.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",j),r.Factory.addGetterSetter(P,"stroke",void 0,(0,i.getStringOrGradientValidator)()),r.Factory.addGetterSetter(P,"strokeWidth",2,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(P,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(P,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(P,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(P,"shadowForStrokeEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(P,"lineJoin"),r.Factory.addGetterSetter(P,"lineCap"),r.Factory.addGetterSetter(P,"sceneFunc"),r.Factory.addGetterSetter(P,"hitFunc"),r.Factory.addGetterSetter(P,"dash"),r.Factory.addGetterSetter(P,"dashOffset",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"shadowColor",void 0,(0,i.getStringValidator)()),r.Factory.addGetterSetter(P,"shadowBlur",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"shadowOpacity",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(P,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(P,"shadowOffsetX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"shadowOffsetY",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternImage"),r.Factory.addGetterSetter(P,"fill",void 0,(0,i.getStringOrGradientValidator)()),r.Factory.addGetterSetter(P,"fillPatternX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternY",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(P,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(P,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(P,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(P,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(P,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(P,"fillEnabled",!0),r.Factory.addGetterSetter(P,"strokeEnabled",!0),r.Factory.addGetterSetter(P,"shadowEnabled",!0),r.Factory.addGetterSetter(P,"dashEnabled",!0),r.Factory.addGetterSetter(P,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(P,"fillPriority","color"),r.Factory.addComponentsGetterSetter(P,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(P,"fillPatternOffsetX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(P,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(P,"fillPatternScaleX",1,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(P,"fillPatternScaleY",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(P,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(P,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(P,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(P,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(P,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(P,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(P,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(P,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(P,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(P,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(P,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(P,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(P,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(P,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(P,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(P,"fillPatternRotation",0),r.Factory.addGetterSetter(P,"fillRule",void 0,(0,i.getStringValidator)()),r.Factory.backCompat(P,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(er),Object.defineProperty(u0,"__esModule",{value:!0}),u0.Layer=void 0;const ao=Cn,F5=oc,zc=dn,z5=dt,$w=fi,FR=Be,zR=er,BR=ct;var HR="#",GR="beforeDraw",UR="draw",iM=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],VR=iM.length;let Bc=class extends F5.Container{constructor(e){super(e),this.canvas=new $w.SceneCanvas,this.hitCanvas=new $w.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){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 t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),e{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;for(var t=1,n=!1;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(e,t){var n=this.getLayer(),r=e||n&&n.getCanvas();return this._fire(GR,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),F5.Container.prototype.drawScene.call(this,r,t),this._fire(UR,{node:this}),this}drawHit(e,t){var n=this.getLayer(),r=e||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),F5.Container.prototype.drawHit.call(this,r,t),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){ao.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return ao.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var e=this.parent,t=!!this.hitCanvas._canvas.parentNode;t?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}}destroy(){return ao.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};u0.Layer=Bc,Bc.prototype.nodeType="Layer",(0,BR._registerNode)(Bc),z5.Factory.addGetterSetter(Bc,"imageSmoothingEnabled",!0),z5.Factory.addGetterSetter(Bc,"clearBeforeDraw",!0),z5.Factory.addGetterSetter(Bc,"hitGraphEnabled",!0,(0,FR.getBooleanValidator)());var P2={};Object.defineProperty(P2,"__esModule",{value:!0}),P2.FastLayer=void 0;const WR=Cn,XR=u0,YR=ct;let B5=class extends XR.Layer{constructor(e){super(e),this.listening(!1),WR.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}};P2.FastLayer=B5,B5.prototype.nodeType="FastLayer",(0,YR._registerNode)(B5);var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.Group=void 0;const KR=Cn,ZR=oc,qR=ct;let H5=class extends ZR.Container{_validateAdd(e){var t=e.getType();t!=="Group"&&t!=="Shape"&&KR.Util.throw("You may only add groups and shapes to groups.")}};Qu.Group=H5,H5.prototype.nodeType="Group",(0,qR._registerNode)(H5);var $u={};Object.defineProperty($u,"__esModule",{value:!0}),$u.Animation=void 0;const G5=ct,Jw=Cn,U5=function(){return G5.glob.performance&&G5.glob.performance.now?function(){return G5.glob.performance.now()}:function(){return new Date().getTime()}}();let J1=class du{constructor(t,n){this.id=du.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:U5(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){let n=[];return t&&(n=Array.isArray(t)?t:[t]),this.layers=n,this}getLayers(){return this.layers}addLayer(t){const n=this.layers,r=n.length;for(let a=0;athis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():p<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=p,this.update())}getTime(){return this._time}setPosition(p){this.prevPos=this._pos,this.propFunc(p),this._pos=p}getPosition(p){return p===void 0&&(p=this._time),this.func(p,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=c,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(p){this.pause(),this._time=p,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 p=this.getTimer()-this._startTime;this.state===s?this.setTime(p):this.state===c&&this.setTime(this.duration-p)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class y{constructor(p){var w=this,E=p.node,C=E._id,_,f=p.easing||e.Easings.Linear,x=!!p.yoyo,k;typeof p.duration>"u"?_=.3:p.duration===0?_=.001:_=p.duration,this.node=E,this._id=d++;var M=E.getLayer()||(E instanceof a.Konva.Stage?E.getLayers():null);M||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){w.tween.onEnterFrame()},M),this.tween=new b(k,function(j){w._tweenFunc(j)},f,0,1,_*1e3,x),this._addListeners(),y.attrs[C]||(y.attrs[C]={}),y.attrs[C][this._id]||(y.attrs[C][this._id]={}),y.tweens[C]||(y.tweens[C]={});for(k in p)i[k]===void 0&&this._addAttr(k,p[k]);this.reset(),this.onFinish=p.onFinish,this.onReset=p.onReset,this.onUpdate=p.onUpdate}_addAttr(p,w){var E=this.node,C=E._id,_,f,x,k,M,j,P,D;if(x=y.tweens[C][p],x&&delete y.attrs[C][x][p],_=E.getAttr(p),t.Util._isArray(w))if(f=[],M=Math.max(w.length,_.length),p==="points"&&w.length!==_.length&&(w.length>_.length?(P=_,_=t.Util._prepareArrayForTween(_,w,E.closed())):(j=w,w=t.Util._prepareArrayForTween(w,_,E.closed()))),p.indexOf("fill")===0)for(k=0;k{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var p=this.node,w=y.attrs[p._id][this._id];w.points&&w.points.trueEnd&&p.setAttr("points",w.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var p=this.node,w=y.attrs[p._id][this._id];w.points&&w.points.trueStart&&p.points(w.points.trueStart),this.onReset&&this.onReset()},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(p){return this.tween.seek(p*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var p=this.node._id,w=this._id,E=y.tweens[p],C;this.pause();for(C in E)delete y.tweens[p][C];delete y.attrs[p][w]}}e.Tween=y,y.attrs={},y.tweens={},r.Node.prototype.to=function(m){var p=m.onFinish;m.node=this,m.onFinish=function(){this.destroy(),p&&p()};var w=new y(m);w.play()},e.Easings={BackEaseIn(m,p,w,E){var C=1.70158;return w*(m/=E)*m*((C+1)*m-C)+p},BackEaseOut(m,p,w,E){var C=1.70158;return w*((m=m/E-1)*m*((C+1)*m+C)+1)+p},BackEaseInOut(m,p,w,E){var C=1.70158;return(m/=E/2)<1?w/2*(m*m*(((C*=1.525)+1)*m-C))+p:w/2*((m-=2)*m*(((C*=1.525)+1)*m+C)+2)+p},ElasticEaseIn(m,p,w,E,C,_){var f=0;return m===0?p:(m/=E)===1?p+w:(_||(_=E*.3),!C||C0?e:t),d=i*t,h=o*(o>0?e:t),b=s*(s>0?t:e);return{x:c,y:n?-1*b:h,width:d-c,height:b-h}}};M2.Arc=io,io.prototype._centroid=!0,io.prototype.className="Arc",io.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,$R._registerNode)(io),ef.Factory.addGetterSetter(io,"innerRadius",0,(0,tf.getNumberValidator)()),ef.Factory.addGetterSetter(io,"outerRadius",0,(0,tf.getNumberValidator)()),ef.Factory.addGetterSetter(io,"angle",0,(0,tf.getNumberValidator)()),ef.Factory.addGetterSetter(io,"clockwise",!1,(0,tf.getBooleanValidator)());var T2={},d0={};Object.defineProperty(d0,"__esModule",{value:!0}),d0.Line=void 0;const nf=dt,JR=er,nx=Be,eF=ct;function yy(e,t,n,r,a,i,o){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),c=Math.sqrt(Math.pow(a-n,2)+Math.pow(i-r,2)),d=o*s/(s+c),h=o*c/(s+c),b=n-d*(a-e),y=r-d*(i-t),m=n+h*(a-e),p=r+h*(i-t);return[b,y,m,p]}function rx(e,t){var n=e.length,r=[],a,i;for(a=2;a4){for(o=this.getTensionPoints(),s=o.length,c=a?0:4,a||e.quadraticCurveTo(o[0],o[1],o[2],o[3]);c{let d,h,b;d=c/2,h=0;for(let y=0;y<20;y++)b=d*e.tValues[20][y]+d,h+=e.cValues[20][y]*r(o,s,b);return d*h};e.getCubicArcLength=t;const n=(o,s,c)=>{c===void 0&&(c=1);const d=o[0]-2*o[1]+o[2],h=s[0]-2*s[1]+s[2],b=2*o[1]-2*o[0],y=2*s[1]-2*s[0],m=4*(d*d+h*h),p=4*(d*b+h*y),w=b*b+y*y;if(m===0)return c*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(s[2]-s[0],2));const E=p/(2*m),C=w/m,_=c+E,f=C-E*E,x=_*_+f>0?Math.sqrt(_*_+f):0,k=E*E+f>0?Math.sqrt(E*E+f):0,M=E+Math.sqrt(E*E+f)!==0?f*Math.log(Math.abs((_+x)/(E+k))):0;return Math.sqrt(m)/2*(_*x-E*k+M)};e.getQuadraticArcLength=n;function r(o,s,c){const d=a(1,c,o),h=a(1,c,s),b=d*d+h*h;return Math.sqrt(b)}const a=(o,s,c)=>{const d=c.length-1;let h,b;if(d===0)return 0;if(o===0){b=0;for(let y=0;y<=d;y++)b+=e.binomialCoefficients[d][y]*Math.pow(1-s,d-y)*Math.pow(s,y)*c[y];return b}else{h=new Array(d);for(let y=0;y{let d=1,h=o/s,b=(o-c(h))/s,y=0;for(;d>.001;){const m=c(h+b),p=Math.abs(o-m)/s;if(p500)break}return h};e.t2length=i})(oM),Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.Path=void 0;const tF=dt,nF=er,rF=ct,Hc=oM;let $d=class Zr extends nF.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Zr.parsePathData(this.data()),this.pathLength=Zr.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,a=0;ah?d:h,E=d>h?1:d/h,C=d>h?h/d:1;t.translate(s,c),t.rotate(m),t.scale(E,C),t.arc(0,0,w,b,b+y,1-p),t.scale(1/E,1/C),t.rotate(-m),t.translate(-s,-c);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(d){if(d.command==="A"){var h=d.points[4],b=d.points[5],y=d.points[4]+b,m=Math.PI/180;if(Math.abs(h-y)y;p-=m){const w=Zr.getPointOnEllipticalArc(d.points[0],d.points[1],d.points[2],d.points[3],p,0);t.push(w.x,w.y)}else for(let p=h+m;pn[a].pathLength;)t-=n[a].pathLength,++a;if(a===i)return r=n[a-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[a].points.slice(0,2),{x:r[0],y:r[1]};var o=n[a],s=o.points;switch(o.command){case"L":return Zr.getPointOnLine(t,o.start.x,o.start.y,s[0],s[1]);case"C":return Zr.getPointOnCubicBezier((0,Hc.t2length)(t,Zr.getPathLength(n),w=>(0,Hc.getCubicArcLength)([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],w)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Zr.getPointOnQuadraticBezier((0,Hc.t2length)(t,Zr.getPathLength(n),w=>(0,Hc.getQuadraticArcLength)([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],w)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":var c=s[0],d=s[1],h=s[2],b=s[3],y=s[4],m=s[5],p=s[6];return y+=m*t/o.pathLength,Zr.getPointOnEllipticalArc(c,d,h,b,y,p)}return null}static getPointOnLine(t,n,r,a,i,o,s){o=o??n,s=s??r;const c=this.getLineLength(n,r,a,i);if(c<1e-10)return{x:n,y:r};if(a===n)return{x:o,y:s+(i>r?t:-t)};const d=(i-r)/(a-n),h=Math.sqrt(t*t/(1+d*d))*(a0&&!isNaN(p[0]);){var _="",f=[],x=c,k=d,M,j,P,D,I,R,H,B,$,q;switch(m){case"l":c+=p.shift(),d+=p.shift(),_="L",f.push(c,d);break;case"L":c=p.shift(),d=p.shift(),f.push(c,d);break;case"m":var K=p.shift(),se=p.shift();if(c+=K,d+=se,_="M",o.length>2&&o[o.length-1].command==="z"){for(var Y=o.length-2;Y>=0;Y--)if(o[Y].command==="M"){c=o[Y].points[0]+K,d=o[Y].points[1]+se;break}}f.push(c,d),m="l";break;case"M":c=p.shift(),d=p.shift(),_="M",f.push(c,d),m="L";break;case"h":c+=p.shift(),_="L",f.push(c,d);break;case"H":c=p.shift(),_="L",f.push(c,d);break;case"v":d+=p.shift(),_="L",f.push(c,d);break;case"V":d=p.shift(),_="L",f.push(c,d);break;case"C":f.push(p.shift(),p.shift(),p.shift(),p.shift()),c=p.shift(),d=p.shift(),f.push(c,d);break;case"c":f.push(c+p.shift(),d+p.shift(),c+p.shift(),d+p.shift()),c+=p.shift(),d+=p.shift(),_="C",f.push(c,d);break;case"S":j=c,P=d,M=o[o.length-1],M.command==="C"&&(j=c+(c-M.points[2]),P=d+(d-M.points[3])),f.push(j,P,p.shift(),p.shift()),c=p.shift(),d=p.shift(),_="C",f.push(c,d);break;case"s":j=c,P=d,M=o[o.length-1],M.command==="C"&&(j=c+(c-M.points[2]),P=d+(d-M.points[3])),f.push(j,P,c+p.shift(),d+p.shift()),c+=p.shift(),d+=p.shift(),_="C",f.push(c,d);break;case"Q":f.push(p.shift(),p.shift()),c=p.shift(),d=p.shift(),f.push(c,d);break;case"q":f.push(c+p.shift(),d+p.shift()),c+=p.shift(),d+=p.shift(),_="Q",f.push(c,d);break;case"T":j=c,P=d,M=o[o.length-1],M.command==="Q"&&(j=c+(c-M.points[0]),P=d+(d-M.points[1])),c=p.shift(),d=p.shift(),_="Q",f.push(j,P,c,d);break;case"t":j=c,P=d,M=o[o.length-1],M.command==="Q"&&(j=c+(c-M.points[0]),P=d+(d-M.points[1])),c+=p.shift(),d+=p.shift(),_="Q",f.push(j,P,c,d);break;case"A":D=p.shift(),I=p.shift(),R=p.shift(),H=p.shift(),B=p.shift(),$=c,q=d,c=p.shift(),d=p.shift(),_="A",f=this.convertEndpointToCenterParameterization($,q,c,d,H,B,D,I,R);break;case"a":D=p.shift(),I=p.shift(),R=p.shift(),H=p.shift(),B=p.shift(),$=c,q=d,c+=p.shift(),d+=p.shift(),_="A",f=this.convertEndpointToCenterParameterization($,q,c,d,H,B,D,I,R);break}o.push({command:_||m,points:f,start:{x,y:k},pathLength:this.calcLength(x,k,_||m,f)})}(m==="z"||m==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(t,n,r,a){var i,o,s,c,d=Zr;switch(r){case"L":return d.getLineLength(t,n,a[0],a[1]);case"C":return(0,Hc.getCubicArcLength)([t,a[0],a[2],a[4]],[n,a[1],a[3],a[5]],1);case"Q":return(0,Hc.getQuadraticArcLength)([t,a[0],a[2]],[n,a[1],a[3]],1);case"A":i=0;var h=a[4],b=a[5],y=a[4]+b,m=Math.PI/180;if(Math.abs(h-y)y;c-=m)s=d.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],c,0),i+=d.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(c=h+m;c1&&(s*=Math.sqrt(m),c*=Math.sqrt(m));var p=Math.sqrt((s*s*(c*c)-s*s*(y*y)-c*c*(b*b))/(s*s*(y*y)+c*c*(b*b)));i===o&&(p*=-1),isNaN(p)&&(p=0);var w=p*s*y/c,E=p*-c*b/s,C=(t+r)/2+Math.cos(h)*w-Math.sin(h)*E,_=(n+a)/2+Math.sin(h)*w+Math.cos(h)*E,f=function(I){return Math.sqrt(I[0]*I[0]+I[1]*I[1])},x=function(I,R){return(I[0]*R[0]+I[1]*R[1])/(f(I)*f(R))},k=function(I,R){return(I[0]*R[1]=1&&(D=0),o===0&&D>0&&(D=D-2*Math.PI),o===1&&D<0&&(D=D+2*Math.PI),[C,_,s,c,M,D,h,o]}};Ju.Path=$d,$d.prototype.className="Path",$d.prototype._attrsAffectingSize=["data"],(0,rF._registerNode)($d),tF.Factory.addGetterSetter($d,"data"),Object.defineProperty(T2,"__esModule",{value:!0}),T2.Arrow=void 0;const rf=dt,aF=d0,ax=Be,iF=ct,ix=Ju;let vl=class extends aF.Line{_sceneFunc(e){super._sceneFunc(e);var t=Math.PI*2,n=this.points(),r=n,a=this.tension()!==0&&n.length>4;a&&(r=this.getTensionPoints());var i=this.pointerLength(),o=n.length,s,c;if(a){const b=[r[r.length-4],r[r.length-3],r[r.length-2],r[r.length-1],n[o-2],n[o-1]],y=ix.Path.calcLength(r[r.length-4],r[r.length-3],"C",b),m=ix.Path.getPointOnQuadraticBezier(Math.min(1,1-i/y),b[0],b[1],b[2],b[3],b[4],b[5]);s=n[o-2]-m.x,c=n[o-1]-m.y}else s=n[o-2]-n[o-4],c=n[o-1]-n[o-3];var d=(Math.atan2(c,s)+t)%t,h=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(n[o-2],n[o-1]),e.rotate(d),e.moveTo(0,0),e.lineTo(-i,h/2),e.lineTo(-i,-h/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(n[0],n[1]),a?(s=(r[0]+r[2])/2-n[0],c=(r[1]+r[3])/2-n[1]):(s=n[2]-n[0],c=n[3]-n[1]),e.rotate((Math.atan2(-c,-s)+t)%t),e.moveTo(0,0),e.lineTo(-i,h/2),e.lineTo(-i,-h/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var t=this.dashEnabled();t&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),t&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),t=this.pointerWidth()/2;return{x:e.x-t,y:e.y-t,width:e.width+t*2,height:e.height+t*2}}};T2.Arrow=vl,vl.prototype.className="Arrow",(0,iF._registerNode)(vl),rf.Factory.addGetterSetter(vl,"pointerLength",10,(0,ax.getNumberValidator)()),rf.Factory.addGetterSetter(vl,"pointerWidth",10,(0,ax.getNumberValidator)()),rf.Factory.addGetterSetter(vl,"pointerAtBeginning",!1),rf.Factory.addGetterSetter(vl,"pointerAtEnding",!0);var I2={};Object.defineProperty(I2,"__esModule",{value:!0}),I2.Circle=void 0;const oF=dt,sF=er,lF=Be,cF=ct;let Gc=class extends sF.Shape{_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)}};I2.Circle=Gc,Gc.prototype._centroid=!0,Gc.prototype.className="Circle",Gc.prototype._attrsAffectingSize=["radius"],(0,cF._registerNode)(Gc),oF.Factory.addGetterSetter(Gc,"radius",0,(0,lF.getNumberValidator)());var A2={};Object.defineProperty(A2,"__esModule",{value:!0}),A2.Ellipse=void 0;const V5=dt,uF=er,ox=Be,dF=ct;let rs=class extends uF.Shape{_sceneFunc(e){var t=this.radiusX(),n=this.radiusY();e.beginPath(),e.save(),t!==n&&e.scale(1,n/t),e.arc(0,0,t,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)}};A2.Ellipse=rs,rs.prototype.className="Ellipse",rs.prototype._centroid=!0,rs.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,dF._registerNode)(rs),V5.Factory.addComponentsGetterSetter(rs,"radius",["x","y"]),V5.Factory.addGetterSetter(rs,"radiusX",0,(0,ox.getNumberValidator)()),V5.Factory.addGetterSetter(rs,"radiusY",0,(0,ox.getNumberValidator)());var L2={};Object.defineProperty(L2,"__esModule",{value:!0}),L2.Image=void 0;const W5=Cn,yl=dt,hF=er,fF=ct,Jd=Be;let ji=class sM extends hF.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){const t=!!this.cornerRadius(),n=this.hasShadow();return t&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),a=this.cornerRadius(),i=this.attrs.image;let o;if(i){const s=this.attrs.cropWidth,c=this.attrs.cropHeight;s&&c?o=[i,this.cropX(),this.cropY(),s,c,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke()||a)&&(t.beginPath(),a?W5.Util.drawRoundedRectPath(t,n,r,a):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),i&&(a&&t.clip(),t.drawImage.apply(t,o))}_hitFunc(t){var n=this.width(),r=this.height(),a=this.cornerRadius();t.beginPath(),a?W5.Util.drawRoundedRectPath(t,n,r,a):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var a=W5.Util.createImageElement();a.onload=function(){var i=new sM({image:a});n(i)},a.onerror=r,a.crossOrigin="Anonymous",a.src=t}};L2.Image=ji,ji.prototype.className="Image",(0,fF._registerNode)(ji),yl.Factory.addGetterSetter(ji,"cornerRadius",0,(0,Jd.getNumberOrArrayOfNumbersValidator)(4)),yl.Factory.addGetterSetter(ji,"image"),yl.Factory.addComponentsGetterSetter(ji,"crop",["x","y","width","height"]),yl.Factory.addGetterSetter(ji,"cropX",0,(0,Jd.getNumberValidator)()),yl.Factory.addGetterSetter(ji,"cropY",0,(0,Jd.getNumberValidator)()),yl.Factory.addGetterSetter(ji,"cropWidth",0,(0,Jd.getNumberValidator)()),yl.Factory.addGetterSetter(ji,"cropHeight",0,(0,Jd.getNumberValidator)());var Nu={};Object.defineProperty(Nu,"__esModule",{value:!0}),Nu.Tag=Nu.Label=void 0;const af=dt,pF=er,gF=Qu,X5=Be,lM=ct;var cM=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],mF="Change.konva",vF="none",by="up",wy="right",xy="down",Cy="left",yF=cM.length;let Y5=class extends gF.Group{constructor(e){super(e),this.on("add.konva",function(t){this._addListeners(t.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var t=this,n,r=function(){t._sync()};for(n=0;n{t=Math.min(t,i.x),n=Math.max(n,i.x),r=Math.min(r,i.y),a=Math.max(a,i.y)}),{x:t,y:r,width:n-t,height:a-r}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}};j2.RegularPolygon=wl,wl.prototype.className="RegularPolygon",wl.prototype._centroid=!0,wl.prototype._attrsAffectingSize=["radius"],(0,kF._registerNode)(wl),sx.Factory.addGetterSetter(wl,"radius",0,(0,lx.getNumberValidator)()),sx.Factory.addGetterSetter(wl,"sides",0,(0,lx.getNumberValidator)());var N2={};Object.defineProperty(N2,"__esModule",{value:!0}),N2.Ring=void 0;const cx=dt,EF=er,ux=Be,OF=ct;var dx=Math.PI*2;let xl=class extends EF.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,dx,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),dx,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)}};N2.Ring=xl,xl.prototype.className="Ring",xl.prototype._centroid=!0,xl.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,OF._registerNode)(xl),cx.Factory.addGetterSetter(xl,"innerRadius",0,(0,ux.getNumberValidator)()),cx.Factory.addGetterSetter(xl,"outerRadius",0,(0,ux.getNumberValidator)());var D2={};Object.defineProperty(D2,"__esModule",{value:!0}),D2.Sprite=void 0;const Cl=dt,PF=er,MF=$u,hx=Be,TF=ct;let Ni=class extends PF.Shape{constructor(e){super(e),this._updated=!0,this.anim=new MF.Animation(()=>{var t=this._updated;return this._updated=!1,t}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){var t=this.animation(),n=this.frameIndex(),r=n*4,a=this.animations()[t],i=this.frameOffsets(),o=a[r+0],s=a[r+1],c=a[r+2],d=a[r+3],h=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,c,d),e.closePath(),e.fillStrokeShape(this)),h)if(i){var b=i[t],y=n*2;e.drawImage(h,o,s,c,d,b[y+0],b[y+1],c,d)}else e.drawImage(h,o,s,c,d,0,0,c,d)}_hitFunc(e){var t=this.animation(),n=this.frameIndex(),r=n*4,a=this.animations()[t],i=this.frameOffsets(),o=a[r+2],s=a[r+3];if(e.beginPath(),i){var c=i[t],d=n*2;e.rect(c[d+0],c[d+1],o,s)}else e.rect(0,0,o,s);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(),t=this.animation(),n=this.animations(),r=n[t],a=r.length/4;e(new RegExp("\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?(?:\\u200D\\p{Emoji_Presentation})+","u").test(n)?t.push(n):new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(a[r+1]||""))?t.push(n+a[r+1]):r>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?t[t.length-1]+=n:t.push(n),t),[])}Wl.stringToArray=uM;var Uc="auto",NF="center",dM="inherit",eh="justify",DF="Change.konva",RF="2d",fx="-",hM="left",FF="text",zF="Text",BF="top",HF="bottom",px="middle",gx="normal",GF="px ",sf=" ",UF="right",mx="rtl",VF="word",WF="char",vx="none",Q5="…",fM=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],XF=fM.length;function YF(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var $5;function J5(){return $5||($5=Sy.Util.createCanvasElement().getContext(RF),$5)}function KF(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function ZF(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function qF(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let kn=class extends LF.Shape{constructor(e){super(qF(e)),this._partialTextX=0,this._partialTextY=0;for(var t=0;t1&&(C+=i)}}}_hitFunc(e){var t=this.getWidth(),n=this.getHeight();e.beginPath(),e.rect(0,0,t,n),e.closePath(),e.fillStrokeShape(this)}setText(e){var t=Sy.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(FF,t),this}getWidth(){var e=this.attrs.width===Uc||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===Uc||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 Sy.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var t,n,r,a,i,o,s,c,d,h,b,y=J5(),m=this.fontSize(),p;y.save(),y.font=this._getContextFont(),p=y.measureText(e),y.restore();const w=m/100;return{actualBoundingBoxAscent:(t=p.actualBoundingBoxAscent)!==null&&t!==void 0?t:71.58203125*w,actualBoundingBoxDescent:(n=p.actualBoundingBoxDescent)!==null&&n!==void 0?n:0,actualBoundingBoxLeft:(r=p.actualBoundingBoxLeft)!==null&&r!==void 0?r:-7.421875*w,actualBoundingBoxRight:(a=p.actualBoundingBoxRight)!==null&&a!==void 0?a:75.732421875*w,alphabeticBaseline:(i=p.alphabeticBaseline)!==null&&i!==void 0?i:0,emHeightAscent:(o=p.emHeightAscent)!==null&&o!==void 0?o:100*w,emHeightDescent:(s=p.emHeightDescent)!==null&&s!==void 0?s:-20*w,fontBoundingBoxAscent:(c=p.fontBoundingBoxAscent)!==null&&c!==void 0?c:91*w,fontBoundingBoxDescent:(d=p.fontBoundingBoxDescent)!==null&&d!==void 0?d:21*w,hangingBaseline:(h=p.hangingBaseline)!==null&&h!==void 0?h:72.80000305175781*w,ideographicBaseline:(b=p.ideographicBaseline)!==null&&b!==void 0?b:-21*w,width:p.width,height:m}}_getContextFont(){return this.fontStyle()+sf+this.fontVariant()+sf+(this.fontSize()+GF)+YF(this.fontFamily())}_addTextLine(e){this.align()===eh&&(e=e.trim());var t=this._getTextWidth(e);return this.textArr.push({text:e,width:t,lastInParagraph:!1})}_getTextWidth(e){var t=this.letterSpacing(),n=e.length;return J5().measureText(e).width+(n?t*(n-1):0)}_setTextData(){var e=this.text().split(`
+`),t=+this.fontSize(),n=0,r=this.lineHeight()*t,a=this.attrs.width,i=this.attrs.height,o=a!==Uc&&a!==void 0,s=i!==Uc&&i!==void 0,c=this.padding(),d=a-c*2,h=i-c*2,b=0,y=this.wrap(),m=y!==vx,p=y!==WF&&m,w=this.ellipsis();this.textArr=[],J5().font=this._getContextFont();for(var E=w?this._getTextWidth(Q5):0,C=0,_=e.length;C<_;++C){var f=e[C],x=this._getTextWidth(f);if(o&&x>d)for(;f.length>0;){for(var k=0,M=f.length,j="",P=0;k>>1,I=f.slice(0,D+1),R=this._getTextWidth(I)+E;R<=d?(k=D+1,j=I,P=R):M=D}if(j){if(p){var H,B=f[j.length],$=B===sf||B===fx;$&&P<=d?H=j.length:H=Math.max(j.lastIndexOf(sf),j.lastIndexOf(fx))+1,H>0&&(k=H,j=j.slice(0,k),P=this._getTextWidth(j))}j=j.trimRight(),this._addTextLine(j),n=Math.max(n,P),b+=r;var q=this._shouldHandleEllipsis(b);if(q){this._tryToAddEllipsisToLastLine();break}if(f=f.slice(k),f=f.trimLeft(),f.length>0&&(x=this._getTextWidth(f),x<=d)){this._addTextLine(f),b+=r,n=Math.max(n,x);break}}else break}else this._addTextLine(f),b+=r,n=Math.max(n,x),this._shouldHandleEllipsis(b)&&C<_-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),s&&b+r>h)break}this.textHeight=t,this.textWidth=n}_shouldHandleEllipsis(e){var t=+this.fontSize(),n=this.lineHeight()*t,r=this.attrs.height,a=r!==Uc&&r!==void 0,i=this.padding(),o=r-i*2,s=this.wrap(),c=s!==vx;return!c||a&&e+n>o}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,t=e!==Uc&&e!==void 0,n=this.padding(),r=e-n*2,a=this.ellipsis(),i=this.textArr[this.textArr.length-1];if(!(!i||!a)){if(t){var o=this._getTextWidth(i.text+Q5)t?null:th.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=th.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var t=this.textDecoration(),n=this.fill(),r=this.fontSize(),a=this.glyphInfo;t==="underline"&&e.beginPath();for(var i=0;i=1){var n=t[0].p0;e.moveTo(n.x,n.y)}for(var r=0;re+`.${pM}`).join(" "),_x="nodesRect",az=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],iz={"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 oz="ontouchstart"in oi.Konva._global;function sz(e,t,n){if(e==="rotater")return n;t+=Gt.Util.degToRad(iz[e]||0);var r=(Gt.Util.radToDeg(t)%360+360)%360;return Gt.Util._inRange(r,315+22.5,360)||Gt.Util._inRange(r,0,22.5)?"ns-resize":Gt.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":Gt.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":Gt.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":Gt.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":Gt.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":Gt.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":Gt.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(Gt.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}var B2=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],kx=1e8;function lz(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function gM(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),a=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return{...e,rotation:e.rotation+t,x:r,y:a}}function cz(e,t){const n=lz(e);return gM(e,t,n)}function uz(e,t,n){let r=t;for(let a=0;ar.isAncestorOf(this)?(Gt.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=e=t,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},i=r._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");r.on(i,a),r.on(az.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(e){let t;e.on(`dragstart.${this._getEventNamespace()}`,n=>{t=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(n,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!t)return;const r=e.getAbsolutePosition(),a=r.x-t.x,i=r.y-t.y;this.nodes().forEach(o=>{if(o===e||o.isDragging())return;const s=o.getAbsolutePosition();o.setAbsolutePosition({x:s.x+a,y:s.y+i}),o.startDrag(n)}),t=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(_x),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(_x,this.__getNodeRect)}__getNodeShape(e,t=this.rotation(),n){var r=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=e.getAbsoluteScale(n),i=e.getAbsolutePosition(n),o=r.x*a.x-e.offsetX()*a.x,s=r.y*a.y-e.offsetY()*a.y;const c=(oi.Konva.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),d={x:i.x+o*Math.cos(c)+s*Math.sin(-c),y:i.y+s*Math.cos(c)+o*Math.sin(c),width:r.width*a.x,height:r.height*a.y,rotation:c};return gM(d,-oi.Konva.getAngle(t),{x:0,y:0})}__getNodeRect(){var e=this.getNode();if(!e)return{x:-kx,y:-kx,width:0,height:0,rotation:0};const t=[];this.nodes().map(c=>{const d=c.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var h=[{x:d.x,y:d.y},{x:d.x+d.width,y:d.y},{x:d.x+d.width,y:d.y+d.height},{x:d.x,y:d.y+d.height}],b=c.getAbsoluteTransform();h.forEach(function(y){var m=b.point(y);t.push(m)})});const n=new Gt.Transform;n.rotate(-oi.Konva.getAngle(this.rotation()));var r=1/0,a=1/0,i=-1/0,o=-1/0;t.forEach(function(c){var d=n.point(c);r===void 0&&(r=i=d.x,a=o=d.y),r=Math.min(r,d.x),a=Math.min(a,d.y),i=Math.max(i,d.x),o=Math.max(o,d.y)}),n.invert();const s=n.point({x:r,y:a});return{x:s.x,y:s.y,width:i-r,height:o-a,rotation:oi.Konva.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(),B2.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater")}_createAnchor(e){var t=new tz.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:oz?10:"auto"}),n=this;t.on("mousedown touchstart",function(r){n._handleMouseDown(r)}),t.on("dragstart",r=>{t.stopDrag(),r.cancelBubble=!0}),t.on("dragend",r=>{r.cancelBubble=!0}),t.on("mouseenter",()=>{var r=oi.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),i=sz(e,r,a);t.getStage().content&&(t.getStage().content.style.cursor=i),this._cursorChange=!0}),t.on("mouseout",()=>{t.getStage().content&&(t.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(t)}_createBack(){var e=new ez.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(t,n){var r=n.getParent(),a=r.padding();t.beginPath(),t.rect(-a,-a,n.width()+a*2,n.height()+a*2),t.moveTo(n.width()/2,-a),r.rotateEnabled()&&r.rotateLineVisible()&&t.lineTo(n.width()/2,-r.rotateAnchorOffset()*Gt.Util._sign(n.height())-a),t.fillStrokeShape(n)},hitFunc:(t,n)=>{if(this.shouldOverdrawWholeArea()){var r=this.padding();t.beginPath(),t.rect(-r,-r,n.width()+r*2,n.height()+r*2),t.fillStrokeShape(n)}}});this.add(e),this._proxyDrag(e),e.on("dragstart",t=>{t.cancelBubble=!0}),e.on("dragmove",t=>{t.cancelBubble=!0}),e.on("dragend",t=>{t.cancelBubble=!0}),this.on("dragmove",t=>{this.update()})}_handleMouseDown(e){if(!this._transforming){this._movingAnchorName=e.target.name().split(" ")[0];var t=this._getNodeRect(),n=t.width,r=t.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/a),this.cos=Math.abs(n/a),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 i=e.target.getAbsolutePosition(),o=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-i.x,y:o.y-i.y},_y++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(s=>{s._fire("transformstart",{evt:e.evt,target:s})})}}_handleMouseMove(e){var t,n,r,a=this.findOne("."+this._movingAnchorName),i=a.getStage();i.setPointersPositions(e);const o=i.getPointerPosition();let s={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y};const c=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(c,s,e)),a.setAbsolutePosition(s);const d=a.getAbsolutePosition();if(!(c.x===d.x&&c.y===d.y)){if(this._movingAnchorName==="rotater"){var h=this._getNodeRect();t=a.x()-h.width/2,n=-a.y()+h.height/2;let H=Math.atan2(-n,t)+Math.PI/2;h.height<0&&(H-=Math.PI);var b=oi.Konva.getAngle(this.rotation());const B=b+H,$=oi.Konva.getAngle(this.rotationSnapTolerance()),q=uz(this.rotationSnaps(),B,$)-h.rotation,K=cz(h,q);this._fitNodesInto(K,e);return}var y=this.shiftBehavior(),m;y==="inverted"?m=this.keepRatio()&&!e.shiftKey:y==="none"?m=this.keepRatio():m=this.keepRatio()||e.shiftKey;var _=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(m){var p=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(p.x-a.x(),2)+Math.pow(p.y-a.y(),2));var w=this.findOne(".top-left").x()>p.x?-1:1,E=this.findOne(".top-left").y()>p.y?-1:1;t=r*this.cos*w,n=r*this.sin*E,this.findOne(".top-left").x(p.x-t),this.findOne(".top-left").y(p.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(m){var p=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(a.x()-p.x,2)+Math.pow(p.y-a.y(),2));var w=this.findOne(".top-right").x()p.y?-1:1;t=r*this.cos*w,n=r*this.sin*E,this.findOne(".top-right").x(p.x+t),this.findOne(".top-right").y(p.y-n)}var C=a.position();this.findOne(".top-left").y(C.y),this.findOne(".bottom-right").x(C.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(m){var p=_?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(p.x-a.x(),2)+Math.pow(a.y()-p.y,2));var w=p.x{var a;r._fire("transformend",{evt:e,target:r}),(a=r.getLayer())===null||a===void 0||a.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,t){var n=this._getNodeRect();const r=1;if(Gt.Util._inRange(e.width,-this.padding()*2-r,r)){this.update();return}if(Gt.Util._inRange(e.height,-this.padding()*2-r,r)){this.update();return}var a=new Gt.Transform;if(a.rotate(oi.Konva.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const b=a.point({x:-this.padding()*2,y:0});e.x+=b.x,e.y+=b.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const b=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const b=a.point({x:0,y:-this.padding()*2});e.x+=b.x,e.y+=b.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const b=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=b.x,this._anchorDragOffset.y-=b.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const b=this.boundBoxFunc()(n,e);b?e=b:Gt.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,o=new Gt.Transform;o.translate(n.x,n.y),o.rotate(n.rotation),o.scale(n.width/i,n.height/i);const s=new Gt.Transform,c=e.width/i,d=e.height/i;this.flipEnabled()===!1?(s.translate(e.x,e.y),s.rotate(e.rotation),s.translate(e.width<0?e.width:0,e.height<0?e.height:0),s.scale(Math.abs(c),Math.abs(d))):(s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(c,d));const h=s.multiply(o.invert());this._nodes.forEach(b=>{var y;const m=b.getParent().getAbsoluteTransform(),p=b.getTransform().copy();p.translate(b.offsetX(),b.offsetY());const w=new Gt.Transform;w.multiply(m.copy().invert()).multiply(h).multiply(m).multiply(p);const E=w.decompose();b.setAttrs(E),(y=b.getLayer())===null||y===void 0||y.batchDraw()}),this.rotation(Gt.Util._getRotation(e.rotation)),this._nodes.forEach(b=>{this._fire("transform",{evt:t,target:b}),b._fire("transform",{evt:t,target:b})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,t){this.findOne(e).setAttrs(t)}update(){var e,t=this._getNodeRect();this.rotation(Gt.Util._getRotation(t.rotation));var n=t.width,r=t.height,a=this.enabledAnchors(),i=this.resizeEnabled(),o=this.padding(),s=this.anchorSize();const c=this.find("._anchor");c.forEach(h=>{h.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+o,offsetY:s/2+o,visible:i&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+o,visible:i&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-o,offsetY:s/2+o,visible:i&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+o,visible:i&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-o,visible:i&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+o,offsetY:s/2-o,visible:i&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-o,visible:i&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-o,offsetY:s/2-o,visible:i&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*Gt.Util._sign(r)-o,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const d=this.anchorStyleFunc();d&&c.forEach(h=>{d(h)}),(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);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),Sx.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return Cx.Node.prototype.toObject.call(this)}clone(e){var t=Cx.Node.prototype.clone.call(this,e);return t}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};z2.Transformer=St,St.isTransforming=()=>_y>0;function dz(e){return e instanceof Array||Gt.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){B2.indexOf(t)===-1&&Gt.Util.warn("Unknown anchor name: "+t+". Available names are: "+B2.join(", "))}),e||[]}St.prototype.className="Transformer",(0,nz._registerNode)(St),Lt.Factory.addGetterSetter(St,"enabledAnchors",B2,dz),Lt.Factory.addGetterSetter(St,"flipEnabled",!0,(0,os.getBooleanValidator)()),Lt.Factory.addGetterSetter(St,"resizeEnabled",!0),Lt.Factory.addGetterSetter(St,"anchorSize",10,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"rotateEnabled",!0),Lt.Factory.addGetterSetter(St,"rotateLineVisible",!0),Lt.Factory.addGetterSetter(St,"rotationSnaps",[]),Lt.Factory.addGetterSetter(St,"rotateAnchorOffset",50,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"rotateAnchorCursor","crosshair"),Lt.Factory.addGetterSetter(St,"rotationSnapTolerance",5,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"borderEnabled",!0),Lt.Factory.addGetterSetter(St,"anchorStroke","rgb(0, 161, 255)"),Lt.Factory.addGetterSetter(St,"anchorStrokeWidth",1,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"anchorFill","white"),Lt.Factory.addGetterSetter(St,"anchorCornerRadius",0,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"borderStroke","rgb(0, 161, 255)"),Lt.Factory.addGetterSetter(St,"borderStrokeWidth",1,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"borderDash"),Lt.Factory.addGetterSetter(St,"keepRatio",!0),Lt.Factory.addGetterSetter(St,"shiftBehavior","default"),Lt.Factory.addGetterSetter(St,"centeredScaling",!1),Lt.Factory.addGetterSetter(St,"ignoreStroke",!1),Lt.Factory.addGetterSetter(St,"padding",0,(0,os.getNumberValidator)()),Lt.Factory.addGetterSetter(St,"node"),Lt.Factory.addGetterSetter(St,"nodes"),Lt.Factory.addGetterSetter(St,"boundBoxFunc"),Lt.Factory.addGetterSetter(St,"anchorDragBoundFunc"),Lt.Factory.addGetterSetter(St,"anchorStyleFunc"),Lt.Factory.addGetterSetter(St,"shouldOverdrawWholeArea",!1),Lt.Factory.addGetterSetter(St,"useSingleNodeRotation",!0),Lt.Factory.backCompat(St,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var H2={};Object.defineProperty(H2,"__esModule",{value:!0}),H2.Wedge=void 0;const lf=dt,hz=er,fz=ct,Ex=Be,pz=ct;let oo=class extends hz.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,fz.Konva.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)}};H2.Wedge=oo,oo.prototype.className="Wedge",oo.prototype._centroid=!0,oo.prototype._attrsAffectingSize=["radius"],(0,pz._registerNode)(oo),lf.Factory.addGetterSetter(oo,"radius",0,(0,Ex.getNumberValidator)()),lf.Factory.addGetterSetter(oo,"angle",0,(0,Ex.getNumberValidator)()),lf.Factory.addGetterSetter(oo,"clockwise",!1),lf.Factory.backCompat(oo,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var G2={};Object.defineProperty(G2,"__esModule",{value:!0}),G2.Blur=void 0;const Ox=dt,gz=dn,mz=Be;function Px(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var vz=[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,396,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],yz=[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 bz(e,t){var n=e.data,r=e.width,a=e.height,i,o,s,c,d,h,b,y,m,p,w,E,C,_,f,x,k,M,j,P,D,I,R,H,B=t+t+1,$=r-1,q=a-1,K=t+1,se=K*(K+1)/2,Y=new Px,he=null,Q=Y,te=null,J=null,ee=vz[t],ie=yz[t];for(s=1;s>ie,R!==0?(R=255/R,n[h]=(y*ee>>ie)*R,n[h+1]=(m*ee>>ie)*R,n[h+2]=(p*ee>>ie)*R):n[h]=n[h+1]=n[h+2]=0,y-=E,m-=C,p-=_,w-=f,E-=te.r,C-=te.g,_-=te.b,f-=te.a,c=b+((c=i+t+1)<$?c:$)<<2,x+=te.r=n[c],k+=te.g=n[c+1],M+=te.b=n[c+2],j+=te.a=n[c+3],y+=x,m+=k,p+=M,w+=j,te=te.next,E+=P=J.r,C+=D=J.g,_+=I=J.b,f+=R=J.a,x-=P,k-=D,M-=I,j-=R,J=J.next,h+=4;b+=r}for(i=0;i>ie,R>0?(R=255/R,n[c]=(y*ee>>ie)*R,n[c+1]=(m*ee>>ie)*R,n[c+2]=(p*ee>>ie)*R):n[c]=n[c+1]=n[c+2]=0,y-=E,m-=C,p-=_,w-=f,E-=te.r,C-=te.g,_-=te.b,f-=te.a,c=i+((c=o+K)0&&bz(e,t)};G2.Blur=wz,Ox.Factory.addGetterSetter(gz.Node,"blurRadius",0,(0,mz.getNumberValidator)(),Ox.Factory.afterSetFilter);var U2={};Object.defineProperty(U2,"__esModule",{value:!0}),U2.Brighten=void 0;const Mx=dt,xz=dn,Cz=Be,Sz=function(e){var t=this.brightness()*255,n=e.data,r=n.length,a;for(a=0;a255?255:a,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,n[s]=a,n[s+1]=i,n[s+2]=o};V2.Contrast=Ez,Tx.Factory.addGetterSetter(_z.Node,"contrast",0,(0,kz.getNumberValidator)(),Tx.Factory.afterSetFilter);var W2={};Object.defineProperty(W2,"__esModule",{value:!0}),W2.Emboss=void 0;const ss=dt,cf=dn,Oz=Cn,Ix=Be,Pz=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),a=this.embossBlend(),i=0,o=0,s=e.data,c=e.width,d=e.height,h=c*4,b=d;switch(r){case"top-left":i=-1,o=-1;break;case"top":i=-1,o=0;break;case"top-right":i=-1,o=1;break;case"right":i=0,o=1;break;case"bottom-right":i=1,o=1;break;case"bottom":i=1,o=0;break;case"bottom-left":i=1,o=-1;break;case"left":i=0,o=-1;break;default:Oz.Util.error("Unknown emboss direction: "+r)}do{var y=(b-1)*h,m=i;b+m<1&&(m=0),b+m>d&&(m=0);var p=(b-1+m)*c*4,w=c;do{var E=y+(w-1)*4,C=o;w+C<1&&(C=0),w+C>c&&(C=0);var _=p+(w-1+C)*4,f=s[E]-s[_],x=s[E+1]-s[_+1],k=s[E+2]-s[_+2],M=f,j=M>0?M:-M,P=x>0?x:-x,D=k>0?k:-k;if(P>j&&(M=x),D>j&&(M=k),M*=t,a){var I=s[E]+M,R=s[E+1]+M,H=s[E+2]+M;s[E]=I>255?255:I<0?0:I,s[E+1]=R>255?255:R<0?0:R,s[E+2]=H>255?255:H<0?0:H}else{var B=n-M;B<0?B=0:B>255&&(B=255),s[E]=s[E+1]=s[E+2]=B}}while(--w)}while(--b)};W2.Emboss=Pz,ss.Factory.addGetterSetter(cf.Node,"embossStrength",.5,(0,Ix.getNumberValidator)(),ss.Factory.afterSetFilter),ss.Factory.addGetterSetter(cf.Node,"embossWhiteLevel",.5,(0,Ix.getNumberValidator)(),ss.Factory.afterSetFilter),ss.Factory.addGetterSetter(cf.Node,"embossDirection","top-left",null,ss.Factory.afterSetFilter),ss.Factory.addGetterSetter(cf.Node,"embossBlend",!1,null,ss.Factory.afterSetFilter);var X2={};Object.defineProperty(X2,"__esModule",{value:!0}),X2.Enhance=void 0;const Ax=dt,Mz=dn,Tz=Be;function n4(e,t,n,r,a){var i=n-t,o=a-r,s;return i===0?r+o/2:o===0?r:(s=(e-t)/i,s=o*s+r,s)}const Iz=function(e){var t=e.data,n=t.length,r=t[0],a=r,i,o=t[1],s=o,c,d=t[2],h=d,b,y,m=this.enhance();if(m!==0){for(y=0;ya&&(a=i),c=t[y+1],cs&&(s=c),b=t[y+2],bh&&(h=b);a===r&&(a=255,r=0),s===o&&(s=255,o=0),h===d&&(h=255,d=0);var p,w,E,C,_,f,x,k,M;for(m>0?(w=a+m*(255-a),E=r-m*(r-0),_=s+m*(255-s),f=o-m*(o-0),k=h+m*(255-h),M=d-m*(d-0)):(p=(a+r)*.5,w=a+m*(a-p),E=r+m*(r-p),C=(s+o)*.5,_=s+m*(s-C),f=o+m*(o-C),x=(h+d)*.5,k=h+m*(h-x),M=d+m*(d-x)),y=0;yC?E:C;var _=o,f=i,x,k,M=360/f*Math.PI/180,j,P;for(k=0;kf?_:f;var x=o,k=i,M,j,P=0,D,I;for(h=0;ht&&(x=f,k=0,M=-1),a=0;a=0&&m=0&&p