InvokeAI/invokeai/frontend/web/dist/assets/App-16da1b5e.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

189 lines
590 KiB
JavaScript
Raw Normal View History

2023-03-14 18:11:42 +00:00
import{r as g,f as fe,j as l,u as zS,c as re,a as Ae,b as Ee,w as ts,d as un,o as At,S as Xf,e as go,g as qe,h as Rr,k as Jo,i as yc,_ as Yd,l as RS,m as NS,R as Me,n as Ev,p as FS,q as Kd,s as ea,t as y1,v as x1,x as LS,y as BS,z as ee,A as b1,B as S1,C as xc,D as ns,F as B,E as X,G as HS,H as cd,T as Ce,I as C1,J as WS,K as rs,L as Pv,M as VS,N as US,O as $S,P as Wo,Q as w1,U as Iv,V as GS,W as k1,X as qS,Y as YS,Z as KS,$ as j1,a0 as XS,a1 as QS,a2 as ZS,a3 as JS,a4 as e3,a5 as t3,a6 as n3,a7 as E1,a8 as r3,a9 as o3,aa as ql,ab as i3,ac as a3,ad as Nl,ae as Yl,af as Xd,ag as Qd,ah as Zd,ai as s3,aj as P1,ak as l3,al as I1,am as c3,an as M1,ao as T1,ap as Vo,aq as jn,ar as _1,as as os,at as u3,au as d3,av as D1,aw as Jd,ax as ef,ay as A1,az as tf,aA as nf,aB as Mv,aC as O1,aD as z1,aE as R1,aF as Fl,aG as Ll,aH as f3,aI as rf,aJ as N1,aK as F1,aL as L1,aM as h3,aN as p3,aO as Tv,aP as _v,aQ as m3,aR as v3,aS as g3,aT as B1,aU as H1,aV as y3,aW as x3,aX as W1,aY as Dv,aZ as b3,a_ as Av,a$ as S3,b0 as C3,b1 as V1,b2 as w3,b3 as k3,b4 as j3,b5 as ud,b6 as Ov,b7 as U1,b8 as of,b9 as E3,ba as zv,bb as Bl,bc as P3,bd as I3,be as Va,bf as Kl,bg as $1,bh as Xl,bi as M3,bj as T3,bk as br,bl as G1,bm as Qf,bn as is,bo as _3,bp as D3,bq as A3,br as wr,bs as q1,bt as O3,bu as z3,bv as Y1,bw as R3,bx as N3,by as F3,bz as L3,bA as B3,bB as H3,bC as W3,bD as V3,bE as U3,bF as Rv,bG as $3,bH as G3,bI as q3,bJ as Y3,bK as K3,bL as X3,bM as dd,bN as Oa,bO as pl,bP as Nv,bQ as fd,bR as hd,bS as ml,bT as Fv,bU as af,bV as Q3,bW as Z3,bX as J3,bY as bc,bZ as eC,b_ as tC,b$ as nC,c0 as rC,c1 as vl,c2 as pd,c3 as gl,c4 as Ia,c5 as oC,c6 as iC,c7 as K1,c8 as Ql,c9 as Zf,ca as X1,cb as Q1,cc as Z1,cd as aC,ce as J1,cf as e2,cg as t2,ch as n2,ci as r2,cj as Fi,ck as Li,cl as o2,cm as i2,cn as a2,co as s2,cp as l2,cq as sC,cr as lC,cs as Lv,ct as yl,cu as cC,cv as Bv,cw as Hv,cx as Wv,cy as Vv,cz as uC,cA as dC,cB as sf,cC as fC,cD as Uv,cE as xl,cF as Zl,cG as hC,cH as pC,cI as mC,cJ as vC,cK as c2,cL as gC,cM as yC}from"./index-d64f4654.js";import{I as tn,u as xC,c as bC,a as jt,b as Wt,A as yo,m as ir,d as Bi,e as ei,P as Ua,f as SC,C as CC,g as Y,h as A}from"./storeHooks-0eed8e9f.js";function wC(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Jl="NOT_FOUND";function kC(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Jl},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function jC(e,t){var n=[];function r(u){var f=n.findIndex(function(h){return t(u,h.key)});if(f>-1){var p=n[f];return f>0&&(n.splice(f,1),n.unshift(p)),p.value}return Jl}function o(u,f){r(u)===Jl&&(n.unshift({key:u,value:f}),n.length>e&&n.pop())}function s(){return n}function c(){n=[]}return{get:r,put:o,getEntries:s,clear:c}}var EC=function(t,n){return t===n};function PC(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function IC(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,o=r===void 0?EC:r,s=n.maxSize,c=s===void 0?1:s,u=n.resultEqualityCheck,f=PC(o),p=c===1?kC(f):jC(c,f);function h(){var y=p.get(arguments);if(y===Jl){if(y=e.apply(null,arguments),u){var x=p.getEntries(),S=x.find(function(C){return u(C.value,y)});S&&(y=S.value)}p.put(arguments,y)}return y}return h.clearCache=function(){return p.clear()},h}function MC(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function TC(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var c=arguments.length,u=new Array(c),f=0;f<c;f++)u[f]=arguments[f];var p=0,h,y={memoizeOptions:void 0},x=u.pop();if(typeof x=="object"&&(y=x,x=u.pop()),typeof
`})}function sw(e){ts({condition:e.isOpen&&!!e.isDisabled,message:"Cannot open a disabled accordion item"})}function Ai(e){const{isOpen:t,isDisabled:n}=th(),{reduceMotion:r}=rh(),o=Ae("chakra-accordion__icon",e.className),s=Cc(),c={opacity:n?.4:1,transform:t?"rotate(-180deg)":void 0,transition:r?void 0:"transform 0.2s",transformOrigin:"center",...s.icon};return l.jsx(tn,{viewBox:"0 0 24 24","aria-hidden":!0,className:o,__css:c,...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}Ai.displayName="AccordionIcon";var Oi=fe(function(t,n){const{children:r,className:o}=t,{htmlProps:s,...c}=rw(t),f={...Cc().container,overflowAnchor:"none"},p=g.useMemo(()=>c,[c]);return l.jsx(QC,{value:p,children:l.jsx(re.div,{ref:n,...s,className:Ae("chakra-accordion__item",o),__css:f,children:typeof r=="function"?r({isExpanded:!!c.isOpen,isDisabled:!!c.isDisabled}):r})})});Oi.displayName="AccordionItem";var Bo={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1]},Ma={scale:{enter:{scale:1},exit:{scale:.95}},fade:{enter:{opacity:1},exit:{opacity:0}},pushLeft:{enter:{x:"100%"},exit:{x:"-30%"}},pushRight:{enter:{x:"-100%"},exit:{x:"30%"}},pushUp:{enter:{y:"100%"},exit:{y:"-30%"}},pushDown:{enter:{y:"-100%"},exit:{y:"30%"}},slideLeft:{position:{left:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"-100%",y:0}},slideRight:{position:{right:0,top:0,bottom:0,width:"100%"},enter:{x:0,y:0},exit:{x:"100%",y:0}},slideUp:{position:{top:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"-100%"}},slideDown:{position:{bottom:0,left:0,right:0,maxWidth:"100vw"},enter:{x:0,y:0},exit:{x:0,y:"100%"}}};function df(e){var t;switch((t=e==null?void 0:e.direction)!=null?t:"right"){case"right":return Ma.slideRight;case"left":return Ma.slideLeft;case"bottom":return Ma.slideDown;case"top":return Ma.slideUp;default:return Ma.slideRight}}var Uo={enter:{duration:.2,ease:Bo.easeOut},exit:{duration:.1,ease:Bo.easeIn}},nr={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},lw=e=>e!=null&&parseInt(e.toString(),10)>0,Kv={exit:{height:{duration:.2,ease:Bo.ease},opacity:{duration:.3,ease:Bo.ease}},enter:{height:{duration:.3,ease:Bo.ease},opacity:{duration:.4,ease:Bo.ease}}},cw={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:lw(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(s=n==null?void 0:n.exit)!=null?s:nr.exit(Kv.exit,o)}},enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>{var s;return{...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(s=n==null?void 0:n.enter)!=null?s:nr.enter(Kv.enter,o)}}},m2=g.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:s=0,endingHeight:c="auto",style:u,className:f,transition:p,transitionEnd:h,...y}=e,[x,S]=g.useState(!1);g.useEffect(()=>{const I=setTimeout(()=>{S(!0)});return()=>clearTimeout(I)},[]),ts({condition:Boolean(s>0&&r),message:"startingHeight and unmountOnExit are mutually exclusive. You can't use them together"});const C=parseFloat(s.toString())>0,k={startingHeight:s,endingHeight:c,animateOpacity:o,transition:x?p:{enter:{duration:0}},transitionEnd:{enter:h==null?void 0:h.enter,exit:r?h==null?void 0:h.exit:{...h==null?void 0:h.exit,display:C?"block":"none"}}},w=r?n:!0,j=n||r?"enter":"exit";return l.jsx(yo,{initial:!1,custom:k,children:w&&l.jsx(ir.div,{ref:t,...y,className:Ae("chakra-collapse",f),style:{overflow:"hidden",display:"block",...u},custom:k,variants:cw,initial:r?"exit":!1,animate:j,exit:"exit"})})});m2.displayName="Collapse";var uw={enter:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:1,transition:(r=e==null?void 0:e.enter)!=null?r:nr.enter(Uo.enter,n),transitionEnd:t==null?void 0:t.enter}},exit:({transition:e,transitionEnd:t,delay:n}={})=>{var r;return{opacity:0,transition:(r=e==null?void 0:e.exit)!=null?r:nr.exit(Uo.exit,n),transitionEnd:t==null?void 0:t.exit
.`.concat(Uj,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(u,"px ").concat(r,`;
}
body {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(s,`px;
padding-right: `).concat(c,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(u,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Vl,` {
right: `).concat(u,"px ").concat(r,`;
}
.`).concat(Ul,` {
margin-right: `).concat(u,"px ").concat(r,`;
}
.`).concat(Vl," .").concat(Vl,` {
right: 0 `).concat(r,`;
}
.`).concat(Ul," .").concat(Ul,` {
margin-right: 0 `).concat(r,`;
}
body {
`).concat($j,": ").concat(u,`px;
}
`)},r7=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,s=g.useMemo(function(){return e7(o)},[o]);return g.createElement(t7,{styles:n7(s,!t,o,n?"":"!important")})},Pf=!1;if(typeof window<"u")try{var wl=Object.defineProperty({},"passive",{get:function(){return Pf=!0,!0}});window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{Pf=!1}var Ei=Pf?{passive:!1}:!1,o7=function(e){return e.tagName==="TEXTAREA"},Wy=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!o7(e)&&n[t]==="visible")},i7=function(e){return Wy(e,"overflowY")},a7=function(e){return Wy(e,"overflowX")},Eg=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=Vy(e,n);if(r){var o=Uy(e,n),s=o[1],c=o[2];if(s>c)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},s7=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},l7=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Vy=function(e,t){return e==="v"?i7(t):a7(t)},Uy=function(e,t){return e==="v"?s7(t):l7(t)},c7=function(e,t){return e==="h"&&t==="rtl"?-1:1},u7=function(e,t,n,r,o){var s=c7(e,window.getComputedStyle(t).direction),c=s*r,u=n.target,f=t.contains(u),p=!1,h=c>0,y=0,x=0;do{var S=Uy(e,u),C=S[0],k=S[1],w=S[2],j=k-w-s*C;(C||j)&&Vy(e,u)&&(y+=j,x+=C),u=u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(h&&(o&&y===0||!o&&c>y)||!h&&(o&&x===0||!o&&-c>x))&&(p=!0),p},kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Pg=function(e){return[e.deltaX,e.deltaY]},Ig=function(e){return e&&"current"in e?e.current:e},d7=function(e,t){return e[0]===t[0]&&e[1]===t[1]},f7=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},h7=0,Pi=[];function p7(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(h7++)[0],s=g.useState(function(){return Hy()})[0],c=g.useRef(e);g.useEffect(function(){c.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var k=xf([e.lockRef.current],(e.shards||[]).map(Ig),!0).filter(Boolean);return k.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),k.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=g.useCallback(function(k,w){if("touches"in k&&k.touches.length===2)return!c.current.allowPinchZoom;var j=kl(k),I=n.current,P="deltaX"in k?k.deltaX:I[0]-j[0],M="deltaY"in k?k.deltaY:I[1]-j[1],T,D=k.target,_=Math.abs(P)>Math.abs(M)?"h":"v";if("touches"in k&&_==="h"&&D.type==="range")return!1;var R=Eg(_,D);if(!R)return!0;if(R?T=_:(T=_==="v"?"h":"v",R=Eg(_,D)),!R)return!1;if(!r.current&&"changedTouches"in k&&(P||M)&&(r.current=T),!T)return!0;var V=r.current||T;return u7(V,w,k,V==="h"?P:M,!0)},[]),f=g.useCallback(function(k){var w=k;if(!(!Pi.length||Pi[Pi.length-1]!==s)){var j="deltaY"in w?Pg(w):kl(w),I=t.current.filter(function(T){return T.name===w.type&&T.target===w.target&&d7(T.delta,j)})[0];if(I&&I.should){w.cancelable&&w.preventDefault();return}if(!I){var P=(c.current.shards||[]).map(Ig).filter(Boolean).filter(function(T){return T.contains(w.target)}),M=P.length>0?u(w,P[0]):!c.current.noIsolation;M&&w.cancelable&&w.preventDefault()}}},[]),p=g.useCallback(function(k,w,j,I){var P={name:k,delta:w,target:j,should:I};t.current.push(P),setTimeout(function(){t.current=t.current.filter(function(M){return M!==P})},1)},[]),h=g.useCallback(function(k){n.current=kl(k),r.current=void 0},[]),y=g.useCallback(function(k){p(k.type,Pg(k),k.target,u(k,e.lockRef.current))},[]),x=g.useCallback(function(k){p(k.type,kl(k),k.target,u(k,e.lockRef.current))},[]);g.useEffect(function(){return Pi.push(s),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ei),document.addEventListener("touchmove",f,Ei),document.addEventListener("touchstart",h,Ei),function(){Pi=Pi.filter(function(k){return k!==s}),document.removeEventListener("wheel",f,Ei),document.removeEventListener("touchmove",f,Ei),document.removeEventListener("touchstart",h,Ei)}},[]);var S=e.removeScrollBar,C=e.inert;return g.createElement(g.Fragment,null,C?g.createElement(s,{styles:f7(o)}):null,S?g.createElement(r7,{gapMode:"margin"}):null)}const m7=m5(By,p7);var $y=g.forwardRef(function(e,t){return g.createElement(Pc,yr({},e,{ref:t,sideCar:m7}))});$y.classNames=Pc.classNames;const v7=$y;function g7(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:s,allowPinchZoom:c,finalFocusRef:u,returnFocusOnClose:f,preserveScrollBarGap:p,lockFocusAcrossFrames:h,isOpen:y}=Qo(),[x,S]=SC();g.useEffect(()=>{!x&&S&&setTimeout(S)},[x,S]);const C=Fy(r,y);return l.jsx(fy,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:u,restoreFocus:f,contentRef:r,lockFocusAcrossFrames:h,children:l.jsx(v7,{removeScrollBar:!p,allowPinchZoom:c,enabled:C===1&&s,forwardProps:!0,children:e.children})})}var mo=fe((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:s,...c}=e,{getDialogProps:u,getDialogContainerProps:f}=Qo(),p=u(c,t),h=f(o),y=Ae("chakra-modal__content",n),x=oa(),S={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...x.dialog},C={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...x.dialogContainer},{motionPreset:k}=Qo();return l.jsx(g7,{children:l.jsx(re.div,{...h,className:"chakra-modal__content-container",tabIndex:-1,__css:C,children:l.jsx(Ny,{preset:k,motionProps:s,className:y,...p,__css:S,children:r})})})});mo.displayName="ModalContent";function Gy(e){const{leastDestructiveRef:t,...n}=e;return l.jsx(po,{...n,initialFocusRef:t})}var qy=fe((e,t)=>l.jsx(mo,{ref:t,role:"alertdialog",...e})),Fr=fe((e,t
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function uE(e){if(Array.isArray(e))return _f(e)}function Bg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Hg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Bg(Object(n),!0).forEach(function(r){xx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qa(e,t){return hE(e)||fE(e,t)||bx(e,t)||dE()}function dE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bx(e,t){if(e){if(typeof e=="string")return _f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _f(e,t)}}function _f(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function hE(e){if(Array.isArray(e))return e}var pE="file-invalid-type",mE="file-too-large",vE="file-too-small",gE="too-many-files",yE=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:pE,message:"File type must be ".concat(n)}},Wg=function(t){return{code:mE,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Vg=function(t){return{code:vE,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},xE={code:gE,message:"Too many files"};function Sx(e,t){var n=e.type==="application/x-moz-file"||sE(e,t);return[n,n?null:yE(t)]}function Cx(e,t,n){if(Lo(e.size))if(Lo(t)&&Lo(n)){if(e.size>n)return[!1,Wg(n)];if(e.size<t)return[!1,Vg(t)]}else{if(Lo(t)&&e.size<t)return[!1,Vg(t)];if(Lo(n)&&e.size>n)return[!1,Wg(n)]}return[!0,null]}function Lo(e){return e!=null}function bE(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,c=e.maxFiles,u=e.validator;return!s&&t.length>1||s&&c>=1&&t.length>c?!1:t.every(function(f){var p=Sx(f,n),h=Qa(p,1),y=h[0],x=Cx(f,r,o),S=Qa(x,1),C=S[0],k=u?u(f):null;return y&&C&&!k})}function cc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Pl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Ug(e){e.preventDefault()}function SE(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function CE(e){return e.indexOf("Edge/")!==-1}function wE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return SE(e)||CE(e)}function mr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),c=1;c<o;c++)s[c-1]=arguments[c];return t.some(function(u){return!cc(r)&&u&&u.apply(void 0,[r].concat(s)),cc(r)})}}function kE(){return"showOpenFilePicker"in window}function jE(e){if(Lo(e)){var t=Object.entries(e).filter(function(n){var r=Qa(n,2),o=r[0],s=r[1],c=!0;return wx(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(s)||!s.every(kx))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Qa(r,2),s=o[0],c=o[1];return Hg(Hg({},n),{},xx({},s,c))},{});return[{description:"Files",accept:t}]}return e}function EE(e){if(Lo(e))return Object.entries(e).reduce(function(t,n){var r=Qa(n,2),o=r[0],s=r[1];return[].concat(Lg(t),[o],Lg(s))},[]).filter(function(t){return wx(t)||kx(t)}).join(",")}function PE(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function IE(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function wx(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function kx(e){return/^.*\.[\w]+$/.test(e)}var ME=["children"],TE=["open"],_E=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDr
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zE(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RE(e){if(Array.isArray(e))return Df(e)}function Dd(e,t){return LE(e)||FE(e,t)||jx(e,t)||NE()}function NE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jx(e,t){if(e){if(typeof e=="string")return Df(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Df(e,t)}}function Df(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FE(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,s=!1,c,u;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){s=!0,u=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(s)throw u}}return r}}function LE(e){if(Array.isArray(e))return e}function $g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Dt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$g(Object(n),!0).forEach(function(r){Af(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Af(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uc(e,t){if(e==null)return{};var n=BE(e,t),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function BE(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Kh=g.forwardRef(function(e,t){var n=e.children,r=uc(e,ME),o=Px(r),s=o.open,c=uc(o,TE);return g.useImperativeHandle(t,function(){return{open:s}},[s]),Me.createElement(g.Fragment,null,n(Dt(Dt({},c),{},{open:s})))});Kh.displayName="Dropzone";var Ex={disabled:!1,getFilesFromEvent:Z8,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Kh.defaultProps=Ex;Kh.propTypes={children:lt.func,accept:lt.objectOf(lt.arrayOf(lt.string)),multiple:lt.bool,preventDropOnDocument:lt.bool,noClick:lt.bool,noKeyboard:lt.bool,noDrag:lt.bool,noDragEventsBubbling:lt.bool,minSize:lt.number,maxSize:lt.number,maxFiles:lt.number,disabled:lt.bool,getFilesFromEvent:lt.func,onFileDialogCancel:lt.func,onFileDialogOpen:lt.func,useFsAccessApi:lt.bool,autoFocus:lt.bool,onDragEnter:lt.func,onDragLeave:lt.func,onDragOver:lt.func,onDrop:lt.func,onDropAccepted:lt.func,onDropRejected:lt.func,onError:lt.func,validator:lt.func};var Of={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Px(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Dt(Dt({},Ex),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,s=t.maxSize,c=t.minSize,u=t.multiple,f=t.maxFiles,p=t.onDragEnter,h=t.onDragLeave,y=t.onDragOver,x=t.onDrop,S=t.onDropAccepted,C=t.onDropRejected,k=t.onFileDialogCancel,w=t.onFileDialogOpen,j=t.useFsAccessApi,I=t.autoFocus,P=t.preventDropOnDocument,M=t.noClick,T=t.noKeyboard,D=t.noDrag,_=t.noDragEventsBubbling,R=t.onError,V=t.validator,F=g.useMemo(function(){return EE(n)},[n]),L=g.useMemo(function(){return jE(n)},[n]),Q=g.useMemo(function(){return typeof w=="function"?w:Gg},[w]),U=g.useMemo(function(){return typeof k=="function"?k:Gg},[k]),K=g.useRef(null),te=g.useRef(null),ne=g.useReducer(HE,Of),$=Dd(ne,2),Z=$[0],oe=$[1],le=Z.isFocused,Re=Z.isFileDialogActive,Ne=g.useRef(typeof window<"u"&&window.isSecureContext&&j&&kE()),Ie=function(){!Ne.current&&Re&&setTimeout(function(){if(te.current){var ae=te.current.files;ae.length||(oe({type:"closeDialog"}),U())}},300)};g.useEffe
${D.message}`,"");o({title:s("toast.uploadFailed"),description:M,status:"error",isClosable:!0})},[s,o]),h=g.useCallback(async P=>{n(Rg({imageFile:P}))},[n]),y=g.useCallback((P,M)=>{M.forEach(T=>{p(T)}),P.forEach(T=>{h(T)})},[h,p]),{getRootProps:x,getInputProps:S,isDragAccept:C,isDragReject:k,isDragActive:w,open:j}=Px({accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg",".png"]},noClick:!0,onDrop:y,onDragOver:()=>u(!0),maxFiles:1});f(j),g.useEffect(()=>{const P=M=>{var R;const T=(R=M.clipboardData)==null?void 0:R.items;if(!T)return;const D=[];for(const V of T)V.kind==="file"&&["image/png","image/jpg"].includes(V.type)&&D.push(V);if(!D.length)return;if(M.stopImmediatePropagation(),D.length>1){o({description:s("toast.uploadFailedMultipleImagesDesc"),status:"error",isClosable:!0});return}const _=D[0].getAsFile();if(!_){o({description:s("toast.uploadFailedUnableToLoadDesc"),status:"error",isClosable:!0});return}n(Rg({imageFile:_}))};return document.addEventListener("paste",P),()=>{document.removeEventListener("paste",P)}},[s,n,o,r]);const I=["img2img","unifiedCanvas"].includes(r)?` to ${String(s(`common.${r}`))}`:"";return l.jsx(qh.Provider,{value:j,children:l.jsxs(Ye,{...x({style:{}}),onKeyDown:P=>{P.key},children:[l.jsx("input",{...S()}),t,w&&c&&l.jsx(n9,{isDragAccept:C,isDragReject:k,overlaySecondaryText:I,setIsHandlingUpload:u})]})})},o9=g.memo(r9),Ax=fe((e,t)=>{const{role:n,tooltip:r="",tooltipProps:o,isChecked:s,...c}=e;return l.jsx(Gt,{label:r,hasArrow:!0,...o,...o!=null&&o.placement?{placement:o.placement}:{placement:"top"},children:l.jsx(fo,{ref:t,role:n,"aria-checked":s!==void 0?s:void 0,...c})})});Ax.displayName="IAIIconButton";const se=g.memo(Ax);var i9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Bt=globalThis&&globalThis.__assign||function(){return Bt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Bt.apply(this,arguments)},Yg={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},Kg={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},Il={width:"20px",height:"20px",position:"absolute"},a9={top:Bt(Bt({},Yg),{top:"-5px"}),right:Bt(Bt({},Kg),{left:void 0,right:"-5px"}),bottom:Bt(Bt({},Yg),{top:void 0,bottom:"-5px"}),left:Bt(Bt({},Kg),{left:"-5px"}),topRight:Bt(Bt({},Il),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:Bt(Bt({},Il),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:Bt(Bt({},Il),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:Bt(Bt({},Il),{left:"-10px",top:"-10px",cursor:"nw-resize"})},s9=function(e){i9(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.onMouseDown=function(r){n.props.onResizeStart(r,n.props.direction)},n.onTouchStart=function(r){n.props.onResizeStart(r,n.props.direction)},n}return t.prototype.render=function(){return g.createElement("div",{className:this.props.className||"",style:Bt(Bt({position:"absolute",userSelect:"none"},a9[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(g.PureComponent),l9=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gr=globalThis&&globalThis.__assign||function(){return gr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProp
* @license React
* react-reconciler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var pO=function(t){var n={},r=g,o=Bl,s=Object.assign;function c(i){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d]);return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,f=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),x=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),T=Symbol.iterator;function D(i){return i===null||typeof i!="object"?null:(i=T&&i[T]||i["@@iterator"],typeof i=="function"?i:null)}function _(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case h:return"Fragment";case p:return"Portal";case x:return"Profiler";case y:return"StrictMode";case w:return"Suspense";case j:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case C:return(i.displayName||"Context")+".Consumer";case S:return(i._context.displayName||"Context")+".Provider";case k:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case I:return a=i.displayName||null,a!==null?a:_(i.type)||"Memo";case P:a=i._payload,i=i._init;try{return _(i(a))}catch{}}return null}function R(i){var a=i.type;switch(i.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=a.render,i=i.displayName||i.name||"",a.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return _(a);case 8:return a===y?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function V(i){var a=i,d=i;if(i.alternate)for(;a.return;)a=a.return;else{i=a;do a=i,a.flags&4098&&(d=a.return),i=a.return;while(i)}return a.tag===3?d:null}function F(i){if(V(i)!==i)throw Error(c(188))}function L(i){var a=i.alternate;if(!a){if(a=V(i),a===null)throw Error(c(188));return a!==i?null:i}for(var d=i,m=a;;){var v=d.return;if(v===null)break;var b=v.alternate;if(b===null){if(m=v.return,m!==null){d=m;continue}break}if(v.child===b.child){for(b=v.child;b;){if(b===d)return F(v),i;if(b===m)return F(v),a;b=b.sibling}throw Error(c(188))}if(d.return!==m.return)d=v,m=b;else{for(var E=!1,O=v.child;O;){if(O===d){E=!0,d=v,m=b;break}if(O===m){E=!0,m=v,d=b;break}O=O.sibling}if(!E){for(O=b.child;O;){if(O===d){E=!0,d=b,m=v;break}if(O===m){E=!0,m=b,d=v;break}O=O.sibling}if(!E)throw Error(c(189))}}if(d.alternate!==m)throw Error(c(190))}if(d.tag!==3)throw Error(c(188));return d.stateNode.current===d?i:a}function Q(i){return i=L(i),i!==null?U(i):null}function U(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var a=U(i);if(a!==null)return a;i=i.sibling}return null}function K(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){if(i.tag!==4){var a=K(i);if(a!==null)return a}i=i.sibling}return null}var te=Array.isArray,ne=t.getPublicInstance,$=t.getRootHostContext,Z=t.getChildHostContext,oe=t.prepareForCommit,le=t.resetAfterCommit,Re=t.createInstance,Ne=t.appendInitialChild,Ie=t.finalizeInitialChildren,pe=t.prepareUpdate,ce=t.shouldSetTextContent,Fe=t.createTextInstance,Ve=t.scheduleTimeout,Ue=t.cancelTimeout,$e=t.noTimeout,Qe=t.isPrimaryRenderer,ge=t.supportsMutation,Te=t.supportsPersistence,Ge=t.supportsHydration,y
`+Qc+i}var Zc=!1;function Jc(i,a){if(!i||Zc)return"";Zc=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(ie){var m=ie}Reflect.construct(i,[],a)}else{try{a.call()}catch(ie){m=ie}i.call(a.prototype)}else{try{throw Error()}catch(ie){m=ie}i()}}catch(ie){if(ie&&m&&typeof ie.stack=="string"){for(var v=ie.stack.split(`
`),b=m.stack.split(`
`),E=v.length-1,O=b.length-1;1<=E&&0<=O&&v[E]!==b[O];)O--;for(;1<=E&&0<=O;E--,O--)if(v[E]!==b[O]){if(E!==1||O!==1)do if(E--,O--,0>O||v[E]!==b[O]){var W=`
`+v[E].replace(" at new "," at ");return i.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",i.displayName)),W}while(1<=E&&0<=O);break}}}finally{Zc=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?ca(i):""}var Vb=Object.prototype.hasOwnProperty,eu=[],ci=-1;function qr(i){return{current:i}}function St(i){0>ci||(i.current=eu[ci],eu[ci]=null,ci--)}function gt(i,a){ci++,eu[ci]=i.current,i.current=a}var Yr={},nn=qr(Yr),yn=qr(!1),jo=Yr;function ui(i,a){var d=i.type.contextTypes;if(!d)return Yr;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},b;for(b in d)v[b]=a[b];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=a,i.__reactInternalMemoizedMaskedChildContext=v),v}function xn(i){return i=i.childContextTypes,i!=null}function ws(){St(yn),St(nn)}function Up(i,a,d){if(nn.current!==Yr)throw Error(c(168));gt(nn,a),gt(yn,d)}function $p(i,a,d){var m=i.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(c(108,R(i)||"Unknown",v));return s({},d,m)}function ks(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Yr,jo=nn.current,gt(nn,i),gt(yn,yn.current),!0}function Gp(i,a,d){var m=i.stateNode;if(!m)throw Error(c(169));d?(i=$p(i,a,jo),m.__reactInternalMemoizedMergedChildContext=i,St(yn),St(nn),gt(nn,i)):St(yn),gt(yn,d)}var qn=Math.clz32?Math.clz32:Gb,Ub=Math.log,$b=Math.LN2;function Gb(i){return i>>>=0,i===0?32:31-(Ub(i)/$b|0)|0}var js=64,Es=4194304;function ua(i){switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Ps(i,a){var d=i.pendingLanes;if(d===0)return 0;var m=0,v=i.suspendedLanes,b=i.pingedLanes,E=d&268435455;if(E!==0){var O=E&~v;O!==0?m=ua(O):(b&=E,b!==0&&(m=ua(b)))}else E=d&~v,E!==0?m=ua(E):b!==0&&(m=ua(b));if(m===0)return 0;if(a!==0&&a!==m&&!(a&v)&&(v=m&-m,b=a&-a,v>=b||v===16&&(b&4194240)!==0))return a;if(m&4&&(m|=d&16),a=i.entangledLanes,a!==0)for(i=i.entanglements,a&=m;0<a;)d=31-qn(a),v=1<<d,m|=i[d],a&=~v;return m}function qb(i,a){switch(i){case 1:case 2:case 4:return a+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Yb(i,a){for(var d=i.suspendedLanes,m=i.pingedLanes,v=i.expirationTimes,b=i.pendingLanes;0<b;){var E=31-qn(b),O=1<<E,W=v[E];W===-1?(!(O&d)||O&m)&&(v[E]=qb(O,a)):W<=a&&(i.expiredLanes|=O),b&=~O}}function tu(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function qp(){var i=js;return js<<=1,!(js&4194240)&&(js=64),i}function nu(i){for(var a=[],d=0;31>d;d++)a.push(i);return a}function da(i,a,d){i.pendingLanes|=a,a!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,a=31-qn(a),i[a]=d}function Kb(i,a){var d=i.pendingLanes&~a;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=a,i.mutableReadLanes&=a,i.entangledLanes&=a,a=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0<d;){var v=31-qn(d),b=1<<v;a[v]=0,m[v]=-1,i[v]=-1,d&=~b}}function ru(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var m=31-qn(d),v=1<<m;v&a|i[m]&a&&(i[m]|=a),d&=~v}}var ot=0;function Yp(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var ou=o.unstable_scheduleCallback,Kp=o.unstable_cancelCallback,Xb=o.unstable_sho
Error generating stack: `+b.message+`
`+b.stack}return{value:i,source:a,stack:v,digest:null}}function Au(i,a,d){return{value:i,source:null,stack:d??null,digest:a??null}}function Ou(i,a){try{console.error(a.value)}catch(d){setTimeout(function(){throw d})}}var fS=typeof WeakMap=="function"?WeakMap:Map;function Rm(i,a,d){d=_r(-1,d),d.tag=3,d.payload={element:null};var m=a.value;return d.callback=function(){il||(il=!0,ed=m),Ou(i,a)},d}function Nm(i,a,d){d=_r(-1,d),d.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;d.payload=function(){return m(v)},d.callback=function(){Ou(i,a)}}var b=i.stateNode;return b!==null&&typeof b.componentDidCatch=="function"&&(d.callback=function(){Ou(i,a),typeof m!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var E=a.stack;this.componentDidCatch(a.value,{componentStack:E!==null?E:""})}),d}function Fm(i,a,d){var m=i.pingCache;if(m===null){m=i.pingCache=new fS;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(d)||(v.add(d),i=ES.bind(null,i,a,d),a.then(i,i))}function Lm(i){do{var a;if((a=i.tag===13)&&(a=i.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return i;i=i.return}while(i!==null);return null}function Bm(i,a,d,m,v){return i.mode&1?(i.flags|=65536,i.lanes=v,i):(i===a?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(a=_r(-1,1),a.tag=2,Xr(d,a,1))),d.lanes|=1),i)}var hS=u.ReactCurrentOwner,bn=!1;function hn(i,a,d,m){a.child=i===null?hm(a,null,d,m):vi(a,i.child,d,m)}function Hm(i,a,d,m,v){d=d.render;var b=a.ref;return mi(a,v),m=Pu(i,a,d,m,b,v),d=Iu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Dr(i,a,v)):(Pt&&d&&lu(a),a.flags|=1,hn(i,a,m,v),a.child)}function Wm(i,a,d,m,v){if(i===null){var b=d.type;return typeof b=="function"&&!ad(b)&&b.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(a.tag=15,a.type=b,Vm(i,a,b,m,v)):(i=dl(d.type,null,m,a,a.mode,v),i.ref=a.ref,i.return=a,a.child=i)}if(b=i.child,!(i.lanes&v)){var E=b.memoizedProps;if(d=d.compare,d=d!==null?d:As,d(E,m)&&i.ref===a.ref)return Dr(i,a,v)}return a.flags|=1,i=to(b,m),i.ref=a.ref,i.return=a,a.child=i}function Vm(i,a,d,m,v){if(i!==null){var b=i.memoizedProps;if(As(b,m)&&i.ref===a.ref)if(bn=!1,a.pendingProps=m=b,(i.lanes&v)!==0)i.flags&131072&&(bn=!0);else return a.lanes=i.lanes,Dr(i,a,v)}return zu(i,a,d,m,v)}function Um(i,a,d){var m=a.pendingProps,v=m.children,b=i!==null?i.memoizedState:null;if(m.mode==="hidden")if(!(a.mode&1))a.memoizedState={baseLanes:0,cachePool:null,transitions:null},gt(Si,_n),_n|=d;else{if(!(d&1073741824))return i=b!==null?b.baseLanes|d:d,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:i,cachePool:null,transitions:null},a.updateQueue=null,gt(Si,_n),_n|=i,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=b!==null?b.baseLanes:d,gt(Si,_n),_n|=m}else b!==null?(m=b.baseLanes|d,a.memoizedState=null):m=d,gt(Si,_n),_n|=m;return hn(i,a,v,d),a.child}function $m(i,a){var d=a.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(a.flags|=512,a.flags|=2097152)}function zu(i,a,d,m,v){var b=xn(d)?jo:nn.current;return b=ui(a,b),mi(a,v),d=Pu(i,a,d,m,b,v),m=Iu(),i!==null&&!bn?(a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~v,Dr(i,a,v)):(Pt&&m&&lu(a),a.flags|=1,hn(i,a,d,v),a.child)}function Gm(i,a,d,m,v){if(xn(d)){var b=!0;ks(a)}else b=!1;if(mi(a,v),a.stateNode===null)qs(i,a),cm(a,d,m),bu(a,d,m,v),m=!0;else if(i===null){var E=a.stateNode,O=a.memoizedProps;E.props=O;var W=E.context,ie=d.contextType;typeof ie=="object"&&ie!==null?ie=zn(ie):(ie=xn(d)?jo:nn.current,ie=ui(a,ie));var je=d.getDerivedStateFromProps,He=typeof je=="function"||typeof E.getSnapshotBeforeUpdate=="function";He||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(O!==m||W!==ie)&&um(a,E,m,ie),Kr=!1;var be=a.memoizedState;E.state=be,Ns(a,m,E,v),W=a.memoizedState,O!==m||be!==W||yn.current||Kr?(typeof je=="function"&&(xu(a,d,je,m),W=a.memoizedState),(O=Kr||lm(a,d,O,m,be,W,ie))?(He||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="
`+(m.join(" > ")+`
No matching component was found for:
`)+i.join(" > ")}return null},n.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return ne(i.child.stateNode);default:return i.child.stateNode}},n.injectIntoDevTools=function(i){if(i={bundleType:i.bundleType,version:i.version,rendererPackageName:i.rendererPackageName,rendererConfig:i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:u.ReactCurrentDispatcher,findHostInstanceByFiber:DS,findFiberByHostInstance:i.findFiberByHostInstance||AS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")i=!1;else{var a=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(a.isDisabled||!a.supportsFiber)i=!0;else{try{Is=a.inject(i),sr=a}catch{}i=!!a.checkDCE}}return i},n.isAlreadyRendering=function(){return!1},n.observeVisibleRects=function(i,a,d,m){if(!N)throw Error(c(363));i=Ku(i,a);var v=Ze(i,d,m).disconnect;return{disconnect:function(){v()}}},n.registerMutableSourceForHydration=function(i,a){var d=a._getVersion;d=d(a._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[a,d]:i.mutableSourceEagerHydrationData.push(a,d)},n.runWithPriority=function(i,a){var d=ot;try{return ot=i,a()}finally{ot=d}},n.shouldError=function(){return null},n.shouldSuspend=function(){return!1},n.updateContainer=function(i,a,d,m){var v=a.current,b=sn(),E=Jr(v);return d=wv(d),a.context===null?a.context=d:a.pendingContext=d,a=_r(b,E),a.payload={element:i},m=m===void 0?null:m,m!==null&&(a.callback=m),i=Xr(v,a,E),i!==null&&(Fn(i,v,E,b),Rs(i,v,E)),E},n};(function(e){e.exports=pO})(hO);const mO=P3(Vf);var pc={},vO={get exports(){return pc},set exports(e){pc=e}},li={};/**
* @license React
* react-reconciler-constants.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/li.ConcurrentRoot=1;li.ContinuousEventPriority=4;li.DefaultEventPriority=16;li.DiscreteEventPriority=1;li.IdleEventPriority=536870912;li.LegacyRoot=0;(function(e){e.exports=li})(vO);const Z0={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let J0=!1,e1=!1;const Dp=".react-konva-event",gO=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
Consider to add onDragMove or onDragEnd events.
For more info see: https://github.com/konvajs/react-konva/issues/256
`,yO=`ReactKonva: You are using "zIndex" attribute for a Konva node.
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
For more info see: https://github.com/konvajs/react-konva/issues/194
`,xO={};function Hc(e,t,n=xO){if(!J0&&"zIndex"in t&&(console.warn(yO),J0=!0),!e1&&t.draggable){var r=t.x!==void 0||t.y!==void 0,o=t.onDragEnd||t.onDragMove;r&&!o&&(console.warn(gO),e1=!0)}for(var s in n)if(!Z0[s]){var c=s.slice(0,2)==="on",u=n[s]!==t[s];if(c&&u){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),e.off(f,n[s])}var p=!t.hasOwnProperty(s);p&&e.setAttr(s,void 0)}var h=t._useStrictMode,y={},x=!1;const S={};for(var s in t)if(!Z0[s]){var c=s.slice(0,2)==="on",C=n[s]!==t[s];if(c&&C){var f=s.substr(2).toLowerCase();f.substr(0,7)==="content"&&(f="content"+f.substr(7,1).toUpperCase()+f.substr(8)),t[s]&&(S[f]=t[s])}!c&&(t[s]!==n[s]||h&&t[s]!==e.getAttr(s))&&(x=!0,y[s]=t[s])}x&&(e.setAttrs(y),So(e));for(var f in S)e.on(f+Dp,S[f])}function So(e){if(!I3.autoDrawEnabled){var t=e.getLayer()||e.getStage();t&&t.batchDraw()}}const H4={},bO={};Va.Node.prototype._applyProps=Hc;function SO(e,t){if(typeof t=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${t}`);return}e.add(t),So(e)}function CO(e,t,n){let r=Va[e];r||(console.error(`Konva has no node with the type ${e}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${e}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=Va.Group);const o={},s={};for(var c in t){var u=c.slice(0,2)==="on";u?s[c]=t[c]:o[c]=t[c]}const f=new r(o);return Hc(f,s),f}function wO(e,t,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${e}"`)}function kO(e,t,n){return!1}function jO(e){return e}function EO(){return null}function PO(){return null}function IO(e,t,n,r){return bO}function MO(){}function TO(e){}function _O(e,t){return!1}function DO(){return H4}function AO(){return H4}const OO=setTimeout,zO=clearTimeout,RO=-1;function NO(e,t){return!1}const FO=!1,LO=!0,BO=!0;function HO(e,t){t.parent===e?t.moveToTop():e.add(t),So(e)}function WO(e,t){t.parent===e?t.moveToTop():e.add(t),So(e)}function W4(e,t,n){t._remove(),e.add(t),t.setZIndex(n.getZIndex()),So(e)}function VO(e,t,n){W4(e,t,n)}function UO(e,t){t.destroy(),t.off(Dp),So(e)}function $O(e,t){t.destroy(),t.off(Dp),So(e)}function GO(e,t,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function qO(e,t,n){}function YO(e,t,n,r,o){Hc(e,o,r)}function KO(e){e.hide(),So(e)}function XO(e){}function QO(e,t){(t.visible==null||t.visible)&&e.show()}function ZO(e,t){}function JO(e){}function ez(){}const tz=()=>pc.DefaultEventPriority,nz=Object.freeze(Object.defineProperty({__proto__:null,appendChild:HO,appendChildToContainer:WO,appendInitialChild:SO,cancelTimeout:zO,clearContainer:JO,commitMount:qO,commitTextUpdate:GO,commitUpdate:YO,createInstance:CO,createTextInstance:wO,detachDeletedInstance:ez,finalizeInitialChildren:kO,getChildHostContext:AO,getCurrentEventPriority:tz,getPublicInstance:jO,getRootHostContext:DO,hideInstance:KO,hideTextInstance:XO,idlePriority:Bl.unstable_IdlePriority,insertBefore:W4,insertInContainerBefore:VO,isPrimaryRenderer:FO,noTimeout:RO,now:Bl.unstable_now,prepareForCommit:EO,preparePortalMount:PO,prepareUpdate:IO,removeChild:UO,removeChildFromContainer:$O,resetAfterCommit:MO,resetTextContent:TO,run:Bl.unstable_runWithPriority,scheduleTimeout:OO,shouldDeprioritizeSubtree:_O,shouldSetTextContent:NO,supportsMutation:BO,unhideInstance:QO,unhideTextInstance:ZO,warnsIfNotActing:LO},Symbol.toStringTag,{value:"Module"}));var rz=Object.defineProperty,oz=Object.defineProperties,iz=Object.getOwnPropertyDescriptors,t1=Object.getOwnPropertySymbols,az=Object.prototype.hasOwnProperty,sz=Object.prototype.propertyIsEnumerable,n1=(e,t,n)=>t in e?rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,r1=(e,t)=>{for(var n in t||(t={}))az.call(t,n)&&n1(e,n,t[n]);if(t1)for(var n of t1(t))sz.call(t,n)&&n1(e,n,t[n]);return e},lz=(e,t)=>oz(e,iz(t));function V4(e,t,n){if(!e)return;if(n(e
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="60px" height="60px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
<g transform="matrix(0.5,0,0,0.5,0,0)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,2.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,7.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,10)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,12.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,15)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,17.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,20)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,22.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,25)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,27.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,30)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-2.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-7.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-10)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-12.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-15)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-17.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-20)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-22.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-25)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-27.5)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
<g transform="matrix(0.5,0,0,0.5,0,-30)">
<path d="M-3.5,63.5L64,-4" style="fill:none;stroke:black;stroke-width:1px;"/>
</g>
</svg>`.replaceAll("black",e),Nz=e=>{const{...t}=e,{maskColorString:n,stageCoordinates:r,stageDimensions:o,stageScale:s}=A(Rz),[c,u]=g.useState(null),[f,p]=g.useState(0),h=g.useRef(null),y=g.useCallback(()=>{p(f+1),setTimeout(y,500)},[f]);return g.useEffect(()=>{if(c)return;const x=new Image;x.onload=()=>{u(x)},x.src=o1(n)},[c,n]),g.useEffect(()=>{c&&(c.src=o1(n))},[c,n]),g.useEffect(()=>{const x=setInterval(()=>p(S=>(S+1)%5),50);return()=>clearInterval(x)},[]),!c||!ee.isNumber(r.x)||!ee.isNumber(r.y)||!ee.isNumber(s)||!ee.isNumber(o.width)||!ee.isNumber(o.height)?null:l.jsx(Ur,{ref:h,offsetX:r.x/s,offsetY:r.y/s,height:o.height/s,width:o.width/s,fillPatternImage:c,fillPatternOffsetY:ee.isNumber(f)?f:0,fillPatternRepeat:"repeat",fillPatternScale:{x:1/s,y:1/s},listening:!0,globalCompositeOperation:"source-in",...t})},Fz=me([tt],e=>({objects:e.layerState.objects}),{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Lz=e=>{const{...t}=e,{objects:n}=A(Fz);return l.jsx(Vr,{listening:!1,...t,children:n.filter(H3).map((r,o)=>l.jsx(mc,{points:r.points,stroke:"rgb(0,0,0)",strokeWidth:r.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:r.tool==="brush"?"source-over":"destination-out"},o))})};var No=g,Bz=function(t,n,r){const o=No.useRef("loading"),s=No.useRef(),[c,u]=No.useState(0),f=No.useRef(),p=No.useRef(),h=No.useRef();return(f.current!==t||p.current!==n||h.current!==r)&&(o.current="loading",s.current=void 0,f.current=t,p.current=n,h.current=r),No.useLayoutEffect(function(){if(!t)return;var y=document.createElement("img");function x(){o.current="loaded",s.current=y,u(Math.random())}function S(){o.current="failed",s.current=void 0,u(Math.random())}return y.addEventListener("load",x),y.addEventListener("error",S),n&&(y.crossOrigin=n),r&&(y.referrerpolicy=r),y.src=t,function(){y.removeEventListener("load",x),y.removeEventListener("error",S)}},[t,n,r]),[s.current,o.current]};const Y4=e=>{const{url:t,x:n,y:r}=e,[o]=Bz(t);return l.jsx(G4,{x:n,y:r,image:o,listening:!1})},Hz=me([tt],e=>{const{layerState:{objects:t}}=e;return{objects:t}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Wz=()=>{const{objects:e}=A(Hz);return e?l.jsx(Vr,{name:"outpainting-objects",listening:!1,children:e.map((t,n)=>{if(U1(t))return l.jsx(Y4,{x:t.x,y:t.y,url:t.image.url},n);if(W3(t)){const r=l.jsx(mc,{points:t.points,stroke:t.color?Yo(t.color):"rgb(0,0,0)",strokeWidth:t.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,listening:!1,globalCompositeOperation:t.tool==="brush"?"source-over":"destination-out"},n);return t.clip?l.jsx(Vr,{clipX:t.clip.x,clipY:t.clip.y,clipWidth:t.clip.width,clipHeight:t.clip.height,children:r},n):r}else{if(V3(t))return l.jsx(Ur,{x:t.x,y:t.y,width:t.width,height:t.height,fill:Yo(t.color)},n);if(U3(t))return l.jsx(Ur,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"rgb(255, 255, 255)",globalCompositeOperation:"destination-out"},n)}})}):null},Vz=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingImage:r,shouldShowStagingOutline:o,boundingBoxCoordinates:{x:s,y:c},boundingBoxDimensions:{width:u,height:f}}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}}),Uz=e=>{const{...t}=e,{currentStagingAreaImage:n,shouldShowStagingImage:r,shouldShowStagingOutline:o,x:s,y:c,width:u,height:f}=A(Vz);return l.jsxs(Vr,{...t,children:[r&&n&&l.jsx(Y4,{url:n.image.url,x:s,y:c}),o&&l.jsxs(Vr,{children:[l.jsx(Ur,{x:s,y:c,width:u,height:f,strokeWidth:1,stroke:"white",strokeScaleEnabled:!1}),l.jsx(Ur,{x:s,y:c,width:u,height:f,dash:[4,4],strokeWidth:1,stroke:"black",strokeScaleEnabled:!1})]})]})},$z=me([tt],e=>{const{layerState:{stagingArea:{images:t,selectedImageIndex:n}},shouldShowStagingOutline:r,shouldShowStagingImage:o}=e;return{currentStagingAreaImage:t.length>0?t[n]:void 0,isOnFirstImage:n===0,isOnLastImage:n===t.length-1,shoul
position: relative;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
overflow: hidden;
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none;
margin: 0;
padding: 0;
}
.transform-component-module_content__uCDPE {
display: flex;
flex-wrap: wrap;
width: -moz-fit-content;
width: fit-content;
height: -moz-fit-content;
height: fit-content;
margin: 0;
padding: 0;
transform-origin: 0% 0%;
}
.transform-component-module_content__uCDPE img {
pointer-events: none;
}
`,g1={wrapper:"transform-component-module_wrapper__7HFJe",content:"transform-component-module_content__uCDPE"};$F(GF);var qF=function(e){var t=e.children,n=e.wrapperClass,r=n===void 0?"":n,o=e.contentClass,s=o===void 0?"":o,c=e.wrapperStyle,u=e.contentStyle,f=e.wrapperProps,p=f===void 0?{}:f,h=e.contentProps,y=h===void 0?{}:h,x=g.useContext(qc).init,S=g.useRef(null),C=g.useRef(null);return g.useEffect(function(){var k=S.current,w=C.current;k!==null&&w!==null&&x&&x(k,w)},[]),Me.createElement("div",uo({},p,{ref:S,className:"react-transform-wrapper ".concat(g1.wrapper," ").concat(r),style:c}),Me.createElement("div",uo({},y,{ref:C,className:"react-transform-component ".concat(g1.content," ").concat(s),style:u}),t))},Sb=function(){var e=g.useContext(qc),t=g.useState(dt(e||{})),n=t[0],r=t[1];if(!e)throw new Error("Transform context mus be placed inside TransformWrapper");return g.useEffect(function(){e.onChange(function(o){r(o)})},[e]),n};Me.forwardRef(function(e,t){var n=g.useRef(null),r=g.useContext(qc);return g.useEffect(function(){return r.onChange(function(o){if(n.current){var s=0,c=0;n.current.style.transform=r.handleTransformStyles(s,c,1/o.state.scale)}})},[r]),Me.createElement("div",uo({},e,{ref:SF([n,t])}))});const YF=()=>{const[e,t]=g.useState(0),[n,r]=g.useState(1),[o,s]=g.useState(1);return{rotation:e,scaleX:n,scaleY:o,flipHorizontally:()=>{r(n*-1)},flipVertically:()=>{s(o*-1)},rotateCounterClockwise:()=>{t(e===-270?0:e-90)},rotateClockwise:()=>{t(e===270?0:e+90)},reset:()=>{t(0),r(1),s(1)}}},KF=({flipHorizontally:e,flipVertically:t,rotateCounterClockwise:n,rotateClockwise:r,reset:o})=>{const{zoomIn:s,zoomOut:c,resetTransform:u}=Sb(),{t:f}=X();return l.jsxs(Qt,{isAttached:!0,orientation:"vertical",children:[l.jsx(se,{icon:l.jsx(dD,{}),"aria-label":f("accessibility.zoomIn"),tooltip:"Zoom In",onClick:()=>s(),fontSize:20}),l.jsx(se,{icon:l.jsx(fD,{}),"aria-label":f("accessibility.zoomOut"),tooltip:"Zoom Out",onClick:()=>c(),fontSize:20}),l.jsx(se,{icon:l.jsx(cD,{}),"aria-label":f("accessibility.rotateCounterClockwise"),tooltip:"Rotate Counter-Clockwise",onClick:n,fontSize:20}),l.jsx(se,{icon:l.jsx(uD,{}),"aria-label":f("accessibility.rotateClockwise"),tooltip:"Rotate Clockwise",onClick:r,fontSize:20}),l.jsx(se,{icon:l.jsx(B0,{}),"aria-label":f("accessibility.flipHorizontally"),tooltip:"Flip Horizontally",onClick:e,fontSize:20}),l.jsx(se,{icon:l.jsx(B0,{style:{transform:"rotate(90deg)"}}),"aria-label":f("accessibility.flipVertically"),tooltip:"Flip Vertically",onClick:t,fontSize:20}),l.jsx(se,{icon:l.jsx(up,{}),"aria-label":f("accessibility.reset"),tooltip:"Reset",onClick:()=>{u(),o()},fontSize:20})]})};function XF({image:e,alt:t,ref:n,styleClass:r,rotation:o,scaleX:s,scaleY:c}){const{centerView:u}=Sb();return l.jsx(qF,{wrapperStyle:{width:"100%",height:"100%"},children:l.jsx("img",{style:{transform:`rotate(${o}deg) scaleX(${s}) scaleY(${c})`,width:"100%"},src:e.url,alt:t,ref:n,className:r||"",onLoad:()=>u(1,0,"easeOut")})})}const QF=me([Gr,Er],(e,t)=>{const{currentImage:n}=e,{shouldShowImageDetails:r}=t;return{viewerImageToDisplay:n,shouldShowImageDetails:r}},{memoizeOptions:{resultEqualityCheck:ee.isEqual}});function ZF(){const e=Y(),t=A(x=>x.lightbox.isLightboxOpen),{rotation:n,scaleX:r,scaleY:o,flipHorizontally:s,flipVertically:c,rotateCounterClockwise:u,rotateClockwise:f,reset:p}=YF(),{viewerImageToDisplay:h,shouldShowImageDetails:y}=A(QF);return de("Esc",()=>{t&&e(Vo(!1))},[t]),l.jsx(yo,{children:t&&l.jsx(ir.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15,ease:"easeInOut"},style:{display:"flex",width:"100vw",height:`calc(100vh - ${dc*4}px)`,position:"fixed",top:`${dc*4}px`,background:"var(--invokeai-colors-base-900)",zIndex:99},children:l.jsxs(UF,{centerOnInit:!0,minScale:.1,initialPositionX:50,initialPositionY:50,children:[l.jsxs(B,{sx:{flexDir:"column",position:"absolute",insetInlineStart:4,gap:4,zIndex:3,top:4},children:[l.jsx(se,{icon:l.jsx(lD,{}),"aria-label":"Exit Viewer",className:"lightbox-close-btn",onClick:()=>{e(Vo(!1))},fontSize:20}),l.jsx(KF,{flipHorizontally: